building 'native', 'cross' and 'cross-native' GCCs

Michael Zintakis michael.zintakis@googlemail.com
Wed Mar 16 17:12:00 GMT 2011


I've installed and tried, in vain, to build my x86_64->powerpc (603e or 
G2 as it is also known) toolchain but was ultimately frustrated by failure!

The error I am getting and see no way around is during the "Installing C 
library" stage:

  make[3]: *** 
[/home/mz/gcc-test/build/powerpc-unknown-linux-gnu/build/build-libc/elf/librtld.map] 
Error 1
  make[2]: *** [elf/subdir_lib] Error 2
  make[1]: *** [all] Error 2
  Build failed in step 'Installing C library'
  Error happened in '/home/mz/gcc/crosstool-ng-1.10.0/scripts/functions' 
in function 'CT_DoExecLog' (line unknown, sorry)
        called from 
'/home/mz/gcc/crosstool-ng-1.10.0/scripts/build/libc/glibc-eglibc.sh-common' 
at line # 251 in function 'do_libc'
        called from 
'/home/mz/gcc/crosstool-ng-1.10.0/scripts/crosstool-NG.sh' at line # 606 
in function 'main'
  Look at 
'/home/mz/gcc-test/install/powerpc-unknown-linux-gnu/build.log' for more 
info on this error.
(elapsed: 21:12.18)
 make: *** [build] Error 2

The appropriate log file reveals this:

  powerpc-unknown-linux-gnu-gcc      -nostdlib -nostartfiles -r -o 
/home/mz/gcc-test/build/powerpc-unknown-linux-gnu/build/build-libc/elf/librtld.map.o 
'-Wl,-(' 
/home/mz/gcc-test/build/powerpc-unknown-linux-gnu/build/build-libc/elf/dl-allobjs.os 
/home/mz/gcc-test/build/powerpc-unknown-linux-gnu/build/build-libc/libc_pic.a 
-lgcc '-Wl,-)' 
-Wl,-Map,/home/mz/gcc-test/build/powerpc-unknown-linux-gnu/build/build-libc/elf/librtld.mapT
  
/home/mz/gcc-test/build/powerpc-unknown-linux-gnu/build/build-libc/libc_pic.a(dl-addr.os): 
In function `_dl_addr_inside_object':
  /home/mz/gcc-test/build/src/glibc-2.12.2/elf/dl-addr.c:157: multiple 
definition of `_dl_addr_inside_object'
  
/home/mz/gcc-test/build/powerpc-unknown-linux-gnu/build/build-libc/elf/dl-allobjs.os:/home/mz/gcc-test/build/src/glibc-2.12.2/elf/dl-open.c:659: 
first defined here
  
/home/mz/gcc-test/build/powerpc-unknown-linux-gnu/build/build-libc/libc_pic.a(init-first.os):(.sdata+0x0): 
multiple definition of `__libc_multiple_libcs'
  
/home/mz/gcc-test/build/powerpc-unknown-linux-gnu/build/build-libc/elf/dl-allobjs.os:/home/mz/gcc-test/build/src/glibc-2.12.2/elf/rtld.c:792: 
first defined here
  
/home/mz/gcc-test/build/powerpc-unknown-linux-gnu/build/build-libc/libc_pic.a(init-first.os): 
In function `_dl_start':
  
/home/mz/gcc-test/build/src/glibc-2.12.2/csu/../sysdeps/unix/sysv/linux/powerpc/../init-first.c:111: 
multiple definition of `_dl_start'
  
/home/mz/gcc-test/build/powerpc-unknown-linux-gnu/build/build-libc/elf/dl-allobjs.os:/home/mz/gcc-test/build/src/glibc-2.12.2/elf/rtld.c:400: 
first defined here
  
/home/mz/gcc-test/build/powerpc-unknown-linux-gnu/build/build-libc/libc_pic.a(_itoa.os): 
In function `_itoa':
  /home/mz/gcc-test/build/src/glibc-2.12.2/stdio-common/_itoa.c:218: 
multiple definition of `_itoa'
  
/home/mz/gcc-test/build/powerpc-unknown-linux-gnu/build/build-libc/elf/dl-allobjs.os:/home/mz/gcc-test/build/src/glibc-2.12.2/elf/dl-minimal.c:303: 
first defined here
  collect2: ld returned 1 exit status
  make[3]: *** 
[/home/mz/gcc-test/build/powerpc-unknown-linux-gnu/build/build-libc/elf/librtld.map] 
Error 1
  make[3]: Leaving directory `/home/mz/gcc-test/build/src/glibc-2.12.2/elf'
  make[2]: *** [elf/subdir_lib] Error 2
  make[2]: Leaving directory `/home/mz/gcc-test/build/src/glibc-2.12.2'
  make[1]: *** [all] Error 2
  make[1]: Leaving directory 
`/home/mz/gcc-test/build/powerpc-unknown-linux-gnu/build/build-libc'

Googling "multiple definition of `_dl_addr_inside_object'" suggests a 
couple of things to try:

1. removing "-fstack-protector" (I use this option when building gcc);
2. force this by adding "-fno-stack-protector" to both the gcc and glibc 
builds;
3. use "-j1" instead of (my usual) "-j3"

Unfortunately none of this worked and I am really stuck and very 
frustrated, so would appreciate any help from the list with regards to 
how to overcome this problem.

My latest version of the .config file I used during the build is 
attached to this message (if it is scrubbed by the mailing list daemon 
please let me know and I will include it in-line as a separate message).

During the whole thing I discovered various bugs in crosstool-ng and 
also have a few suggestions/questions which I will post in a separate 
thread as I do not wish to pollute this one.

The versions of the packages I am using/building is:

gcc 4.5.2
gmp 4.3.1
mpfr 3.0.0
binutils 2.21
cloog-ppl 0.15.10
glibc 2.12.2
libelf 0.8.13
mpc 0.8.2
linux kernel 2.6.35

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: .config
URL: <http://sourceware.org/pipermail/crossgcc/attachments/20110316/e0f11a99/attachment.ksh>
-------------- next part --------------
--
For unsubscribe information see http://sourceware.org/lists.html#faq


More information about the crossgcc mailing list