public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Cross Linux/x86 to Solaris2.10/x86-64 compiler build problem
@ 2007-03-19 21:33 Alex Bennee
  2007-03-19 21:45 ` Michael Wetherell
  2007-03-19 21:46 ` Daniel Jacobowitz
  0 siblings, 2 replies; 5+ messages in thread
From: Alex Bennee @ 2007-03-19 21:33 UTC (permalink / raw)
  To: gcc; +Cc: binutils

Hi,

I'm not sure if this is a binutils problem or something funky in my
configure for gcc. gcc fails to link while building libgcc:

/export/toolchain/gcc-4.1.2.git/host-i686-pc-linux-gnu/gcc/xgcc
-B/export/toolchain/gcc-4.1.2.git/host-i686-pc-linux-gnu/gcc/
-B/export/toolchain/build-install/i686-sun-solaris2.10/bin/
-B/export/toolchain/build-install/i686-sun-solaris2.10/lib/
-isystem /export/toolchain/build-install/i686-sun-solaris2.10/include
-isystem /export/toolchain/build-install/i686-sun-solaris2.10/sys-include -O2  -O2 -g3   -DIN_GCC -DCROSS_COMPILE   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -fPIC -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED  -shared -nodefaultlibs -Wl,--soname=libgcc_s.so.1 -Wl,--version-script=libgcc/amd64/libgcc.map -o amd64/libgcc_s.so.1.tmp  -m64 libgcc/amd64/_muldi3_s.o libgcc/amd64/_negdi2_s.o libgcc/amd64/_lshrdi3_s.o libgcc/amd64/_ashldi3_s.o libgcc/amd64/_ashrdi3_s.o libgcc/amd64/_cmpdi2_s.o libgcc/amd64/_ucmpdi2_s.o libgcc/amd64/_clear_cache_s.o libgcc/amd64/_enable_execute_stack_s.o libgcc/amd64/_trampoline_s.o libgcc/amd64/__main_s.o libgcc/amd64/_absvsi2_s.o libgcc/amd64/_absvdi2_s.o libgcc/amd64/_addvsi3_s.o libgcc/amd64/_addvdi3_s.o libgcc/amd64/_subvsi3_s.o libgcc/amd64/_subvdi3_s.o libgcc/amd64/_mulvsi3_s.o libgcc/amd64/_mulvdi3_s.o libgcc/amd64/_negvsi2_s.o libgcc/amd64/_negvdi2_s.o libgcc/amd64/_ctors_s.o libgcc/amd64/_ffssi2_s.o libgcc/amd64/_ffsdi2_s.o libgcc/amd64/_clz_s.o libgcc/amd64/_clzsi2_s.o libgcc/amd64/_clzdi2_s.o libgcc/amd64/_ctzsi2_s.o libgcc/amd64/_ctzdi2_s.o libgcc/amd64/_popcount_tab_s.o libgcc/amd64/_popcountsi2_s.o libgcc/amd64/_popcountdi2_s.o libgcc/amd64/_paritysi2_s.o libgcc/amd64/_paritydi2_s.o libgcc/amd64/_powisf2_s.o libgcc/amd64/_powidf2_s.o libgcc/amd64/_powixf2_s.o libgcc/amd64/_powitf2_s.o libgcc/amd64/_mulsc3_s.o libgcc/amd64/_muldc3_s.o libgcc/amd64/_mulxc3_s.o libgcc/amd64/_multc3_s.o libgcc/amd64/_divsc3_s.o libgcc/amd64/_divdc3_s.o libgcc/amd64/_divxc3_s.o libgcc/amd64/_divtc3_s.o libgcc/amd64/_fixunssfsi_s.o libgcc/amd64/_fixunsdfsi_s.o libgcc/amd64/_fixunsxfsi_s.o libgcc/amd64/_fixsfdi_s.o libgcc/amd64/_fixunssfdi_s.o libgcc/amd64/_floatdisf_s.o libgcc/amd64/_fixdfdi_s.o libgcc/amd64/_fixunsdfdi_s.o libgcc/amd64/_floatdidf_s.o libgcc/amd64/_fixxfdi_s.o libgcc/amd64/_fixunsxfdi_s.o libgcc/amd64/_floatdixf_s.o libgcc/amd64/_fixtfdi_s.o libgcc/amd64/_fixunstfdi_s.o libgcc/amd64/_floatditf_s.o libgcc/amd64/_divdi3_s.o libgcc/amd64/_moddi3_s.o libgcc/amd64/_udivdi3_s.o libgcc/amd64/_umoddi3_s.o libgcc/amd64/_udiv_w_sdiv_s.o libgcc/amd64/_udivmoddi4_s.o libgcc/amd64/unwind-dw2_s.o libgcc/amd64/unwind-dw2-fde_s.o libgcc/amd64/unwind-sjlj_s.o libgcc/amd64/gthr-gnat_s.o libgcc/amd64/unwind-c_s.o -lc && rm -f amd64/libgcc_s.so && if [ -f amd64/libgcc_s.so.1 ]; then mv -f amd64/libgcc_s.so.1 amd64/libgcc_s.so.1.backup; else true; fi && mv amd64/libgcc_s.so.1.tmp amd64/libgcc_s.so.1 && ln -s libgcc_s.so.1 amd64/libgcc_s.so
/export/toolchain/build-install/bin/i686-sun-solaris2.10-ld: cannot find
-lc
collect2: ld returned 1 exit status
make[3]: *** [amd64/libgcc_s.so] Error 1
make[3]: Leaving directory
`/export/toolchain/gcc-4.1.2.git/host-i686-pc-linux-gnu/gcc'
make[2]: *** [stmp-multilib] Error 2
make[2]: Leaving directory
`/export/toolchain/gcc-4.1.2.git/host-i686-pc-linux-gnu/gcc'
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory `/export/toolchain/gcc-4.1.2.git'
make: *** [all] Error 2

I've configured gcc with the following:

path=`pwd`
crossrc="$path/.."
host=i686-pc-gnu
target=i686-sun-solaris2.10
prefix=$crosssrc/build-install
sysroot=$crosssrc/sysroot
syslibs=$sysroot/usr/lib
sysincludes=$sysroot/usr/include

./configure -prefix=$prefix --target=$target --with-gnu-as --with-gnu-ld
--with-libs=$syslibs --with-headers=$sysincludes --enable-languages=c,c
++ --with-cpu=opteron

And I'm using the latest binutils CVS as I've been told the linker
already supports this cross-compile option. 

strace'ing the build it seems to search a series of options before it
fails:

[pid  4382]
open("/export/toolchain/build-install/i686-sun-solaris2.10/bin/libc.so",
O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
[pid  4382]
open("/export/toolchain/build-install/i686-sun-solaris2.10/bin/libc.a",
O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
[pid  4382]
open("/export/toolchain/build-install/i686-sun-solaris2.10/lib/amd64/libc.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
[pid  4382]
open("/export/toolchain/build-install/i686-sun-solaris2.10/lib/amd64/libc.a", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
[pid  4382]
open("/export/toolchain/build-install/lib/../i686-sun-solaris2.10/lib/amd64/libc.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
[pid  4382]
open("/export/toolchain/build-install/lib/../i686-sun-solaris2.10/lib/amd64/libc.a", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
[pid  4382] open("/lib/64/libc.so", O_RDONLY|O_LARGEFILE) = -1 ENOENT
(No such file or directory)

Are these files that should of been copied over into the build directory
by binutils from the --with-libs I passed it or should they be
referencing sysroot directly.

binutils was configured with:

path=`pwd`
crossrc="$path/.."
host=i686-pc-gnu
target=i686-sun-solaris2.10
prefix=$crosssrc/build-install
sysroot=$crosssrc/sysroot
syslibs=$sysroot/usr/lib
sysincludes=$sysroot/usr/include
./configure -prefix=$prefix --target=$target --with-gnu-as --with-gnu-ld
--with-libs=$syslibs --with-headers=$sysincludes --enable-languages=c,c
++ --with-cpu=opteron

Regards,

-- 
Alex, homepage: http://www.bennee.com/~alex/
By doing just a little every day, you can gradually let the task
completely overwhelm you.

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

* Re: Cross Linux/x86 to Solaris2.10/x86-64 compiler build problem
  2007-03-19 21:33 Cross Linux/x86 to Solaris2.10/x86-64 compiler build problem Alex Bennee
@ 2007-03-19 21:45 ` Michael Wetherell
  2007-03-20  7:35   ` Alex Bennee
  2007-03-19 21:46 ` Daniel Jacobowitz
  1 sibling, 1 reply; 5+ messages in thread
From: Michael Wetherell @ 2007-03-19 21:45 UTC (permalink / raw)
  To: binutils

On Monday 19 Mar 2007 21:33, Alex Bennee wrote:
> I'm not sure if this is a binutils problem or something funky in my
> configure for gcc. gcc fails to link while building libgcc:

Hi,

These worked for me this morning:

$ ../binutils-070315/configure --build=i586-pc-linux-gnu 
--host=i586-pc-linux-gnu --target=i386-pc-solaris2.10 --prefix=$prefix 
--disable-nls --mandir=/tmp --infodir=/tmp --with-sysroot=$sysroot

$ ../gcc-4.1.1/configure --build=i586-pc-linux-gnu 
--host=i586-pc-linux-gnu --target=i386-pc-solaris2.10 --prefix=$prefix 
--disable-nls --mandir=/tmp --infodir=/tmp --enable-languages=c,c++ 
--disable-libstdcxx-pch --with-sysroot=$sysroot --with-gnu-ld 
--with-gnu-as

Regards,
Mike

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

* Re: Cross Linux/x86 to Solaris2.10/x86-64 compiler build problem
  2007-03-19 21:33 Cross Linux/x86 to Solaris2.10/x86-64 compiler build problem Alex Bennee
  2007-03-19 21:45 ` Michael Wetherell
@ 2007-03-19 21:46 ` Daniel Jacobowitz
  1 sibling, 0 replies; 5+ messages in thread
From: Daniel Jacobowitz @ 2007-03-19 21:46 UTC (permalink / raw)
  To: Alex Bennee; +Cc: gcc, binutils

On Mon, Mar 19, 2007 at 09:33:01PM +0000, Alex Bennee wrote:
> path=`pwd`
> crossrc="$path/.."
> host=i686-pc-gnu
> target=i686-sun-solaris2.10
> prefix=$crosssrc/build-install
> sysroot=$crosssrc/sysroot
> syslibs=$sysroot/usr/lib
> sysincludes=$sysroot/usr/include
> 
> ./configure -prefix=$prefix --target=$target --with-gnu-as --with-gnu-ld
> --with-libs=$syslibs --with-headers=$sysincludes --enable-languages=c,c
> ++ --with-cpu=opteron

I strongly recommend you use --with-sysroot instead of --with-libs /
--with-headers.  That should help.


-- 
Daniel Jacobowitz
CodeSourcery

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

* Re: Cross Linux/x86 to Solaris2.10/x86-64 compiler build problem
  2007-03-19 21:45 ` Michael Wetherell
@ 2007-03-20  7:35   ` Alex Bennee
  2007-03-20 10:18     ` Michael Wetherell
  0 siblings, 1 reply; 5+ messages in thread
From: Alex Bennee @ 2007-03-20  7:35 UTC (permalink / raw)
  To: Michael Wetherell; +Cc: binutils

On Mon, 2007-03-19 at 21:45 +0000, Michael Wetherell wrote:
> On Monday 19 Mar 2007 21:33, Alex Bennee wrote:
> > I'm not sure if this is a binutils problem or something funky in my
> > configure for gcc. gcc fails to link while building libgcc:
> <snip>
> These worked for me this morning:
> 
> $ ../binutils-070315/configure --build=i586-pc-linux-gnu 
> --host=i586-pc-linux-gnu --target=i386-pc-solaris2.10 --prefix=$prefix 
> --disable-nls --mandir=/tmp --infodir=/tmp --with-sysroot=$sysroot
> 
> $ ../gcc-4.1.1/configure --build=i586-pc-linux-gnu 
> --host=i586-pc-linux-gnu --target=i386-pc-solaris2.10 --prefix=$prefix 
> --disable-nls --mandir=/tmp --infodir=/tmp --enable-languages=c,c++ 
> --disable-libstdcxx-pch --with-sysroot=$sysroot --with-gnu-ld 
> --with-gnu-as

Hmmm so using sysroot instead of the header/libs options gcc now fails
with:

The directory that should contain system headers does not exist:
  /export/toolchain/build-install/i686-sun-solaris2.10/sys-include
make[2]: *** [stmp-fixinc] Error 1
make[2]: Leaving directory
`/export/toolchain/gcc-4.1.2.git/host-i686-pc-linux-gnu/gcc'
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory `/export/toolchain/gcc-4.1.2.git'
make: *** [all] Error 2

But my sysroot certainly has stuff in it.

Whats the process for sysroot? Does binutils copy what is needed into
your prefixed build dir or should all the builds be referencing the
sysroot directly?

-- 
Alex Bennee <kernel-hacker@bennee.com>

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

* Re: Cross Linux/x86 to Solaris2.10/x86-64 compiler build problem
  2007-03-20  7:35   ` Alex Bennee
@ 2007-03-20 10:18     ` Michael Wetherell
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Wetherell @ 2007-03-20 10:18 UTC (permalink / raw)
  To: binutils

On Tuesday 20 Mar 2007 07:34, Alex Bennee wrote:
> But my sysroot certainly has stuff in it.
>
> Whats the process for sysroot? Does binutils copy what is needed into
> your prefixed build dir or should all the builds be referencing the
> sysroot directly?

Hi,

No it doesn't copy anything out of the sysroot. Here's the docs:

--with-sysroot
--with-sysroot=dir
Tells GCC to consider dir as the root of a tree that contains a (subset 
of) the root filesystem of the target operating system. Target system 
headers, libraries and run-time object files will be searched in there. 
The specified directory is not copied into the install tree, unlike the 
options --with-headers and --with-libs that this option obsoletes. The 
default value, in case --with-sysroot is not given an argument, is 
${gcc_tooldir}/sys-root. If the specified directory is a subdirectory 
of ${exec_prefix}, then it will be found relative to the GCC binaries 
if the installation tree is moved. 

Regards,
Mike

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

end of thread, other threads:[~2007-03-20 10:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-19 21:33 Cross Linux/x86 to Solaris2.10/x86-64 compiler build problem Alex Bennee
2007-03-19 21:45 ` Michael Wetherell
2007-03-20  7:35   ` Alex Bennee
2007-03-20 10:18     ` Michael Wetherell
2007-03-19 21:46 ` Daniel Jacobowitz

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).