bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

unable to build glibc-2.3.1 ...


From: Josh Fryman
Subject: unable to build glibc-2.3.1 ...
Date: Thu, 13 Feb 2003 14:34:36 -0500

hi,

i haven't seen the process to join this mailing list, and the glibc
web page doesn't allow subscription to the bug-glibc one... the
obvious mail 'subscribe' try didn't work, so, please CC me on any
replies as i'm not on the list :)

i'm trying to build a cross-hosted toolchain using glibc 2.3.1...  
at the bottom of this message is the script i've put together to
build the toolchain with all options.  the host box is an
i686-pc-linux-gnu RH8 base.  no existing ARM-XScale tools are on
the system, so this is a first-time bootstrap...

the relevant clips are:

--------------
../glibc-2.3.1-src/configure armv5b-linux --build=i686-pc-linux-gnu 
--with-headers=/usr/local/xscale/src/linux-adi-brh//include --enable-add-ons 
--enable-shared --prefix=/usr/local/armv5b-linux/ --with-cpu=xscale 
--without-fp --enable-kernel=2.4.19
--------------

the failure occurs here:

--------------
armv5b-linux-gcc -nostdlib -nostartfiles -r -o 
/usr/local/xscale/toolchain/build/glibc-2.3.1-build/csu/crt1.o 
/usr/local/xscale/toolchain/build/glibc-2.3.1-build/csu/start.o 
/usr/local/xscale/toolchain/build/glibc-2.3.1-build/csu/abi-note.o 
/usr/local/xscale/toolchain/build/glibc-2.3.1-build/csu/init.o
/usr/local/armv5b-linux/bin/../lib/gcc-lib/armv5b-linux/3.2.1/../../../../armv5b-linux/bin/ld:
 /usr/local/xscale/toolchain/build/glibc-2.3.1-build/csu/start.o: compiled for 
a big endian system and target is little endian
File in wrong format: failed to merge target specific data of file 
/usr/local/xscale/toolchain/build/glibc-2.3.1-build/csu/start.o
/usr/local/armv5b-linux/bin/../lib/gcc-lib/armv5b-linux/3.2.1/../../../../armv5b-linux/bin/ld:
 /usr/local/xscale/toolchain/build/glibc-2.3.1-build/csu/abi-note.o: compiled 
for a big endian system and target is little endian
File in wrong format: failed to merge target specific data of file 
/usr/local/xscale/toolchain/build/glibc-2.3.1-build/csu/abi-note.o
/usr/local/armv5b-linux/bin/../lib/gcc-lib/armv5b-linux/3.2.1/../../../../armv5b-linux/bin/ld:
 /usr/local/xscale/toolchain/build/glibc-2.3.1-build/csu/init.o: compiled for a 
big endian system and target is little endian
File in wrong format: failed to merge target specific data of file 
/usr/local/xscale/toolchain/build/glibc-2.3.1-build/csu/init.o
collect2: ld returned 1 exit status
make[2]: *** [/usr/local/xscale/toolchain/build/glibc-2.3.1-build/csu/crt1.o] 
Error 1
make[2]: Leaving directory 
`/usr/local/xscale/toolchain/build/glibc-2.3.1-src/csu'
make[1]: *** [csu/subdir_lib] Error 2
make[1]: Leaving directory `/usr/local/xscale/toolchain/build/glibc-2.3.1-src'
make: *** [all] Error 2
--------------

does anyone have any ideas?  i looked through the mailing list, but 
haven't seen anything...

here's the script i'm running:

--------------
address@hidden scripts]# cat build-tools.sh 
#!/bin/bash -e

#Script for building the Oerlikon XScale Development toolchain
#Release 2
#Original code from the arm-linux mailing list
#By Dominic Duval, address@hidden
# 
# 12-Feb-02 ---
# Modified to support proper building directories as per requirements
# of modern glibc, gcc, binutils, etc, and other minor changes
# by Josh Fryman, address@hidden
#

TARGET="armv5b-linux"
HOST="i686-pc-linux-gnu"
PROGPREFIX="armv5b-linux-"

PREFIX=${PREFIX:-/usr/local/$TARGET/}
KERNEL=${KERNEL:-/usr/local/xscale/src/linux-adi-brh/}
SRCS=${SRCS:-/usr/local/xscale/toolchain/src}
BUILD=${BUILD:-/usr/local/xscale/toolchain/build}
SCRIPTS=${SCRIPTS:-/usr/local/xscale/toolchain/scripts}

# versions of tools to build
BINUTILSVER=${BINUTILS:-2.13.90.0.16}
GCCVER=${GCCVER:-3.2.1}
GLIBCVER=${GLIBCVER:-2.3.1}
GDBVER=${GDBVER:-5.3}

echo ""
echo ""
echo "Preparing to build gcc $GCCVER + binutils $BINUTILSVER + glibc $GLIBCVER 
+"
echo "gdb $GDBVER, installation directory in $PREFIX, and using kernel headers "
echo "from $KERNEL.  Host platform is $HOST, "
echo "target is $TARGET, and program prefix is $PROGPREFIX."
echo ""
echo "Sources for gcc, etc, will be read from $SRCS "
echo "and the build directories will be placed in $BUILD."
echo "  NOTE: will include glibc-linuxthreads."
echo ""
echo "PRESS A KEY TO CONTINUE, CTRL-C to CANCEL"
echo ""
read x

echo ""
echo "Checking configuration status and $SRCS..."
if [ "$KERNEL" = "" -o ! -f "$KERNEL/Documentation/arm/README" ]; then
  echo "You haven't changed KERNEL to point at a valid kernel tree"
  exit 1
fi
if [ ! -f $SRCS/binutils-$BINUTILSVER.tar.gz ]; then
  echo "Binutils $BINUTILSVER seems to be missing"
  exit 1
fi
if [ ! -f $SRCS/gcc-$GCCVER.tar.gz ]; then
  echo "GCC $GCCVER seems to be missing"
  exit 1
fi
if [ ! -f $SRCS/gdb-$GDBVER.tar.gz ]; then
  echo "GDB $GDBVER seems to be missing"
  exit 1
fi
if [ ! -f $SRCS/glibc-$GLIBCVER.tar.gz ]; then
  echo "GLIBC $GLIBCVER seems to be missing"
  exit 1
fi
if [ ! -f $SRCS/glibc-linuxthreads-$GLIBCVER.tar.gz ]; then
  echo "GLIBC LinuxThreads $GLIBCVER seems to be missing"
  exit 1
fi

echo ""
echo ""
echo "Constructing directories if needed..."
mkdir -p $PREFIX
mkdir -p $BUILD

echo ""
echo ""
echo "Building binutils..."
pushd $BUILD
rm -rf binutils-$BINUTILSVER-src
rm -rf binutils-$BINUTILSVER-build
tar zxf $SRCS/binutils-$BINUTILSVER.tar.gz
patch -p1 < $SCRIPTS/binutils-2.13.90.0.16.patch
mv binutils-$BINUTILSVER binutils-$BINUTILSVER-src
mkdir binutils-$BINUTILSVER-build
pushd binutils-$BINUTILSVER-build
echo "../binutils-$BINUTILSVER-src/configure --target=$TARGET 
--program-prefix=$PROGPREFIX --prefix=$PREFIX --with-cpu=xscale --nfp"
../binutils-$BINUTILSVER-src/configure --target=$TARGET 
--program-prefix=$PROGPREFIX --prefix=$PREFIX --with-cpu=xscale --nfp
make 
make install
popd
rm -rf binutils-$BINUTILSVER-src
rm -rf binutils-$BINUTILSVER-build
popd
PATH=$PATH:$PREFIX/bin

echo ""
echo ""
echo "Building gcc, the first time..."
pushd $BUILD
rm -rf gcc-$GCCVER-src
rm -rf gcc-$GCCVER-build
tar zxf $SRCS/gcc-$GCCVER.tar.gz
patch -p1 < $SCRIPTS/gcc-3.2.1.patch
mv gcc-$GCCVER gcc-$GCCVER-src
mkdir gcc-$GCCVER-build
pushd gcc-$GCCVER-src
perl -pi -e 's/^(TARGET_LIBGCC2_CFLAGS.*)/$1 -Dinhibit_libc -D__gthr_posix_h/' 
gcc/config/arm/t-linux
echo 'T_CFLAGS = -Dinhibit_libc -D__gthr_posix_h' >> gcc/config/arm/t-linux
popd
pushd gcc-$GCCVER-build
echo "../gcc-$GCCVER-src/configure --target=$TARGET --prefix=$PREFIX $HOST 
--with-headers=$KERNEL/include --disable-shared --disable-threads 
--enable-languages="c" --nfp --with-cpu=xscale --without-fp 
--with-softfloat-support=internal --program-prefix=$PROGPREFIX"
../gcc-$GCCVER-src/configure --target=$TARGET --prefix=$PREFIX $HOST 
--with-headers=$KERNEL/include --disable-shared --disable-threads 
--enable-languages="c" --nfp --with-cpu=xscale --without-fp 
--with-softfloat-support=internal --program-prefix=$PROGPREFIX
make 
make install 
popd
rm -rf gcc-$GCCVER-src
rm -rf gcc-$GCCVER-build
popd

echo ""
echo ""
echo "Building glibc with linuxthreads"
if [ ! -f "$KERNEL/include/linux/version.h" ]; then
  echo "Building glibc requires a configured kernel tree."
  echo "So, build the kernel with the cross compiler in $PREFIX and run this 
script again."
  exit 1
fi
pushd $BUILD
rm -rf glibc-$GLIBCVER-src
rm -rf glibc-$GLIBCVER-build
tar zxf $SRCS/glibc-$GLIBCVER.tar.gz
tar -C glibc-$GLIBCVER -zxf $SRCS/glibc-linuxthreads-$GLIBCVER.tar.gz
mv glibc-$GLIBCVER glibc-$GLIBCVER-src
mkdir  glibc-$GLIBCVER-build
pushd glibc-$GLIBCVER-build
echo "../glibc-$GLIBCVER-src/configure $TARGET --build=$HOST 
--with-headers=$KERNEL/include --enable-add-ons --enable-shared 
--prefix=$PREFIX --with-cpu=xscale --without-fp --enable-kernel=2.4.19"
CLFAGS="-mbig-endian" ../glibc-$GLIBCVER-src/configure $TARGET --build=$HOST 
--with-headers=$KERNEL/include --enable-add-ons --enable-shared 
--prefix=$PREFIX --with-cpu=xscale --without-fp --enable-kernel=2.4.19
make
make install
popd
pushd $PREFIX/arm-linux/lib
ln -s $PREFIX/lib/* .
popd
rm -rf glibc-$GLIBCVER-src
rm -rf glibc-$GLIBCVER-build
popd

echo ""
echo ""
echo "Building gcc, second time with glibc..."
pushd $BUILD
rm -rf gcc-$GCCVER-src
rm -rf gcc-$GCCVER-build
tar zxf $SRCS/gcc-$GCCVER.tar.gz
patch -p1 < $SCRIPTS/gcc-3.2.1.patch
mv gcc-$GCCVER gcc-$GCCVER-src
mkdir gcc-$GCCVER-build
pushd gcc-$GCCVER-build
echo "../gcc-$GCCVER-src/configure --target=$TARGET --prefix=$PREFIX $HOST 
--with-headers=$KERNEL/include --with-cpu=xscale 
--with-softfloat-support=internal --enable-languages="c,c++" --nfp 
--program-prefix=$PROGPREFIX"
../gcc-$GCCVER-src/configure --target=$TARGET --prefix=$PREFIX $HOST 
--with-headers=$KERNEL/include --with-cpu=xscale 
--with-softfloat-support=internal --enable-languages="c,c++" --nfp 
--program-prefix=$PROGPREFIX
perl -pi -e 's/int namelen/unsigned int namelen/' 
libjava/java/net/natInetAddress.cc
make 
make install 
popd
rm -rf gcc-$GCCVER-src
rm -rf gcc-$GCCVER-build
popd

echo ""
echo ""
echo "Building GDB..."
pushd $BUILD
rm -rf gdb-$GDBVER-src
rm -rf gdb-$GDBVER-build
tar zxf $SRCS/gdb-$GDBVER.tar.gz
mv gdb-$GDBVER gdb-$GDBVER-src
mkdir gdb-$GDBVER-build
pushd gdb-$GDBVER-build
echo "../gdb-$GDBVER-src/configure --target=$TARGET --build=$HOST 
--prefix=$PREFIX --program-prefix=$PROGPREFIX"
../gdb-$GDBVER-src/configure --target=$TARGET --build=$HOST --prefix=$PREFIX 
--program-prefix=$PROGPREFIX
make
make install
popd
rm -rf gdb-$GDBVER-src
rm -rf gdb-$GDBVER-build
popd


echo ""
echo ""
echo "Done!"
echo ""
--------------

thanks for any advice...

-josh





reply via email to

[Prev in Thread] Current Thread [Next in Thread]