简体   繁体   English

交叉编译gcc

[英]Cross-Compiling gcc

I am following the instructions here for cross-compiling GCC. 我按照这里的说明交叉编译GCC。 I am on a mac. 我在Mac上。 When I run this command from the gcc source folder: ./configure --target=i586-elf --prefix=/usr/local/cross --disable-nls --without-headers --enable-languages=c,ada,c++,fortran,java,objc,obj-c++,treelang I get this error: configure: error: GMP 4.1 and MPFR 2.2.1 or newer versions required by fortran . 当我从gcc源文件夹运行此命令时: ./configure --target=i586-elf --prefix=/usr/local/cross --disable-nls --without-headers --enable-languages=c,ada,c++,fortran,java,objc,obj-c++,treelang我收到此错误: configure: error: GMP 4.1 and MPFR 2.2.1 or newer versions required by fortran When I change the command to this (I couln't compile GMP): ./configure --target=i586-elf --prefix=/usr/local/cross --disable-nls --without-headers --enable-languages=c,ada,c++,java,objc,obj-c++,treelang I get this error: 当我将命令更改为此时(我无法编译GMP):./ ./configure --target=i586-elf --prefix=/usr/local/cross --disable-nls --without-headers --enable-languages=c,ada,c++,java,objc,obj-c++,treelang我收到此错误:

The following requested languages could not be built: ada
Recognised languages are: c,ada,c++,fortran,java,objc,obj-c++,treelang

which doesn't make sense to me because it says ada is recognized. 这对我来说没有意义,因为它说ada是公认的。 All other configurations of the enable-languages settings (and when the setting isn't changed and the default is used) give me this error: 启用语言设置的所有其他配置(以及设置未更改且使用默认设置时)给出了以下错误:

/usr/local/cross/i586-elf/bin/ranlib ./libgcov.a
_error_not_here_yet - havent even thought about it - it may even work
make[1]: _error_not_here_yet: Command not found
make[1]: *** [treelang.all.cross] Error 127
make: *** [all-gcc] Error 2

How can I cross compile GCC? 如何交叉编译GCC?

Are you running configure from the gcc source tree? 您是否正在从gcc源代码树运行configure If so: don't do that. 如果是这样的话:不要这样做。 Follow the instructions (verbatim) in the page you linked to. 按照您链接到的页面中的说明(逐字)。

Look carefully and you'll notice that they're running the configure command from outside the gcc source tree. 仔细查看,你会发现他们正在从gcc源代码树外部运行configure命令。

If your platform is supported by it, the crosstool script (also linked from the bottom of your instructions page) is very helpful. 如果您的平台受其支持,则crosstool脚本 (也从说明页面底部链接)非常有用。

Edit: As potatoswatter points out in a comment, your installation is probably hosed at this point. 编辑:正如potatoswatter在评论中指出的那样,您的安装可能已经在这一点上进行了调整。 Remove the whole tree and start from scratch. 删除整棵树,从头开始。 (It sounds like it will take too long, and you'll want to take a short cut, but it will be faster in the end if you just start from scratch now.) (这听起来好像需要很长时间,你会想要做一个捷径,但如果你现在从头开始,它会更快。)

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

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