C++ 什么是工具链和交叉编译器?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22756199/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-28 00:12:20  来源:igfitidea点击:

What is a toolchain and a cross compiler?

c++ccross-compilingtoolchain

提问by ctrl-shift-esc

I have had confusion over this terminology for a long time. I have tried to google this question and have been getting some contradictory answers.

长期以来,我一直对这个术语感到困惑。我试图用谷歌搜索这个问题,但得到了一些相互矛盾的答案。

One site says cross compiler is the same as a tool chain, some sites say cross compiler is a part of a toolchain. I have clearly not found this useful.

一个站点说交叉编译器与工具链相同,一些站点说交叉编译器是工具链的一部分。我显然没有发现这很有用。

To be specific, I have used PowerPCeabi cross-compiler and Atmel AVR toolchain. Are these both toolchains and/or cross-compilers or are they different?

具体来说,我使用了 PowerPCeabi 交叉编译器和 Atmel AVR 工具链。这些是工具链和/或交叉编译器还是不同?

I guess, my very specific question would be, if I had to put this in my resume, will it be right in saying Experienced in powerpceabi and AVR toolchains?

我想,我的非常具体的问题是,如果我必须把这个写在我的简历中,这样说对Experienced in powerpceabi and AVR toolchains吗?

Edit: For the people who marked this question as unclear what you're asking, how much more clear should I have to make this ?

编辑:对于将这个问题标记为 的人,unclear what you're asking我应该更清楚多少?

Modified question: Can I mention powerpceabiand AVRtogether as toolchains?

修改后的问题:我可以提到powerpceabiAVR一起作为toolchains吗?

回答by Mats Petersson

If we define the word "host" to mean a computer on which you are compiling, and "target" as the computer on which you want to run the code, then a native compiler is one where the target and the host are the same (kind). A cross-compiler is a compiler where the target is different from the host.

如果我们将“主机”一词定义为正在编译的计算机,而将“目标”定义为要在其上运行代码的计算机,那么本机编译器就是目标和主机相同的编译器(种类)。交叉编译器是目标与主机不同的编译器。

A toolchain is the set of compiler + linker + librarian + any other tools you need to produce the executable (+ shared libraries, etc) for the target. A debugger and/or IDE may also count as part of a toolchain.

工具链是一组编译器 + 链接器 + 库管理器 + 为目标生成可执行文件(+ 共享库等)所需的任何其他工具。调试器和/或 IDE 也可以算作工具链的一部分。

So

所以

Experience with Powerpceabi and AVR toolchains

使用 Powerpceabi 和 AVR 工具链的经验

would be how I'd express it if I had some experience with those.

如果我对这些有一些经验,我会如何表达它。