Skip to content

kernel-open: fix BTF generation on kernel 6.15+#1038

Closed
coleleavitt wants to merge 1 commit intoNVIDIA:mainfrom
coleleavitt:fix/btf-generation-kernel-6.15
Closed

kernel-open: fix BTF generation on kernel 6.15+#1038
coleleavitt wants to merge 1 commit intoNVIDIA:mainfrom
coleleavitt:fix/btf-generation-kernel-6.15

Conversation

@coleleavitt
Copy link

Summary

On kernel 6.15+, Makefile.btf was introduced upstream which sets PAHOLE and other BTF-related variables, making the separate assignment in the NVIDIA Makefile redundant and causing build warnings.

This patch uses $(or ...) to conditionally set PAHOLE, BTF_PAHOLE_FLAGS_EXTRA, HOLEPUNCH, and BTF_IDS_FLAGS_EXTRA only when they are not already defined by the kernel build system.

Split from #1025 per reviewer request — this change is independent of the DisplayPort MST fix.

Kernel 6.15+ replaced scripts/pahole-flags.sh with scripts/Makefile.btf
and scripts/gen-btf.sh for BTF generation. The existing check only looks
for pahole-flags.sh, causing the PAHOLE_AWK_PROGRAM wrapper to be used
unnecessarily on newer kernels. This wrapper has shell quoting issues
that result in awk parse errors during module build.

Update the condition to also check for Makefile.btf, allowing the kernel's
native BTF infrastructure to handle generation without the awk wrapper.

Signed-off-by: Cole Leavitt <cole@unwrap.rs>
@Binary-Eater
Copy link
Collaborator

Hi @coleleavitt,

#1041 has a more accurate version of this fix related to the changes in kernel 7.0. Will work on top of there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants