Merge tag 'kbuild-fixes-7.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux

Pull Kbuild fixes from Nathan Chancellor:

 - Fix regression with MO= when building out of tree kernel modules due
   to incorrectly overwriting build tree's Makefile

 - Avoid stripping .BTF sections from modules when building debug .rpm
   packages

* tag 'kbuild-fixes-7.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux:
  kbuild: rpm-pkg: Preserve BTF sections in kernel modules during debuginfo stripping
  kbuild: Stop modifying $(objtree)/Makefile when building oot-kmods oos
This commit is contained in:
Linus Torvalds
2026-07-31 20:45:28 -07:00
2 changed files with 14 additions and 5 deletions
+3 -5
View File
@@ -700,13 +700,11 @@ filechk_makefile = { \
echo "include $(abs_srctree)/Makefile"; \
}
$(objtree)/Makefile: FORCE
PHONY += $(CURDIR)/Makefile
$(CURDIR)/Makefile: FORCE
$(call filechk,makefile)
# Prevent $(srcroot)/Makefile from inhibiting the rule to run.
PHONY += $(objtree)/Makefile
outputmakefile: $(objtree)/Makefile
outputmakefile: $(CURDIR)/Makefile
ifeq ($(KBUILD_EXTMOD),)
@if [ -f $(srctree)/.config -o \
-d $(srctree)/include/config -o \
+11
View File
@@ -67,7 +67,18 @@ This package provides debug information for the kernel image and modules from th
%undefine _unique_debug_srcs
%undefine _debugsource_packages
%undefine _debuginfo_subpackages
# Preserve .BTF and .BTF.base sections in kernel modules during debuginfo
# stripping. find-debuginfo.sh uses eu-strip which removes non-allocated ELF
# sections like .BTF by default. .BTF.base is required for BTF distillation
# support; without it, module BTF validation fails.
%global with_keep_section %(%{__find_debuginfo} --help 2>&1 | grep -c keep-section)
%if %{with_keep_section}
%global _find_debuginfo_opts -r --keep-section .BTF --keep-section .BTF.base
%else
%global _find_debuginfo_opts -r
%endif
%global _missing_build_ids_terminate_build 1
%global _no_recompute_build_ids 1
%{debug_package}