I've recently tried to move from Linux Mint 21 to 21.2. I've downloaded distro and noted 3Gb vs 2.4 Gb size of ISO file. From comparison major single difference is inclusion of GCC 12
along with GCC 11
. 11 takes 66Mb, 12 - 411 Mb ! (uncompressed).
Web search has not helped to find an answer. What makes GCC 12 so much bigger? TIA
P.S. Bonus question what will happen if I just delete GCC 12 from the distro to save space ? (Well, not just delete, also replace links to 12 with links to executables from 11)
Folders (/usr/lib/gcc/x86_64-linux-gnu/12/
| 11
) differ mostly due to sizes of two files: cc1
executable 200 vs 26 Mb, lto1
194 vs 24 Mb.
When software "suddenly" gets bloated 6 times I get suspicious...
P.S.2. In the meanwhile as there are no answers, I wanted to compare to Ubuntu suspecting Linux Mint builders overlooking some optimization. But currently newest Ubuntu distro has some issues (unrelated to the question).
Various factors play a role in the size of binaries, mostly with which options the compiler was built.
You might get some additional clues by comparing
-v
output of either compiler version which tells GCC's configure options.If the compiler is built from a source revision that's not already released, additional internal checkings are enabled which increase code size and execution time. In such a case you can add
--enable-checking=release
to the configure options.The optimization level used when building the compiler. If the compiler was built with
-O0
for some reason (debugging etc.), code size and execution times will increase. For release, you want to build the compiler with optimization on like-O2
and with LTO enabled.If the compiler was built with debugging information, that may increase binary size a lot, in particular with DWARF-3 which includes all macro definitions. Most people won't need debug info in the compiler, so you can try to
strip
the executable(s). Upon installing, you canmake install-strip
instead ofmake install
so the install script will runstrip
for you.The compiler used to build
gcc
also plays a role (in non-boostrap mode, e.g. with--disable-bootstrap
).My guess is no. 3, so before deleting the executables you can try
strip
on them.