PATCH to support IRIX6 with GNU ld

Mark Mitchell mark@codesourcery.com
Thu Jul 1 18:14:00 GMT 1999


For those that aren't aware, CodeSourcery has donated work to get GNU
ld up and running on the IRIX6 N32 ABI.  The N64 ABI is in the works.
You can play with the N32 linker by checking out the sourceware
binutils sources.

To make that easier, here's patches to enable GNU ld as the linker
used by GCC.  I've tested that the following patches, combined with
the N32 ld, yield a GCC that behaves no differently on the regression
tests from an IRIX6-ld built GCC, after a full bootstrap.

I'd like to get this in so interested folks can try out the new `ld';
I'm sure there are bugs to shake out.  Using this patch, you just
configure `--with-gnu-ld' and off you go.

OK to check in?

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

Thu Jul  1 19:08:13 1999  Mark P. Mitchell  <mark@codesourcery.com>

	* gcc/configure.in (mips-sgi-irix6*): Handle --with-gnu-ld.
	* gcc/config/mips/t-iris6gld: New file.
	* gcc/config/mips/iris6gld.h: Likewise.

Index: gcc/configure.in
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/configure.in,v
retrieving revision 1.248
diff -c -p -r1.248 configure.in
*** configure.in	1999/05/26 16:44:14	1.248
--- configure.in	1999/07/02 00:58:58
*************** changequote([,])dnl
*** 2178,2187 ****
  		tmake_file=m88k/t-sysv4
  		;;
  	mips-sgi-irix6*)		# SGI System V.4., IRIX 6
! 		tm_file=mips/iris6.h
  		xm_file=mips/xm-iris6.h
  		xmake_file=mips/x-iris6
- 		tmake_file=mips/t-iris6
  # 		if test x$enable_threads = xyes; then
  #			thread_file='irix'
  #		fi
--- 2178,2193 ----
  		tmake_file=m88k/t-sysv4
  		;;
  	mips-sgi-irix6*)		# SGI System V.4., IRIX 6
! 		if test "x$gnu_ld" = xyes
! 		then
! 			tm_file="mips/iris6.h mips/iris6gld.h"
! 			tmake_file=mips/t-iris6gld
! 		else
! 			tm_file=mips/iris6.h
! 			tmake_file=mips/t-iris6
! 		fi
  		xm_file=mips/xm-iris6.h
  		xmake_file=mips/x-iris6
  # 		if test x$enable_threads = xyes; then
  #			thread_file='irix'
  #		fi
Index: gcc/config/mips/t-iris6gld
===================================================================
RCS file: t-iris6gld
diff -N t-iris6gld
*** /dev/null	Sat Dec  5 20:30:03 1998
--- t-iris6gld	Thu Jul  1 17:58:59 1999
***************
*** 0 ****
--- 1,10 ----
+ # Suppress building libgcc1.a, since the MIPS compiler port is complete
+ # and does not need anything from libgcc1.a.
+ LIBGCC1 = 
+ CROSS_LIBGCC1 = 
+ 
+ # We don't multilib because we don't yet have 64-bit linker support in
+ # GNU ld.
+ 
+ CRTSTUFF_T_CFLAGS=-g1
+ 
Index: gcc/config/mips/iris6gld.h
===================================================================
RCS file: iris6gld.h
diff -N iris6gld.h
*** /dev/null	Sat Dec  5 20:30:03 1998
--- iris6gld.h	Thu Jul  1 18:07:03 1999
***************
*** 0 ****
--- 1,48 ----
+ /* Definitions of target machine for GNU compiler.  Iris version 6 with
+    GNU ld.
+    Copyright (C) 1999 Free Software Foundation, Inc.
+    Written by Mark Mitchell <mark@codesourcery.com>.
+ 
+ This file is part of GNU CC.
+ 
+ GNU CC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+ 
+ GNU CC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+ 
+ You should have received a copy of the GNU General Public License
+ along with GNU CC; see the file COPYING.  If not, write to
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.  */
+ 
+ #undef LIB_SPEC
+ #define LIB_SPEC \
+   "%{mabi=n32: %{mips4:-L/usr/lib32/mips4} %{!mips4:-L/usr/lib32/mips3} \
+      -L/usr/lib32} \
+    %{mabi=64: %{mips4:-L/usr/lib64/mips4} %{!mips4:-L/usr/lib64/mips3} \
+      -L/usr/lib64} \
+    %{!mabi*: %{mips4:-L/usr/lib32/mips4} %{!mips4:-L/usr/lib32/mips3} \
+      -L/usr/lib32} \
+    %{!shared: \
+      %{p:libprof1.a%s}%{pg:libprof1.a%s} -lc}"
+ 
+ /* Use the default libgcc spec.  */
+ #undef LIBGCC_SPEC
+ 
+ /* ??? If no mabi=X option give, but a mipsX option is, then should depend
+    on the mipsX option.  */
+ #undef LINK_SPEC
+ #define LINK_SPEC "\
+ %{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} %{mips4} \
+ %{bestGnum} %{shared} %{non_shared} \
+ %{call_shared} %{no_archive} %{exact_version} \
+ %{static: -non_shared} \
+ %{!static: \
+   %{!shared: %{!non_shared: %{!call_shared: -call_shared}}}} \
+ %{rpath} -init __do_global_ctors -fini __do_global_dtors \
+ %{mabi=32: -melf32bsmip}%{mabi=n32: -melfbmipn32}%{mabi=64: -melfbmip64}%{!mabi*: -melf32bmipn32}"


More information about the Gcc-patches mailing list