Summary: | sys-devel/binutils-2.40 breaks kernel BTF generation with dev-util/pahole-1.24 | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Johannes Penßel <johannesp> |
Component: | Current packages | Assignee: | Matthias Schwarzott <zzam> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | holger, sam, toolchain |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: |
https://github.com/acmel/dwarves/issues/37 https://bugs.gentoo.org/show_bug.cgi?id=892291 |
||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Johannes Penßel
2023-01-15 18:03:27 UTC
CORRECTION: the pahole from git is affected as well. https://lore.kernel.org/all/YzwkazNc6wNCpQTN@kernel.org/t/ possibly (not read the thread yet). Confirmed with 6.1.6, WTF are these guys doing.. So if I build pahole/next from git, replace the pahole binary and build again I get: .. LD .tmp_vmlinux.btf BTF .btf.vmlinux.bin.o LD .tmp_vmlinux.kallsyms1 NM .tmp_vmlinux.kallsyms1.syms KSYMS .tmp_vmlinux.kallsyms1.S AS .tmp_vmlinux.kallsyms1.S LD .tmp_vmlinux.kallsyms2 NM .tmp_vmlinux.kallsyms2.syms KSYMS .tmp_vmlinux.kallsyms2.S AS .tmp_vmlinux.kallsyms2.S LD vmlinux BTFIDS vmlinux NM System.map SORTTAB vmlinux .. There's a whole boatload of patches since 1.24: https://git.kernel.org/pub/scm/devel/pahole/pahole.git/log/?h=next I tried to selectively apply only the necessary bits but it turns out to be another great episode of whack-a-mole, with 10 patches in and always one more bit missing. Maybe select & apply everything since 1.24 into a patchball? That's the best I can think of right now. Just to make sure I did a full kernel/modules build with the pahole/next binary, booted the result and bpftrace still works fine. So that should be safe, for Gentoo definitions of "safe". :D Also not sure about comment#1, pahole/master also works fine since it has the relevant commits. That would make the patchset smaller (by ~half). $ git clone git://git.kernel.org/pub/scm/devel/pahole/pahole.git $ cd pahole $ mkdir -p /etc/portage/patches/dev-util/pahole $ git format-patch --stdout v1.24 > binutils-2.40-fix.patch $ mv binutils-2.40-fix.patch /etc/portage/patches/dev-util/pahole $ emerge -v1 \=pahole-1.24 $ build kernel $ \o/ The patchset is 88k and 23k gzipped, so probably too large for in-tree. (In reply to Holger Hoffstätte from comment #6) > Also not sure about comment#1, pahole/master also works fine since it has > the relevant commits. That would make the patchset smaller (by ~half). It probably failed again because I did not perform a kernel rebuild with the new pahole, but simply tried to complete the unsuccessful one. Can confirm Problem at Kernel Build but somehow i doubt that it is pahole. I suspect binutils-libs maybe.... Fact is that file: - .tmp_vmlinux.btf is either not present in source or not created by pahole(???) or whatever creates it. Not sure if this might be related: - https://lore.kernel.org/all/YzwkazNc6wNCpQTN@kernel.org/t/ I tested build of Kernel 6.1.6 and 6.1.7 which both show same Problem. (In reply to Argh!... Rats!... from comment #9) > Can confirm Problem at Kernel Build but somehow i doubt that it is pahole. > I suspect binutils-libs maybe.... > Please see the discussion above and the linked mailing list threads, as well as the patches. It's to do with new binutils (not binutils-libs) but that doesn't mean the fault lies with it. (In reply to Sam James from comment #10) > (In reply to Argh!... Rats!... from comment #9) > > Can confirm Problem at Kernel Build but somehow i doubt that it is pahole. > > I suspect binutils-libs maybe.... > > > > Please see the discussion above and the linked mailing list threads, as well > as the patches. > > It's to do with new binutils (not binutils-libs) but that doesn't mean the > fault lies with it. does downgrade to binutils-2.39-r4 help? (In reply to Argh!... Rats!... from comment #11) > does downgrade to binutils-2.39-r4 help? It should. But I'm going to backport the pahole patches in a minute as well. The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8447b2c20881b1d6b1fe417f16c82e39e24c1ac5 commit 8447b2c20881b1d6b1fe417f16c82e39e24c1ac5 Author: Sam James <sam@gentoo.org> AuthorDate: 2023-01-19 02:48:35 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-01-19 02:48:35 +0000 dev-util/pahole: backport patches for binutils-2.40 compat Kernel fails to compile otherwise. Closes: https://bugs.gentoo.org/890963 Signed-off-by: Sam James <sam@gentoo.org> dev-util/pahole/Manifest | 1 + dev-util/pahole/pahole-1.24_p20221024.ebuild | 65 ++++++++++++++++++++++++++++ dev-util/pahole/pahole-9999.ebuild | 41 +++++++++++++----- 3 files changed, 97 insertions(+), 10 deletions(-) |