This is the mail archive of the binutils@sourceware.cygnus.com 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]

Re: Enable 64-ld on Solaris7+/sparc


On Dec  6, 1999, Alexandre Oliva <oliva@lsd.ic.unicamp.br> wrote:

> Here's one more bit to allow GNU binutils to be as close as possible
> to the native toolchain on Solaris7/sparc, WRT 64bit support.

Oops, it was missing the bits to enable the automatic search on the
appropriate directories, when linking 64bit.  Here's a new version of
the patch, that supersedes the one I have just posted:

Index: ld/ChangeLog
from  Alexandre Oliva  <oliva@lsd.ic.unicamp.br>
	
	* configure.tgt: Enable elf64_sparc on Solaris7+/sparc.  And make
	it default if sparcv9 or sparc64.
	
Index: ld/configure.tgt
===================================================================
RCS file: /cvs/binutils/binutils/ld/configure.tgt,v
retrieving revision 1.17
diff -u -r1.17 configure.tgt
--- ld/configure.tgt	1999/09/04 17:37:36	1.17
+++ ld/configure.tgt	1999/12/06 05:53:55
@@ -51,6 +51,19 @@
 			;;
 sparc*-*-lynxos*)	targ_emul=sparclynx ;;
 sparc*-*-netbsd*)	targ_emul=sparcnbsd ;;
+sparc-*-solaris2.[0-6] | sparc-*-solaris2.[0-6].*)
+			targ_emul=elf32_sparc ;;
+sparc-*-solaris2*)	targ_emul=elf32_sparc
+			targ_extra_emuls="elf64_sparc"
+			targ_extra_libpath=$targ_extra_emuls
+			tdir_elf64_sparc=`echo ${targ_alias} | sed -e 's/32//'`
+			;;
+sparcv9-*-solaris2* | sparc64-*-solaris2*)
+			targ_emul=elf64_sparc
+			targ_extra_emuls="elf32_sparc"
+			targ_extra_libpath=$targ_extra_emuls
+			tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'`
+			;;
 sparc*-*-solaris2*)	targ_emul=elf32_sparc ;;
 sparc*-wrs-vxworks*)	targ_emul=sparcaout ;;
 sparc*-*-rtems*)	targ_emul=sparcaout ;;


After this patch and some patches for gcc, I could build a 32/64bit
fully multilibbed gcc on sparc-sun-solaris2.7 with GNU as and ld.
Unfortunately, a C program as simple as `int main(){}' fails to run
when linked with GNU ld.  However, if I use the native linker instead
of GNU ld, with the very same object files and libraries, it runs.
The program linked with GNU ld is simply `Killed'; not even `truss'
can start it.  Any ideas about how to investigate this problem?


BTW, the last patch for gcc that I needed to install, to enable
32/64bit multilibbing, was one to pass -m elf64_sparc or -m
elf32_sparc to ld, depending on whether gcc was run with -32 or -64.
The native linker automatically detects the appropriate EMULATION,
from the first object file it opens.  Any tips about how to do it
within GNU ld?

-- 
Alexandre Oliva http://www.ic.unicamp.br/~oliva IC-Unicamp, Bra[sz]il
oliva@{lsd.ic.unicamp.br,guarana.{org,com}} aoliva@{acm,computer}.org
oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org}
** I may forward mail about projects to mailing lists; please use them

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