On Thu, Jul 28, 2005 at 12:31:05PM -0700, James E Wilson wrote: > Mark Cuss wrote: > >[EMAIL PROTECTED] helloworldsun]$ g++ -b sparc-sun-solaris2.9 hello.cxx > >/cdl/apps/.software/linux/gcc-3.4.4-x86-sparc/lib/gcc/sparc-sun-solaris2.9/3.4.4/../../../../sparc-sun-solaris2.9/bin/ld: > > > >values-Xa.o: No such file: No such file or directory > >collect2: ld returned 1 exit status > > Building cross compilers for solaris is not common, so it may be that no > one else has seen this problem. You may have to try to figure this out > yourself. Or you could try submitting a bugzilla bug report and hope > that someone looks at this. > > /usr/ccs/lib is not a normal search directory for gcc, so it may be that > the mechanism we use for it doesn't work for crosses. Checking, I see > that config/svr4.h doesn't set MD_STARTFILE_PREFIX when CROSS_COMPILE is > true. Also, the driver, gcc.c, does not use MD_STARTFILE_PREFIX when > CROSS_COMPILE is true. This might need some work to fix. Though this > doesn't explain why it does work for one of your compilers but not the > other. > > Try adding verbose options to see what is happening, i.e. compile with > -v -Wl,-v and look at the output to see if you can see something that > explains what is happening. > --
This is a very old patch I used to build a Solaris cross compiler on Linux. H.J. ---- Fri Mar 20 08:01:41 1998 H.J. Lu ([EMAIL PROTECTED]) * config/sparc/sol2.h (LINK_SPEC): Add support for cross compile. diff -x CVS -x README.libg++ -x librx -x libg++ -urp --new-file /local/work/gnu/import/egcs-1.1.x/egcs/gcc/config/sparc/sol2.h egcs-1.1.x/gcc/config/sparc/sol2.h --- gcc/config/sparc/sol2.h Thu Jul 2 20:19:35 1998 +++ gcc/config/sparc/sol2.h Sat Feb 6 15:04:16 1999 @@ -145,6 +145,18 @@ Boston, MA 02111-1307, USA. */ /* 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,*:%*} \ @@ -164,6 +176,7 @@ Boston, MA 02111-1307, USA. */ %{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. */