What's the difference between --host and --target in gcc?

前端 未结 2 1776
没有蜡笔的小新
没有蜡笔的小新 2020-12-18 00:21

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),

相关标签:
2条回答
  • 2020-12-18 00:49

    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!

    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.

    0 讨论(0)
  • 2020-12-18 00:52

    As per "Configure Terms" the different between "host" and "target" only applies to building a GCC cross compiler for a different machine.

    http://gcc.gnu.org/onlinedocs/gccint/Configure-Terms.html

    0 讨论(0)
提交回复
热议问题