diff options
author | Hubert Tong <hubert.reinterpretcast@gmail.com> | 2019-02-13 00:55:30 +0000 |
---|---|---|
committer | Hubert Tong <hubert.reinterpretcast@gmail.com> | 2019-02-13 00:55:30 +0000 |
commit | 55a1112a67832d143171561baae524088dc4655b (patch) | |
tree | e983f42914edc7dd2ab6c8cc15630ecc5e203003 | |
parent | 0f2a20acc9665e7af482e279ab03d1fa5f198caa (diff) | |
download | compiler-rt-55a1112a67832d143171561baae524088dc4655b.tar.gz |
[xray][tests][RHDTS] Add -lstdc++ after LLVM libs, resolving link error with RHDTS
Summary:
A link error was encountered when using the Red Hat Developer Toolset.
In the RHDTS, `libstdc++.so` is a linker script that may resolve symbols
to a static library. This patch places `-lstdc++` later in the ordering.
Reviewers: sfertile, nemanjai, tstellar, dberris
Reviewed By: dberris
Subscribers: dberris, mgorny, delcypher, jdoerfert, #sanitizers, llvm-commits
Tags: #llvm, #sanitizers
Differential Revision: https://reviews.llvm.org/D58144
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@353905 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/xray/tests/CMakeLists.txt | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/xray/tests/CMakeLists.txt b/lib/xray/tests/CMakeLists.txt index deddc5101..145852904 100644 --- a/lib/xray/tests/CMakeLists.txt +++ b/lib/xray/tests/CMakeLists.txt @@ -48,8 +48,7 @@ endfunction() set(XRAY_TEST_ARCH ${XRAY_SUPPORTED_ARCH}) set(XRAY_UNITTEST_LINK_FLAGS - ${CMAKE_THREAD_LIBS_INIT} - -l${SANITIZER_CXX_ABI_LIBRARY}) + ${CMAKE_THREAD_LIBS_INIT}) if (NOT APPLE) # Needed by LLVMSupport. @@ -81,6 +80,8 @@ if (NOT APPLE) append_list_if(COMPILER_RT_HAS_LIBEXECINFO -lexecinfo XRAY_UNITTEST_LINK_FLAGS) endif() +list(APPEND XRAY_UNITTEST_LINK_FLAGS -l${SANITIZER_CXX_ABI_LIBRARY}) + macro(add_xray_unittest testname) cmake_parse_arguments(TEST "" "" "SOURCES;HEADERS" ${ARGN}) if(UNIX AND NOT APPLE) |