0

我已经gcc-4.6.2从源代码安装,但它无法构建 32 位程序,它似乎没有 32 位库。错误报告gcc

/usr/local/gcc-4.6.2/lib/gcc/x86_64-redhat-linux/4.6.2/crtbegin.o: could not read symbols: File in wrong format

my gcc-4.6.2配置是:

Target: x86_64-redhat-linux
Configured with: ../gcc-4.6.2/configure --prefix=/usr/local/gcc-4.6.2 --mandir=/usr/share/man --infodir=/usr/share/info --enable-bootstrap --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --enable-languages=c,c++ --with-gmp=/usr/local/gmp-5.0.1 --with-mpfr=/usr/local/mpfr-2.4.2 --with-mpc=/usr/local/mpc-1.0.1 --without-ppl --without-cloog --with-arch-32=i686 --build=x86_64-redhat-linux --disable-multilib

Thread model: posix
4

1 回答 1

1

使用以下命令配置和构建 gcc:

--enable-multilib --with-multilib-list=m32,m64

安装后,您可以通过将“-m32”选项传递给 gcc 来编译 32 位。请注意,您还需要所有需要的库(如 glibc)的 32 位版本。

于 2013-07-15T08:37:22.770 回答