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]

A solaris patch for cross-compile


Hi,

This is an old patch I have been using to cross-compile from Linux
to Solaris/Sparc. The only cross linker for Solaris/Sparc I know is
the GNU ld and my cross ld supports many different targets. This is 
why I added "-m elf32_sparc". Also ld command line syntax and
the library locations are different.

Thanks. 


-- 
H.J. Lu (hjl@gnu.org)
---
Fri Mar 20 08:01:41 1998  H.J. Lu  (hjl@gnu.org)

	* config/sparc/sol2.h (LINK_SPEC): Add support for cross
	compile.

--- ../../../import/egcs/gcc/config/sparc/sol2.h	Mon Oct 20 13:49:16 1997
+++ config/sparc/sol2.h	Fri Mar 20 11:00:28 1998
@@ -138,6 +138,18 @@
 
 /* This should be the same as in svr4.h, except with -R added.  */
 #undef LINK_SPEC
+#ifdef CROSS_COMPILE
+#define LINK_SPEC \
+  "-m elf32_sparc %{h*} \
+   %{b} %{Wl,*:%*} \
+   %{static:-dn -Bstatic} \
+   %{shared:-G -dy %{!mimpure-text:-z text} %{!h*:%{o*:-h %*}}} \
+   %{symbolic:-Bsymbolic -G -dy -z text %{!h*:%{o*:-h %*}}} \
+   %{G:-G} \
+   %{YP,*} \
+   %{R*} \
+   %{Qy:} %{!Qn:-Qy}"
+#else
 #define LINK_SPEC \
   "%{h*} %{v:-V} \
    %{b} %{Wl,*:%*} \
@@ -157,6 +169,7 @@
        %{pg:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
        %{!p:%{!pg:-Y P,/usr/ccs/lib:/usr/lib}}}} \
    %{Qy:} %{!Qn:-Qy}"
+#endif
 
 /* This defines which switch letters take arguments.
    It is as in svr4.h but with -R added.  */


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