我在我的x86 32位linux系统上构建了GCC 4.7.当我尝试使用-m64标志进行交叉编译时,我得到以下结果:
抱歉,未实现:64位模式未编译
而我的Linux发行版默认提供的编译器可以与-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)
Run Code Online (Sandbox Code Playgroud)
编辑:
--enable-multilib和--enable-targets = i686-pc-linux-gnu,x86_64-pc-linux-gnu
不要改变这种情况.编译器仍抱怨未编译的64位模式:
$ 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 = i686-pc-linux-gnu,x86_64-pc-linux-gnu线程模型:posix gcc版本4.7.0 20120113(实验)(GCC)
$ g ++ -m64 c.cpp c.cpp:1:0:抱歉,未实现:64位模式未编译
Cha*_*ara 21
这通常意味着您使用的是错误的(旧)编译器.
新的编译器支持-m32和-m64.您必须在Rtools中的任何旧编译器之前将PATH设置为新编译器(在Rtools的gcc,MinGW子目录中).
尝试将编译器的二进制lib路径更新为64位版本.lib文件夹等其他资源也应相应更改.
rub*_*nvb 10
您将需要binutils和gcc配置:
--enable-multilib
Run Code Online (Sandbox Code Playgroud)
可能:
--enable-targets=i686-pc-linux-gnu,x86_64-pc-linux-gnu
Run Code Online (Sandbox Code Playgroud)
支持multilib(-m64和/或-m32选项).你还需要两个版本的东西,如glibc,以便能够链接和运行生成的二进制文件.