]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/doc/gccint/source-tree-structure-and-build-system/configure-terms-and-history.rst
sphinx: add missing trailing newline
[thirdparty/gcc.git] / gcc / doc / gccint / source-tree-structure-and-build-system / configure-terms-and-history.rst
1 ..
2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
5
6 .. index:: configure terms, canadian
7
8 .. _configure-terms:
9
10 Configure Terms and History
11 ***************************
12
13 The configure and build process has a long and colorful history, and can
14 be confusing to anyone who doesn't know why things are the way they are.
15 While there are other documents which describe the configuration process
16 in detail, here are a few things that everyone working on GCC should
17 know.
18
19 There are three system names that the build knows about: the machine you
20 are building on (:dfn:`build`), the machine that you are building for
21 (:dfn:`host`), and the machine that GCC will produce code for
22 (:dfn:`target`). When you configure GCC, you specify these with
23 :option:`--build=`, :option:`--host=`, and :option:`--target=`.
24
25 Specifying the host without specifying the build should be avoided, as
26 :command:`configure` may (and once did) assume that the host you specify
27 is also the build, which may not be true.
28
29 If build, host, and target are all the same, this is called a
30 :dfn:`native`. If build and host are the same but target is different,
31 this is called a :dfn:`cross`. If build, host, and target are all
32 different this is called a :dfn:`canadian` (for obscure reasons dealing
33 with Canada's political party and the background of the person working
34 on the build at that time). If host and target are the same, but build
35 is different, you are using a cross-compiler to build a native for a
36 different system. Some people call this a :dfn:`host-x-host`,
37 :dfn:`crossed native`, or :dfn:`cross-built native`. If build and target
38 are the same, but host is different, you are using a cross compiler to
39 build a cross compiler that produces code for the machine you're
40 building on. This is rare, so there is no common way of describing it.
41 There is a proposal to call this a :dfn:`crossback`.
42
43 If build and host are the same, the GCC you are building will also be
44 used to build the target libraries (like ``libstdc++``). If build and host
45 are different, you must have already built and installed a cross
46 compiler that will be used to build the target libraries (if you
47 configured with :option:`--target=foo-bar`, this compiler will be called
48 :command:`foo-bar-gcc`).
49
50 In the case of target libraries, the machine you're building for is the
51 machine you specified with :option:`--target`. So, build is the machine
52 you're building on (no change there), host is the machine you're
53 building for (the target libraries are built for the target, so host is
54 the target you specified), and target doesn't apply (because you're not
55 building a compiler, you're building libraries). The configure/make
56 process will adjust these variables as needed. It also sets
57 ``$with_cross_host`` to the original :option:`--host` value in case you
58 need it.
59
60 The ``libiberty`` support library is built up to three times: once
61 for the host, once for the target (even if they are the same), and once
62 for the build if build and host are different. This allows it to be
63 used by all programs which are generated in the course of the build
64 process.