how to get a prebuilt glibc

Xiaogeng (Shawn) Jin xjin@redswitch.com
Wed Jul 31 19:55:00 GMT 2002


William A. Gatliff wrote:
> Have you tried the instructions here?
> 
> http://billgatliff.com/twiki/bin/view/Crossgcc/ToolSetup
> 
> I think you can see now why you want to avoid a prebuilt glibc if at
> all possible.  I haven't built a powerpc-linux toolchain in a while,
> but I don't recall needing a prebuilt glibc anywhere.  I'd be happy to
> give it a go if you find the instructions in the wiki to not work for
> you.
> 
> You need preconfigured KERNEL headers for the OS that you'll run on
> the target (Linux, in this case).  Otherwise, gcc and glibc won't know
> how to hook into the OS.  But that's not the same thing as a
> preconfigured glibc.

Thanks, bill. Unfornately my target 'powerpc-linux' is on your TODO 
list. Actually I did make a cross gcc, sort of successfully, but I'm not 
sure. The procedure is as follows:
$TARGET=powerpc-linux
$PREFIX=<some value>
1. binutils-2.11.2
../binutils-2.11.2/configure --target=$TARGET --prefix=$PREFIX
../binutils-2.11.2/make all install

2. bootstrap gcc-2.95.3
../gcc-2.95.3/configure --target=$TARGET --prefix=$PREFIX 
--disable-shared --enable-languages=c --without-headers --with-newlib
../gcc-2.95.3/make all-gcc
../gcc-2.95.3/make install-gcc

3. configure kernel headers

4. glibc-2.2.5
../glibc-2.2.5/configure  --host=$TARGET --prefix=$PREFIX/$TARGET 
--enable-add-ons --with-headers=$PREFIX/$TARGET/include
../glibc-2.2.5/make all
../glibc-2.2.5/make install

5. gcc-2.95.3
../gcc-2.95.3/configure --target=$TARGET --prefix=$PREFIX 
--enable-shared --enable-threads --enable-languages=c,c++
../gcc-2.95.3/make all install

My question is in step 4. When running 'make check' before 'make 
install', it complained that some headers (stdlib.h etc.) couldn't be 
found when isomac.c was compiled. Error messages are shown as follows.

---------------------strip---------------------------------------
cd /u/xjin/code/b2-libc/stdlib && powerpc-linux-gcc -O  -include 
../config.h /u/xjin/code/glibc-2.2.5/stdlib/isomac.c -o isomac
/u/xjin/code/glibc-2.2.5/stdlib/isomac.c:74: stdio.h: No such file or 
directory
/u/xjin/code/glibc-2.2.5/stdlib/isomac.c:75: stdlib.h: No such file or 
directory
/u/xjin/code/glibc-2.2.5/stdlib/isomac.c:76: string.h: No such file or 
directory
make[2]: *** [/u/xjin/code/b2-libc/stdlib/isomac] Error 1
make[2]: *** Waiting for unfinished jobs....
---------------------strip---------------------------------------

After glibc was installed, the error became this. I guess the currently 
built binary 'isomac' is in ppc-linux format. It certiainly cannot be 
run on i686/linux machine. Is it a bug of glibc's make procedure or some 
error due to the building process? In general, my another question is 
how to verify the glibc I build. Thanks again.

---------------------strip---------------------------------------
powerpc-linux-gcc -nostdlib -nostartfiles -o 
/u/xjin/code/b2-libc/stdlib/tst-fmtmsg 
-Wl,-dynamic-linker=/opt/xdev/ppc/8xx/powerpc-linux/lib/ld.so.1 
/u/xjin/code/b2-libc/csu/crt1.o /u/xjin/code/b2-libc/csu/crti.o 
`powerpc-linux-gcc --print-file-name=crtbegin.o` 
/u/xjin/code/b2-libc/stdlib/tst-fmtmsg.o 
-Wl,-rpath-link=/u/xjin/code/b2-libc:/u/xjin/code/b2-libc/math:/u/xjin/code/b2-libc/elf:/u/xjin/code/b2-libc/dlfcn:/u/xjin/code/b2-libc/nss:/u/xjin/code/b2-libc/nis:/u/xjin/code/b2-libc/rt:/u/xjin/code/b2-libc/resolv:/u/xjin/code/b2-libc/crypt:/u/xjin/code/b2-libc/linuxthreads 
/u/xjin/code/b2-libc/libc.so.6 /u/xjin/code/b2-libc/libc_nonshared.a 
-lgcc `powerpc-linux-gcc --print-file-name=crtend.o` 
/u/xjin/code/b2-libc/csu/crtn.o
/u/xjin/code/b2-libc/stdlib/isomac 'powerpc-linux-gcc'  \
'-I../include -I.. -I/u/xjin/code/b2-libc -I../sysdeps/powerpc/elf 
-I../linuxthreads/sysdeps/unix/sysv/linux 
-I../linuxthreads/sysdeps/pthread -I../sysdeps/pthread 
-I../linuxthreads/sysdeps/unix/sysv -I../linuxthreads/sysdeps/unix 
-I../linuxthreads/sysdeps/powerpc -I../sysdeps/unix/sysv/linux/powerpc 
-I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/common 
-I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../sysdeps/unix/sysv 
-I../sysdeps/unix/powerpc -I../sysdeps/unix -I../sysdeps/posix 
-I../sysdeps/powerpc/fpu -I../sysdeps/powerpc -I../sysdeps/wordsize-32 
-I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754/dbl-64 
-I../sysdeps/powerpc/soft-fp -I../sysdeps/ieee754 
-I../sysdeps/generic/elf -I../sysdeps/generic -nostdinc -isystem 
/opt/xdev/ppc/8xx/lib/gcc-lib/powerpc-linux/2.95.3/include -isystem 
/opt/xdev/ppc/8xx/powerpc-linux/include' > 
/u/xjin/code/b2-libc/stdlib/isomac.out
/bin/sh: /u/xjin/code/b2-libc/stdlib/isomac: cannot execute binary file
make[2]: *** [/u/xjin/code/b2-libc/stdlib/isomac.out] Error 126
make[2]: Leaving directory `/u/xjin/code/glibc-2.2.5/stdlib'
make[1]: *** [stdlib/tests] Error 2
---------------------strip---------------------------------------

- Shawn.


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



More information about the crossgcc mailing list