summaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-elfvers
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2021-09-03 16:26:21 +0930
committerAlan Modra <amodra@gmail.com>2021-09-03 16:26:21 +0930
commit669d5115345a3f3dc1c06aec31098eb4b349a6d0 (patch)
tree0bd69d93c3e4c1b7b57d6a58e803ad3a9bd0419f /ld/testsuite/ld-elfvers
parentad77db1c02a92c912f9719f32e2452890aa738ad (diff)
downloadbinutils-gdb-669d5115345a3f3dc1c06aec31098eb4b349a6d0.tar.gz
ld testsuite tidy
Fixes a few issues: 1) If you use "-fsanitize=address,undefined" in CFLAGS, the Makefile attempt to trim off -fsanitize options left us with ",undefined". 2) ld_compile adds CFLAGS_FOR_TARGET itself, no need to pass it. 3) CFLAGS might be needed linking bootstrap test. * Makefile.am (CFLAGS_FOR_TARGET, CXXFLAGS_FOR_TARGET): Trim off all -fsanitize=*. * Makefile.in: Regenerate. * testsuite/ld-bootstrap/bootstrap.exp: Use CFLAGS when linking. * testsuite/ld-cdtest/cdtest.exp: Use CFLAGS_FOR_TARGET when linking. * testsuite/ld-auto-import/auto-import.exp: Don't pass CFLAGS_FOR_TARGET to ld_compile. * testsuite/ld-cygwin/exe-export.exp: Likewise. * testsuite/ld-elfvers/vers.exp: Likewise. * testsuite/ld-elfvsb/elfvsb.exp: Likewise. * testsuite/ld-elfweak/elfweak.exp: Likewise. * testsuite/ld-gc/gc.exp: Likewise. * testsuite/ld-pe/pe-compile.exp: Likewise. * testsuite/ld-pe/pe-run.exp: Likewise. * testsuite/ld-pe/pe-run2.exp: Likewise. * testsuite/ld-plugin/plugin.exp: Likewise. * testsuite/ld-shared/shared.exp: Likewise. * testsuite/ld-elfcomm/elfcomm.exp: Likewise, and don't allow nios2 testing to trash CFLAGS_FOR_TARGET. * testsuite/ld-scripts/crossref.exp: Don't pass options in CC_FOR_TARGET, do so in CFLAGS_FOR_TARGET instead. * testsuite/ld-srec/srec.exp: Likewise, and for CXX.
Diffstat (limited to 'ld/testsuite/ld-elfvers')
-rw-r--r--ld/testsuite/ld-elfvers/vers.exp12
1 files changed, 4 insertions, 8 deletions
diff --git a/ld/testsuite/ld-elfvers/vers.exp b/ld/testsuite/ld-elfvers/vers.exp
index b97da8014e9..1557f3f28de 100644
--- a/ld/testsuite/ld-elfvers/vers.exp
+++ b/ld/testsuite/ld-elfvers/vers.exp
@@ -487,12 +487,11 @@ proc build_binary { shared pic test source libname other mapfile verexp versymex
global as_options
global objdump
global CC_FOR_TARGET
- global CFLAGS_FOR_TARGET
global script
global NOSANITIZE_CFLAGS
global NOLTO_CFLAGS
- if ![ld_compile "$CC_FOR_TARGET -S $pic $CFLAGS_FOR_TARGET $NOSANITIZE_CFLAGS $NOLTO_CFLAGS" $srcdir/$subdir/$source $tmpdir/$libname.s] {
+ if ![ld_compile "$CC_FOR_TARGET -S $pic $NOSANITIZE_CFLAGS $NOLTO_CFLAGS" $srcdir/$subdir/$source $tmpdir/$libname.s] {
unsupported "$test"
return
}
@@ -579,7 +578,6 @@ proc test_ldfail { test flag source execname other mapfile whyfail } {
global as_options
global objdump
global CC_FOR_TARGET
- global CFLAGS_FOR_TARGET
global script
if [string match "" $other] then {
@@ -588,7 +586,7 @@ proc test_ldfail { test flag source execname other mapfile whyfail } {
set other_lib $tmpdir/$other
}
- if ![ld_compile "$CC_FOR_TARGET -S $flag $CFLAGS_FOR_TARGET" $srcdir/$subdir/$source $tmpdir/$execname.s] {
+ if ![ld_compile "$CC_FOR_TARGET -S $flag" $srcdir/$subdir/$source $tmpdir/$execname.s] {
unsupported "$test"
return
}
@@ -619,10 +617,9 @@ proc test_asfail { test flag source execname whyfail } {
global tmpdir
global as
global CC_FOR_TARGET
- global CFLAGS_FOR_TARGET
global NOLTO_CFLAGS
- if ![ld_compile "$CC_FOR_TARGET -S $flag $CFLAGS_FOR_TARGET $NOLTO_CFLAGS" $srcdir/$subdir/$source $tmpdir/$execname.s] {
+ if ![ld_compile "$CC_FOR_TARGET -S $flag $NOLTO_CFLAGS" $srcdir/$subdir/$source $tmpdir/$execname.s] {
unsupported "$test"
return
}
@@ -689,7 +686,6 @@ proc build_exec { test source execname flags solibname verexp versymexp symexp }
global as_options
global objdump
global CC_FOR_TARGET
- global CFLAGS_FOR_TARGET
global NOSANITIZE_CFLAGS
global NOLTO_CFLAGS
@@ -697,7 +693,7 @@ proc build_exec { test source execname flags solibname verexp versymexp symexp }
set script --version-script
# Disable LTO for these tests.
- set cc_cmd "$CC_FOR_TARGET -S $CFLAGS_FOR_TARGET"
+ set cc_cmd "$CC_FOR_TARGET -S"
if {[check_lto_available]} {
append cc_cmd " -fno-lto"
}