problems building an ARM cross-compiler

Brian Young brian@tildeslash.org
Thu Sep 20 20:27:00 GMT 2001


I'm attempting to build a linux x86 hosted cross-compiler targetting
an ARM platform.  I've tried arm-aout and arm-linux (I'd heard arm-elf
was a bit rough).

The directory structure I'm working from looks like:

drwxrwxr-x   14 brian    brian        4096 Sep 19 23:18 binutils-2.11.2
-rwxrw-r--    1 brian    brian         661 Sep 20 23:17 build
drwxrwxr-x   16 brian    brian        4096 Aug 19 23:53 gcc-3.0.1
drwxrwxr-x   15 brian    brian        4096 Sep 19 23:12 gdb-5.0
drwxrwxr-x    9 brian    brian        4096 Sep 20 00:52 install
drwxr-xr-x    7 brian    brian        4096 Dec 14  2000 newlib-1.9.0

Here's the script ('build') I've been using to build:

==============
TARGET=arm-linux
PREFIX=$PWD/install

PATH=$PREFIX/bin:$PATH

# binutils
rm -rf build-binutils
mkdir build-binutils
cd build-binutils
../binutils-2.11.2/configure --target=$TARGET --prefix=$PREFIX -v
make all install
cd ..

# gcc
rm -rf build-gcc
mkdir build-gcc
cd build-gcc
../gcc-3.0.1/configure --target=$TARGET --prefix=$PREFIX -v
make all install
cd ..
==============

When I try arm-aout for TARGET I get a failure when building gcc (binutils
appears to build fine):

==============
Testing libgcc1.  Ignore linker warning messages.
/home/brian/home/gcc-arm/build-gcc/gcc/xgcc -B/home/brian/home/gcc-arm/build-gcc/gcc/ -B/home/brian/home/gcc-arm/install/arm-aout/bin/ -B/home/brian/home/gcc-arm/install/arm-aout/lib/ -isystem /home/brian/home/gcc-arm/install/arm-aout/include -DCROSS_COMPILE -DIN_GCC    -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -isystem ./include  libgcc1-test.o -o libgcc1-test \
  -nostartfiles -nostdlib `/home/brian/home/gcc-arm/build-gcc/gcc/xgcc -B/home/brian/home/gcc-arm/build-gcc/gcc/ -B/home/brian/home/gcc-arm/install/arm-aout/bin/ -B/home/brian/home/gcc-arm/install/arm-aout/lib/ -isystem /home/brian/home/gcc-arm/install/arm-aout/include --print-libgcc-file-name`
/home/brian/home/gcc-arm/install/arm-aout/bin/nm: libgcc1-test: File in wrong format
collect2: /home/brian/home/gcc-arm/install/arm-aout/bin/nm returned 1 exit status
make[1]: *** [libgcc1-test] Error 1
make[1]: Leaving directory `/home/brian/home/gcc-arm/build-gcc/gcc'
make: *** [all-gcc] Error 2
==============

When I try arm-linux I also get a build failure in gcc:

==============
/home/brian/home/gcc-arm/build-gcc/gcc/xgcc -B/home/brian/home/gcc-arm/build-gcc/gcc/ -B/home/brian/home/gcc-arm/install/arm-linux/bin/ -B/home/brian/home/gcc-arm/install/arm-linux/lib/ -isystem /home/brian/home/gcc-arm/install/arm-linux/include -O2  -DCROSS_COMPILE -DIN_GCC    -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -isystem ./include  -fomit-frame-pointer -fPIC -g0 -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I. -I../../gcc-3.0.1/gcc -I../../gcc-3.0.1/gcc/. -I../../gcc-3.0.1/gcc/config -I../../gcc-3.0.1/gcc/../include -DL_dvmd_lnx -xassembler-with-cpp -c ../../gcc-3.0.1/gcc/config/arm/lib1funcs.asm -o libgcc/./_dvmd_lnx.o
../../gcc-3.0.1/gcc/config/arm/lib1funcs.asm:633:24: asm/unistd.h: No such file or directory
make[2]: *** [libgcc/./_dvmd_lnx.o] Error 1
make[2]: Leaving directory `/home/brian/home/gcc-arm/build-gcc/gcc'
make[1]: *** [libgcc.a] Error 2
make[1]: Leaving directory `/home/brian/home/gcc-arm/build-gcc/gcc'
make: *** [all-gcc] Error 2
===============

Can any kind soul shed any light on either of these problems?

Eventually I'd like to be able to build an ARM executable of some
sort and run it under the gdb ARM simulator.  Is what I'm doing
crazy?  What target might be best for this?

Later,
Brian.

-- 
brian@tildeslash.org



More information about the Gcc-help mailing list