[compiler-rt] r337142 - [XRay][compiler-rt] Use `SANITIZER_CXX_ABI_LIBRARY` for XRay unit tests

Dean Michael Berris via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 15 18:08:56 PDT 2018


Author: dberris
Date: Sun Jul 15 18:08:56 2018
New Revision: 337142

URL: http://llvm.org/viewvc/llvm-project?rev=337142&view=rev
Log:
[XRay][compiler-rt] Use `SANITIZER_CXX_ABI_LIBRARY` for XRay unit tests

Summary:
Fix a TODO in CMake config for XRay tests to use the detected C++ ABI
library in the tests.

Also make the tests depend on the llvm-xray target when built in-tree.

Reviewers: kpw, eizan

Reviewed By: eizan

Subscribers: mgorny, llvm-commits

Differential Revision: https://reviews.llvm.org/D49358

Modified:
    compiler-rt/trunk/lib/xray/tests/CMakeLists.txt

Modified: compiler-rt/trunk/lib/xray/tests/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/xray/tests/CMakeLists.txt?rev=337142&r1=337141&r2=337142&view=diff
==============================================================================
--- compiler-rt/trunk/lib/xray/tests/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/xray/tests/CMakeLists.txt Sun Jul 15 18:08:56 2018
@@ -42,8 +42,8 @@ endfunction()
 set(XRAY_TEST_ARCH ${XRAY_SUPPORTED_ARCH})
 set(XRAY_UNITTEST_LINK_FLAGS
   ${CMAKE_THREAD_LIBS_INIT}
+	-l${SANITIZER_CXX_ABI_LIBRARY}
   -fxray-instrument
-  -lstdc++  # TODO: Detect the correct standard library used!
   )
 if (NOT APPLE)
   append_list_if(COMPILER_RT_HAS_LIBM -lm XRAY_UNITTEST_LINK_FLAGS)
@@ -68,7 +68,7 @@ macro(add_xray_unittest testname)
         COMPILE_DEPS ${TEST_SOURCES} ${COMPILER_RT_GTEST_SOURCE}
         ${XRAY_HEADERS} ${XRAY_ALL_SOURCE_FILES_ABS_PATHS}
         RUNTIME "${XRAY_RUNTIME_LIBS}"
-        DEPS gtest xray
+        DEPS gtest xray llvm-xray
         CFLAGS ${XRAY_UNITTEST_CFLAGS}
         LINK_FLAGS ${TARGET_LINK_FLAGS} ${XRAY_UNITTEST_LINK_FLAGS})
       set_target_properties(XRayUnitTests




More information about the llvm-commits mailing list