本文介绍了如何通过crosstool-NG更改“加拿大交叉”GCC汇编的主机类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了crosstool-NG并在主机+构建的x86机器上构建了GCC,该机器的目标是arm-unknown-linux-gnueabi。然后,我使用arm-unknown-linux-gnueabi-gcc来编译在我的ARM主板上运行良好的程序。



我现在想要构建GCC,将ARM托管在ARM上。我相信这个术语是:b
$ b

  build = i486-pc-linux-gnu 
target = arm-unknown-linux- gnueabi-gcc
host = arm-unknown-linux-gnueabi-gcc

我如何做这个?我是否运行./configure进行crosstool-NG传递--host = arm-unknown-linux-gnueabi-gcc?



还是改变CC /你可以使用 .config 文件来完成这项工作。

我认为名称中带有逗号的样本是很好的例子。主要区别在于您必须多次运行 ct-ng 来创建多个交叉编译器。



ct-ng 加拿大十字架中发生了一些变化。但是,您可能需要重新使用在PC上运行的原始交叉编译器。原因是编译器将包含为 ARM 编译的库,并且您需要在PC上生成这些库。通常,确保iX86主机+ ARM目标编译器位于您的路径上。然后,您必须在工具链菜单中为此工具链设置主机元组或前缀。您需要将构建元组设置为相同的编译器。

这给了一个包含大量 text 文件的目录,您可以 grep 提示。



例如,请参阅 6 - Toolchain types.txt 。在建筑的复杂性方面, native 或 Canadian-cross 确实没有关系。您只需要一个用于 Cross native 的中间体,但是您需要两个中间编译器用于加拿大十字

编辑: 包含了所有情况的一些信息。


I've installed crosstool-NG and built GCC on a host+build x86 machine that targets arm-unknown-linux-gnueabi. I've then used arm-unknown-linux-gnueabi-gcc to compile a program that ran well on my ARM board.

I'm wanting to now build GCC, targeting ARM to be hosted on ARM. I believe the lingo is

build=i486-pc-linux-gnu
target=arm-unknown-linux-gnueabi-gcc
host=arm-unknown-linux-gnueabi-gcc

How do I do this? do I run ./configure for crosstool-NG passing --host=arm-unknown-linux-gnueabi-gcc?

or do I change the environment variables for CC/etc?

解决方案

You do this with a .config file. I think samples with a comma in the name are good ones to look at. The main difference is that you must run ct-ng multiple times to create several cross compilers.

ct-ng has under went some changes in Canadian crosses lately. However, you will probably need to re-use your original cross compiler that runs on the PC. The reason is that a compiler will include libraries compiled for the ARM and you need to generate these libraries on your PC. Generally, ensure that the iX86-host+ARM-target compiler is on your path. Then you must set the host tuple or prefix for this tool chain in the toolchain menu. You need set the build tuple to the same compiler.

This gives a directory with a bunch of text files that you can grep for hints.

See 6 - Toolchain types.txt for example. Cross-native or Canadian-cross really doesn't matter, in terms of complexity of building. You need only one intermediate for Cross native, but you need two intermediate compilers for a Canadian cross.

Edit: Ct-ng's How a compiler is constructed has some information on all the happening.

这篇关于如何通过crosstool-NG更改“加拿大交叉”GCC汇编的主机类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 08:50