This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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] Small fix for x86_64 testsuite bug


This patch fixes a testsuite test failure on x86_64 linux targets where the
built gcc is 64-bit and the native C compiler is, for whatever reason, 32-bit
by default.

The test links an object file from the built gcc with an object file from the
native C compiler, and so invokes the native C compiler.  The architecture
of the object file built by the native C compiler must match that of the
object file from the built gcc; if not, the link and the test fail.

The patch adds -m64 to the native C compilation if the file being linked to
from the built gcc is a 64-bit object.

Tested and confirmed with gcc testsuite.  Okay for mainline?


gcc/testsuite/ChangeLog:
2008-07-23  Simon Baldwin  <simonb@google.com>

	* gcc.misc-tests/linkage.exp: Added -m64 to x86_64 linux target
	native C compilation where required.


Index: gcc/testsuite/gcc.misc-tests/linkage.exp
===================================================================
--- gcc/testsuite/gcc.misc-tests/linkage.exp	(revision 149974)
+++ gcc/testsuite/gcc.misc-tests/linkage.exp	(working copy)
@@ -62,6 +62,9 @@ if { [isnative] && ![is_remote host] } t
 	    if [ string match "*32-bit*" $file_string ] {
 		set native_cflags "-m32"
 	    }
+	    if [ string match "*64-bit*" $file_string ] {
+		set native_cflags "-m64"
+	    }
 	} elseif [istarget "*-hp-hpux*"] {
 	    set file_string [exec file "linkage-x.o"]
 	    if [ string match "*ELF-64*" $file_string ] {


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