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
Unified · Split
| @@ -700,13 +700,11 @@ filechk_makefile = { \ · 699 unmodified lines | ||
| 700 | 700 | echo "include $(abs_srctree)/Makefile"; \ |
| 701 | 701 | } |
| 702 | 702 | |
| 703 | −$(objtree)/Makefile: FORCE | |
| 703 | +PHONY += $(CURDIR)/Makefile | |
| 704 | +$(CURDIR)/Makefile: FORCE | |
| 704 | 705 | $(call filechk,makefile) |
| 705 | 706 | |
| 706 | −# Prevent $(srcroot)/Makefile from inhibiting the rule to run. | |
| 707 | −PHONY += $(objtree)/Makefile | |
| 708 | − | |
| 709 | −outputmakefile: $(objtree)/Makefile | |
| 707 | +outputmakefile: $(CURDIR)/Makefile | |
| 710 | 708 | ifeq ($(KBUILD_EXTMOD),) |
| 711 | 709 | @if [ -f $(srctree)/.config -o \ |
| 712 | 710 | -d $(srctree)/include/config -o \ |
| @@ -67,7 +67,18 @@ This package provides debug information for the kernel image and modules from th · 66 unmodified lines | ||
| 67 | 67 | %undefine _unique_debug_srcs |
| 68 | 68 | %undefine _debugsource_packages |
| 69 | 69 | %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 | |
| 70 | 79 | %global _find_debuginfo_opts -r |
| 80 | +%endif | |
| 81 | + | |
| 71 | 82 | %global _missing_build_ids_terminate_build 1 |
| 72 | 83 | %global _no_recompute_build_ids 1 |
| 73 | 84 | %{debug_package} |