Skip to content

Commit a9f91c8

Browse files
committedFeb 13, 2019
[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 llvm-svn: 353905
1 parent 9ea90ac commit a9f91c8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎compiler-rt/lib/xray/tests/CMakeLists.txt

+3-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ endfunction()
4848

4949
set(XRAY_TEST_ARCH ${XRAY_SUPPORTED_ARCH})
5050
set(XRAY_UNITTEST_LINK_FLAGS
51-
${CMAKE_THREAD_LIBS_INIT}
52-
-l${SANITIZER_CXX_ABI_LIBRARY})
51+
${CMAKE_THREAD_LIBS_INIT})
5352

5453
if (NOT APPLE)
5554
# Needed by LLVMSupport.
@@ -81,6 +80,8 @@ if (NOT APPLE)
8180
append_list_if(COMPILER_RT_HAS_LIBEXECINFO -lexecinfo XRAY_UNITTEST_LINK_FLAGS)
8281
endif()
8382

83+
list(APPEND XRAY_UNITTEST_LINK_FLAGS -l${SANITIZER_CXX_ABI_LIBRARY})
84+
8485
macro(add_xray_unittest testname)
8586
cmake_parse_arguments(TEST "" "" "SOURCES;HEADERS" ${ARGN})
8687
if(UNIX AND NOT APPLE)

0 commit comments

Comments
 (0)
Please sign in to comment.