how to get a prebuilt glibc
Xiaogeng (Shawn) Jin
xjin@redswitch.com
Tue Jul 30 20:10:00 GMT 2002
Kai and the list,
It is a stupid question. But I really have no idea about the answer.
As Kai recommended in many messages in this list, a prebuilt glibc is
necessary to build a bootstrap gcc before building a complete cross
compiler. My target is powerpc-linux. Actually prebuilt glibc can be
obtained from various sources, such as SuSE, YellowDog. But the problem
is that these binary RPMs cannot be relocated. And I only have
i686/RedHat hosts.
Well, I got target machine's header files and some libraries (lib?.a and
*crt*.o) from HardHat 2.0 (MontaVista). But the target (ppc_8xx) is
slightly different from what I use (powerpc-linux). And they are
installed under $PREFIX/$TARGET/include and $PREFIX/$TARGET/lib,
respectively. Unfortunately I still got some error when making the
bootstrap gcc.
1. First, I didn't copy the libraries, as I remembered that only
prebuilt glibc's header files are required as Kai mentioned in some
message. Maybe I'm wrong. The following error messages show up. Well,
this is easy to solve by copying all necessary libraries.
Making all in makeinfo
make[3]: Entering directory `/u/xjin/code/b2h-gcc/texinfo/makeinfo'
gcc -DHAVE_CONFIG_H -I. -I../../../gcc-2.95.3/texinfo/makeinfo -I..
-I../../../gcc-2.95.3/texinfo/lib -I../intl
-DLOCALEDIR=\"/opt/xdev/gnuppc8xx/share/locale\" -g -O2 -c
../../../gcc-2.95.3/texinfo/makeinfo/makeinfo.c
gcc -DHAVE_CONFIG_H -I. -I../../../gcc-2.95.3/texinfo/makeinfo -I..
-I../../../gcc-2.95.3/texinfo/lib -I../intl
-DLOCALEDIR=\"/opt/xdev/gnuppc8xx/share/locale\" -g -O2 -c
../../../gcc-2.95.3/texinfo/makeinfo/multi.c
gcc -g -O2 -o makeinfo makeinfo.o multi.o ../lib/libtxi.a
/opt/xdev/gnuppc8xx/powerpc-linux/bin/ld: cannot open crt1.o: No such
file or directory
collect2: ld returned 1 exit status
2. After copying all necessary header files and libraries, I still got
the error message.
gcc -c -DCROSS_COMPILE -DIN_GCC -DHAIFA -g -O2 -DHAVE_CONFIG_H
-I. -I../../gcc-2.95.3/gcc -I../../gcc-2.95.3/gcc/config
-I../../gcc-2.95.3/gcc/../include \
../../gcc-2.95.3/gcc/gencheck.c
rm -f obstack.c
ln -s ../../gcc-2.95.3/gcc/../libiberty/obstack.c obstack.c
gcc -c -DCROSS_COMPILE -DIN_GCC -DHAIFA -g -O2 -DHAVE_CONFIG_H
-I. -I../../gcc-2.95.3/gcc -I../../gcc-2.95.3/gcc/config
-I../../gcc-2.95.3/gcc/../include obstack.c
gcc -DCROSS_COMPILE -DIN_GCC -DHAIFA -g -O2 -DHAVE_CONFIG_H -o
gencheck \
gencheck.o ` case "obstack.o" in ?*) echo obstack.o ;; esac ` ` case
"" in ?*) echo ;; esac ` ` case "" in ?*) echo ;; esac ` ` case "" in
?*) echo ;; esac ` ` case "" in ?*) echo ;; esac `
./gencheck > tmp-check.h
/bin/sh: ./gencheck: cannot execute binary file
make[1]: *** [s-check] Error 126
make[1]: Leaving directory `/u/xjin/code/b2h-gcc/gcc'
make: *** [all-gcc] Error 2
The built gencheck cannot be run on the host. Is it in target format? Why?
Packages I used are gcc-2.95.3, binutils-2.12.1, and glibc-2.2.5. The
configuration for gcc is
../gcc-2.95.3/configure
--with-gcc-version-trigger=/u/xjin/code/gcc-2.95.3/gcc/version.c
--host=i686-pc-linux-gnu --target=powerpc-linux
--prefix=/opt/xdev/gnuppc8xx --disable-shared
--with-headers=/opt/xdev/gnuppc8xx/powerpc-linux/include
--enable-languages=c --norecursion
Thank you very much.
- 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