Created attachment 15904 [details] patch to fix issue if using llvm-readelf Gentoo have theses two patches applied (for musl) which seems haven't be applied? see https://sourceware.org/pipermail/dwz/2024q4/001434.html and https://sourceware.org/pipermail/dwz/2024q4/001435.html if using llvm profile and using llvm-readelf, build will failed: > readelf: error: unknown argument '-w' the reason is NATIVE_POINTER_SIZE is determined by readelf, but lvm-readelf has different arguments w/ gnu readelf, it doesn't accept "-wi". llvm-dwarfdump can be used to get addr_size, > # llvm-dwarfdump --debug-line var/tmp/portage/sys-devel/dwz-0.15-r4/work/dwz/native.o > ... > address_size: 8 > ... can be replaced if know how llvm-readelf get pointer size
Can you make sure to have binutils readelf installed? I rather not try supporting both binutils readelf and llvm dwarfdump in the testsuite. Matching output of one is tricky enough.
(In reply to Mark Wielaard from comment #1) > Can you make sure to have binutils readelf installed? > I rather not try supporting both binutils readelf and llvm dwarfdump in the > testsuite. Matching output of one is tricky enough. In Gentoo, when using llvm profile, readelf is: # which readelf /usr/lib/llvm/19/bin/readelf # ls -l /usr/lib/llvm/19/bin/readelf lrwxrwxrwx 1 root root 12 12月23日 15:58 /usr/lib/llvm/19/bin/readelf -> llvm-readelf and binutils is nstalled, but executables are not installed in search path: /usr/x86_64-pc-linux-gnu/binutils-bin/2.44/readelf proposed Gentoo PR is at https://github.com/gentoo/gentoo/pull/40327
Sounds like a bad idea for gentoo to name something readelf if it isn't command line compatible with (binutils) readelf, especially if the output also doesn't match.
It's not quite what we're doing. It exists as a fallback on PATH if nothing else exists (/usr/lib/llvm/*/bin is way after /usr/bin and so on). I would expect GNU Binutils readelf to be earlier on PATH if it's available at all...
Aha, ok, then we can just close this bug with as note that to make/check dwz you have to make sure binutils readelf is on the PATH? A patch to detect that readelf isn't usable would be appreciated though.
(In reply to Sam James from comment #4) > It's not quite what we're doing. It exists as a fallback on PATH if nothing > else exists (/usr/lib/llvm/*/bin is way after /usr/bin and so on). > > I would expect GNU Binutils readelf to be earlier on PATH if it's available > at all... Even then it looks like a bad idea. Argument and output incompatible program shouldn't be called the same, if users want the llvm version, they should use the llvm- prefixed one, or readelf should be a script that transforms readelf arguments to llvm-readelf arguments and changes output to match the expectations. Guess same mistake is to call clang gcc or vice versa, while they have some options in common, there are many incompatible options and the compilers behave quite differently in many ways.
https://sourceware.org/pipermail/dwz/2024q4/001435.html is it possible to merge this patch?
(In reply to Zhixu Liu from comment #7) > https://sourceware.org/pipermail/dwz/2024q4/001435.html > > is it possible to merge this patch? Note that it was discussed on list and there were some (unanswered) questions about it: https://inbox.sourceware.org/dwz/892b7edc860b8d1530560bc4f796c93f26098715.camel@klomp.org/T/#u