buildroot/toolchain
Arnout Vandecappelle 919c06c282 gcc: use toolchain wrapper
We have a toolchain wrapper for external toolchain, but it is also
beneficial for internal toolchains, for the following reasons:

1. It can make sure that BR2_TARGET_OPTIMIZATION is passed to the
   compiler even if a package's build system doesn't honor CFLAGS.
2. It allows us to do the unsafe path check (i.e. -I/usr/include)
   without patching gcc.
3. It makes it simpler to implement building each package with a
   separate staging directory (per-package staging).
4. It makes it simpler to implement a compiler hash check for ccache.

The wrapper is reused from the external toolchain. A third CROSS_PATH_
option is added to the wrapper: in this case, the real executable is in
the same directory, with the extension .real.

The creation of the simple symlinks is merged with the creation of the
wrapper symlinks, otherwise part of the -gcc-ar handling logic would
have to be repeated.

The complex case-condition could be refactored with the one for the
external toolchain, but then it becomes even more complex because
they each have special corner cases. For example, the internal
toolchain has to handle *.real to avoid creating an extra indirection
after host-gcc-{final,initial}-rebuild.

Instead of creating the .real files, it would also have been possible
to install the internal toolchain in $(HOST_DIR)/opt, similar to what
we do for the external toolchain. However, then we would also have to
copy things to the sysroot and do more of the magic that the external
toolchain is doing. So keeping it in $(HOST_DIR)/usr/bin is much
simpler.

Note that gcc-initial has to be wrapped as well, because it is used for
building libc and we want to apply the same magic when building libc.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Cc: Fabio Porcedda <fabio.porcedda@gmail.com>
Cc: Jérôme Oufella <jerome.oufella@savoirfairelinux.com>
Reviewed-by: Romain Naour <romain.naour@openwide.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2015-10-04 18:22:20 +02:00
..
toolchain toolchain/toolchain-buildroot: migrate to virtual package infrastructure 2014-06-14 19:10:13 +02:00
toolchain-buildroot aarch64: add big endian(aarch64_be) support 2015-07-12 18:32:37 +02:00
toolchain-external toolchain-external: move wrapper to toolchain directory 2015-10-04 18:22:19 +02:00
Config.in toolchain: make IPv6 mandatory for external toolchains 2015-04-22 22:59:31 +02:00
helpers.mk toolchain: Fix glibc breakage 2015-10-04 13:59:46 +02:00
toolchain-common.in toolchain: add 4.2.x choice for headers 2015-09-01 10:05:20 +02:00
toolchain-wrapper.c gcc: use toolchain wrapper 2015-10-04 18:22:20 +02:00
toolchain-wrapper.mk toolchain-external: move wrapper to toolchain directory 2015-10-04 18:22:19 +02:00
toolchain.mk toolchain: fix installing gconv libs with multi-arch toolchain 2015-04-22 22:30:34 +02:00