Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 705728 - =sys-kernel/dracut-0.49-r3 installs unnecessary copies of libgcc_s.so
Summary: =sys-kernel/dracut-0.49-r3 installs unnecessary copies of libgcc_s.so
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Patrick McLean
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2020-01-18 11:48 UTC by David Flogeras
Modified: 2020-03-10 19:50 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Flogeras 2020-01-18 11:48:13 UTC
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
Comment 1 Alexander Tsoy 2020-01-18 12:45:38 UTC
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
Comment 2 David Flogeras 2020-01-18 14:41:50 UTC
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.
Comment 3 Alexander Tsoy 2020-01-20 09:59:28 UTC
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.
Comment 4 Larry the Git Cow gentoo-dev 2020-03-10 19:50:17 UTC
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(+)