This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gcc for mips cannot find libc


Hi, all

I am trying to set up gcc 3.3.1 as a cross compiler for mips.

I firstly configured the binutils 2.13 as the followings:

cd /cygdrive/d/build/build-bin
/cygdrive/d/build/binutils-2.13.1/configure --target=mipsisa32-elf \
--prefix=/cygdrive/d/build/bar
make all install

Secondly i configured the gcc 3.3.1 as the followings:

export PATH=/cygdrive/d/build/bar/bin:$PATH

cd /cygdrive/d/build/build-gcc
/cygdrive/d/build/gcc-3.3.1/configure --target=mipsisa32-elf \
--prefix=/cygdrive/d/build/bar --with-newlib \
--with-headers=/cygdrive/d/build/newlib-1.11.0/newlib/libc/include \
--enable-languages=c --disable-threads \
--with-gnu-as --with-gnu-ld --with-gnu-ar
make all install

then i configured the newlib-1.11.0 as the followings:

export PATH=/cygdrive/d/build/bar/bin:$PATH

cd /cygdrive/d/build/build-newlib
/cygdrive/d/build/newlib-1.11.0/configure --target=mipsisa32-elf \
--prefix=/cygdrive/d/build/bar --srcdir=/cygdrive/d/build/newlib-1.11.0
make all install \
CC_FOR_TARGET=/cygdrive/d/build/bar/bin/mipsisa32-elf-gcc \
AS_FOR_TARGET=/cygdrive/d/build/bar/bin/mipsisa32-elf-as \
LD_FOR_TARGET=/cygdrive/d/build/bar/bin/mipsisa32-elf-ld \
AR_FOR_TARGET=/cygdrive/d/build/bar/bin/mipsisa32-elf-ar \
RANLIB_FOR_TARGET=/cygdrive/d/build/bar/bin/mipsisa32-elf-ranlib

at last i configured the gcc 3.3.1 again to support c++ as followings:

export PATH=/cygdrive/d/build/bar/bin:$PATH

rm -rf /cygdrive/d/build/build-gcc
mkdir /cygdrive/d/build/build-gcc

cd /cygdrive/d/build/build-gcc
/cygdrive/d/build/gcc-3.3.1/configure --target=mipsisa32-elf \
--prefix=/cygdrive/d/build/bar --with-newlib \
--with-headers=/cygdrive/d/build/newlib-1.11.0/newlib/libc/include \
--enable-languages=c++ --disable-threads \
--with-gnu-ar --with-gnu-as --with-gnu-ld
make all install

all of the above compiled successfully,and i write hello.c to have a test:

#include <stdio.h>

int main()
{
   printf("hello!");
   return 0;
}

then i compiled it with the cross-compiler:

$mips-elf-gcc hello.c -o hello

/cygdrive/d/build/bar/lib/gcc-lib/mipsisa32-elf/3.3.1/../../../../mipsisa32-elf/
bin/ld: warning: cannot find entry symbol _start; defaulting to 000000000040004c


/cygdrive/d/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccn7jRJo.o: In function `main':
/cygdrive/d/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ccn7jRJo.o(.text+0x14): undefined re
ference to `printf'
collect2: ld returned 1 exit status


it seems that the compiler can not recognize the libc,so i open the specs (D:/build/bar/lib/gcc-lib/mipsisa32-elf/3.3.1/specs):

*link:
%(endian_spec) %{G*} %{mips1} %{mips2} %{mips3} %{mips4} %{mips32} %{mips64} %{bestGnum} %{shared} %{non_shared}


*lib:


*libgcc: -lgcc


to my surprise,(*lib:) have nothing !


anyone can give me some advice ?

best regards,
Dai Yuwen



------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]