Skip to content

Commit 02dc699

Browse files
committed
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
2 parents 2aa6a5e + e5a259d commit 02dc699

2 files changed

Lines changed: 14 additions & 5 deletions

File tree

Makefile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -700,13 +700,11 @@ filechk_makefile = { \
700700
echo "include $(abs_srctree)/Makefile"; \
701701
}
702702

703-
$(objtree)/Makefile: FORCE
703+
PHONY += $(CURDIR)/Makefile
704+
$(CURDIR)/Makefile: FORCE
704705
$(call filechk,makefile)
705706

706-
# Prevent $(srcroot)/Makefile from inhibiting the rule to run.
707-
PHONY += $(objtree)/Makefile
708-
709-
outputmakefile: $(objtree)/Makefile
707+
outputmakefile: $(CURDIR)/Makefile
710708
ifeq ($(KBUILD_EXTMOD),)
711709
@if [ -f $(srctree)/.config -o \
712710
-d $(srctree)/include/config -o \

scripts/package/kernel.spec

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,18 @@ This package provides debug information for the kernel image and modules from th
6767
%undefine _unique_debug_srcs
6868
%undefine _debugsource_packages
6969
%undefine _debuginfo_subpackages
70+
71+
# Preserve .BTF and .BTF.base sections in kernel modules during debuginfo
72+
# stripping. find-debuginfo.sh uses eu-strip which removes non-allocated ELF
73+
# sections like .BTF by default. .BTF.base is required for BTF distillation
74+
# support; without it, module BTF validation fails.
75+
%global with_keep_section %(%{__find_debuginfo} --help 2>&1 | grep -c keep-section)
76+
%if %{with_keep_section}
77+
%global _find_debuginfo_opts -r --keep-section .BTF --keep-section .BTF.base
78+
%else
7079
%global _find_debuginfo_opts -r
80+
%endif
81+
7182
%global _missing_build_ids_terminate_build 1
7283
%global _no_recompute_build_ids 1
7384
%{debug_package}

0 commit comments

Comments
 (0)