diff options
author | Alan Modra <amodra@gmail.com> | 2021-09-03 16:26:21 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2021-09-03 16:26:21 +0930 |
commit | 669d5115345a3f3dc1c06aec31098eb4b349a6d0 (patch) | |
tree | 0bd69d93c3e4c1b7b57d6a58e803ad3a9bd0419f /ld/testsuite/ld-srec | |
parent | ad77db1c02a92c912f9719f32e2452890aa738ad (diff) | |
download | gdb-669d5115345a3f3dc1c06aec31098eb4b349a6d0.zip gdb-669d5115345a3f3dc1c06aec31098eb4b349a6d0.tar.gz gdb-669d5115345a3f3dc1c06aec31098eb4b349a6d0.tar.bz2 |
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-srec')
-rw-r--r-- | ld/testsuite/ld-srec/srec.exp | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/ld/testsuite/ld-srec/srec.exp b/ld/testsuite/ld-srec/srec.exp index 20472af..57380ca 100644 --- a/ld/testsuite/ld-srec/srec.exp +++ b/ld/testsuite/ld-srec/srec.exp @@ -355,25 +355,23 @@ if { ![check_compiler_available] } { # tests. Also add $NOPIE_CFLAGS and $NOPIE_LDFLAGS if PIE doesn't work # with S-records. Also add $NOCF_PROTECTION_CFLAGS for S-records. # Also add $NOSANITIZE_CFLAGS for S-records. -set old_CC "$CC_FOR_TARGET" -append CC_FOR_TARGET " $PLT_CFLAGS $NOPIE_CFLAGS $NOPIE_LDFLAGS $NOCF_PROTECTION_CFLAGS $NOSANITIZE_CFLAGS $NOLTO_CFLAGS" -set old_CXX "$CXX_FOR_TARGET" +set old_CFLAGS "$CFLAGS_FOR_TARGET" +append CFLAGS_FOR_TARGET " $PLT_CFLAGS $NOPIE_CFLAGS $NOPIE_LDFLAGS $NOCF_PROTECTION_CFLAGS $NOSANITIZE_CFLAGS $NOLTO_CFLAGS" set old_CXXFLAGS "$CXXFLAGS_FOR_TARGET" append CXXFLAGS_FOR_TARGET " $PLT_CFLAGS $NOPIE_CFLAGS $NOPIE_LDFLAGS $NOCF_PROTECTION_CFLAGS $NOSANITIZE_CFLAGS $NOLTO_CFLAGS" # S-records can't handle .note.gnu.property sections. if { [is_elf_format] \ && ([istarget "i?86-*-*"] || [istarget "x86_64-*-*"]) } { - append CC_FOR_TARGET " -Wa,-mx86-used-note=no" - append CXX_FOR_TARGET " -Wa,-mx86-used-note=no" + append CFLAGS_FOR_TARGET " -Wa,-mx86-used-note=no" + append CXXFLAGS_FOR_TARGET " -Wa,-mx86-used-note=no" } if { ![ld_compile $CC_FOR_TARGET $srcdir/$subdir/sr1.c tmpdir/sr1.o] \ || ![ld_compile $CC_FOR_TARGET $srcdir/$subdir/sr2.c tmpdir/sr2.o] } { unsupported $test1 unsupported $test2 - set CC_FOR_TARGET "$old_CC" - set CXX_FOR_TARGET "$old_CXX" + set CFLAGS_FOR_TARGET "$old_CFLAGS" set CXXFLAGS_FOR_TARGET "$old_CXXFLAGS" return } @@ -446,16 +444,14 @@ run_srec_test $test1 "tmpdir/sr1.o tmpdir/sr2.o" if { ![is_remote host] && [which $CXX_FOR_TARGET] == 0 } { untested $test2 - set CC_FOR_TARGET "$old_CC" - set CXX_FOR_TARGET "$old_CXX" + set CFLAGS_FOR_TARGET "$old_CFLAGS" set CXXFLAGS_FOR_TARGET "$old_CXXFLAGS" return } -if ![ld_compile "$CXX_FOR_TARGET $CXXFLAGS_FOR_TARGET -fno-exceptions" $srcdir/$subdir/sr3.cc tmpdir/sr3.o] { +if ![ld_compile "$CXX_FOR_TARGET -fno-exceptions" $srcdir/$subdir/sr3.cc tmpdir/sr3.o] { unsupported $test2 - set CC_FOR_TARGET "$old_CC" - set CXX_FOR_TARGET "$old_CXX" + set CFLAGS_FOR_TARGET "$old_CFLAGS" set CXXFLAGS_FOR_TARGET "$old_CXXFLAGS" return } @@ -482,6 +478,5 @@ setup_xfail "bpf-*-*" run_srec_test $test2 "tmpdir/sr3.o" -set CC_FOR_TARGET "$old_CC" -set CXX_FOR_TARGET "$old_CXX" +set CFLAGS_FOR_TARGET "$old_CFLAGS" set CXXFLAGS_FOR_TARGET "$old_CXXFLAGS" |