Co-installable Compilers
It is useful to be able to install compilers built for more than one architecture side by side (e.g. amd64 and i386). This page describes a rearrangement of the packaging which allows that. This scheme also nicely enables cross-compilers using the same layout.
<ver> on this page refers to the gcc version number, (currently (Dec 2014) 4.9).
<triplet> refers to the GNU triplet (e.g. arm-linux-gnueabi)
Concept
Currently we can install gcc-<ver> and gcc-<ver>-<triplet> but you can't install gcc:i386 and gcc:amd64
This is useful (for example because ghc depends on gcc and wanting to install ghc:i386 or ghc:x32 to use less RAM makes a lot of sense). Not a high priority, but is useful and removes arbitrary distinction between compiler and cross-compiler. Makes things nice and orthogonal.
gcc-<ver> is MA:none and cannot simply be made MA:foreign, because it only works properly on the main arch.
ghc:i386 needs gcc(core):i386 but leaving gcc(core):amd64 installed
- native compilers have BUILD=HOST=TARGET
- cross-compilers have BUILD=HOST!=TARGET
Currently we have:
gcc-<ver> which contains the native compiler
and gcc-<ver>-<triplet> which contains a cross-compiler
so instead we have these packages containing the actual compilers:
gcc-<ver>-x86_64-linux-gnu gcc-<ver>-i386-linux-gnu gcc-<ver>-arm-linux-gnueabihf
etc
The user installs gcc-ver (arch:any) which is now just symlinks to gcc-<ver>-<triplet> with TARGET=HOST. so gcc-<ver>-TARGET:HOST ('actual compilers' packages) are MA:foreign
gcc-ver:HOST is MA:none, arch:any, depends on gcc-ver-HOST
So we should be able to install:
gcc-ver-TARGET:HOST (cross) and gcc-ver-HOST:HOST (native)
g++-ver-TARGET:HOST (cross) and g++-ver-HOST:HOST (native)
at the same time.
- gcc-4.9-arm-linux-gnueabihf:armhf built from 'gcc-4.9' source. This lives in armhf architecture of repo
- gcc-4.9-x86_64-linux-gnu:amd64 built from 'gcc-4.9' source. this lives in amd64 architecture of repo
- gcc-4.9-arm-linux-gnueabihf:amd64 built from 'cross-gcc-4.9' source. cross-compiler for armhf on amd64
- gcc-4.9-i386-linux-gnu:amd64 built from 'cross-gcc-4.9' source. cross-compiler for i386 on amd64 these last 2 live in amd64 architecture of repo
Example patch for tcc: 695354
gcc bug: 666743