This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
GNU ld on sparc-sun-solaris2.7 won't auto-detect 32/64 bits
- To: gcc-patches at gcc dot gnu dot org
- Subject: GNU ld on sparc-sun-solaris2.7 won't auto-detect 32/64 bits
- From: Alexandre Oliva <oliva at lsd dot ic dot unicamp dot br>
- Date: 06 Dec 1999 05:26:27 -0200
Unlike Solaris 7/sparc's native linker, GNU ld won't auto-detect the
EMULATION to be used from the first object file listed in the command
line, so it must be specified explicitly. This patch allows an almost
complete build of a multilibbed (-m32/-m64) gcc with GNU as and ld on
sparc-sun-solaris2.7. There are a few build errors and ICEs while
building libio, libstdc++ and libg++ -m64, that I will report
separately.
This patch completes the work of sparc64-sol.patch, that I posted
before, and that affected the assembler interface. This one affects
the linker. Are they ok to install?
Index: gcc/ChangeLog
from Alexandre Oliva <oliva@lsd.ic.unicamp.br>
* config/sparc/sol2-64.h: Same as sol2-sld-64.h, except that
`-m EMULATION' is added to non-default LINK_ARCH_SPECs.
* configure.in: Use sol2-64.h instead of sol2-sld-64.h if linker
is GNU ld.
* configure: Rebuilt.
Index: gcc/configure.in
===================================================================
RCS file: /cvs/gcc/egcs/gcc/configure.in,v
retrieving revision 1.307
diff -u -r1.307 configure.in
--- gcc/configure.in 1999/11/23 07:57:06 1.307
+++ gcc/configure.in 1999/12/03 21:45:08
@@ -3257,7 +3257,12 @@
tm_file=sparc/rtems.h
;;
sparcv9-*-solaris2*)
- tm_file=sparc/sol2-sld-64.h
+ if test x$gnu_ld = xyes
+ then
+ tm_file=sparc/sol2-64.h
+ else
+ tm_file=sparc/sol2-sld-64.h
+ fi
xm_file="sparc/xm-sysv4-64.h sparc/xm-sol2.h"
xm_defines="USG POSIX"
tmake_file="sparc/t-sol2 sparc/t-sol2-64"
@@ -3309,10 +3314,15 @@
extra_parts="crt1.o crti.o crtn.o gcrt1.o gmon.o crtbegin.o crtend.o"
case $machine in
changequote(,)dnl
*-*-solaris2.[0-6] | *-*-solaris2.[0-6].*) ;;
changequote([,])dnl
*-*-solaris2*)
- tm_file=sparc/sol2-sld-64.h
+ if test x$gnu_ld = xyes
+ then
+ tm_file=sparc/sol2-64.h
+ else
+ tm_file=sparc/sol2-sld-64.h
+ fi
tmake_file="$tmake_file sparc/t-sol2-64"
;;
esac
Index: gcc/config/sparc/sol2-64.h
===================================================================
RCS file: sol2-64.h
diff -N sol2-64.h
--- gcc/config/sparc/sol2-64.h Tue May 5 13:32:27 1998
+++ gcc/config/sparc/sol2-64.h Sun Dec 5 23:09:11 1999
@@ -0,0 +1,22 @@
+/* Definitions of target machine for GNU compiler, for 64-bit SPARC
+ running Solaris 2 using the GNU linker. */
+
+#include "sparc/sol2-sld-64.h"
+
+#ifdef LINKER_DOES_NOT_WORK_WITH_DWARF2
+#undef LINKER_DOES_NOT_WORK_WITH_DWARF2
+#endif
+
+#ifdef AS_SPARC64_FLAG
+
+#ifdef LINK_ARCH_SPEC
+#undef LINK_ARCH_SPEC
+#endif
+
+#define LINK_ARCH_SPEC "\
+%{m32:-m elf32_sparc %(link_arch32)} \
+%{m64:-m elf64_sparc %(link_arch64)} \
+%{!m32:%{!m64:%(link_arch_default)}} \
+"
+
+#endif
--
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