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

Merge tag 'kbuild-fixes-v5.14-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild

Pull Kbuild fixes from Masahiro Yamada:

- Correct the Extended Regular Expressions in tools

- Adjust scripts/checkversion.pl for the current Kbuild

- Unset sub_make_done for 'make install' to make DKMS work again

* tag 'kbuild-fixes-v5.14-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
kbuild: cancel sub_make_done for the install target to fix DKMS
scripts: checkversion: modernize linux/version.h search strings
mips: Fix non-POSIX regexp
x86/tools/relocs: Fix non-POSIX regexp

+26 -12
+10
Makefile
··· 1317 1317 $(Q)$(MAKE) $(build)=scripts scripts/unifdef 1318 1318 1319 1319 # --------------------------------------------------------------------------- 1320 + # Install 1321 + 1322 + # Many distributions have the custom install script, /sbin/installkernel. 1323 + # If DKMS is installed, 'make install' will eventually recuses back 1324 + # to the this Makefile to build and install external modules. 1325 + # Cancel sub_make_done so that options such as M=, V=, etc. are parsed. 1326 + 1327 + install: sub_make_done := 1328 + 1329 + # --------------------------------------------------------------------------- 1320 1330 # Tools 1321 1331 1322 1332 ifdef CONFIG_STACK_VALIDATION
+1 -1
arch/mips/Makefile
··· 321 321 322 322 ifdef CONFIG_MIPS 323 323 CHECKFLAGS += $(shell $(CC) $(KBUILD_CFLAGS) -dM -E -x c /dev/null | \ 324 - egrep -vw '__GNUC_(|MINOR_|PATCHLEVEL_)_' | \ 324 + egrep -vw '__GNUC_(MINOR_|PATCHLEVEL_)?_' | \ 325 325 sed -e "s/^\#define /-D'/" -e "s/ /'='/" -e "s/$$/'/" -e 's/\$$/&&/g') 326 326 endif 327 327
+4 -4
arch/x86/tools/relocs.c
··· 57 57 [S_REL] = 58 58 "^(__init_(begin|end)|" 59 59 "__x86_cpu_dev_(start|end)|" 60 - "(__parainstructions|__alt_instructions)(|_end)|" 61 - "(__iommu_table|__apicdrivers|__smp_locks)(|_end)|" 60 + "(__parainstructions|__alt_instructions)(_end)?|" 61 + "(__iommu_table|__apicdrivers|__smp_locks)(_end)?|" 62 62 "__(start|end)_pci_.*|" 63 63 "__(start|end)_builtin_fw|" 64 - "__(start|stop)___ksymtab(|_gpl)|" 65 - "__(start|stop)___kcrctab(|_gpl)|" 64 + "__(start|stop)___ksymtab(_gpl)?|" 65 + "__(start|stop)___kcrctab(_gpl)?|" 66 66 "__(start|stop)___param|" 67 67 "__(start|stop)___modver|" 68 68 "__(start|stop)___bug_table|"
+11 -7
scripts/checkversion.pl
··· 1 1 #! /usr/bin/env perl 2 2 # SPDX-License-Identifier: GPL-2.0 3 3 # 4 - # checkversion find uses of LINUX_VERSION_CODE or KERNEL_VERSION 5 - # without including <linux/version.h>, or cases of 6 - # including <linux/version.h> that don't need it. 7 - # Copyright (C) 2003, Randy Dunlap <rdunlap@xenotime.net> 4 + # checkversion finds uses of all macros in <linux/version.h> 5 + # where the source files do not #include <linux/version.h>; or cases 6 + # of including <linux/version.h> where it is not needed. 7 + # Copyright (C) 2003, Randy Dunlap <rdunlap@infradead.org> 8 8 9 9 use strict; 10 10 ··· 13 13 my $debugging; 14 14 15 15 foreach my $file (@ARGV) { 16 - next if $file =~ "include/linux/version\.h"; 16 + next if $file =~ "include/generated/uapi/linux/version\.h"; 17 + next if $file =~ "usr/include/linux/version\.h"; 17 18 # Open this file. 18 19 open( my $f, '<', $file ) 19 20 or die "Can't open $file: $!\n"; ··· 42 41 $iLinuxVersion = $. if m/^\s*#\s*include\s*<linux\/version\.h>/o; 43 42 } 44 43 45 - # Look for uses: LINUX_VERSION_CODE, KERNEL_VERSION, UTS_RELEASE 46 - if (($_ =~ /LINUX_VERSION_CODE/) || ($_ =~ /\WKERNEL_VERSION/)) { 44 + # Look for uses: LINUX_VERSION_CODE, KERNEL_VERSION, 45 + # LINUX_VERSION_MAJOR, LINUX_VERSION_PATCHLEVEL, LINUX_VERSION_SUBLEVEL 46 + if (($_ =~ /LINUX_VERSION_CODE/) || ($_ =~ /\WKERNEL_VERSION/) || 47 + ($_ =~ /LINUX_VERSION_MAJOR/) || ($_ =~ /LINUX_VERSION_PATCHLEVEL/) || 48 + ($_ =~ /LINUX_VERSION_SUBLEVEL/)) { 47 49 $fUseVersion = 1; 48 50 last if $iLinuxVersion; 49 51 }