aboutsummaryrefslogtreecommitdiff
path: root/README
blob: bea5e304665a2d7551e88f795cea93b26059b946 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
What is gcc-config?
-------------------

Gentoo allows switching gcc as system runs via gcc-config:
    $ gcc-config x86_64-pc-linux-gnu-8.1.0
    $ gcc-config x86_64-pc-linux-gnu-7.2.0

Ideally changes should be visible instantly and atomically
without shell restart.

Files, variables, things.
-------------------------

- Wrappers (symlinks to compiler binary like /usr/${CTARGET}/gcc-bin/${GCC_VERSION}/gcc)
    /usr/bin/gcc (native)
    /usr/bin/g++ (native)
    /usr/bin/${CTARGET}-gcc (native and cross)
    ...
    (all files from /usr/${CTARGET}/gcc-bin/$GCC_VERSION/*)

      See `gcc-config` script for wrapping details.

- private gcc configs (provided by `toolchain.eclass`, gcc ebuilds)

    /etc/env.d/gcc/.NATIVE -> x86_64-pc-linux-gnu-8.1.0 (link to target config)
    /etc/env.d/gcc/x86_64-pc-linux-gnu-8.1.0

      Contains variables that describe toolchain layout:

          LDPATH="/usr/lib/gcc/x86_64-pc-linux-gnu/8.1.0"
          MANPATH="/usr/share/gcc-data/x86_64-pc-linux-gnu/8.1.0/man"
          INFOPATH="/usr/share/gcc-data/x86_64-pc-linux-gnu/8.1.0/info"
          STDCXX_INCDIR="g++-v8"
          CTARGET="x86_64-pc-linux-gnu"
          GCC_SPECS=""
          MULTIOSDIRS="../lib64"
          GCC_PATH="/usr/x86_64-pc-linux-gnu/gcc-bin/8.1.0"

      Used by gcc-config to generate wrappers and 05gcc- env.d files.

- gcc env.d compiler entries (provided by gcc-config)

    /etc/env.d/04gcc-${CTARGET} (native)

      Populates paths for native-compilers

        GCC_SPECS=""
        MANPATH="/usr/share/gcc-data/x86_64-pc-linux-gnu/8.2.0/man"
        INFOPATH="/usr/share/gcc-data/x86_64-pc-linux-gnu/8.2.0/info"

      Used by env-update to populate PATH and more (TODO: remove PATH population).

    /etc/env.d/05gcc-${CTARGET} (cross)

      Empty.

      Until Aug 2018 used to contain paths for cross-compilers.
      To be removed eventually.

TODOs
-----

- Write proper `gcc-config` manpage off this readme to be more discoverable.

- Figure out symlink ownership story. Today symlinks don't belong to any package.

  See https://bugs.gentoo.org/626606