[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 1417558e4a to be
relanded.
This commit is contained in:
Fangrui Song 2019-12-27 15:08:10 -08:00
parent 5ce2ca524e
commit 33a1b3d8fc
1 changed files with 1 additions and 1 deletions

View File

@ -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()