mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-27 16:41:11 +02:00
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.