This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
PATCH: Pass -fcommon for elfcomm.exp
- From: mitchell at codesourcery dot com (Mark Mitchell)
- To: binutils at sourceware dot org
- Date: Fri, 6 Mar 2009 13:30:09 -0800 (PST)
- Subject: PATCH: Pass -fcommon for elfcomm.exp
- Reply-to: mark at codesourcery dot com
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
}