diff options
author | 2021-09-03 16:26:21 +0930 | |
---|---|---|
committer | 2021-09-03 16:26:21 +0930 | |
commit | 669d5115345a3f3dc1c06aec31098eb4b349a6d0 (patch) | |
tree | 0bd69d93c3e4c1b7b57d6a58e803ad3a9bd0419f /ld/testsuite/ld-elfcomm | |
parent | CC_FOR_TARGET et al (diff) | |
download | binutils-gdb-669d5115345a3f3dc1c06aec31098eb4b349a6d0.tar.gz binutils-gdb-669d5115345a3f3dc1c06aec31098eb4b349a6d0.tar.bz2 binutils-gdb-669d5115345a3f3dc1c06aec31098eb4b349a6d0.zip |
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-elfcomm')
-rw-r--r-- | ld/testsuite/ld-elfcomm/elfcomm.exp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/ld/testsuite/ld-elfcomm/elfcomm.exp b/ld/testsuite/ld-elfcomm/elfcomm.exp index b74910440ae..bed4e8c173a 100644 --- a/ld/testsuite/ld-elfcomm/elfcomm.exp +++ b/ld/testsuite/ld-elfcomm/elfcomm.exp @@ -163,15 +163,15 @@ proc stt_common_test { options testname } { return 1 } -if [istarget nios2*-*-*] { - append CFLAGS_FOR_TARGET " -G0" -} - # Explicitly use "-fcommon" so that even if $CFLAGS includes # "-fno-common", these tests are compiled as expected. -if { ![ld_compile "$CC_FOR_TARGET $CFLAGS_FOR_TARGET -fcommon $NOSANITIZE_CFLAGS $NOLTO_CFLAGS" $srcdir/$subdir/common1a.c tmpdir/common1a.o] - || ![ld_compile "$CC_FOR_TARGET $CFLAGS_FOR_TARGET -fcommon $NOSANITIZE_CFLAGS $NOLTO_CFLAGS" $srcdir/$subdir/common1b.c tmpdir/common1b.o] - || ![ld_compile "$CC_FOR_TARGET $CFLAGS_FOR_TARGET $NOSANITIZE_CFLAGS $NOLTO_CFLAGS -Wa,--elf-stt-common=yes -fcommon" $srcdir/$subdir/common1b.c tmpdir/common1c.o] } { +set options "-fcommon $NOSANITIZE_CFLAGS $NOLTO_CFLAGS" +if [istarget nios2*-*-*] { + append options " -G0" +} +if { ![ld_compile "$CC_FOR_TARGET $options" $srcdir/$subdir/common1a.c tmpdir/common1a.o] + || ![ld_compile "$CC_FOR_TARGET $options" $srcdir/$subdir/common1b.c tmpdir/common1b.o] + || ![ld_compile "$CC_FOR_TARGET $options -Wa,--elf-stt-common=yes" $srcdir/$subdir/common1b.c tmpdir/common1c.o] } { unsupported $test1 return } |