【问题标题】:gcc can't build 32bit program in 64bit RHEL6?gcc 无法在 64 位 RHEL6 中构建 32 位程序?
【发布时间】:2013-07-12 21:57:50
【问题描述】:

我已经从源代码安装了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

【问题讨论】:

    标签: gcc build 32-bit


    【解决方案1】:

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

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

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

    【讨论】:

      猜你喜欢
      • 2014-04-10
      • 2010-12-01
      • 2012-01-15
      • 2012-11-26
      • 1970-01-01
      • 1970-01-01
      • 2022-01-13
      • 2016-03-31
      • 1970-01-01
      相关资源
      最近更新 更多