--host和--target在gcc之间有什么区别? [英] What's the difference between --host and --target in gcc?

查看:169
本文介绍了--host和--target在gcc之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


构建知道三个系统名称:您正在构建的
机器(build),您为
构建的机器(主机),以及GCC将为(目标)产生
代码的机器。当你配置GCC时,你可以用'--build =','--host ='和'--target ='来指定

There are three system names that the build knows about: the machine you are building on (build), the machine that you are building for (host), and the machine that GCC will produce code for (target). When you configure GCC, you specify these with ‘--build=’, ‘--host=’, and ‘--target=’.

不是您正在为其构建的机器 GCC将为
产生代码的机器
同样的事情?有什么区别?

Aren't the machine that you are building for and the machine that GCC will produce code for the same thing? What's the difference?

推荐答案

可以将gcc编译为交叉编译器。也就是说,你可以构建一个运行在一个架构(主机)上的gcc,但为不同的架构(目标)生成代码。

It's possible to build gcc as a cross compiler. That is, you can build a gcc that runs on one architecture (the host) but generates code for a different architecture (the target).

遇到这个时候是为嵌入式平台构建代码。如果你在冰箱里为处理器编写代码,你会喜欢在桌面上创建它,而不是在冰箱里!

The common place you'll come across this is when building code for embedded platforms. If you're writing code for the processor in your fridge, you'd kind of like to build it on your desktop, not in the fridge!

有些人使用交叉编译器为同一架构上的不同操作系统构建代码。例如,可以使用 MinGW 工具链从Linux主机定位Windows。

Some folks use cross compilers to build code for a different OS on the same architecture. For example, it's possible to target Windows from a Linux host with the MinGW toolchain.

这篇关于--host和--target在gcc之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆