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]

Trouble building gcc-3.2.2/glibc-2.3.2 for cross powerpc-linux


I've been pounding my head on the glass tube trying to build
gcc-3.2.2/glibc-2.3.2 for powerpc-linux on my x86 linux machine.

I attempted to build a bootstrap that I could use to build glibc, so I
first built binutils, installed the linux header files and configured
the bootstrap with:

${BOOTSTRAP_BUILDDIR}/Makefile:
	export PATH=${INSTALL_DIR}/bin:${HOST_INSTALL_DIR}/bin:$$PATH; \
	echo "PATH="$$PATH; \
	cd ${BOOTSTRAP_BUILDDIR}; \
	${GCC_SOURCE_PATH}/configure --target=${TARGET} \
	--prefix=${INSTALL_DIR} \
	--with-local-prefix=${INSTALL_DIR}/${TARGET} \
        --without-headers --with-newlib \
	--disable-shared --enable-languages=c \
	--disable-threads

And it fails building libgcc2.c since gcc/config/rs6000/linux.h thinks
that libgcc2 has *all* its headers available:

/home/pbarada/work/cvs-wavemark/cross-linux-tools/foo2/powerpc-linux-bootstrap/gcc/xgcc -B/home/pbarada/work/cvs-wavemark/cross-linux-tools/foo2/powerpc-linux-bootstrap/gcc/ -B/usr/local/wave/x-ppc-linux/powerpc-linux/bin/ -B/usr/local/wave/x-ppc-linux/powerpc-linux/lib/ -isystem /usr/local/wave/x-ppc-linux/powerpc-linux/include -O2  -DIN_GCC -DCROSS_COMPILE   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -isystem ./include  -fPIC -g  -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I. -I/home/pbarada/work/cvs-wavemark/cross-linux-tools/gcc-3.2.2/gcc -I/home/pbarada/work/cvs-wavemark/cross-linux-tools/gcc-3.2.2/gcc/. -I/home/pbarada/work/cvs-wavemark/cross-linux-tools/gcc-3.2.2/gcc/config -I/home/pbarada/work/cvs-wavemark/cross-linux-tools/gcc-3.2.2/gcc/../include  -fPIC -mstrict-align -DL_muldi3 -c /home/pbarada/work/cvs-wavemark/cross-linux-tools/gcc-3.2.2/gcc/libgcc2.c -o libgcc/./_muldi3.o
In file included from tconfig.h:21,
                 from /home/pbarada/work/cvs-wavemark/cross-linux-tools/gcc-3.2.2/gcc/libgcc2.c:36:
/home/pbarada/work/cvs-wavemark/cross-linux-tools/gcc-3.2.2/gcc/config/rs6000/linux.h:81:20: signal.h: No such file or directory
/home/pbarada/work/cvs-wavemark/cross-linux-tools/gcc-3.2.2/gcc/config/rs6000/linux.h:82:26: sys/ucontext.h: No such file or directory
make[2]: *** [libgcc/./_muldi3.o] Error 1
make[2]: Leaving directory `/home/pbarada/work/cvs-wavemark/cross-linux-tools/foo2/powerpc-linux-bootstrap/gcc'

unfortunatley I can't give it any headers until after glibc installs
them, but glibc needs a cross compiler.  The classic catch-22....

Is there *any* way to configure gcc so that in the bootstrap phase it will
not assume that *any* header file is around(and skip building anything
that *does* assume that)?

I got around it by brute-force setting LIB2ADDEH/LIB2ADDEHDP to empty
strings in gcc/Makefile:

# Use unwind-dw2-fde-glibc
LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-glibc.c \
  $(srcdir)/unwind-sjlj.c
LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c
# Common support for PowerPC ELF targets (both EABI and SVR4).

# HACK!!! Don't build *any* exception code in the bootstrap phase
LIB2ADDEH = 
LIB2ADDEHDEP =


Also, glibc-2.3.2 configured successfully and built, but it failed
installing with:

make[3]: *** No rule to make target `/home/pbarada/work/cvs-wavemark/cross-linux-tools/foo2/ppc-linux-glibc/dlfcn/libdl.so.2', needed by `/home/pbarada/work/cvs-wavemark/cross-linux-tools/foo2/ppc-linux-glibc/elf/sprof'.  Stop.
make[3]: Leaving directory `/home/pbarada/work/cvs-wavemark/cross-linux-tools/glibc-2.3.2/elf'
make[2]: *** [elf/subdir_install] Error 2
make[2]: Leaving directory `/home/pbarada/work/cvs-wavemark/cross-linux-tools/glibc-2.3.2'
make[1]: *** [install] Error 2

It turns out that in dlfcn there is a libdl.so, so again I brute
forced it by creating a symbolic link between libdl.so and libdl.so.2

Does anyone have any suggestions how I can get past this?
Has anyone build a powerpc-linux cross-toolchain using glibc-3.2.2 and
glibc-2.3.2?

Any help is appreciated.

-- 
Peter Barada                                   Peter dot Barada at motorola dot com
Wizard                                         781-852-2768 (direct)
WaveMark Solutions(wholly owned by Motorola)   781-270-0193 (fax)

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


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