cross compiler for MIPS problems

filipe.pereira@philips.com filipe.pereira@philips.com
Tue Jan 16 08:09:00 GMT 2001


Dear all,

I'm trying to build a mips cross compiler on a sparc-sun-solaris2.7 hos=
t.
I am using binutils 2.10.1, gcc 2.95.2 and newlib 1.9.0.
I used the following to configure/build:

BINUTILS:
../binutils-2.10.1/configure --host=3Dsparc-sun-solaris2.7 --prefix=3D/=
home/pereira/mips/binutils --target=3Dmips
make all install

GCC:
../gcc-2.95.2/configure --target=3Dmips --prefix=3D/home/pereira/mips/b=
inutils --enable-languages=3Dc=20
	--with-newlib --with-headers=3D/home/pereira/gcc/newlib/libc/include/
make=20
make install


I've been able to configure/build/install both binutils and gcc but, wh=
en I try to configure newlib, the ld acuses the missing "crt0.o" file. =
Since I have a MIPS machine, I downloaded the crt0.o file from there (j=
ust as GCC CROSS FAQ advices) but now I=20
get the following error:

Configuring for a sparc-sun-solaris2.7 host.
Created "Makefile" in /home/pereira/install_programs/build-newlib using=
 "mh-frag"
/home/pereira/mips/binutils/lib/gcc-lib/mips/2.95.2/crt0.o: In function=
 `_start':
crt0.s:41: undefined reference to `trt_initialize'
/home/pereira/mips/binutils/lib/gcc-lib/mips/2.95.2/libgcc.a(_exit.o): =
In function `exit':
../../gcc-2.95.2/gcc/libgcc2.c(.text+0x14): undefined reference to `_cl=
eanup'
../../gcc-2.95.2/gcc/libgcc2.c(.text+0x1c): undefined reference to `_ex=
it'
collect2: ld returned 1 exit status
*** The command '/home/pereira/mips/binutils/mips/bin/gcc -o conftest -=
g -O2   conftest.c' failed.
*** You must set the environment variable CC to a working compiler.

The question now is if I should or not use that crt0.o... It looks like=
 it is different from what I want, and therefor I should not use that o=
ne. In that case, have I done=20
something wrong? Should I have my crt0.o file automatically generated?
About the error in libgcc.a: is the library not correctly built? Have I=
 done something wrong?

Thanks in advance,
FIlipe Pereira



More information about the Gcc-help mailing list