ld: Pass -fno-sanitize=all to tests with linker
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 3 Jun 2020 13:47:38 +0000 (06:47 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 3 Jun 2020 13:57:19 +0000 (06:57 -0700)
commit1949ad044a6979e176b0d0ebd5cfebbf162dd4f5
tree71903e6c42db856c5fcb343a440e561647d34370
parent37a141bfed4dd3c33d77c15dfde00e4b4f5b24c7
ld: Pass -fno-sanitize=all to tests with linker

When binutils is compiled with -fsanitize=undefined, many tests with
linker, instead of $CC, fail with undefined symbol references to sanitize
library.  Define NOSANTIZE_CFLAGS to -fno-sanitize=all if target compiler
supports it and compile such tests with $NOSANTIZE_CFLAGS.

* testsuite/config/default.exp (NOSANTIZE_CFLAGS): New.
* testsuite/ld-elf/linux-x86.exp: Add $NOSANTIZE_CFLAGS to
tests with run_ld_link_exec_tests.
* testsuite/ld-elf/shared.exp: Add $NOSANTIZE_CFLAGS to tests
with run_ld_link_tests.
* testsuite/ld-elf/tls.exp: Likewise.
* testsuite/ld-elfweak/elfweak.exp: Add $NOSANTIZE_CFLAGS to
tests with ld_link.
* testsuite/ld-gc/gc.exp: Add $NOSANTIZE_CFLAGS to cflags.
* testsuite/ld-plugin/lto.exp: Add $NOSANTIZE_CFLAGS to tests
with run_ld_link_tests.a
* testsuite/ld-plugin/plugin.exp: Append $NOSANTIZE_CFLAGS to
CFLAGS.
* testsuite/ld-selective/selective.exp: Add $NOSANTIZE_CFLAGS
to cflags and cxxflags.
* testsuite/ld-srec/srec.exp: Append $NOSANTIZE_CFLAGS to CC
and CXX.
* testsuite/ld-x86-64/plt-main-ibt-x32.dd: Updated for
-fsanitize=undefined.
* testsuite/ld-x86-64/plt-main-ibt.dd: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Add $NOSANTIZE_CFLAGS to
tests with run_cc_link_tests and run_ld_link_tests.
14 files changed:
ld/ChangeLog
ld/testsuite/config/default.exp
ld/testsuite/ld-elf/linux-x86.exp
ld/testsuite/ld-elf/shared.exp
ld/testsuite/ld-elf/tls.exp
ld/testsuite/ld-elfweak/elfweak.exp
ld/testsuite/ld-gc/gc.exp
ld/testsuite/ld-plugin/lto.exp
ld/testsuite/ld-plugin/plugin.exp
ld/testsuite/ld-selective/selective.exp
ld/testsuite/ld-srec/srec.exp
ld/testsuite/ld-x86-64/plt-main-ibt-x32.dd
ld/testsuite/ld-x86-64/plt-main-ibt.dd
ld/testsuite/ld-x86-64/x86-64.exp
This page took 0.02623 seconds and 4 git commands to generate.