Summary: | >=sys-devel/dwz-0.15-r3 llvm-readelf: error: unknown argument '-w' | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | felix <meyerfelixdev> |
Component: | Current packages | Assignee: | Gentoo Toolchain Maintainers <toolchain> |
Status: | CONFIRMED --- | ||
Severity: | normal | CC: | contact, egger.m, erhard_f, gentoo.qxrin, lockalsash, nate, sandyvujakovicj, zhixu.liu |
Priority: | Normal | Keywords: | PullRequest |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: |
https://github.com/gentoo/gentoo/pull/40327 https://sourceware.org/bugzilla/show_bug.cgi?id=32611 |
||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 408963 | ||
Attachments: |
build.log
build.log (amd64, 0.15-r4) emerge --info |
Description
felix
2024-12-01 17:14:57 UTC
Indeed combination of https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-devel/dwz/files/dwz-0.15-readelf.patch and `READELF="llvm-readelf"` does not work, as llvm-readelf does not support `-wi` parameter (llvm-dwarfdump allows to extract the same value, but it would require if-else in Makefile). Created attachment 916044 [details]
build.log (amd64, 0.15-r4)
Same on 0.15-r4 on musl/llvm.
Created attachment 916045 [details]
emerge --info
@lanodan The 2nd part of your dwz upstream patch https://sourceware.org/pipermail/dwz/2024q4/001435.html (../files/dwz-0.15-readelf.patch in Gentoo) unfortunately breaks the build on llvm profiles. As said in #1 READELF="llvm-readelf" does not support -wi parameter so the pointer size can't be grepped afterwards. Not applying dwz-0.15-readelf.patch works as a workaround. BTW thanks for your quick error-standalone fix! > Not applying dwz-0.15-readelf.patch works as a workaround.
Or having the $READELF environment variable being set to "${CHOST}-readelf", which is what I have as a workaround here as my machines use llvm profiles.
Although maybe that workaround could be done in the ebuild? Not 100% sure how that could be done correctly.
> Although maybe that workaround could be done in the ebuild? There are cases when ebuilds probe tools (like OBJCOPY or READELF) in pkg_setup for flag support and override them with binutils. Sometimes it is not very accurate (example: https://bugs.gentoo.org/947826). I think a common function (maybe in toolchain-funcs) would be useful: - Accepts arbitrary tool name - local name=$(basename "$1") - Removes `llvm-` in the name, if any - Returns ${EPREFIX}/usr/bin/${name} So that it covers the following cases: READELF=llvm-readelf READELF=/usr/lib/llvm/18/bin/llvm-readelf READELF=/usr/lib/llvm/18/bin/readelf READELF=/usr/lib/llvm/18/bin/x86_64-pc-linux-gnu-readelf And in the individual ebuilds call this function if tool does not if ! "${READELF}" --help | grep -q '^ -w '; then READELF=tool-to-binutils "${READELF}" fi (disclaimer: I'm bad at naming, placement and highly-customized toolchains, so take my words with a grain of salt) *** Bug 948879 has been marked as a duplicate of this bug. *** |