Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Distcc] Failed cross-toolchain targetting the AMD64 arch
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC
View previous topic :: View next topic  
Author Message
el_Salmon
Guru
Guru


Joined: 15 Dec 2003
Posts: 339
Location: Around 2.4GHz

PostPosted: Tue Mar 07, 2006 11:24 pm    Post subject: [Distcc] Failed cross-toolchain targetting the AMD64 arch Reply with quote

Hi,

I'm trying to compile amd64 ebuilds in my Mac Mini with distcc && crossover. But I get an error when I try to create a cross-toolchain targetting the AMD64 architecture:
Code:
$ crossdev -t x86_64
[...]
checking for gcc... gcc
checking whether the C compiler (gcc -O2 -pipe -march=powerpc ) works... no
configure: error: installation or configuration problem: C compiler cannot creat
e executables.

!!! ERROR: cross-x86_64-pc-linux-gnu/binutils-2.16.1-r2 failed.
!!! Function toolchain-binutils_src_compile, Line 165, Exitcode 1
!!! configure failed
[...]


¿Could anyone to try "crossover -t x86_64" in his ppc machine to look it shows the same error?
Back to top
View user's profile Send private message
hiyuh
n00b
n00b


Joined: 18 Jan 2006
Posts: 11
Location: Japan

PostPosted: Thu Mar 23, 2006 4:05 am    Post subject: Reply with quote

This error is not so difficult to understand.
First, the configure script detects "gcc" as "gcc".
Then, the configure script checks whether its gcc can understand "-O2 -pipe -march=powerpc" as flags.
And its test must failed.
Because of "-march=powerpc" is not valid gcc's flags in this case, IMHO.
Please try to do "gcc --target-help" and see its output.
Or, I recommend to read "man gcc" in PowerPC/RS/6000 options.
IIRC, gcc for PowerPC/RS6000 has no "-march" as a flag at the moment.

But, all I can say is:
I cann't understand why it use with invalid flag like "-march=powerpc" and where it comes from.

And then, FYI,
I recommend to use crossdev with binutils/gcc/libc/kernel are specfied version which you want, IMHO.
Of cource, please specfiy TARGET for crossdev like x86_64-pc-linux-gnu or so.
Otherwite, when you use it via distcc, apps/libs sometimes may be screwing up.
Because of these were compiled by different version/TARGET toolchain.
Please read output of "crossdev --help && crossdev --target help" for it usage.
And the bunch of this guide http://www.gentoo.org/doc/en/cross-compiling-distcc.xml can help you.
Back to top
View user's profile Send private message
el_Salmon
Guru
Guru


Joined: 15 Dec 2003
Posts: 339
Location: Around 2.4GHz

PostPosted: Thu Mar 23, 2006 6:57 pm    Post subject: Reply with quote

Thank you very much. I'm trying your tips in my Gentoo.
Back to top
View user's profile Send private message
el_Salmon
Guru
Guru


Joined: 15 Dec 2003
Posts: 339
Location: Around 2.4GHz

PostPosted: Sun Mar 26, 2006 3:27 pm    Post subject: Reply with quote

I fixed my CFLAGS (CFLAGS="-O2 -pipe -mpowerpc -maltivec -mabi=altivec"),
but now crossdev tries to install the latest gcc (gcc-4.0) and throws an error at gcc-stage2 step:

Code:
$ crossdev -t x86_64-pc-linux-gnu
-------------------------------------------------------------------------------- * Host Portage ARCH:     ppc
 * Target Portage ARCH:   amd64
 * Target System:         x86_64-pc-linux-gnu
 * Stage:                 4 (C/C++ compiler)

 * binutils:              binutils-[latest]
 * gcc:                   gcc-[latest]
 * headers:               linux-headers-[latest]
 * libc:                  glibc-[latest]

[...]

 * Forcing the latest versions of binutils-config/gcc-config ...          [ ok ] * Log: /var/log/portage/cross-x86_64-pc-linux-gnu-binutils.log
 * Emerging cross-binutils ...                                            [ ok ] * Log: /var/log/portage/cross-x86_64-pc-linux-gnu-gcc-stage1.log
 * Emerging cross-gcc-stage1 ...                                          [ ok ] * Log: /var/log/portage/cross-x86_64-pc-linux-gnu-linux-headers.log
 * Emerging cross-linux-headers ...                                       [ ok ] * Log: /var/log/portage/cross-x86_64-pc-linux-gnu-glibc.log
 * Emerging cross-glibc ...                                               [ ok ] * Log: /var/log/portage/cross-x86_64-pc-linux-gnu-gcc-stage2.log
 * Emerging cross-gcc-stage2 ...

 * gcc failed :(
 * If you file a bug, please attach the following logfiles:
 * /var/log/portage/cross-x86_64-pc-linux-gnu-info.log
 * /var/log/portage/cross-x86_64-pc-linux-gnu-gcc-stage2.log

$ tail -50  /var/log/portage/cross-x86_64-pc-linux-gnu-gcc-stage2.log
[...]
mv 'libgcc/./tmp-libgcc.map' libgcc/./libgcc.map
/var/tmp/cross/x86_64-pc-linux-gnu/portage/gcc-4.1.0/work/build/./gcc/xgcc -B/var/tmp/cross/x86_64-pc-linux-gnu/portage/gcc-4.1.0/work/build/./gcc/ -B/usr/x86_64-pc-linux-gnu/bin/ -B/usr/x86_64-pc-linux-gnu/lib/ -isystem /usr/x86_64-pc-linux-gnu/include -isystem /usr/x86_64-pc-linux-gnu/sys-include -O2  -O2 -O2 -pipe  -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/./libgcc.map -o ./libgcc_s.so.1.tmp  libgcc/./_muldi3_s.o libgcc/./_negdi2_s.o libgcc/./_lshrdi3_s.o libgcc/./_ashldi3_s.o libgcc/./_ashrdi3_s.o libgcc/./_cmpdi2_s.o libgcc/./_ucmpdi2_s.o libgcc/./_floatdidf_s.o libgcc/./_floatdisf_s.o libgcc/./_fixunsdfsi_s.o libgcc/./_fixunssfsi_s.o libgcc/./_fixunsdfdi_s.o libgcc/./_fixdfdi_s.o libgcc/./_fixunssfdi_s.o libgcc/./_fixsfdi_s.o libgcc/./_fixxfdi_s.o libgcc/./_fixunsxfdi_s.o libgcc/./_floatdixf_s.o libgcc/./_fixunsxfsi_s.o libgcc/./_fixtfdi_s.o libgcc/./_fixunstfdi_s.o libgcc/./_floatditf_s.o libgcc/./_clear_cache_s.o libgcc/./_enable_execute_stack_s.o libgcc/./_trampoline_s.o libgcc/./__main_s.o libgcc/./_absvsi2_s.o libgcc/./_absvdi2_s.o libgcc/./_addvsi3_s.o libgcc/./_addvdi3_s.o libgcc/./_subvsi3_s.o libgcc/./_subvdi3_s.o libgcc/./_mulvsi3_s.o libgcc/./_mulvdi3_s.o libgcc/./_negvsi2_s.o libgcc/./_negvdi2_s.o libgcc/./_ctors_s.o libgcc/./_ffssi2_s.o libgcc/./_ffsdi2_s.o libgcc/./_clz_s.o libgcc/./_clzsi2_s.o libgcc/./_clzdi2_s.o libgcc/./_ctzsi2_s.o libgcc/./_ctzdi2_s.o libgcc/./_popcount_tab_s.o libgcc/./_popcountsi2_s.o libgcc/./_popcountdi2_s.o libgcc/./_paritysi2_s.o libgcc/./_paritydi2_s.o libgcc/./_powisf2_s.o libgcc/./_powidf2_s.o libgcc/./_powixf2_s.o libgcc/./_powitf2_s.o libgcc/./_mulsc3_s.o libgcc/./_muldc3_s.o libgcc/./_mulxc3_s.o libgcc/./_multc3_s.o libgcc/./_divsc3_s.o libgcc/./_divdc3_s.o libgcc/./_divxc3_s.o libgcc/./_divtc3_s.o libgcc/./_divdi3_s.o libgcc/./_moddi3_s.o libgcc/./_udivdi3_s.o libgcc/./_umoddi3_s.o libgcc/./_udiv_w_sdiv_s.o libgcc/./_udivmoddi4_s.o libgcc/./unwind-dw2_s.o libgcc/./unwind-dw2-fde-glibc_s.o libgcc/./unwind-sjlj_s.o libgcc/./gthr-gnat_s.o libgcc/./unwind-c_s.o -lc && rm -f ./libgcc_s.so && if [ -f ./libgcc_s.so.1 ]; then mv -f ./libgcc_s.so.1 ./libgcc_s.so.1.backup; else true; fi && mv ./libgcc_s.so.1.tmp ./libgcc_s.so.1 && ln -s libgcc_s.so.1 ./libgcc_s.so
/usr/bin/x86_64-pc-linux-gnu-ld: cannot find /usr/x86_64-pc-linux-gnu/lib64/libc.so.6 inside /usr/x86_64-pc-linux-gnu
collect2: ld returned 1 exit status
make[3]: *** [libgcc_s.so] Error 1
make[3]: Leaving directory `/var/tmp/cross/x86_64-pc-linux-gnu/portage/gcc-4.1.0/work/build/gcc'
make[2]: *** [stmp-multilib] Error 2
make[2]: Leaving directory `/var/tmp/cross/x86_64-pc-linux-gnu/portage/gcc-4.1.0/work/build/gcc'
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory `/var/tmp/cross/x86_64-pc-linux-gnu/portage/gcc-4.1.0/work/build'
make: *** [all] Error 2

!!! ERROR: cross-x86_64-pc-linux-gnu/gcc-4.1.0 failed.
!!! Function gcc_do_make, Line 1361, Exitcode 2
!!! emake failed with all
!!! If you need support, post the topmost build error, NOT this status message.


What can I force to emerge a stable version of gcc ?
Back to top
View user's profile Send private message
hiyuh
n00b
n00b


Joined: 18 Jan 2006
Posts: 11
Location: Japan

PostPosted: Sun Mar 26, 2006 5:01 pm    Post subject: Reply with quote

It seems one of linker issues or your host compiler/library version is not acceptable to built it, IMHO.

And then, gcc-4.1 and/or glibc-2.4 is highly experimental still now, IIRC.
If you cann't resolve your problem yourself,
please stick stable version, file it as a bug in bugzilla, and be patient.
Back to top
View user's profile Send private message
pteppic
l33t
l33t


Joined: 28 Nov 2005
Posts: 781

PostPosted: Sun Mar 26, 2006 6:02 pm    Post subject: Reply with quote

el_Salmon wrote:
What can I force to emerge a stable version of gcc ?


When you run crossdev for the first time it puts entries into /etc/portage/package.keywords
Edit them to reflect non ~arch and it should compile the gcc version you want.
Failing that mask cross's gcc-4.1 and glibc-2.4 in /etc/portage/package.mask
Back to top
View user's profile Send private message
gringo
Advocate
Advocate


Joined: 27 Apr 2003
Posts: 3793

PostPosted: Sun Mar 26, 2006 6:31 pm    Post subject: Reply with quote

Quote:
What can I force to emerge a stable version of gcc ?


Code:
(/root)-(37:237Mb)-->  crossdev --help
Usage: crossdev [options] --target TARGET

Options:
    --b, --binutils ver   Specify version of binutils to use
    --g, --gcc ver        Specify version of gcc to use
    --k, --kernel ver     Specify version of kernel headers to use
    --l, --libc ver       Specify version of libc to use
    -C, --clean target    Uninstall specified target
    -b, -d, -p, -v, -q    Options to pass to emerge (see emerge(1))
Stage Options:
    -s0, --stage0         Build just binutils
    -s1, --stage1         Also build a C compiler (no libc/C++)
    -s2, --stage2         Also build kernel headers
    -s3, --stage3         Also build the C library (no C++)
    -s4, --stage4         Also build a C++ compiler [default]
Extra Fun (must be run after above stages):
    --ex-only             Skip the stage steps above
    --ex-gcc              Build extra gcc targets (gcj/ada/etc...)
    --ex-gdb              Build a cross gdb

Target (-t):   takes the form: ARCH-VENDOR-OS-LIBC
    Run 'crossdev -t help' for examples


cheers
Back to top
View user's profile Send private message
jedsen
Apprentice
Apprentice


Joined: 15 Oct 2004
Posts: 276
Location: Sacramento, California, USA

PostPosted: Sun Mar 26, 2006 8:43 pm    Post subject: Reply with quote

You can either edit the /usr/sbin/crossdev script at line 434, removing ~$TARCH, or edit /etc/portage/package.keywords, removing the ~[arch] flags, then emerge cross-[arch]-linux-gnu/gcc, or use crossdev with the -b -g -k -l flags.
Back to top
View user's profile Send private message
el_Salmon
Guru
Guru


Joined: 15 Dec 2003
Posts: 339
Location: Around 2.4GHz

PostPosted: Sun Mar 26, 2006 10:13 pm    Post subject: Reply with quote

pteppic wrote:

When you run crossdev for the first time it puts entries into /etc/portage/package.keywords
Edit them to reflect non ~arch and it should compile the gcc version you want.
Failing that mask cross's gcc-4.1 and glibc-2.4 in /etc/portage/package.mask

I didn't know it this because I don't remember to have read that crossdev modifies "package.keywords" file in any Gentoo document. Why does crossdev try to emerge unstable ebuilds?

Edit:Emerge GCC 3.4.6 fails too:

Code:

Calculating dependencies  ...done!
>>> emerge (1 of 1) cross-x86_64-pc-linux-gnu/gcc-3.4.6 to /
>>> md5 files   ;-) gcc-3.3.2-r7.ebuild
>>> md5 files   ;-) gcc-3.1.1-r2.ebuild
>>> md5 files   ;-) gcc-4.0.2-r3.ebuild
>>> md5 files   ;-) gcc-3.4.5-r1.ebuild
>>> md5 files   ;-) gcc-3.3.5-r1.ebuild
>>> md5 files   ;-) gcc-4.1.0.ebuild
>>> md5 files   ;-) gcc-3.4.4-r1.ebuild
>>> md5 files   ;-) gcc-3.2.2.ebuild
>>> md5 files   ;-) gcc-4.0.3.ebuild
>>> md5 files   ;-) gcc-3.2.3-r4.ebuild
>>> md5 files   ;-) gcc-3.3.5.20050130-r1.ebuild
>>> md5 files   ;-) gcc-3.4.6.ebuild
>>> md5 files   ;-) gcc-3.4.1-r3.ebuild
>>> md5 files   ;-) gcc-2.95.3-r9.ebuild
>>> md5 files   ;-) gcc-3.3.6.ebuild
>>> md5 files   ;-) gcc-3.4.5.ebuild
>>> md5 files   ;-) files/digest-gcc-4.1.0
>>> md5 files   ;-) files/digest-gcc-3.2.3-r4

[...]

/usr/x86_64-pc-linux-gnu/bin/ld: cannot find /usr/x86_64-pc-linux-gnu/lib64/libc.so.6 inside /usr/x86_64-pc-linux-gnu/binutils-bin/2.16.1/../../../x86_64-pc-linux-gnu
collect2: ld returned 1 exit status
make[2]: *** [libgcc_s.so] Error 1
make[2]: Leaving directory `/var/tmp/cross/x86_64-pc-linux-gnu/portage/gcc-3.4.6/work/build/gcc'
make[1]: *** [stmp-multilib] Error 2
rm gcc.pod
make[1]: Leaving directory `/var/tmp/cross/x86_64-pc-linux-gnu/portage/gcc-3.4.6/work/build/gcc'
make: *** [all-gcc] Error 2

!!! ERROR: cross-x86_64-pc-linux-gnu/gcc-3.4.6 failed.
!!! Function gcc_do_make, Line 1361, Exitcode 2
!!! emake failed with all
!!! If you need support, post the topmost build error, NOT this status message.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum