This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: Pass -fcommon for elfcomm.exp


If "-fno-common" is in CFLAGS, then the tests for correct handling of
common data fail because the compiler doesn't actually generate common
data.  This patch explicitly passes -fcommon, making the testsuite
more robust.  

Tested on arm-none-eabi.  OK to apply?

--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713

2009-03-05  Mark Mitchell  <mark@codesourcery.com>

	* ld-elfcomm/elfcomm.exp: Compile with -fcommon.

Index: ld/testsuite/ld-elfcomm/elfcomm.exp
===================================================================
--- ld/testsuite/ld-elfcomm/elfcomm.exp	(revision 238952)
+++ ld/testsuite/ld-elfcomm/elfcomm.exp	(working copy)
@@ -175,9 +175,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
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]