summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHubert Tong <hubert.reinterpretcast@gmail.com>2019-05-01 22:25:16 +0000
committerHubert Tong <hubert.reinterpretcast@gmail.com>2019-05-01 22:25:16 +0000
commitfc6f4a6ed7e7a8a77d1592f1ec6948fbb3ca42fa (patch)
tree02730357b80860eff842f2f0212f162b483d71b6
parent692ede971f895be1b16d661ee221c1c05a48111f (diff)
downloadcompiler-rt-fc6f4a6ed7e7a8a77d1592f1ec6948fbb3ca42fa.tar.gz
[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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@359733 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/interception/tests/CMakeLists.txt3
-rw-r--r--lib/msan/tests/CMakeLists.txt3
-rw-r--r--lib/sanitizer_common/tests/CMakeLists.txt2
-rw-r--r--lib/scudo/standalone/tests/CMakeLists.txt2
-rw-r--r--lib/tsan/tests/CMakeLists.txt2
-rw-r--r--lib/xray/tests/CMakeLists.txt5
6 files changed, 13 insertions, 4 deletions
diff --git a/lib/interception/tests/CMakeLists.txt b/lib/interception/tests/CMakeLists.txt
index 1da0a455b..96bdda73e 100644
--- a/lib/interception/tests/CMakeLists.txt
+++ b/lib/interception/tests/CMakeLists.txt
@@ -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)
diff --git a/lib/msan/tests/CMakeLists.txt b/lib/msan/tests/CMakeLists.txt
index ae3c13269..eceb11cdd 100644
--- a/lib/msan/tests/CMakeLists.txt
+++ b/lib/msan/tests/CMakeLists.txt
@@ -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 arch kind)
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()
diff --git a/lib/sanitizer_common/tests/CMakeLists.txt b/lib/sanitizer_common/tests/CMakeLists.txt
index 21ffe2528..fd29d178b 100644
--- a/lib/sanitizer_common/tests/CMakeLists.txt
+++ b/lib/sanitizer_common/tests/CMakeLists.txt
@@ -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)
diff --git a/lib/scudo/standalone/tests/CMakeLists.txt b/lib/scudo/standalone/tests/CMakeLists.txt
index 75c67263b..182d6a26a 100644
--- a/lib/scudo/standalone/tests/CMakeLists.txt
+++ b/lib/scudo/standalone/tests/CMakeLists.txt
@@ -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()
diff --git a/lib/tsan/tests/CMakeLists.txt b/lib/tsan/tests/CMakeLists.txt
index 3bf02ed5d..7b1ba21c5 100644
--- a/lib/tsan/tests/CMakeLists.txt
+++ b/lib/tsan/tests/CMakeLists.txt
@@ -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()
diff --git a/lib/xray/tests/CMakeLists.txt b/lib/xray/tests/CMakeLists.txt
index 609120c83..a1fbccaeb 100644
--- a/lib/xray/tests/CMakeLists.txt
+++ b/lib/xray/tests/CMakeLists.txt
@@ -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.