diff options
author | Petr Hosek <phosek@chromium.org> | 2017-07-25 23:38:25 +0000 |
---|---|---|
committer | Petr Hosek <phosek@chromium.org> | 2017-07-25 23:38:25 +0000 |
commit | fd63314d6770e0da62572a3fea2c41c4cc0fc58a (patch) | |
tree | 9c3600f45b806aafae26485cc388c30e30cec72e /lib/ubsan | |
parent | 5d89c4be98863f7456a8c2c1936d768cc55f5c66 (diff) |
[sanitizer] Support compiler-rt builtins
This change adds support for compiler-rt builtins as an alternative
compiler runtime to libgcc.
Differential Revision: https://reviews.llvm.org/D35165
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@309060 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ubsan')
-rw-r--r-- | lib/ubsan/CMakeLists.txt | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/ubsan/CMakeLists.txt b/lib/ubsan/CMakeLists.txt index 457a6b475..ab0e78073 100644 --- a/lib/ubsan/CMakeLists.txt +++ b/lib/ubsan/CMakeLists.txt @@ -34,9 +34,12 @@ set(UBSAN_CXXFLAGS ${SANITIZER_COMMON_CFLAGS}) append_rtti_flag(ON UBSAN_CXXFLAGS) append_list_if(SANITIZER_CAN_USE_CXXABI -DUBSAN_CAN_USE_CXXABI UBSAN_CXXFLAGS) +set(UBSAN_DYNAMIC_LIBS ${SANITIZER_COMMON_LINK_LIBS}) + append_list_if(COMPILER_RT_HAS_LIBDL dl UBSAN_DYNAMIC_LIBS) append_list_if(COMPILER_RT_HAS_LIBRT rt UBSAN_DYNAMIC_LIBS) append_list_if(COMPILER_RT_HAS_LIBPTHREAD pthread UBSAN_DYNAMIC_LIBS) +append_list_if(COMPILER_RT_HAS_LIBSTDCXX stdc++ UBSAN_DYNAMIC_LIBS) add_compiler_rt_component(ubsan) @@ -155,6 +158,7 @@ else() RTSanitizerCommonLibc RTUbsan CFLAGS ${UBSAN_CFLAGS} + LINK_FLAGS ${SANITIZER_COMMON_LINK_FLAGS} LINK_LIBS ${UBSAN_DYNAMIC_LIBS} PARENT_TARGET ubsan) @@ -166,6 +170,7 @@ else() RTUbsan RTUbsan_cxx CFLAGS ${UBSAN_CXXFLAGS} + LINK_FLAGS ${SANITIZER_COMMON_LINK_FLAGS} LINK_LIBS ${UBSAN_DYNAMIC_LIBS} PARENT_TARGET ubsan) |