Summary: | portage's prestrip phase breaks LTO static libraries | ||
---|---|---|---|
Product: | Portage Development | Reporter: | Sergei Trofimovich (RETIRED) <slyfox> |
Component: | Core - Ebuild Support | Assignee: | Portage team <dev-portage> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | canarauc, damoju+gentoo, klaus.kusche, mike, paolo.pedroni, steffen, tsmksubc |
Priority: | Normal | Keywords: | PATCH |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
URL: | https://sourceware.org/bugzilla/show_bug.cgi?id=21479 | ||
See Also: |
https://bugs.gentoo.org/show_bug.cgi?id=667854 https://sourceware.org/bugzilla/show_bug.cgi?id=21479 https://bugs.gentoo.org/show_bug.cgi?id=866422 |
||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 618550, 671498 | ||
Attachments: | estrip: Fix static library index |
Description
Sergei Trofimovich (RETIRED)
2016-12-23 16:56:38 UTC
Some more packages causing build errors of other packages: dev-libs/crossguid-0_pre20150817 -> media-tv/kodi-9999 dev-qt/designer-5.7.1 -> kde-plasma/kwin-5.9.5 dev-qt/qtgui-5.7.1 -> dev-qt/qtwayland-5.7.2 I'm also using FEATURE="nostrip" as workaround. The bug has been reported upstream: https://sourceware.org/bugzilla/show_bug.cgi?id=21479 If you want to avoid FEATURE="nostrip" you can use STRIP_MASK="*/lib*.a" instead as a more fine-grained workaround. What should we do for EAPI 7? It appears that STRIP_MASK is ignored for this EAPI version. We really depend on this for lto-overlay, and we would appreciate any help we could get. (In reply to Shane Peelar from comment #4) > What should we do for EAPI 7? It appears that STRIP_MASK is ignored for this > EAPI version. We really depend on this for lto-overlay, and we would > appreciate any help we could get. A call to dostrip in src_install like this should do the trick: > set -o noglob > has ${EAPI} {0..6} || dostrip -x ${STRIP_MASK} > set +o noglob Actually, dostrip -x does not support globs, so if you need globs then you'll have to do something like this:
> set -o noglob
> if ! has ${EAPI} {0..6}; then
> pushd "${ED}" || die
> local x y
> for x in ${STRIP_MASK}; do
> set +o noglob
> for y in "${ED%/}"/${x#/}; do
> dostrip -x "${y#${ED%/}}"
> done
> set -o noglob
> done
> popd
> set +o noglob
Why are static libraries stripped anyway? If it's just for space saving, does it really make any sense since the common case of splitdebug means it is a best awash. It's not going to make any difference to application load times or memory usage since any binary using static libraries is going to be stripped itself anyway. It just seems to me to be a hold over from the days when *many* packages were installed with static libraries by default, and prior to splitdebug, when space savings were paramount. What is the current rationale? Created attachment 551860 [details, diff] estrip: Fix static library index (In reply to Steven Newbury from comment #7) > What is the current rationale? According to comments, unstripped are archives tend to be very large, there was talk of putting the files in a -debuginfo package: https://bugzilla.redhat.com/show_bug.cgi?id=1395280 Maybe it makes sense to split static libraries into a -static-libs package. There could even be two variants, one stripped and one unstripped. I've already got plans to add support for separate debuginfo and source packages, see bug 639376. > If it's just for space saving, does it really make any sense since the common > case of splitdebug means it is a best awash. In fact portage does not strip static libraries when splitdebug is enabled, the code has this comment about it: > # If we have split debug enabled, then do not strip this. > # There is no concept of splitdebug for objects not yet > # linked in (only for finally linked ELFs), so we have to > # retain the debug info in the archive itself. The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=2404ddca9d5db7992bf6853cbde8ca944224560c commit 2404ddca9d5db7992bf6853cbde8ca944224560c Author: Michał Górny <mgorny@gentoo.org> AuthorDate: 2018-10-29 16:41:45 +0000 Commit: Michał Górny <mgorny@gentoo.org> CommitDate: 2018-10-31 16:37:35 +0000 estrip: Run RANLIB after stripping static archives to fix LTO Run RANLIB after stripping static archives in order to fix potentially mangled LTO symbol indexes. According to the user's report, strip lacks support for LTO symbols (and for binutils plugins that could add the missing support) and breaks them. Upstream suggests fixing the archive by running ranlib -- and since there should be no harm in doing that, we can do that unconditionally. Suggested-by: Shane Peelar Bug: https://github.com/mgorny/portage-mgorny/issues/21 Bug: https://bugs.gentoo.org/603594 Reviewed-by: Zac Medico <zmedico@gentoo.org> Signed-off-by: Michał Górny <mgorny@gentoo.org> bin/estrip | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) Fixed in portage-2.3.62. *** Bug 591542 has been marked as a duplicate of this bug. *** |