summaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-elfcomm/elfcomm.exp
diff options
context:
space:
mode:
Diffstat (limited to 'ld/testsuite/ld-elfcomm/elfcomm.exp')
-rw-r--r--ld/testsuite/ld-elfcomm/elfcomm.exp14
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
}