Skip to content

Commit 4972bb9

Browse files
committed
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
2 parents c9194f3 + 14ccc63 commit 4972bb9

File tree

4 files changed

+26
-12
lines changed

4 files changed

+26
-12
lines changed

Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,6 +1316,16 @@ PHONY += scripts_unifdef
13161316
scripts_unifdef: scripts_basic
13171317
$(Q)$(MAKE) $(build)=scripts scripts/unifdef
13181318

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+
13191329
# ---------------------------------------------------------------------------
13201330
# Tools
13211331

arch/mips/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ KBUILD_LDFLAGS += -m $(ld-emul)
321321

322322
ifdef CONFIG_MIPS
323323
CHECKFLAGS += $(shell $(CC) $(KBUILD_CFLAGS) -dM -E -x c /dev/null | \
324-
egrep -vw '__GNUC_(|MINOR_|PATCHLEVEL_)_' | \
324+
egrep -vw '__GNUC_(MINOR_|PATCHLEVEL_)?_' | \
325325
sed -e "s/^\#define /-D'/" -e "s/ /'='/" -e "s/$$/'/" -e 's/\$$/&&/g')
326326
endif
327327

arch/x86/tools/relocs.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ static const char * const sym_regex_kernel[S_NSYMTYPES] = {
5757
[S_REL] =
5858
"^(__init_(begin|end)|"
5959
"__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)?|"
6262
"__(start|end)_pci_.*|"
6363
"__(start|end)_builtin_fw|"
64-
"__(start|stop)___ksymtab(|_gpl)|"
65-
"__(start|stop)___kcrctab(|_gpl)|"
64+
"__(start|stop)___ksymtab(_gpl)?|"
65+
"__(start|stop)___kcrctab(_gpl)?|"
6666
"__(start|stop)___param|"
6767
"__(start|stop)___modver|"
6868
"__(start|stop)___bug_table|"

scripts/checkversion.pl

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#! /usr/bin/env perl
22
# SPDX-License-Identifier: GPL-2.0
33
#
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>
88

99
use strict;
1010

@@ -13,7 +13,8 @@
1313
my $debugging;
1414

1515
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";
1718
# Open this file.
1819
open( my $f, '<', $file )
1920
or die "Can't open $file: $!\n";
@@ -41,8 +42,11 @@
4142
$iLinuxVersion = $. if m/^\s*#\s*include\s*<linux\/version\.h>/o;
4243
}
4344

44-
# Look for uses: LINUX_VERSION_CODE, KERNEL_VERSION, UTS_RELEASE
45-
if (($_ =~ /LINUX_VERSION_CODE/) || ($_ =~ /\WKERNEL_VERSION/)) {
45+
# Look for uses: LINUX_VERSION_CODE, KERNEL_VERSION,
46+
# LINUX_VERSION_MAJOR, LINUX_VERSION_PATCHLEVEL, LINUX_VERSION_SUBLEVEL
47+
if (($_ =~ /LINUX_VERSION_CODE/) || ($_ =~ /\WKERNEL_VERSION/) ||
48+
($_ =~ /LINUX_VERSION_MAJOR/) || ($_ =~ /LINUX_VERSION_PATCHLEVEL/) ||
49+
($_ =~ /LINUX_VERSION_SUBLEVEL/)) {
4650
$fUseVersion = 1;
4751
last if $iLinuxVersion;
4852
}

0 commit comments

Comments
 (0)