-
Notifications
You must be signed in to change notification settings - Fork 98
Description
This is a bit of a long running issue that unfortunately needs upstream support in order to fix. I'll detail it here for interested parties.
Upstream Gentoo bug: https://bugs.gentoo.org/603594
Upstream binutils bug: https://sourceware.org/bugzilla/show_bug.cgi?id=21479
The strip utility in LTO builds will commonly emit errors like this for static archives:
x86_64-pc-linux-gnu-strip: /dev/shm/portage/sys-libs/zlib-1.2.8-r1/image/usr/lib64/stzjlms5/adler32.o: plugin needed to handle lto object
Originally I didn't think this was a problem since that should effectively make it a no-op. I was wrong, though -- it actually makes the static archive unusable (I believe this has something to do with the index).
The real solution to this will be introducing LTO support into strip. However, a workaround is needed in the meantime. The linked upstream threads suggest a few options
- Add FEATURES=nostrip (will disable stripping entirely globally)
- Run
ranlibafterstrip(requires a Portage patch, but it does seem to fix it... I'm unsure of the effects of this on non-LTO systems) - Use
-ffat-lto-objectsor remove-flto(Obviously not ideal)
@pchome has suggested a workaround that we'll be using in the meantime, which is to set the STRIP_MASK variable to disable stripping static archives only (stripping binaries still). This is the best workaround right now until the upstream issues are sorted out. We can close this issue when things are handled properly upstream.