Since upgrading from 048-r1 and regenerating my initramfs, I noticed on my main development machine the blob grew substantially. Looking into the cpio, it seems that version 049-r3 now pulls in libgcc_s.so. What makes it worse on this machine is that I have many versions of gcc (all the way back to 4.7.x) and multiarch, so I get 8 copies of libgcc_s (and 8 more because of multiarch for the 32bit versions). I did a quick look through all the binaries and shared libs in the image, and it doesn't even look like anything depends on libgcc_s.so. Comparing the image 048 produces, that version didn't put _any_ copies of libgcc_s.so. I only see libgcc_s.so mentioned twice in dracut/modules.d/* one in 90multipath and one in 95iscsi, neither of which modules I use (that I am aware of). Reproducible: Always
This is probably caused by https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d2232b443f0a608c6a6ea578484187d82dec0573 So $libdirs now contains the output of ldconfig_paths(). (In reply to David Flogeras from comment #0) > Comparing the image 048 produces, that version didn't put _any_ copies of > libgcc_s.so. I only see libgcc_s.so mentioned twice in dracut/modules.d/* > one in 90multipath and one in 95iscsi, neither of which modules I use (that > I am aware of). Relevant dracut code is here: https://github.com/dracutdevs/dracut/blob/f4ad2e5c8964b6c7b50420299a0096bade6a40bd/dracut.sh#L1619
OK, so it seems libgcc_s is sometimes needed at runtime, but probably we don't need to install anything but the latest GCC version.
Yes, some filtering of $libdirs would be nice. But this will be a non-upstreamable change. Also getting the library path for the latest installed gcc properly would require to copy a lot of code from gcc-config. genkernel uses libgcc_s.so from the currently selected gcc path: https://gitweb.gentoo.org/proj/genkernel.git/tree/gen_initramfs.sh?id=a6223abe3b87bc544445f1b2ee51019084209181#n905 Not sure how safe is it.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4963c4ebb04f862691cbb8a769709d34e86eb953 commit 4963c4ebb04f862691cbb8a769709d34e86eb953 Author: Alexander Tsoy <alexander@tsoy.me> AuthorDate: 2020-03-09 23:21:19 +0000 Commit: Mike Gilbert <floppym@gentoo.org> CommitDate: 2020-03-10 19:49:53 +0000 sys-kernel/dracut: Version bump to 050 * Switch back to tarballs from kernel.org * Remove redundant gcc paths in ldconfig_paths() Closes: https://bugs.gentoo.org/705728 Signed-off-by: Alexander Tsoy <alexander@tsoy.me> Signed-off-by: Mike Gilbert <floppym@gentoo.org> sys-kernel/dracut/Manifest | 1 + sys-kernel/dracut/dracut-050.ebuild | 165 +++++++++++++++++++++ .../files/050-Makefile-fix-VERSION-again.patch | 34 +++++ ...erge-main-version-and-git-version-earlier.patch | 78 ++++++++++ ...on-t-call-fsfreeze-on-subvol-of-root-file.patch | 75 ++++++++++ .../dracut/files/050-gentoo-ldconfig-paths.patch | 39 +++++ 6 files changed, 392 insertions(+)