diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2017-10-04 23:35:14 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2017-10-04 23:35:14 +0000 |
commit | 9433990fcfd399354addc756602a8391b66bf788 (patch) | |
tree | 298ac4b4d59583370ad71b52600450b31fb693a8 /lib/ubsan/CMakeLists.txt | |
parent | a16d35ab9a371ca82f039a5cdd2ac308d0f58e80 (diff) | |
download | compiler-rt-9433990fcfd399354addc756602a8391b66bf788.tar.gz |
[sanitizer] Move cxx-abi library earlier in link flags.
Summary:
This change moves cxx-abi library in asan/ubsan/dd link command line
ahead of other libraries, such as pthread/rt/dl/c/gcc. Given that
cxx-abi may be the full libstdc++/libc++, it makes sense for it to be
ahead of libc and libgcc, at least.
The real motivation is Android, where in the arm32 NDK toolchain
libstdc++.a is actually a linker script that tries to sneak LLVM's
libunwind ahead of libgcc's. Wrong library order breaks unwinding.
Reviewers: srhines, danalbert
Subscribers: aemerson, kubamracek, mgorny, kristof.beyls, llvm-commits
Differential Revision: https://reviews.llvm.org/D38520
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@314948 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ubsan/CMakeLists.txt')
-rw-r--r-- | lib/ubsan/CMakeLists.txt | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/ubsan/CMakeLists.txt b/lib/ubsan/CMakeLists.txt index 34b250696..644b598c5 100644 --- a/lib/ubsan/CMakeLists.txt +++ b/lib/ubsan/CMakeLists.txt @@ -35,15 +35,13 @@ 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}) +set(UBSAN_DYNAMIC_LIBS ${SANITIZER_CXX_ABI_LIBRARY} ${SANITIZER_COMMON_LINK_LIBS}) append_list_if(COMPILER_RT_HAS_LIBDL dl UBSAN_DYNAMIC_LIBS) append_list_if(COMPILER_RT_HAS_LIBLOG log 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) -list(APPEND UBSAN_DYNAMIC_LIBS ${SANITIZER_CXX_ABI_LIBRARY}) - add_compiler_rt_component(ubsan) if(APPLE) |