我正在尝试在x86_64上编译glibc(作为次要的,不是系统的替代品)2.6,并试图使其生成32位对象。当我给它一个标准配置时,它可以很好地编译,生成通常的64位库对象。一些信息:
$ uname -a
Linux localhost.localdomain 2.6.18-164.11.1.el5 #1 SMP Wed Jan 20
07:32:21 \
EST 2010 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/redhat-release
CentOS release 5.4 (Final)
除其他外,我尝试了以下方法:
尝试1:
$ # [in build/glibc-2.6]
$ ../../src/glibc-2.6/configure --prefix=$HOME/glibc32-2.6 \
--with-cpu=i386-pc-linux-gnu
...
checking sysdep dirs... configure: error: The i386-pc-linux-gnu
subspecies of x86_64 is not supported."
尝试2:
$ ../../src/glibc-2.6/configure --prefix=$HOME/glibc32-2.6 \
--host=i386-pc-linux-gnu
...
$ make
配置成功,但是make会导致一系列编译错误,如下所示:
nptl/sysdeps/i386/tls.h:65:3: error: #error "TLS support is required."
In file included from include/tls.h:6,
from sysdeps/unix/sysv/linux/i386/sysdep.h:30,
from :1:
如果添加–with-tls和/或–target = i386-pc-linux-gnu,我会得到相同的结果。
[编辑:看来我对–build的–target感到困惑。我尝试添加–build = i386-pc-linux-gnu,也尝试添加其他所有尝试使用–</