Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 925212 - FEATURES=dedupdebug: support sys-devel/dwz's multifile mode
Summary: FEATURES=dedupdebug: support sys-devel/dwz's multifile mode
Status: CONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Enhancement/Feature Requests (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-22 07:25 UTC by Sam James
Modified: 2024-05-03 08:31 UTC (History)
4 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 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-02-22 07:25:38 UTC
Carrying on from https://bugs.gentoo.org/906368#c1.
Comment 1 Arsen Arsenović gentoo-dev 2024-03-01 09:57:15 UTC
for context, rpm uses https://sourceware.org/cgit/debugedit/tree/scripts/find-debuginfo.in

there are outstanding patches to make it less rpm-specific: https://inbox.sourceware.org/debugedit/20220611212217.4297-1-adrianvovk@gmail.com/

and there's upstream interest in making it generic, so I suspect that we *could* use it (and imo that'd be nice)
Comment 2 YiFei Zhu 2024-03-23 23:52:51 UTC
So I had a closer look at this (sorry a bunch of IRL stuffs was going on that took priority).

The reason multifile mode is so troublesome is that, to my knowledge, the dwz needs to be invoked just once for all ELFs of a package, instead of one invocation per ELF. This interferes with the strip logic with compressdebug, because dwz will not operate on ELFs that have compressed debug sections [1]. I took a look at the rpm script and it does not seem to have objcopy invocation where we add "--compress-debug-sections", so I can't tell how they workaround this dwz limitation, or that their debug sections aren't actually compressed at all.

The way I see this potentially working is to separate the estrip process_elf into more stages, where first stage is only save_elf_sources for every ELFs, second stage collect all the ELF inodes, third stage perform the dwz multifile outside the loop, fourth stage splitdebug, compressdebug, strip. This looks complicated and needs some refactoring of the bash script logic, so I want to confirm if this makes sense before I attempt to tackle this.

[1] https://sourceware.org/git/?p=dwz.git;a=blob;f=dwz.c;h=3bc6038e35a553e7474e1457cdbee658261be0eb;hb=HEAD#l13587
Comment 3 Zac Medico gentoo-dev 2024-03-24 23:01:43 UTC
(In reply to YiFei Zhu from comment #2)
> The way I see this potentially working is to separate the estrip process_elf
> into more stages, where first stage is only save_elf_sources for every ELFs,
> second stage collect all the ELF inodes, third stage perform the dwz
> multifile outside the loop, fourth stage splitdebug, compressdebug, strip.
> This looks complicated and needs some refactoring of the bash script logic,
> so I want to confirm if this makes sense before I attempt to tackle this.

Please go ahead and refactor it into these stages. In order support multifile mode for dedupdebug, it's perfectly logical to batch everything into a single dwz invocation.