Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

Pull Kbuild fixes from Nathan Chancellor:

- Ensure tools/objtool is cleaned by 'make clean' and 'make mrproper'

- Fix test program for CONFIG_CC_CAN_LINK to avoid a warning, which is
made fatal by -Werror

- Drop explicit LZMA parallel compression in scripts/make_fit.py

- Several fixes for commit 62089b804895 ("kbuild: rpm-pkg: Generate
debuginfo package manually")

* tag 'kbuild-fixes-7.0-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux:
kbuild: rpm-pkg: Disable automatic requires for manual debuginfo package
kbuild: rpm-pkg: Fix manual debuginfo generation when using .src.rpm
kernel: rpm-pkg: Restore find-debuginfo.sh approach to -debuginfo package
kbuild: rpm-pkg: Restrict manual debug package creation
scripts/make_fit.py: Drop explicit LZMA parallel compression
kbuild: Fix CC_CAN_LINK detection
kbuild: Add objtool to top-level clean target

+104 -15
+10 -1
Makefile
··· 1497 1497 $(Q)$(MAKE) -sC $(srctree)/tools/bpf/resolve_btfids O=$(resolve_btfids_O) clean 1498 1498 endif 1499 1499 1500 + PHONY += objtool_clean 1501 + 1502 + objtool_O = $(abspath $(objtree))/tools/objtool 1503 + 1504 + objtool_clean: 1505 + ifneq ($(wildcard $(objtool_O)),) 1506 + $(Q)$(MAKE) -sC $(abs_srctree)/tools/objtool O=$(objtool_O) srctree=$(abs_srctree) clean 1507 + endif 1508 + 1500 1509 tools/: FORCE 1501 1510 $(Q)mkdir -p $(objtree)/tools 1502 1511 $(Q)$(MAKE) O=$(abspath $(objtree)) subdir=tools -C $(srctree)/tools/ ··· 1675 1666 $(Q)$(CONFIG_SHELL) $(srctree)/scripts/link-vmlinux.sh clean 1676 1667 $(Q)$(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) clean) 1677 1668 1678 - clean: archclean vmlinuxclean resolve_btfids_clean 1669 + clean: archclean vmlinuxclean resolve_btfids_clean objtool_clean 1679 1670 1680 1671 # mrproper - Delete all generated files, including .config 1681 1672 #
+1 -1
scripts/cc-can-link.sh
··· 5 5 #include <stdio.h> 6 6 int main(void) 7 7 { 8 - printf(""); 8 + printf("\n"); 9 9 return 0; 10 10 } 11 11 END
+1 -1
scripts/make_fit.py
··· 54 54 'bzip2': CompTool('.bz2', 'pbzip2,bzip2'), 55 55 'gzip': CompTool('.gz', 'pigz,gzip'), 56 56 'lz4': CompTool('.lz4', 'lz4'), 57 - 'lzma': CompTool('.lzma', 'plzip,lzma'), 57 + 'lzma': CompTool('.lzma', 'lzma'), 58 58 'lzo': CompTool('.lzo', 'lzop'), 59 59 'xz': CompTool('.xz', 'xz'), 60 60 'zstd': CompTool('.zstd', 'zstd'),
+55 -9
scripts/package/kernel.spec
··· 2 2 %{!?_arch: %define _arch dummy} 3 3 %{!?make: %define make make} 4 4 %define makeflags %{?_smp_mflags} ARCH=%{ARCH} 5 - %define __spec_install_post /usr/lib/rpm/brp-compress || : 6 - %define debug_package %{nil} 7 5 8 6 Name: kernel 9 7 Summary: The Linux Kernel ··· 45 47 against the %{version} kernel package. 46 48 %endif 47 49 48 - %if %{with_debuginfo} 50 + %if %{with_debuginfo_manual} 49 51 %package debuginfo 50 52 Summary: Debug information package for the Linux kernel 53 + Group: Development/Debug 54 + AutoReq: 0 55 + AutoProv: 1 51 56 %description debuginfo 52 57 This package provides debug information for the kernel image and modules from the 53 58 %{version} package. 59 + %define install_mod_strip 1 54 60 %endif 61 + 62 + %if %{with_debuginfo_rpm} 63 + # list of debuginfo-related options taken from distribution kernel.spec 64 + # files 65 + %undefine _include_minidebuginfo 66 + %undefine _find_debuginfo_dwz_opts 67 + %undefine _unique_build_ids 68 + %undefine _unique_debug_names 69 + %undefine _unique_debug_srcs 70 + %undefine _debugsource_packages 71 + %undefine _debuginfo_subpackages 72 + %global _find_debuginfo_opts -r 73 + %global _missing_build_ids_terminate_build 1 74 + %global _no_recompute_build_ids 1 75 + %{debug_package} 76 + 77 + # later, we make all modules executable so that find-debuginfo.sh strips 78 + # them up. but they don't actually need to be executable, so remove the 79 + # executable bit, taking care to do it _after_ find-debuginfo.sh has run 80 + %define __spec_install_post \ 81 + %{?__debug_package:%{__debug_install_post}} \ 82 + %{__arch_install_post} \ 83 + %{__os_install_post} \ 84 + find %{buildroot}/lib/modules/%{KERNELRELEASE} -name "*.ko" -type f \\\ 85 + | xargs --no-run-if-empty chmod u-x 86 + %else 87 + %define __spec_install_post /usr/lib/rpm/brp-compress || : 88 + %endif 89 + # some (but not all) versions of rpmbuild emit %%debug_package with 90 + # %%install. since we've already emitted it manually, that would cause 91 + # a package redefinition error. ensure that doesn't happen 92 + %define debug_package %{nil} 55 93 56 94 %prep 57 95 %setup -q -n linux ··· 101 67 mkdir -p %{buildroot}/lib/modules/%{KERNELRELEASE} 102 68 cp $(%{make} %{makeflags} -s image_name) %{buildroot}/lib/modules/%{KERNELRELEASE}/vmlinuz 103 69 # DEPMOD=true makes depmod no-op. We do not package depmod-generated files. 104 - %{make} %{makeflags} INSTALL_MOD_PATH=%{buildroot} INSTALL_MOD_STRIP=1 DEPMOD=true modules_install 70 + %{make} %{makeflags} INSTALL_MOD_PATH=%{buildroot} %{?install_mod_strip:INSTALL_MOD_STRIP=1} DEPMOD=true modules_install 105 71 %{make} %{makeflags} INSTALL_HDR_PATH=%{buildroot}/usr headers_install 106 72 cp System.map %{buildroot}/lib/modules/%{KERNELRELEASE} 107 73 cp .config %{buildroot}/lib/modules/%{KERNELRELEASE}/config ··· 132 98 echo "%exclude /lib/modules/%{KERNELRELEASE}/build" 133 99 } > %{buildroot}/kernel.list 134 100 135 - %if %{with_debuginfo} 101 + %if 0%{with_debuginfo_manual}%{with_debuginfo_rpm} > 0 136 102 # copying vmlinux directly to the debug directory means it will not get 137 103 # stripped (but its source paths will still be collected + fixed up) 138 104 mkdir -p %{buildroot}/usr/lib/debug/lib/modules/%{KERNELRELEASE} 139 105 cp vmlinux %{buildroot}/usr/lib/debug/lib/modules/%{KERNELRELEASE} 106 + %endif 140 107 108 + %if %{with_debuginfo_rpm} 109 + # make modules executable so that find-debuginfo.sh strips them. this 110 + # will be undone later in %%__spec_install_post 111 + find %{buildroot}/lib/modules/%{KERNELRELEASE} -name "*.ko" -type f \ 112 + | xargs --no-run-if-empty chmod u+x 113 + %endif 114 + 115 + %if %{with_debuginfo_manual} 141 116 echo /usr/lib/debug/lib/modules/%{KERNELRELEASE}/vmlinux > %{buildroot}/debuginfo.list 142 - 143 117 while read -r mod; do 144 118 mod="${mod%.o}.ko" 145 119 dbg="%{buildroot}/usr/lib/debug/lib/modules/%{KERNELRELEASE}/kernel/${mod}" 146 - buildid=$("${READELF}" -n "${mod}" | sed -n 's@^.*Build ID: \(..\)\(.*\)@\1/\2@p') 120 + buildid=$("${READELF:-readelf}" -n "${mod}" | sed -n 's@^.*Build ID: \(..\)\(.*\)@\1/\2@p') 147 121 link="%{buildroot}/usr/lib/debug/.build-id/${buildid}.debug" 148 122 149 123 mkdir -p "${dbg%/*}" "${link%/*}" 150 - "${OBJCOPY}" --only-keep-debug "${mod}" "${dbg}" 124 + "${OBJCOPY:-objcopy}" --only-keep-debug "${mod}" "${dbg}" 151 125 ln -sf --relative "${dbg}" "${link}" 152 126 153 127 echo "${dbg#%{buildroot}}" >> %{buildroot}/debuginfo.list ··· 165 123 166 124 %clean 167 125 rm -rf %{buildroot} 126 + %if %{with_debuginfo_rpm} 127 + rm -f debugfiles.list debuglinks.list debugsourcefiles.list debugsources.list \ 128 + elfbins.list 129 + %endif 168 130 169 131 %post 170 132 if [ -x /usr/bin/kernel-install ]; then ··· 208 162 /lib/modules/%{KERNELRELEASE}/build 209 163 %endif 210 164 211 - %if %{with_debuginfo} 165 + %if %{with_debuginfo_manual} 212 166 %files -f %{buildroot}/debuginfo.list debuginfo 213 167 %defattr (-, root, root) 214 168 %exclude /debuginfo.list
+35 -3
scripts/package/mkspec
··· 23 23 echo '%define with_devel 0' 24 24 fi 25 25 26 + # use %{debug_package} machinery to generate -debuginfo 27 + with_debuginfo_rpm=0 28 + # manually generate -debuginfo package 29 + with_debuginfo_manual=0 26 30 # debuginfo package generation uses find-debuginfo.sh under the hood, 27 31 # which only works on uncompressed modules that contain debuginfo 28 32 if grep -q CONFIG_DEBUG_INFO=y include/config/auto.conf && 29 33 (! grep -q CONFIG_MODULE_COMPRESS=y include/config/auto.conf) && 30 34 (! grep -q CONFIG_DEBUG_INFO_SPLIT=y include/config/auto.conf); then 31 - echo '%define with_debuginfo %{?_without_debuginfo: 0} %{?!_without_debuginfo: 1}' 32 - else 33 - echo '%define with_debuginfo 0' 35 + # If module signing is enabled (which may be required to boot with 36 + # lockdown enabled), the find-debuginfo.sh machinery cannot be used 37 + # because the signatures will be stripped off the modules. However, due 38 + # to an rpm bug in versions prior to 4.20.0 39 + # 40 + # https://github.com/rpm-software-management/rpm/issues/3057 41 + # https://github.com/rpm-software-management/rpm/commit/49f906998f3cf1f4152162ca61ac0869251c380f 42 + # 43 + # We cannot provide our own debuginfo package because it does not listen 44 + # to our custom files list, failing the build due to unpackaged files. 45 + # Manually generate the debug info package if using rpm 4.20.0. If not 46 + # using rpm 4.20.0, avoid generating a -debuginfo package altogether, 47 + # as it is not safe. 48 + if grep -q CONFIG_MODULE_SIG=y include/config/auto.conf; then 49 + rpm_ver_str=$(rpm --version 2>/dev/null) 50 + # Split the version on spaces 51 + IFS=' ' 52 + set -- $rpm_ver_str 53 + if [ "${1:-}" = RPM -a "${2:-}" = version ]; then 54 + IFS=. 55 + set -- $3 56 + rpm_ver=$(( 1000000 * $1 + 10000 * $2 + 100 * $3 + ${4:-0} )) 57 + if [ "$rpm_ver" -ge 4200000 ]; then 58 + with_debuginfo_manual='%{?_without_debuginfo:0}%{?!_without_debuginfo:1}' 59 + fi 60 + fi 61 + else 62 + with_debuginfo_rpm='%{?_without_debuginfo:0}%{?!_without_debuginfo:1}' 63 + fi 34 64 fi 65 + echo "%define with_debuginfo_manual $with_debuginfo_manual" 66 + echo "%define with_debuginfo_rpm $with_debuginfo_rpm" 35 67 36 68 cat<<EOF 37 69 %define ARCH ${ARCH}
+2
tools/objtool/Makefile
··· 29 29 srctree := $(patsubst %/,%,$(dir $(srctree))) 30 30 endif 31 31 32 + RM ?= rm -f 33 + 32 34 LIBSUBCMD_DIR = $(srctree)/tools/lib/subcmd/ 33 35 ifneq ($(OUTPUT),) 34 36 LIBSUBCMD_OUTPUT = $(abspath $(OUTPUT))/libsubcmd