3

I am trying to build glibc-2.13 with debugging symbols for ARM using the Linaro Toolchain on a 32-bit Ubuntu 10.04 Virtual Machine. From what I have researched, the steps to do so ( and the steps I've taken ) are shown here:

mkdir /home/user/Desktop/glibc
cd /home/user/Desktop/glibc
wget http://ftp.gnu.org/gnu/glibc/glibc-ports-2.13.tar.gz
wget http://ftp.gnu.org/gnu/glibc/glibc-2.13.tar.bz2
tar xvjf glibc-2.13.tar.bz2
tar xvf glibc-ports-2.13.tar.gz
mkdir -p glibc-2.13/ports
cp -r glibc-ports-2.13/* glibc-2.13/ports
mkdir tmp
mkdir glibc-build
cd glibc-build
export CFLAGS="-O1 -g"
export CPPFLAGS="-O1 -g"
export CC=/home/user/proj/toolchain/linaro/bin/arm-linux-gnueabi-gcc
export CXX=/home/user/proj/toolchain/linaro/bin/arm-linux-gnueabi-g++
../glibc-2.13/configure --host=arm-linux --prefix=/home/user/Desktop/glibc/tmp --enable-addons ports=yes
make

The configure step completes and when I move on to make, the build errors after a short time with the following error:

In file included from ../ports/sysdeps/unix/sysv/linux/arm/ldsodefs.h:23:0,
                 from ../csu/libc-tls.c:21,
                 from ../ports/sysdeps/arm/libc-tls.c:20:
../sysdeps/unix/sysv/linux/ldsodefs.h:64:0: note: this is the location of the previous definition
/tmp/ccgCNS8e.s: Assembler messages:
/tmp/ccgCNS8e.s:174: Error: invalid swi expression
/tmp/ccgCNS8e.s:174: Error: value of 983045 too large for field of 2 bytes at 196
make[2]: *** [/home/user/Desktop/glibc/glibc-build/csu/libc-tls.o] Error 1
make[2]: Leaving directory `/home/user/Desktop/glibc/glibc-2.13/csu'
make[1]: *** [csu/subdir_lib] Error 2
make[1]: Leaving directory `/home/user/Desktop/glibc/glibc-2.13'
make: *** [all] Error 2

From what I've read 'tls' is required, and if I try to build --without-tls , it errors saying that I do need tls. I haven't found anything on Google for this problem.

Does anyone know how I can resolve this and get past this error? Thanks -

EDIT: I've added the following exports before the configure command and still get the same error:

export CC=/home/user/gemini/toolchain/linaro/bin/arm-linux-gnueabi-gcc
export CXX=/home/user/gemini/toolchain/linaro/bin/arm-linux-gnueabi-g++
export AR=/home/user/proj/toolchain/linaro/bin/arm-linux-gnueabi-ar
export AS=/home/user/proj/toolchain/linaro/bin/arm-linux-gnueabi-as
export LD=/home/user/proj/toolchain/linaro/bin/arm-linux-gnueabi-ld
export RANLIB=/home/user/proj/toolchain/linaro/bin/arm-linux-gnueabi-ranlib
4

1 回答 1

4

我不确切知道这笔交易是什么——可能为我的工具链指定了不正确的 --host 参数。我最终使用以下命令在我的 Ubuntu 32 位 10.04 VM 上成功编译了 glibc 2.13:

sudo apt-get install libmpc-dev -y
sudo apt-get install libgmp-dev -y
sudo apt-get install libmpfr-dev -y
sudo apt-get install autoconf -y
sudo apt-get install gawk -y
cd ~/Desktop
GLIBC_VERSION="2.13"
rm -rf glibc
mkdir /home/user/Desktop/glibc
cd /home/user/Desktop/glibc
wget http://ftp.gnu.org/gnu/glibc/glibc-ports-$GLIBC_VERSION.tar.gz
wget http://ftp.gnu.org/gnu/glibc/glibc-$GLIBC_VERSION.tar.bz2
rm -rf glibc-build/ tmp/ glibc-$GLIBC_VERSION/ glibc-ports-$GLIBC_VERSION/
tar xvjf glibc-$GLIBC_VERSION.tar.bz2
tar xvf glibc-ports-$GLIBC_VERSION.tar.gz
mkdir -p glibc-$GLIBC_VERSION/ports
cp -r glibc-ports-$GLIBC_VERSION/* glibc-$GLIBC_VERSION/ports
mkdir tmp
mkdir glibc-build
cd glibc-build
CFLAGS="-O1 -g"
CPPFLAGS="-O1 -g"
CC=/home/user/proj/toolchain/linaro/bin/arm-linux-gnueabi-gcc
CXX=/home/user/proj/toolchain/linaro/bin/arm-linux-gnueabi-g++
AR=/home/user/proj/toolchain/linaro/bin/arm-linux-gnueabi-ar
AS=/home/user/proj/toolchain/linaro/bin/arm-linux-gnueabi-as
LD=/home/user/proj/toolchain/linaro/bin/arm-linux-gnueabi-ld
RANLIB=/home/user/proj/toolchain/linaro/bin/arm-linux-gnueabi-ranlib
export PATH=$PATH:/home/user/proj/toolchain/linaro/bin
export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu
../glibc-$GLIBC_VERSION/configure --with-tls --host=arm-linux-gnueabi --prefix=/home/user/Desktop/glibc/tmp --enable-addons ports=yes
make
cd ../
于 2012-12-18T20:19:38.253 回答