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 | echo "include $(abs_srctree)/Makefile"; \ | 700 | echo "include $(abs_srctree)/Makefile"; \ |
| 701 | } | 701 | } |
| 702 | 702 | ||
| 703 | $(objtree)/Makefile: FORCE | 703 | PHONY += $(CURDIR)/Makefile |
| 704 | $(CURDIR)/Makefile: FORCE | ||
| 704 | $(call filechk,makefile) | 705 | $(call filechk,makefile) |
| 705 | 706 | ||
| 706 | # Prevent $(srcroot)/Makefile from inhibiting the rule to run. | 707 | outputmakefile: $(CURDIR)/Makefile |
| 707 | PHONY += $(objtree)/Makefile | ||
| 708 | |||
| 709 | outputmakefile: $(objtree)/Makefile | ||
| 710 | ifeq ($(KBUILD_EXTMOD),) | 708 | ifeq ($(KBUILD_EXTMOD),) |
| 711 | @if [ -f $(srctree)/.config -o \ | 709 | @if [ -f $(srctree)/.config -o \ |
| 712 | -d $(srctree)/include/config -o \ | 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 | %undefine _unique_debug_srcs | 67 | %undefine _unique_debug_srcs |
| 68 | %undefine _debugsource_packages | 68 | %undefine _debugsource_packages |
| 69 | %undefine _debuginfo_subpackages | 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 | %global _find_debuginfo_opts -r | 79 | %global _find_debuginfo_opts -r |
| 80 | %endif | ||
| 81 | |||
| 71 | %global _missing_build_ids_terminate_build 1 | 82 | %global _missing_build_ids_terminate_build 1 |
| 72 | %global _no_recompute_build_ids 1 | 83 | %global _no_recompute_build_ids 1 |
| 73 | %{debug_package} | 84 | %{debug_package} |