building native cross compiler

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


>> I wonder if there is a newer crosstool script out there somewhere.
>>
>> Ian
>>     
>
> The revamped tool is called crosstool-ng and is available from here:
>
> http://ymorin.is-a-geek.org/projects/crosstool
>   
Thanks Mick for posting the link - this crosstool seems to be in active 
development, and having already tried it, it gave me a lot of ideas as 
to how to automate the build processes on my own project.

This tool, however, is unable to overcome another glibbloodyc problem 
and I am really stuck this time, despite my best efforts, so I hope by 
posting it here there will be more than a pair of eyes looking into it 
and see if I could solve this.

I already posted this on the crosstool-ng mailing list, though don't 
know if I am going to get an answer.

The problem is the following (from make of the fully-blown glibc build):

  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'

This happens much further in the process that I have been before, during 
the glibc build after all the kernel headers, gmp, mpfr, ppl, cloog-ppl, 
mpc, libelf, binutils, core gcc, basic glibc (headers and files) and the 
shared core gcc have been built:

[INFO ]  Performing some trivial sanity checks
[INFO ]  Build started 20110316.035430
[INFO ]  Building environment variables
[INFO ]  Downloading forbidden by configuration, skipping downloads
[INFO ]  =================================================================
[INFO ]  Extracting and patching toolchain components
[INFO ]  Extracting and patching toolchain components: done in 101.93s 
(at 01:44)
[INFO ]  =================================================================
[INFO ]  Installing kernel headers
[INFO ]  Installing kernel headers: done in 12.83s (at 01:56)
[INFO ]  =================================================================
[INFO ]  Installing GMP
[INFO ]  Installing GMP: done in 65.69s (at 03:02)
[INFO ]  =================================================================
[INFO ]  Installing MPFR
[INFO ]  Installing MPFR: done in 16.17s (at 03:18)
[INFO ]  =================================================================
[INFO ]  Installing PPL
[INFO ]  Installing PPL: done in 72.93s (at 04:31)
[INFO ]  =================================================================
[INFO ]  Installing CLooG/ppl
[INFO ]  Installing CLooG/ppl: done in 5.96s (at 04:37)
[INFO ]  =================================================================
[INFO ]  Installing MPC
[INFO ]  Installing MPC: done in 7.97s (at 04:45)
[INFO ]  =================================================================
[INFO ]  Installing libelf
[INFO ]  Installing libelf: done in 4.36s (at 04:50)
[INFO ]  =================================================================
[INFO ]  Installing binutils
[INFO ]  Installing binutils: done in 43.16s (at 05:33)
[INFO ]  =================================================================
[INFO ]  Installing static core C compiler
[INFO ]  Installing static core C compiler: done in 230.83s (at 09:24)
[INFO ]  =================================================================
[INFO ]  Installing C library headers & start files
[INFO ]  Installing C library headers & start files: done in 47.99s (at 
10:12)
[INFO ]  =================================================================
[INFO ]  Installing shared core C compiler
[INFO ]  Installing shared core C compiler: done in 277.37s (at 14:49)
[INFO ]  =================================================================
[INFO ]  Installing C library
  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


Any ideas as to what might be the cause for this. I used google and 
tried 3 of the things suggested, i.e. removing "-fstack-protector" (I 
use this option when building gcc), then force this by adding 
"-fno-stack-protector" to both the gcc and glibc builds and finally use 
"-j1" instead of (my usual) "-j3" but nothing worked, unfortunately!

Any ideas?



More information about the Gcc-help mailing list