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 to fix linkage.c test on sparc-sun-solaris2.7 w/-m64


When running the gcc-3.1 testsuite on sparc-sun-solaris2.7 with -m64,
the test gcc.misc-tests/linkage.c fails.  See
http://gcc.gnu.org/ml/gcc-testresults/2002-03/msg00859.html

This test links an object file generated by gcc with one generated by
cc to make sure that linking the two together works.  But the default
ABI for cc on solaris2 is 32-bit, not 64-bit which we're trying to
test.

Note, this same problem (and solution) afflicted 64-bit irix6, namely
that you had to pass a special flag to cc to get a 64-bit object file
from the native compiler.

The patch below was tested on the 3.1 branch by rerunning make
check-gcc and ensuring that linkage.c passed in both 64 and 32 modes.
(I used diff -u9 to make clear my patch is similar to the irix6 hack.)

Okay to install on the branch and trunk?

		Thanks,
		--Kaveh


2002-03-31  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* gcc.misc-tests/linkage.exp: Special case 64-bit solaris2.

diff -ru9p orig/egcc-3.1-CVS20020331/gcc/testsuite/gcc.misc-tests/linkage.exp egcc-3.1-CVS20020331/gcc/testsuite/gcc.misc-tests/linkage.exp
--- orig/egcc-3.1-CVS20020331/gcc/testsuite/gcc.misc-tests/linkage.exp	Tue Oct  9 06:16:26 2001
+++ egcc-3.1-CVS20020331/gcc/testsuite/gcc.misc-tests/linkage.exp	Sun Mar 31 10:50:21 2002
@@ -30,18 +30,24 @@ if [isnative] then {
 	if  [istarget "mips-sgi-irix6*"] {
 	    set file_string [exec file "linkage-x.o"]
 	    if [ string match "*64*" $file_string ] {
 		set native_cflags "-64"
 	    }
 	    if [ string match "*N32*" $file_string ] {
 		set native_cflags "-n32"
 	    }
 	}
+	if  [istarget "sparc-sun-solaris2*"] {
+	    set file_string [exec file "linkage-x.o"]
+	    if [ string match "*64*" $file_string ] {
+		set native_cflags "-xarch=v9"
+	    }
+	}
 
 	catch { exec rm -f linkage-y.o }
 	send_log "cc -c $native_cflags $srcdir/$subdir/linkage-y.c >&/dev/null\n"
 	catch { exec cc -c $native_cflags "$srcdir/$subdir/linkage-y.c" >&/dev/null }
 	if ![file exists "linkage-y.o"] then {
 	    send_log "c89 -c $native_cflags $srcdir/$subdir/linkage-y.c >&/dev/null\n"
 	    catch { exec c89 -c $native_cflags "$srcdir/$subdir/linkage-y.c" >&/dev/null }
 	}
 	if [file exists "linkage-y.o"] then {


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