免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 842 | 回复: 0
打印 上一主题 下一主题

GCC Internals-Configure Terms and History [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-09-29 14:37 |只看该作者 |倒序浏览
The configure and build process has a long and colorful history, and can
be confusing to anyone who doesn't know why things are the way they are.
While there are other documents which describe the configuration process
in detail, here are a few things that everyone working on GCC should
know.

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=.

Specifying the host without specifying the build should be avoided, as
configure may (and once did) assume that the host you specify
is also the build, which may not be true.

If build, host, and target are all the same, this is called a
native.  If build and host are the same but target is different,
this is called a cross.  If build, host, and target are all
different this is called a canadian (for obscure reasons dealing
with Canada's political party and the background of the person working
on the build at that time).  If host and target are the same, but build
is different, you are using a cross-compiler to build a native for a
different system.  Some people call this a host-x-host,
crossed native, or cross-built native.  If build and target
are the same, but host is different, you are using a cross compiler to
build a cross compiler that produces code for the machine you're
building on.  This is rare, so there is no common way of describing it.
There is a proposal to call this a crossback.

If build and host are the same, the GCC you are building will also be
used to build the target libraries (like libstdc++).  If build and host
are different, you must have already built and installed a cross
compiler that will be used to build the target libraries (if you
configured with --target=foo-bar, this compiler will be called
foo-bar-gcc).

In the case of target libraries, the machine you're building for is the
machine you specified with --target.  So, build is the machine
you're building on (no change there), host is the machine you're
building for (the target libraries are built for the target, so host is
the target you specified), and target doesn't apply (because you're not
building a compiler, you're building libraries).  The configure/make
process will adjust these variables as needed.  It also sets
$with_cross_host to the original --host value in case you
need it.

The libiberty support library is built up to three times: once
for the host, once for the target (even if they are the same), and once
for the build if build and host are different.  This allows it to be
used by all programs which are generated in the course of the build
process.
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/4329/showart_2062587.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP