Building gcc for powerpc

Feb 08, 2005 2 Replies

Hi All,



# As I am building cross toolchain for ppc 8xx CPU. # The following steps were performed


  1. Built binutils
  2. Configured the linux kernel (menuconfig)(ofcourse with make clean etc.)
  3. Building gcc (pass 1)


  • Step 3 expanded: i. extracted the code from gcc-2.95.3.tar.gz ii. Applied libchack solution iii. ran configure as: ../gcc-2.95.3/configure --targrt=powerpc --prefix=/usr



--with-headers=/usr/src/linux/include --enable-languages=c



--disable-threads


  1. make


  • Here I get errors that says: stdlib.h not found and unistd.h not found.



# Error file shows the following:


**----------------------------------------------**

../libiberty/libiberty.a(choose-temp.o): In function `choose_temp_base': /usr/cross/builds/powerpc-linux-gcc/libiberty/../../gcc-2.95.3/libiberty/choose-temp.c:138: the use of `mktemp' is dangerous, better use `mkstemp' ../libiberty/libiberty.a(choose-temp.o): In function `choose_temp_base': /usr/cross/builds/powerpc-linux-gcc/libiberty/../../gcc-2.95.3/libiberty/choose-temp.c:138: the use of `mktemp' is dangerous, better use `mkstemp' ../libiberty/libiberty.a(choose-temp.o): In function `choose_temp_base': /usr/cross/builds/powerpc-linux-gcc/libiberty/../../gcc-2.95.3/libiberty/choose-temp.c:138: the use of `mktemp' is dangerous, better use `mkstemp' ../libiberty/libiberty.a(choose-temp.o): In function `choose_temp_base': /usr/cross/builds/powerpc-linux-gcc/libiberty/../../gcc-2.95.3/libiberty/choose-temp.c:138: the use of `mktemp' is dangerous, better use `mkstemp' ../../gcc-2.95.3/gcc/libgcc2.c:41: stdlib.h: No such file or directory ../../gcc-2.95.3/gcc/libgcc2.c:42: unistd.h: No such file or directory make[3]: *** [libgcc2.a] Error 1 make[2]: *** [stmp-multilib-sub] Error 2 make[1]: *** [stmp-multilib] Error 1 make: *** [all-gcc] Error 2


**--------------------------------------------------------**

try changing the source path to /usr/include or wherver the glibc headers are included think tht path you have given is the linux kenel include files u dont expect to find stdlib.h

It could be that the configure portion of the build failed.

"--targrt" must be spelled "--target"

You could also try looking at Karim's Yaghmour's site:

formatting link
& buy the book Building Embedded Linux Systems by the same author.

Edwin

/usr/cross/builds/powerpc-linux-gcc/libiberty/../../gcc-2.95.3/libiberty/choose-temp.c:138:

/usr/cross/builds/powerpc-linux-gcc/libiberty/../../gcc-2.95.3/libiberty/choose-temp.c:138:

/usr/cross/builds/powerpc-linux-gcc/libiberty/../../gcc-2.95.3/libiberty/choose-temp.c:138:

/usr/cross/builds/powerpc-linux-gcc/libiberty/../../gcc-2.95.3/libiberty/choose-temp.c:138:

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required