我在我的x86 32位Linux系统上构建了GCC 4.7。 64位模式不GCC:对不起,未实现:64位模式未编译
编译,同时通过我的Linux发行版默认提供的编译器可以交叉:与-m64标志我得到
对不起,没有实现当我尝试交叉编译用-m64编译。
我必须传递给./configure以启用GCC中的64位模式?这些都是我用来构建GCC 4.7的选项:
$ /usr/local/bin/g++ -v Using built-in specs. COLLECT_GCC=/usr/local/bin/g++ COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/i686-pc-linux-gnu/4.7.0/lto-wrapper Target: i686-pc-linux-gnu Configured with: ./configure --enable-multiarch --with-cloog=/usr/local/ --with-mpfr=/usr/local/ --with-ppl=/usr/local/ --verbose --enable-languages=c,c++ Thread model: posix gcc version 4.7.0 20120113 (experimental) (GCC)
编辑:
--enable-multilib的和--enable-目标= i686的-PC-Linux的GNU,x86_64的-PC- linux-gnu
不改变这种情况。编译器仍抱怨未编译的65位模式:
$ g ++ -v使用内置规格。 COLLECT_GCC = g ++ COLLECT_LTO_WRAPPER =/usr/local/libexec/gcc/i686-pc-linux-gnu/4.7.0/lto-wrapper 目标:i686-pc-linux-gnu配置:./configure --enable -multiarch --with-cloog =/usr/local/--with-mpfr =/usr/local/--with-ppl =/usr/local/--verbose --enable-languages = c,C++ --enable -multilib --enable-targets = x86-64-pc-linux-gnu线程模型:posix gcc version 4.7.0 20120113(experimental)(GCC)
$ g ++ -m64 c.cpp c.cpp:1:0:对不起,没有实现:64位模式不 在
'--enable-multiarch'建议Debian(或衍生产品),我记得,FSF的GCC在Debian的多元化系统中并不能很好地工作。您可能需要将Debian的补丁应用于FSF GCC快照。 – hvd 2012-01-14 09:47:20
当然,它不会像这样工作。 Multilib具有*后向*兼容性,而不是*前向*。要在32位机器上编译64位代码,你必须建立最小的SDK:binutils + libc [musl,uclibc,glibc,...] + gcc。 – 0andriy 2017-06-14 11:26:31