简体   繁体   English

使用交叉编译器为arm编译本地GCC

[英]compiling native GCC for arm using cross-compiler

I am looking to create a native build of GCC for an ARM system and I am running into some trouble. 我正在寻找为ARM系统创建GCC的本机版本,但遇到了一些麻烦。 The build machine is i686-linux. 构建机器是i686-linux。 Every tutorial I see tells me how to set up the actual cross compiling suite (which I have already done using crosstools-ng). 我看到的每个教程都告诉我如何设置实际的交叉编译套件(我已经使用crosstools-ng完成了此工作)。 However, I don't see anything related to compiling native ARM GCC. 但是,我看不到与编译本机ARM GCC有关的任何内容。 The configure string I used is below, I have set up the sysroot only with headers. 我使用的配置字符串如下,我仅使用标头设置了sysroot。 I have also cross-compiled and installed GMP and MPFR. 我还交叉编译并安装了GMP和MPFR。

../../gcc-4.3.5/configure \
    --host=arm-unknown-linux-gnueabi \
    --build=i686-build_pc-linux-gnu \
    --target=arm-unknown-linux-gnueabi \
    --prefix=/home/vm/gcc-native/sysroot \
    --with-sysroot=/home/vm/gcc-native/sysroot \
    --enable-shared --enable-threads --disable-libmudflap --disable-libssp \
    --disable-libgomp --disable-libstdcxx-pch --with-gnu-as --with-gnu-ld \
    --enable-languages=c,c++ --enable-symvers=gnu --enable-__cxa_atexit \
    --disable-nls --disable-multilib \
    --with-gmp=/home/vm/gcc-native/sysroot/ \
    --with-mpfr=/home/vm/gcc-native/sysroot/

GCC will build for a while but then dies with this: GCC将构建一段时间,然后死于此:

checking for suffix of object files... configure: error: cannot compute suffix of object files: cannot compile. 正在检查目标文件的后缀...配置:错误:无法计算目标文件的后缀:无法编译。

I am not sure how this would even run on my system as I am building on i686-linux and the target/host are both arm-linux. 我不确定这将如何在我的系统上运行,因为我是在i686-linux上构建的,而目标/主机都是arm-linux。 My thought right now is to find a ltib distro and looking at a spec file for GCC and trying to follow all of the steps. 我现在的想法是找到一个ltib发行版,并查看GCC的规范文件,然后尝试执行所有步骤。 The GCC that ltib shipped with for my board fails to compile on my system due to conflicts with the std namespace. ltib随附的用于我的主板的GCC由于与std名称空间冲突而无法在我的系统上编译。

Any info/links would be appreciated! 任何信息/链接将不胜感激!

Look in the config.log file (maybe not the top-level one) and see what it was trying to do when the test failed. 查看config.log文件(可能不是顶级文件),看看测试失败时它试图做什么。 Just grep for the cannot compute suffix message and you should find the right bit (it won't be at the end of the file). 只是grep表示cannot compute suffix消息,您应该找到正确的位(它不会在文件末尾)。

Note that you'll need a working arm-unknown-linux-gnueabi-gcc on your path somewhere if you want to build a cross-native toolchain. 请注意,如果您要构建跨本机工具链,则需要在路径上的某个地方使用arm-unknown-linux-gnueabi-gcc Ie you need a cross compiler to build cross-native compiler. 也就是说,您需要一个交叉编译器来构建交叉本地编译器。

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

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