Normally GCC is installed in a way that allows installing multiple
versions and switching between them. Our production images do not need
this and additionally the only things from the GCC package that are
needed are the shared libraries. To ensure these libraries are *always*
locatable regardless of the presence of /etc/ld.so.conf and
/etc/ld.so.cache we can install those libraries to plain old /usr/lib.
The GCC packages don't have a built in way to do this but we can get
away with extracting the libraries directly from the binary package.
This is actually similar to what ChromeOS did with a few exceptions:
- We use a native GCC build instead of the cross toolchain
- The archive is properly extracted from the package instead of feeding
the package directly to tar and ignoring the resulting warnings.
As an added benefit switching from a blacklist to a whitelist ensures
that extra cruft does not slip through the cracks, saving 5-10MB.
Create profile as a real directory instead of a symlink to the board
root's configuration. Normally the board root does not modify this but
it is useful for build_image to use it to modify package.provided.
Gentoo disabled systemd's preference for link-time-optimization because
it consumes a far amount of CPU and distcc doesn't run the linking step
remotely. This change alone shaves some 19MB from the uncompressed /usr
filesystem. That seems like a solid reason to leave it enabled.
Normally Gentoo expects moving between major GCC releases to be a manual
step. In our case we want this to always be automatic, otherwise the GCC
version won't be switched at all.
This updates our compiler to gcc-4.7.3-r1 which has been stable in
Gentoo for a long time now. One interesting thing in this compiler is it
will report errors if you attempt to link against system libraries when
building in an alternate sysroot like /build/amd64-usr which should help
catch a variety of mistakes.
This would only be needed if we were building board packages with the
"doc" use flag, which we don't. So it and many things can go away:
app-text/docbook-dsssl-stylesheets
app-text/docbook-sgml-dtd
app-text/openjade
app-text/opensp
app-text/rarian
app-text/scrollkeeper
app-text/scrollkeeper-dtd
app-text/yelp-tools
dev-util/gtk-doc
dev-util/itstool
gnome-extra/yelp-xsl