Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 950662 - sys-libs/glibc: Enable the stripping phase if using llvm-strip
Summary: sys-libs/glibc: Enable the stripping phase if using llvm-strip
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2025-03-05 19:43 UTC by Sergio Gomez
Modified: 2025-03-21 15:48 UTC (History)
1 user (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 Sergio Gomez 2025-03-05 19:43:39 UTC
Currently in the glibc ebuilds there is

      # Avoid stripping binaries not targeted by ${CHOST}. Or else
      # ${CHOST}-strip would break binaries build for ${CTARGET}.
      is_crosscompile && dostrip -x /

which avoids the stripping phase when cross-compiling (CHOST != CTARGET), since the $CHOST-strip tool doesn't understand the CTARGET object files when multitarget is not enabled: see 697428 for the details.

However, I'm using llvm-strip for the stripping, which doesn't have the mentioned problem, and I would like to have the stripping of the object files occur. My solution is to change the above line for

      [[ "$STRIP" != "llvm-strip" ]] && is_crosscompile && dostrip -x /

Is this solution reasonable (for a PR), or is some other way preferred?

Thanks.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-03-07 05:11:14 UTC
I think it sounds reasonable. It might be nice if we checked whether `strip` is capable of it (so we handle the multitarget case) as well.
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-03-07 05:19:15 UTC
(In reply to Sergio Gomez from comment #0)
> Is this solution reasonable (for a PR), or is some other way preferred?
> 
> Thanks.

A PR is good. If you can, please see about some portable-ish solution where we can make it work for binutils[multitarget] too. But I don't insist.
Comment 3 Sergio Gomez 2025-03-13 16:39:27 UTC
(In reply to Sam James from comment #2)
> (In reply to Sergio Gomez from comment #0)
> > Is this solution reasonable (for a PR), or is some other way preferred?
> > 
> > Thanks.
> 
> A PR is good. If you can, please see about some portable-ish solution where
> we can make it work for binutils[multitarget] too. But I don't insist.

Thanks.
Not sure I understand. AFAIU binutils[multitarget] doesn't have any stripping issues when CHOST != CTARGET (precisely in virtue of its 'multitarget' FEATURE)?