* ld-elfcomm/elfcomm.exp: Compile with -fcommon.
authorNathan Sidwell <nathan@codesourcery.com>
Fri, 30 Oct 2009 10:46:00 +0000 (10:46 +0000)
committerNathan Sidwell <nathan@codesourcery.com>
Fri, 30 Oct 2009 10:46:00 +0000 (10:46 +0000)
ld/testsuite/ChangeLog
ld/testsuite/ld-elfcomm/elfcomm.exp

index 28829c632517fc6f65d09d742d307c7cc232ec44..e634cceb718af71b8862720dcfce954d8ff43e6c 100644 (file)
@@ -1,3 +1,7 @@
+2009-10-30  Mark Mitchell  <mark@codesourcery.com>
+
+       * ld-elfcomm/elfcomm.exp: Compile with -fcommon.
+
 2009-10-28  Johan Kristell  <johankri@axis.com>
 
        * ld-cris/dso12-pltdis.d: New test.
index 213a821bc35d826218cf82bbcf16d98a36314f2a..5ece03fd8f4fe8c5d1e2e5e7940db4d4ab2d3721 100644 (file)
@@ -176,9 +176,10 @@ proc assembler_generates_commons {} {
     return 1
 }
 
-
-if {   ![ld_compile "$CC $CFLAGS" $srcdir/$subdir/common1a.c tmpdir/common1a.o]
-    || ![ld_compile "$CC $CFLAGS" $srcdir/$subdir/common1b.c tmpdir/common1b.o] } {
+# Explicitly use "-fcommon" so that even if $CFLAGS includes
+# "-fno-common", these tests are compiled as expected.
+if {   ![ld_compile "$CC $CFLAGS -fcommon" $srcdir/$subdir/common1a.c tmpdir/common1a.o]
+    || ![ld_compile "$CC $CFLAGS -fcommon" $srcdir/$subdir/common1b.c tmpdir/common1b.o] } {
     unresolved $test1
     return
 }