繁体   English   中英

gcc无法在64位RHEL6中构建32位程序?

[英]gcc can't build 32bit program in 64bit RHEL6?

我已经从源代码安装了gcc-4.6.2 ,但是它无法构建32bit程序,似乎没有32bit lib。 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:

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

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM