diff options
author | Kostya Kortchinsky <kostyak@google.com> | 2017-01-18 17:11:17 +0000 |
---|---|---|
committer | Kostya Kortchinsky <kostyak@google.com> | 2017-01-18 17:11:17 +0000 |
commit | 90a89f08a361a74276ffbb3d232301fe6fb6363f (patch) | |
tree | a2ba3f0671fac9d56aafc701e4256e8f57499a9c /lib/scudo/CMakeLists.txt | |
parent | 1a0f6f34b0e78ed6112fa1d511396a58f7080c49 (diff) | |
download | compiler-rt-90a89f08a361a74276ffbb3d232301fe6fb6363f.tar.gz |
[scudo] Refactor of CRC32 and ARM runtime CRC32 detection
Summary:
ARM & AArch64 runtime detection for hardware support of CRC32 has been added
via check of the AT_HWVAL auxiliary vector.
Following Michal's suggestions in D28417, the CRC32 code has been further
changed and looks better now. When compiled with full relro (which is strongly
suggested to benefit from additional hardening), the weak symbol for
computeHardwareCRC32 is read-only and the assembly generated is fairly clean
and straight forward. As suggested, an additional optimization is to skip
the runtime check if SSE 4.2 has been enabled globally, as opposed to only
for scudo_crc32.cpp.
scudo_crc32.h has no purpose anymore and was removed.
Reviewers: alekseyshl, kcc, rengolin, mgorny, phosek
Reviewed By: rengolin, mgorny
Subscribers: aemerson, rengolin, llvm-commits
Differential Revision: https://reviews.llvm.org/D28574
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@292409 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/scudo/CMakeLists.txt')
-rw-r--r-- | lib/scudo/CMakeLists.txt | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/scudo/CMakeLists.txt b/lib/scudo/CMakeLists.txt index 4f1acec78..ba5e8acd8 100644 --- a/lib/scudo/CMakeLists.txt +++ b/lib/scudo/CMakeLists.txt @@ -16,10 +16,17 @@ set(SCUDO_SOURCES scudo_termination.cpp scudo_utils.cpp) +# Enable the SSE 4.2 instruction set for scudo_crc32.cpp, if available. if (COMPILER_RT_HAS_MSSE4_2_FLAG) set_source_files_properties(scudo_crc32.cpp PROPERTIES COMPILE_FLAGS -msse4.2) endif() +# Enable the AArch64 CRC32 feature for scudo_crc32.cpp, if available. +# Note that it is enabled by default starting with armv8.1-a. +if (COMPILER_RT_HAS_MCRC_FLAG) + set_source_files_properties(scudo_crc32.cpp PROPERTIES COMPILE_FLAGS -mcrc) +endif() + if(COMPILER_RT_HAS_SCUDO) foreach(arch ${SCUDO_SUPPORTED_ARCH}) add_compiler_rt_runtime(clang_rt.scudo |