Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 866422 - sys-devel/binutils: strip command does not support lto archives
Summary: sys-devel/binutils: strip command does not support lto archives
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
: 866416 866419 866500 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-08-24 22:14 UTC by Kostadin Shishmanov
Modified: 2025-05-23 21:56 UTC (History)
1 user (show)

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


Attachments
buildlog (sys-libs:binutils-libs-2.38-r2:20220824-221135.log,517.35 KB, text/x-log)
2022-08-24 22:14 UTC, Kostadin Shishmanov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kostadin Shishmanov 2022-08-24 22:14:19 UTC
Created attachment 800899 [details]
buildlog

sys-libs/binutils-libs-2.38-r2: finishes the strip stage with
x86_64-pc-linux-gnu-strip: /var/tmp/portage/sys-libs/binutils-libs-2.38-r2/image/usr/lib64/stIEIWxU/regex.o: plugin needed to handle lto object

can be solved by adding -ffat-lto-objects to the compiler flags
Comment 1 Mike Gilbert gentoo-dev 2022-08-25 17:16:48 UTC
*** Bug 866416 has been marked as a duplicate of this bug. ***
Comment 2 Mike Gilbert gentoo-dev 2022-08-25 17:16:52 UTC
*** Bug 866419 has been marked as a duplicate of this bug. ***
Comment 3 Mike Gilbert gentoo-dev 2022-08-25 17:16:57 UTC
*** Bug 866500 has been marked as a duplicate of this bug. ***
Comment 4 Arfrever Frehtes Taifersar Arahesis 2022-08-25 20:10:16 UTC
"plugin needed to handle lto object" message should now be completely harmless.

Workaround (calling ranlib on archive) was added to Portage over 3 years ago for bug #603594:
https://gitweb.gentoo.org/proj/portage.git/commit/?id=2404ddca9d5db7992bf6853cbde8ca944224560c

See also:
https://sourceware.org/bugzilla/show_bug.cgi?id=21479
https://github.com/InBetweenNames/gentooLTO/issues/49
Comment 5 Kostadin Shishmanov 2022-08-26 09:53:44 UTC
I suppose we can close this then?
Comment 6 Mike Gilbert gentoo-dev 2022-08-26 15:58:37 UTC
Let's keep this open in case someone runs into it again.
Comment 7 zurabid2016 2023-07-07 11:04:13 UTC
Hey, just wanted to open a new bug for this issue. It occurs to any package built with LTO with USE="static-libs". Are you sure it's harmless?
Comment 8 Kostadin Shishmanov 2023-07-07 11:11:31 UTC
(In reply to zurabid2016 from comment #7)
> Hey, just wanted to open a new bug for this issue. It occurs to any package
> built with LTO with USE="static-libs". Are you sure it's harmless?

I've had kde-frameworks/kwayland fail to build with -fno-lto if dev-qt/qtgui:5 wasn't built with -ffat-lto-objects, but that's only happened when using the mold linker.
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-05-04 10:05:43 UTC
H.J. Lu is kindly working on this. Testing his patch.
Comment 10 Larry the Git Cow gentoo-dev 2025-05-04 10:15:22 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/toolchain/binutils-patches.git/commit/?id=dbbd30a6cf0ba45b316f11a01f25428230fe2768

commit dbbd30a6cf0ba45b316f11a01f25428230fe2768
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2025-05-04 10:14:41 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2025-05-04 10:14:41 +0000

    9999: add H.J.'s patch for strip --plugin
    
    Bug: https://sourceware.org/PR21479
    Bug: https://bugs.gentoo.org/866422
    Bug: https://bugs.gentoo.org/926120
    Signed-off-by: Sam James <sam@gentoo.org>

 9999/0006-strip-lto-plugin.patch | 751 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 751 insertions(+)
Comment 11 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-05-04 10:25:13 UTC
(In reply to Kostadin Shishmanov from comment #8)
> (In reply to zurabid2016 from comment #7)
> > Hey, just wanted to open a new bug for this issue. It occurs to any package
> > built with LTO with USE="static-libs". Are you sure it's harmless?
> 
> I've had kde-frameworks/kwayland fail to build with -fno-lto if
> dev-qt/qtgui:5 wasn't built with -ffat-lto-objects, but that's only happened
> when using the mold linker.

That should happen either way if -ffat-lto-objects wasn't used, as you can't opt-out then (nothing to fallback on). This bug is still a real issue if calling strip manually though and the ranlib hack never felt like something to rely on.

It's also noise that scares people ;)

Anyway, bug 926120 handles all of that. I think we're nearly there on it. Just testing the eclass more...
Comment 12 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-05-04 10:28:37 UTC
(In reply to Sam James from comment #11)
> That should happen either way if -ffat-lto-objects wasn't used, as you can't
> opt-out then (nothing to fallback on). This bug is still a real issue if
> calling strip manually though and the ranlib hack never felt like something
> to rely on.
> 

It also makes a few things start to make more sense with the eclass and behave more consistently (all of my tests pass now even when using archives, not just raw objects).
Comment 13 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-05-23 21:56:19 UTC
commit 70a5c8b6e74d26c9dd3571950a08761a72751d21
Author: Andreas K. Hüttel <dilfridge@gentoo.org>
Date:   Thu May 22 23:43:11 2025 +0200

    sys-devel/binutils: add 2.44-r2 (patchlevel 4), no keywords

    Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>

commit 2166943fbf9a78333b5ec4f31017e79e68806be0
Author: Andreas K. Hüttel <dilfridge@gentoo.org>
Date:   Fri May 23 01:21:07 2025 +0200

    sys-devel/binutils: keyword 2.44-r2

    Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>