public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Can't find values-Xa.o when cross compiling
@ 2005-07-25 19:05 Mark Cuss
  2005-07-28 17:57 ` Mark Cuss
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Cuss @ 2005-07-25 19:05 UTC (permalink / raw)
  To: gcc

 Hello All

I've built gcc-3.4.4 as a linux to Solaris (on SPARC) cross compiler.  If I
change my path to include my new compiler executables, I can compile and
 link a simple "hello world" program.

 However, I want to be able to specify the target architecture and compiler
 version number with gcc's -b and -V flags.  When I try to build my program
 using these flags, the system can't find values-Xa.o:
 [mark@locutus helloworld]$ g++ -b sparc-sun-solaris2.9 -V 3.4.4 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 [mark@locutus helloworld]$ The file is in $sysroot/usr/lib (and $sysroot/usr/ccs/lib too).  $sysroot was set as configure option when built gcc.  According to the docs, itlooks like $sysroot should be searched for the library & object files, but it doesn't seem to work.  Even if I specify the path to the linker with -Wl,-L <path>, it still can't find the file.  However, if I directly call gcc instead of using -b and -V to call sparc-sun-solaris2.9-gcc, it works... Any ideas why this might be?  My gcc package is configured as:[mark@locutus helloworld]$ gcc -vReading specs from/cdl/apps/.software/linux/gcc-3.4.4-x86-sparc/lib/gcc/sparc-sun-solaris2.9/3.4.4/specsConfigured with:../gcc-3.4.4/configure --host=i686-pc-linux-gnu --target=sparc-sun-solaris2.9 --with-sysroot=/cdl/apps/.software/linux/gcc-3.4.4-x86-sparc-build/sysroot --with-gnu-as --with-gnu-ld --prefix=/cdl/apps/.software/linux/gcc-3.4.4-x86-sparc --enable-languages=c,c++Thread model: posixgcc version 3.4.4[mark@locutus helloworld]$ Thanks Mark Mark Cuss, B. Sc. Real Time Systems Analyst System Administrator CDL Systems Ltd Suite 230 3553 - 31 Street NW Calgary, AB, Canada Phone: 403 289 1733 ext 226Fax: 403 289 3967> www.cdlsystems.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Can't find values-Xa.o when cross compiling
  2005-07-25 19:05 Can't find values-Xa.o when cross compiling Mark Cuss
@ 2005-07-28 17:57 ` Mark Cuss
  2005-07-28 19:31   ` James E Wilson
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Cuss @ 2005-07-28 17:57 UTC (permalink / raw)
  To: gcc

Hello all

Can anyone shed any light on this problem for me?  I've built gcc 3.4.4 as a 
Linux (on x86) to Solaris (on SPARC) cross compiler.  When I do the make 
install, I get 2 sets of binaries:

1)  $prefix/bin - this contains all of the binaries with 
'sparc-sun-solaris2.9' in front of them (ie - sparc-sun-solaris2.9-g++, etc)
2)  $prefix/sparc-sun-solaris2.9/bin - this contains all of the binaries 
with their normal names (ie - g++, gcc, etc)

If I set my PATH to $prefix/sparc-sun-solaris2.9/bin, then I can build a 
simple "hello world" test program.  However, if I either directly call 
$prefix/bin/sparc-sun-solaris2.9/g++ or indirectly call it by using g++ -b 
sparc-sun-solaris2.9, I get:

[mark@locutus 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
[mark@locutus helloworldsun]$

values-Xa.o lives in $sysroot/usr/ccs/lib like it's supposed to.  If I call 
$prefix/sparc-sun-solaris2.9/bin/g++ it finds it OK, but 
$prefix/bin/sparc-sun-solaris-2.9-g++ can't - any ideas why this might be? 
I've tried including the path to values-Xa.o with -L but that hasn't helped? 
I'd really appreciate some pointers on this one.

Thanks in advance

Mark


----- Original Message ----- 
From: "Mark Cuss" <mcuss@cdlsystems.com>
To: <gcc@gcc.gnu.org>
Sent: Monday, July 25, 2005 1:04 PM
Subject: Can't find values-Xa.o when cross compiling


> Hello All
>
> I've built gcc-3.4.4 as a linux to Solaris (on SPARC) cross compiler.  If 
> I
> change my path to include my new compiler executables, I can compile and
> link a simple "hello world" program.
>
> However, I want to be able to specify the target architecture and compiler
> version number with gcc's -b and -V flags.  When I try to build my program
> using these flags, the system can't find values-Xa.o:
> [mark@locutus helloworld]$ g++ -b sparc-sun-solaris2.9 -V 3.4.4 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 [mark@locutus helloworld]$ The file is in $sysroot/usr/lib 
> (and $sysroot/usr/ccs/lib too).  $sysroot was set as configure option when 
> built gcc.  According to the docs, itlooks like $sysroot should be 
> searched for the library & object files, but it doesn't seem to work. 
> Even if I specify the path to the linker with -Wl,-L <path>, it still 
> can't find the file.  However, if I directly call gcc instead of using -b 
> and -V to call sparc-sun-solaris2.9-gcc, it works... Any ideas why this 
> might be?  My gcc package is configured as:[mark@locutus helloworld]$ 
> gcc -vReading specs 
> from/cdl/apps/.software/linux/gcc-3.4.4-x86-sparc/lib/gcc/sparc-sun-solaris2.9/3.4.4/specsConfigured 
> with:../gcc-3.4.4/configure --host=i686-pc-linux-gnu --target=sparc-sun-solaris2.9 
>  --with-sysroot=/cdl/apps/.software/linux/gcc-3.4.4-x86-sparc-build/sysroot --with-gnu-as --with-gnu-ld --prefix=/cdl/apps/.software/linux/gcc-3.4.4-x86-sparc --enable-languages=c,c++Thread model: posixgcc version3.4.4[mark@locutus helloworld]$ Thanks Mark Mark Cuss, B. Sc. Real TimeSystems Analyst System Administrator CDL Systems Ltd Suite 230 3553 - 31Street NW Calgary, AB, Canada Phone: 403 289 1733 ext 226Fax: 403 289 3967>www.cdlsystems.com>>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Can't find values-Xa.o when cross compiling
  2005-07-28 17:57 ` Mark Cuss
@ 2005-07-28 19:31   ` James E Wilson
  2005-07-29  0:43     ` H. J. Lu
  0 siblings, 1 reply; 4+ messages in thread
From: James E Wilson @ 2005-07-28 19:31 UTC (permalink / raw)
  To: Mark Cuss; +Cc: gcc

Mark Cuss wrote:
> [mark@locutus 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.
-- 
Jim Wilson, GNU Tools Support, http://www.specifix.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Can't find values-Xa.o when cross compiling
  2005-07-28 19:31   ` James E Wilson
@ 2005-07-29  0:43     ` H. J. Lu
  0 siblings, 0 replies; 4+ messages in thread
From: H. J. Lu @ 2005-07-29  0:43 UTC (permalink / raw)
  To: James E Wilson; +Cc: Mark Cuss, gcc

On Thu, Jul 28, 2005 at 12:31:05PM -0700, James E Wilson wrote:
> Mark Cuss wrote:
> >[mark@locutus 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  (hjl@gnu.org)

	* 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.  */

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-07-29  0:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-25 19:05 Can't find values-Xa.o when cross compiling Mark Cuss
2005-07-28 17:57 ` Mark Cuss
2005-07-28 19:31   ` James E Wilson
2005-07-29  0:43     ` H. J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).