Problems with creating bootstrap headers for MIPS toolchain...
Daniel Kegel
dank@kegel.com
Fri Apr 8 00:15:00 GMT 2005
Steven J. Hill wrote:
> I have discovered some issues with HEAD of glibc and trying to
> get a set of headers to bootstrap compiling a HEAD of GCC, 4.1.0
> currently. The first snag that I hit was during the initial
> configure. On line 4104, the check for gcc is:
>
> 3.4*| 4.[0-9]* )
>
> in glibc-2.3.3 it was:
>
> 3.[2-9]*|4.[01]*)
>
> However, this is a chicken and egg problem if I am looking at
> it correctly. The gcc being checked should be a MIPS gcc compiler,
> not the host gcc. Just for fun, I used a host gcc-3.4 compiler
> and then get errors associated with 'gcc -mabi=32 ....' and that
> gives me:
>
> cc1: error: invalid option `abi=32'
>
> which again makes perfect sense. So, what is the proper way to
> install glibc headers so that the cross compiler can be built,
> but at the same time not disable the gcc check which is getting
> confused?
Have you seen the hoops that crosstool jumps through for this?
# The following three things have to be done to build glibc-2.3.x, but they don't hurt older versions.
# 1. override CC to keep glibc's configure from using $TARGET-gcc.
# 2. disable linuxthreads, which needs a real cross-compiler to generate tcb-offsets.h properly
# 3. build with gcc 3.2 or later
# Compare these options with the ones used when building glibc for real below - they're different.
# As of glibc-2.3.2, to get this step to work for hppa-linux, you need --enable-hacker-mode
# so when configure checks to make sure gcc has access to the assembler you just built...
# Alternately, we could put ${PREFIX}/${TARGET}/bin on the path.
# Set --build so maybe we don't have to specify "cross-compiling=yes" below (haven't tried yet)
# Note: the warning
# "*** WARNING: Are you sure you do not want to use the `linuxthreads'"
# *** add-on?"
# is ok here, since all we want are the basic headers at this point.
# Override libc_cv_ppc_machine so glibc-cvs doesn't complain
# 'a version of binutils that supports .machine "altivec" is needed'.
libc_cv_ppc_machine=yes \
CC=gcc \
${GLIBC_DIR}/configure --prefix=/usr \
--build=$BUILD --host=$TARGET \
--without-cvs --disable-sanity-checks --with-headers=$HEADERDIR \
--enable-hacker-mode
if grep -q GLIBC_2.3 ${GLIBC_DIR}/ChangeLog; then
# glibc-2.3.x passes cross options to $(CC) when generating errlist-compat.c, which fails without a real cross-compiler.
# Fortunately, we don't need errlist-compat.c, since we just need .h files,
# so work around this by creating a fake errlist-compat.c and satisfying its dependencies.
# Another workaround might be to tell configure to not use any cross options to $(CC).
# The real fix would be to get install-headers to not generate errlist-compat.c.
libc_cv_ppc_machine=yes \
make sysdeps/gnu/errlist.c
mkdir -p stdio-common
# sleep for 2 seconds for benefit of filesystems with lousy time resolution, like FAT,
# so make knows for sure errlist-compat.c doesn't need generating
sleep 2
touch stdio-common/errlist-compat.c
fi
libc_cv_ppc_machine=yes \
make cross-compiling=yes install_root=${SYSROOT} $GLIBC_SYSROOT_ARG install-headers
# Two headers -- stubs.h and features.h -- aren't installed by install-headers,
# so do them by hand. We can tolerate an empty stubs.h for the moment.
# See e.g. http://gcc.gnu.org/ml/gcc/2002-01/msg00900.html
mkdir -p $HEADERDIR/gnu
touch $HEADERDIR/gnu/stubs.h
cp ${GLIBC_DIR}/include/features.h $HEADERDIR/features.h
# Building the bootstrap gcc requires either setting inhibit_libc, or
# having a copy of stdio_lim.h... see
# http://sources.redhat.com/ml/libc-alpha/2003-11/msg00045.html
cp bits/stdio_lim.h $HEADERDIR/bits/stdio_lim.h
------
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