[compiler-rt] r359733 - [compiler-rt][tests] Propagate COMPILER_RT_UNITTEST_LINK_FLAGS
Hubert Tong via llvm-commits
llvm-commits at lists.llvm.org
Wed May 1 15:25:16 PDT 2019
Author: hubert.reinterpretcast
Date: Wed May 1 15:25:16 2019
New Revision: 359733
URL: http://llvm.org/viewvc/llvm-project?rev=359733&view=rev
Log:
[compiler-rt][tests] Propagate COMPILER_RT_UNITTEST_LINK_FLAGS
`COMPILER_RT_UNITTEST_LINK_FLAGS` is dropped in many places, unlike
`COMPILER_RT_UNITTEST_CFLAGS`. This patch attempts to remove that
inconsistency.
Previously reviewed as part of D58951.
Reviewers: sfertile, peter.smith, pzheng, phosek, Hahnfeld, nemanjai, jasonliu
Reviewed By: sfertile
Subscribers: jsji, kubamracek, dberris, mgorny, delcypher, jdoerfert, #sanitizers, llvm-commits
Tags: #llvm, #sanitizers
Differential Revision: https://reviews.llvm.org/D60143
Modified:
compiler-rt/trunk/lib/interception/tests/CMakeLists.txt
compiler-rt/trunk/lib/msan/tests/CMakeLists.txt
compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt
compiler-rt/trunk/lib/scudo/standalone/tests/CMakeLists.txt
compiler-rt/trunk/lib/tsan/tests/CMakeLists.txt
compiler-rt/trunk/lib/xray/tests/CMakeLists.txt
Modified: compiler-rt/trunk/lib/interception/tests/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/interception/tests/CMakeLists.txt?rev=359733&r1=359732&r2=359733&view=diff
==============================================================================
--- compiler-rt/trunk/lib/interception/tests/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/interception/tests/CMakeLists.txt Wed May 1 15:25:16 2019
@@ -21,6 +21,9 @@ set(INTERCEPTION_TEST_CFLAGS_COMMON
-Werror=sign-compare
-Wno-non-virtual-dtor)
+set(INTERCEPTION_TEST_LINK_FLAGS_COMMON
+ ${COMPILER_RT_UNITTEST_LINK_FLAGS})
+
# -gline-tables-only must be enough for these tests, so use it if possible.
if(COMPILER_RT_TEST_COMPILER_ID MATCHES "Clang")
list(APPEND INTERCEPTION_TEST_CFLAGS_COMMON -gline-tables-only)
Modified: compiler-rt/trunk/lib/msan/tests/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/tests/CMakeLists.txt?rev=359733&r1=359732&r2=359733&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/tests/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/msan/tests/CMakeLists.txt Wed May 1 15:25:16 2019
@@ -47,6 +47,7 @@ set(MSAN_UNITTEST_INSTRUMENTED_CFLAGS
-mllvm -msan-keep-going=1
)
set(MSAN_UNITTEST_LINK_FLAGS
+ ${COMPILER_RT_UNITTEST_LINK_FLAGS}
-fsanitize=memory
# Don't need -stdlib=libc++ because we explicitly list libc++.a in the linker
# inputs.
@@ -73,7 +74,7 @@ macro(msan_link_shared so_list so_name a
endif()
clang_link_shared(${output_so}
OBJECTS ${SOURCE_OBJECTS}
- LINK_FLAGS ${TARGET_LINK_FLAGS} ${SOURCE_LINK_FLAGS}
+ LINK_FLAGS ${COMPILER_RT_UNITTEST_LINK_FLAGS} ${TARGET_LINK_FLAGS} ${SOURCE_LINK_FLAGS}
DEPS ${SOURCE_DEPS})
list(APPEND ${so_list} ${output_so})
endmacro()
Modified: compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt?rev=359733&r1=359732&r2=359733&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt Wed May 1 15:25:16 2019
@@ -59,6 +59,8 @@ set(SANITIZER_TEST_CFLAGS_COMMON
-Wno-non-virtual-dtor
-Wno-gnu-zero-variadic-macro-arguments)
+set(SANITIZER_TEST_LINK_FLAGS_COMMON ${COMPILER_RT_UNITTEST_LINK_FLAGS})
+
# -gline-tables-only must be enough for these tests, so use it if possible.
if(COMPILER_RT_TEST_COMPILER_ID MATCHES "Clang")
list(APPEND SANITIZER_TEST_CFLAGS_COMMON -gline-tables-only)
Modified: compiler-rt/trunk/lib/scudo/standalone/tests/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/scudo/standalone/tests/CMakeLists.txt?rev=359733&r1=359732&r2=359733&view=diff
==============================================================================
--- compiler-rt/trunk/lib/scudo/standalone/tests/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/scudo/standalone/tests/CMakeLists.txt Wed May 1 15:25:16 2019
@@ -15,7 +15,7 @@ set(SCUDO_UNITTEST_CFLAGS
set(SCUDO_TEST_ARCH ${SCUDO_STANDALONE_SUPPORTED_ARCH})
# gtests requires c++
-set(LINK_FLAGS)
+set(LINK_FLAGS ${COMPILER_RT_UNITTEST_LINK_FLAGS})
foreach(lib ${SANITIZER_TEST_CXX_LIBRARIES})
list(APPEND LINK_FLAGS -l${lib})
endforeach()
Modified: compiler-rt/trunk/lib/tsan/tests/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/tests/CMakeLists.txt?rev=359733&r1=359732&r2=359733&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/tests/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/tsan/tests/CMakeLists.txt Wed May 1 15:25:16 2019
@@ -15,7 +15,7 @@ set(TSAN_UNITTEST_CFLAGS
set(TSAN_TEST_ARCH ${TSAN_SUPPORTED_ARCH})
-set(LINK_FLAGS)
+set(LINK_FLAGS ${COMPILER_RT_UNITTEST_LINK_FLAGS})
foreach(lib ${SANITIZER_TEST_CXX_LIBRARIES})
list(APPEND LINK_FLAGS -l${lib})
endforeach()
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=359733&r1=359732&r2=359733&view=diff
==============================================================================
--- compiler-rt/trunk/lib/xray/tests/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/xray/tests/CMakeLists.txt Wed May 1 15:25:16 2019
@@ -47,7 +47,10 @@ function(get_xray_lib_for_arch arch lib)
endfunction()
set(XRAY_TEST_ARCH ${XRAY_SUPPORTED_ARCH})
-set(XRAY_UNITTEST_LINK_FLAGS ${CMAKE_THREAD_LIBS_INIT})
+set(XRAY_UNITTEST_LINK_FLAGS
+ ${COMPILER_RT_UNITTEST_LINK_FLAGS}
+ ${CMAKE_THREAD_LIBS_INIT}
+ )
if (NOT APPLE)
# Needed by LLVMSupport.
More information about the llvm-commits
mailing list