Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 902197 - sys-devel/dwz-0.15-r2 calls readelf directly
Summary: sys-devel/dwz-0.15-r2 calls readelf directly
Status: RESOLVED FIXED
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: 2023-03-19 21:25 UTC by Agostino Sarubbo
Modified: 2024-12-01 11:26 UTC (History)
2 users (show)

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


Attachments
build.log (build.log,43.66 KB, text/plain)
2023-03-19 21:25 UTC, Agostino Sarubbo
Details
readelf.patch (readelf.patch,872 bytes, patch)
2024-11-02 21:19 UTC, Marco Rebhan
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2023-03-19 21:25:30 UTC
https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/

Issue: sys-devel/dwz-0.15 calls readelf directly.
Discovered on: amd64 (internal ref: ci)

NOTE:
As per QA policy, toolchain tools must not be called directly because they can cause issue in cross-compiling and because is not possible use a different READELF implementation (like llvm-readelf). To reproduce, please use sys-devel/gcc-config[-native-symlinks], sys-devel/binutils-config[-native-symlinks].
Comment 1 Agostino Sarubbo gentoo-dev 2023-03-19 21:25:33 UTC
Created attachment 858413 [details]
build.log

build log and emerge --info
Comment 2 Agostino Sarubbo gentoo-dev 2023-03-19 21:25:34 UTC
Error(s) that match a know pattern:


/bin/sh: line 1: readelf: command not found
dwz.c:42:10: fatal error: xxhash.h: No such file or directory
dwz.c:42:10: fatal error: xxhash.h: No such file or directory
Comment 3 Agostino Sarubbo gentoo-dev 2024-09-01 07:33:56 UTC
ci has reproduced this issue with version 0.15-r1 - Updating summary.
Comment 4 Marco Rebhan 2024-11-02 21:19:25 UTC
Created attachment 907733 [details, diff]
readelf.patch

This patch allows compilation with sys-devel/binutils-config[-native-symlinks]. It will not in fact build with llvm-readelf*, so still needs additionally setting READELF="x86_64-pc-linux-gnu-readelf" when building the package to make it actually compile, but it might fix cross compilation completely.

Note there are other occurrences of readelf, in the package tests, that this patch patch doesn't cover, so dwz[test] will probably still not compile, but this at least gets compilation working when "readelf" is not GNU readelf (or the readelf for the correct arch)

* llvm-readelf: error: unknown argument '-w'
Comment 5 Agostino Sarubbo gentoo-dev 2024-11-06 11:53:13 UTC
ci has reproduced this issue with version 0.15-r2 - Updating summary.
Comment 6 Larry the Git Cow gentoo-dev 2024-12-01 11:26:43 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c7c4e417ac9c0e113dbf679baca04019dcb85723

commit c7c4e417ac9c0e113dbf679baca04019dcb85723
Author:     Haelwenn (lanodan) Monnier <contact@hacktivis.me>
AuthorDate: 2024-11-22 06:55:13 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-12-01 11:25:58 +0000

    sys-devel/dwz: fix hardcoded readelf, pull error-standalone
    
    Closes: https://bugs.gentoo.org/829239
    Closes: https://bugs.gentoo.org/902197
    Signed-off-by: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-devel/dwz/dwz-0.15-r3.ebuild           | 72 ++++++++++++++++++++++++++++++
 sys-devel/dwz/files/dwz-0.15-readelf.patch | 43 ++++++++++++++++++
 2 files changed, 115 insertions(+)

Additionally, it has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0ccf7e0e8dae6c81674d1f0ded6b0f16e54db378

commit 0ccf7e0e8dae6c81674d1f0ded6b0f16e54db378
Author:     Haelwenn (lanodan) Monnier <contact@hacktivis.me>
AuthorDate: 2024-11-30 11:12:07 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-12-01 11:25:57 +0000

    sys-libs/error-standalone: new package, add 1.0
    
    Needed for sys-devel/dwz and dev-util/debugedit, see referenced bugs.
    
    Tested on:
    * Ryzen: amd64, x86
    * RockPro64: arm, arm64
    * StarFive VisionFive2: riscv
    
    Signed-off-by: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
    Bug: https://bugs.gentoo.org/902197
    Bug: https://bugs.gentoo.org/829239
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-libs/error-standalone/Manifest                    |  1 +
 sys-libs/error-standalone/error-standalone-1.0.ebuild | 12 ++++++++++++
 sys-libs/error-standalone/metadata.xml                | 12 ++++++++++++
 3 files changed, 25 insertions(+)