aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHubert Tong <hubert.reinterpretcast@gmail.com>2019-02-13 00:55:30 +0000
committerHubert Tong <hubert.reinterpretcast@gmail.com>2019-02-13 00:55:30 +0000
commit55a1112a67832d143171561baae524088dc4655b (patch)
treee983f42914edc7dd2ab6c8cc15630ecc5e203003
parent0f2a20acc9665e7af482e279ab03d1fa5f198caa (diff)
downloadcompiler-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.txt5
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)