Thanks for the replies. I am using --with-sysroot=/opt/x, on both gcc stage 1 and final. you can check the configurations in my first email. But my problem is that uclibc files are at: /opt/x/usr/arm-linux-uclibc/usr/include/stdio.h Do I need to change for gcc final stage the sysroot to: --with-sysroot=/opt/x/usr/arm-linux-uclibc/ thanks! On Tue, Apr 3, 2012 at 7:24 AM, Ian Lance Taylor <iant@xxxxxxxxxx> wrote: > Alberich de megres <alberich2k5@xxxxxxxxx> writes: > >> I forgot to add the uclibc 0.9.33 to the list. >> I already configured the --with-sysroot into the gcc (on both stage1 and final) >> In the uclibc I configured the kernel_headers to point to sysroot to >> sysroot/usr/include >> >> Should I use the --prefix to point to the headers? or the --with-sysroot? > > You should use --with-sysroot to point to the root for the target system > files. If the header files are in /sysroot/usr/include, then you should > use --with-sysroot=/sysroot. > > Ian > >> On Mon, Apr 2, 2012 at 11:03 AM, Andrew Haley <aph@xxxxxxxxxx> wrote: >>> On 04/02/2012 09:11 AM, Alberich de megres wrote: >>>> I'm trying to understand the toolchain creation, by building one. I >>>> want to learn how they work. >>>> I'm building one for arm, with: >>>> - binutils 2.22 >>>> - kernel 3.1.8 headers >>>> - gcc 4.6.2 >>>> >>>> >>>> When compiling gcc final stage I got the following error: >>> >>> You need the C libraries for your target system. >>> >>> Install them somewhere, and then configure --with-sysroot= >>> >>> Something like this: >>> >>> $ /home/aph/gcc/trunk/configure \ >>> --target=armv7hl-redhat-linux-gnueabi \ >>> --prefix=/home/aph/gcc/trunk/x-armv7hl-redhat-linux-gnueabi-install \ >>> --with-sysroot=/home/aph/fedora_armv7hl_rootfs/ \ >>> --enable-languages=c,c++ >>> >>> Andrew.