[compiler-rt] 33a1b3d - [sanitizer] Link Sanitizer-x86_64-Test-Nolibc with -static
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 27 15:25:17 PST 2019
Author: Fangrui Song
Date: 2019-12-27T15:25:08-08:00
New Revision: 33a1b3d8fceae7dd543cd3cf465f7fa6b71a9e7b
URL: https://github.com/llvm/llvm-project/commit/33a1b3d8fceae7dd543cd3cf465f7fa6b71a9e7b
DIFF: https://github.com/llvm/llvm-project/commit/33a1b3d8fceae7dd543cd3cf465f7fa6b71a9e7b.diff
LOG: [sanitizer] Link Sanitizer-x86_64-Test-Nolibc with -static
Pass -static so that clang will not pass -Wl,--dynamic-linker,... to the
linker. The test is not expected to run under a ld.so. (Technically it
works under a ld.so but glibc expects to see a PT_DYNAMIC. lld
intentionally does not follow GNU ld's complex rules regarding
PT_DYNAMIC.)
This allows commit 1417558e4a61794347c6bfbafaff7cd96985b2c3 to be
relanded.
Added:
Modified:
compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt
Removed:
################################################################################
diff --git a/compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt b/compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt
index fd31b6dbdf4d..0726280e4180 100644
--- a/compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt
+++ b/compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt
@@ -171,7 +171,7 @@ macro(add_sanitizer_tests_for_arch arch)
-Wl,-no-whole-archive
DEPS sanitizer_nolibc_test_main.${arch}.o
RTSanitizerCommon.test.nolibc.${arch}
- LINK_FLAGS -nostdlib ${TARGET_FLAGS})
+ LINK_FLAGS -static -nostdlib ${TARGET_FLAGS})
endif()
endmacro()
More information about the llvm-commits
mailing list