Help building cross-compiler gcc with newlib, target powerpc

Angus Gratton angus.gratton at anu.edu.au
Wed Jul 14 07:14:45 UTC 2010


I know I'm doing something stupid here, but I can't find what it is.

I'm trying to build an RTEMS toolchain for powerpc, and I'm up to
gcc-4.4.4 with newlib.

I've applied patches from the RTEMS-4.10 CVS tag, specifically

binutils-2.20.1-rtems4.10-20100310.diff
newlib-1.18.0-rtems4.10-20100426.diff
gcc-core-4.4.4-rtems4.10-20100429.diff

binutils is built and installed to my prefix.

I've symlinked the newlib-1.18 source directory to the gcc source
directory as 'newlib'.

gcc is configured as recommended in the current-doc RTEMS Getting
Started (although that doc is for an earlier gcc version)

../gcc-4.4.4/configure --target=powerpc-rtems4.10 --with-gnu-as
--with-gnu-ld --with-newlib --verbose --enable-threads
--enable-languages="c,c++" --prefix=/opt/rtems/rtems-4.10


I've had two errors, one early on: "no include path in which to search
for limits.h" which I worked around by putting in an empty
sys-include/limits.h as suggested here
(http://osdir.com/ml/rtems.user/2007-01/msg00064.html)

That seemed to work because the build ran for a while longer then failed
while building newlib:

configure: error: in
`/opt/rtems/source/tools/build/powerpc-rtems4.10/newlib':
configure: error: C compiler cannot create executables


in powerpc-rtems4.10/newlib/config.log:

configure:4352: /opt/rtems/source/tools/build/./gcc/xgcc
-B/opt/rtems/source/tools/build/./gcc/ -nostdinc
-B/opt/rtems/source/tools/build/powerpc-rtems4.10/newlib/
-isystem /opt/rtems/source/tools/build/powerpc-rtems4.10/newlib/targ-include -isystem /opt/rtems/source/tools/gcc-4.4.4/newlib/libc/include -B/opt/rtems/rtems-4.10/powerpc-rtems4.10/bin/ -B/opt/rtems/rtems-4.10/powerpc-rtems4.10/lib/ -isystem /opt/rtems/rtems-4.10/powerpc-rtems4.10/include -isystem /opt/rtems/rtems-4.10/powerpc-rtems4.10/sys-include -g -O2     conftest.c  >&5
/opt/rtems/rtems-4.10/powerpc-rtems4.10/bin/ld: crt0.o: No such file: No
such file or directory
collect2: ld returned 1 exit status


... which is correct: crt0.o has not yet been built for the target
architecture.

Finally, these are the full configure arguments to newlib as per
newlib/config.log:

$ /opt/rtems/source/tools/gcc-4.4.4/newlib/configure
--cache-file=./config.cache --with-newlib --enable-multilib
--with-cross-host=x86_64-unknown-linux-gnu --with-
gnu-as --with-gnu-ld --with-newlib --verbose --enable-threads
--prefix=/opt/rtems/rtems-4.10 --enable-languages=c,c++
--program-transform-name=s,^,powerpc-rtems4.10-
, --with-target-subdir=powerpc-rtems4.10
--build=x86_64-unknown-linux-gnu --host=powerpc-rtems4.10
--target=powerpc-rtems4.10 --srcdir=../../../gcc-4.4.4/newlib



I can't really work out what I'm doing wrong to prevent make from
building crt0 first. Can anyone help me out? :)

My machine is Ubuntu Lucid x64. Host gcc is 4.4.3.


Thanks heaps in advance,

Angus




More information about the users mailing list