Error in the building the Cross-Compiler: xgcc
Brendan Simon
brendan@dgs.monash.edu.au
Fri Jun 25 03:08:00 GMT 1999
mzlai@263.net wrote:
> Hi ;
>
> I am doing my cross-compiler for a embedded system.
> I use the following:
> binutils-2.9.1
> egcs-1.1.2
> newlib-1.8.1.
> My working directory is "/home/tools",and the directory structure as
> following:
> /home/tools/binutils-2.9.1
> /home/tools/egcs-1.1.2
> /home/tools/newlib-1.8.1
> then I run the shell program :
>
> cd /home/tools
> target=arm-coff
> prefix=/usr/local/arm
> mkdir build-binutils
> mkdir build-gcc
> mkdir build-newlib
>
> cd build-binutils
> ../binutils-2.9.1/configure --target=$target --prefix=$prefix
> make all install
>
> cd ../build-gcc
> ../egcs-1.1.2/configure --target=$target --prefix=$prefix
> --with-gnu-as --with-gnu-ld
> make cross install
>
> cd ../build-newlib
> ../newlib-1.8.1/configure --target=$target --prefix=$prefix
> make all install
>
> exit
>
> When I run the shell program , errors evoked.Maybe it was running
> in the second step----"make cross the egcs" when the error came.
> On the console,It prints:
>
> checking whether we are using GNU C... yes
> checking whether /home/tools/build-gcc/gcc/xgcc --B/home/tools/build-gcc/gcc accepts -g... yes
> checking for POSIXized ISC.. no
> checking for a BSD compatible install... /usr/bin/install -c
> x host-mkfrag is unchanged.
> checking for sys/file.h... yes
> checking for sys/param.h... yes
> checking for stdlib.h... yes
> checking for unistd.h .. yes
> checking whether the C compiler (/home/tools/build-gcc/gcc/xgcc
> -B/home/tools/build-gcc/gcc/ -g )work.... no
> configure : error : installation or configuration problem: C compiler cannot create executables.
> make[1]: ***[configure-target-libiberty] Error1
> make[1]: Leaving directory '/home/tools/build-gcc'
> make: ***[cross] Error2
>
> then the program exited.I don't know where is the error happened and what is the reasons.Maybe the "xgcc" is the key of the problem!
I had the same problem. xgcc was trying to link in libc and was picking up the linux naitive libc instead of a preinstalled one. You
can verify this by running the xgcc command line by hand with a simple test app. I was compiling for a powerpc-linux target and the
solution was to get some prebuilt libraries and install them in $prefix/$target/lib. I'm not sure where to get prebuilt binaries for
your target or even if they exist.
The libc is not necessarily the actual libc you will be using to link with your programs. It is just one used to get passed the egcs
build/installation process. You can then build/install newlib as your libc.
Another alternative is to get a prebuilt cross-compiler for your target, build newlib and install it in $prefix/$target/lib.
Hope it helps a bit.
Brendan Simon.
_______________________________________________
New CrossGCC FAQ: http://www.objsw.com/CrossGCC
_______________________________________________
To remove yourself from the crossgcc list, send
mail to crossgcc-request@cygnus.com with the
text 'unsubscribe' (without the quotes) in the
body of the message.
More information about the crossgcc
mailing list