Skip to content

Commit ad28859

Browse files
committed
Merge tag 'kbuild-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
Pull Kbuild updates from Masahiro Yamada: - Remove the deprecated rule to build *.dtbo from *.dts - Refactor section mismatch detection in modpost - Fix bogus ARM section mismatch detections - Fix error of 'make gtags' with O= option - Add Clang's target triple to KBUILD_CPPFLAGS to fix a build error with the latest LLVM version - Rebuild the built-in initrd when KBUILD_BUILD_TIMESTAMP is changed - Ignore more compiler-generated symbols for kallsyms - Fix 'make local*config' to handle the ${CONFIG_FOO} form in Makefiles - Enable more kernel-doc warnings with W=2 - Refactor <linux/export.h> by generating KSYMTAB data by modpost - Deprecate <asm/export.h> and <asm-generic/export.h> - Remove the EXPORT_DATA_SYMBOL macro - Move the check for static EXPORT_SYMBOL back to modpost, which makes the build faster - Re-implement CONFIG_TRIM_UNUSED_KSYMS with one-pass algorithm - Warn missing MODULE_DESCRIPTION when building modules with W=1 - Make 'make clean' robust against too long argument error - Exclude more objects from GCOV to fix CFI failures with GCOV - Allow 'make modules_install' to install modules.builtin and modules.builtin.modinfo even when CONFIG_MODULES is disabled - Include modules.builtin and modules.builtin.modinfo in the linux-image Debian package even when CONFIG_MODULES is disabled - Revive "Entering directory" logging for the latest Make version * tag 'kbuild-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (72 commits) modpost: define more R_ARM_* for old distributions kbuild: revive "Entering directory" for Make >= 4.4.1 kbuild: set correct abs_srctree and abs_objtree for package builds scripts/mksysmap: Ignore prefixed KCFI symbols kbuild: deb-pkg: remove the CONFIG_MODULES check in buildeb kbuild: builddeb: always make modules_install, to install modules.builtin* modpost: continue even with unknown relocation type modpost: factor out Elf_Sym pointer calculation to section_rel() modpost: factor out inst location calculation to section_rel() kbuild: Disable GCOV for *.mod.o kbuild: Fix CFI failures with GCOV kbuild: make clean rule robust against too long argument error script: modpost: emit a warning when the description is missing kbuild: make modules_install copy modules.builtin(.modinfo) linux/export.h: rename 'sec' argument to 'license' modpost: show offset from symbol for section mismatch warnings modpost: merge two similar section mismatch warnings kbuild: implement CONFIG_TRIM_UNUSED_KSYMS without recursion modpost: use null string instead of NULL pointer for default namespace modpost: squash sym_update_namespace() into sym_add_exported() ...
2 parents e3c2b10 + f5983da commit ad28859

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+667
-1003
lines changed

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
*.symversions
5252
*.tab.[ch]
5353
*.tar
54-
*.usyms
5554
*.xz
5655
*.zst
5756
Module.symvers
@@ -112,7 +111,6 @@ modules.order
112111
#
113112
/include/config/
114113
/include/generated/
115-
/include/ksym/
116114
/arch/*/include/generated/
117115

118116
# stgit generated dirs

Documentation/kbuild/kbuild.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,12 @@ the UTS_MACHINE variable, and on some architectures also the kernel config.
150150
The value of KBUILD_DEBARCH is assumed (not checked) to be a valid Debian
151151
architecture.
152152

153+
KDOCFLAGS
154+
---------
155+
Specify extra (warning/error) flags for kernel-doc checks during the build,
156+
see scripts/kernel-doc for which flags are supported. Note that this doesn't
157+
(currently) apply to documentation builds.
158+
153159
ARCH
154160
----
155161
Set ARCH to the architecture to be built.

Documentation/process/changes.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ openssl & libcrypto 1.0.0 openssl version
6060
bc 1.06.95 bc --version
6161
Sphinx\ [#f1]_ 1.7 sphinx-build --version
6262
cpio any cpio --version
63+
GNU tar 1.28 tar --version
64+
gtags (optional) 6.6.5 gtags --version
6365
====================== =============== ========================================
6466

6567
.. [#f1] Sphinx is needed only to build the Kernel documentation
@@ -174,6 +176,18 @@ You will need openssl to build kernels 3.7 and higher if module signing is
174176
enabled. You will also need openssl development packages to build kernels 4.3
175177
and higher.
176178

179+
Tar
180+
---
181+
182+
GNU tar is needed if you want to enable access to the kernel headers via sysfs
183+
(CONFIG_IKHEADERS).
184+
185+
gtags / GNU GLOBAL (optional)
186+
-----------------------------
187+
188+
The kernel build requires GNU GLOBAL version 6.6.5 or later to generate
189+
tag files through ``make gtags``. This is due to its use of the gtags
190+
``-C (--directory)`` flag.
177191

178192
System utilities
179193
****************

Makefile

Lines changed: 43 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ __all:
3838
# descending is started. They are now explicitly listed as the
3939
# prepare rule.
4040

41+
this-makefile := $(lastword $(MAKEFILE_LIST))
42+
export abs_srctree := $(realpath $(dir $(this-makefile)))
43+
export abs_objtree := $(CURDIR)
44+
4145
ifneq ($(sub_make_done),1)
4246

4347
# Do not use make's built-in rules and variables
@@ -185,20 +189,8 @@ $(if $(abs_objtree),, \
185189

186190
# $(realpath ...) resolves symlinks
187191
abs_objtree := $(realpath $(abs_objtree))
188-
else
189-
abs_objtree := $(CURDIR)
190192
endif # ifneq ($(KBUILD_OUTPUT),)
191193

192-
ifeq ($(abs_objtree),$(CURDIR))
193-
# Suppress "Entering directory ..." unless we are changing the work directory.
194-
MAKEFLAGS += --no-print-directory
195-
else
196-
need-sub-make := 1
197-
endif
198-
199-
this-makefile := $(lastword $(MAKEFILE_LIST))
200-
abs_srctree := $(realpath $(dir $(this-makefile)))
201-
202194
ifneq ($(words $(subst :, ,$(abs_srctree))), 1)
203195
$(error source directory cannot contain spaces or colons)
204196
endif
@@ -211,9 +203,25 @@ need-sub-make := 1
211203
$(this-makefile): ;
212204
endif
213205

214-
export abs_srctree abs_objtree
215206
export sub_make_done := 1
216207

208+
endif # sub_make_done
209+
210+
ifeq ($(abs_objtree),$(CURDIR))
211+
# Suppress "Entering directory ..." if we are at the final work directory.
212+
no-print-directory := --no-print-directory
213+
else
214+
# Recursion to show "Entering directory ..."
215+
need-sub-make := 1
216+
endif
217+
218+
ifeq ($(filter --no-print-directory, $(MAKEFLAGS)),)
219+
# If --no-print-directory is unset, recurse once again to set it.
220+
# You may end up recursing into __sub-make twice. This is needed due to the
221+
# behavior change in GNU Make 4.4.1.
222+
need-sub-make := 1
223+
endif
224+
217225
ifeq ($(need-sub-make),1)
218226

219227
PHONY += $(MAKECMDGOALS) __sub-make
@@ -223,18 +231,12 @@ $(filter-out $(this-makefile), $(MAKECMDGOALS)) __all: __sub-make
223231

224232
# Invoke a second make in the output directory, passing relevant variables
225233
__sub-make:
226-
$(Q)$(MAKE) -C $(abs_objtree) -f $(abs_srctree)/Makefile $(MAKECMDGOALS)
234+
$(Q)$(MAKE) $(no-print-directory) -C $(abs_objtree) \
235+
-f $(abs_srctree)/Makefile $(MAKECMDGOALS)
227236

228-
endif # need-sub-make
229-
endif # sub_make_done
237+
else # need-sub-make
230238

231239
# We process the rest of the Makefile if this is the final invocation of make
232-
ifeq ($(need-sub-make),)
233-
234-
# Do not print "Entering directory ...",
235-
# but we want to display it when entering to the output directory
236-
# so that IDEs/editors are able to understand relative filenames.
237-
MAKEFLAGS += --no-print-directory
238240

239241
ifeq ($(abs_srctree),$(abs_objtree))
240242
# building in the source tree
@@ -1199,28 +1201,12 @@ endif
11991201
export KBUILD_VMLINUX_LIBS
12001202
export KBUILD_LDS := arch/$(SRCARCH)/kernel/vmlinux.lds
12011203

1202-
# Recurse until adjust_autoksyms.sh is satisfied
1203-
PHONY += autoksyms_recursive
12041204
ifdef CONFIG_TRIM_UNUSED_KSYMS
12051205
# For the kernel to actually contain only the needed exported symbols,
12061206
# we have to build modules as well to determine what those symbols are.
1207-
# (this can be evaluated only once include/config/auto.conf has been included)
12081207
KBUILD_MODULES := 1
1209-
1210-
autoksyms_recursive: $(build-dir) modules.order
1211-
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/adjust_autoksyms.sh \
1212-
"$(MAKE) -f $(srctree)/Makefile autoksyms_recursive"
12131208
endif
12141209

1215-
autoksyms_h := $(if $(CONFIG_TRIM_UNUSED_KSYMS), include/generated/autoksyms.h)
1216-
1217-
quiet_cmd_autoksyms_h = GEN $@
1218-
cmd_autoksyms_h = mkdir -p $(dir $@); \
1219-
$(CONFIG_SHELL) $(srctree)/scripts/gen_autoksyms.sh $@
1220-
1221-
$(autoksyms_h):
1222-
$(call cmd,autoksyms_h)
1223-
12241210
# '$(AR) mPi' needs 'T' to workaround the bug of llvm-ar <= 14
12251211
quiet_cmd_ar_vmlinux.a = AR $@
12261212
cmd_ar_vmlinux.a = \
@@ -1229,7 +1215,7 @@ quiet_cmd_ar_vmlinux.a = AR $@
12291215
$(AR) mPiT $$($(AR) t $@ | sed -n 1p) $@ $$($(AR) t $@ | grep -F -f $(srctree)/scripts/head-object-list.txt)
12301216

12311217
targets += vmlinux.a
1232-
vmlinux.a: $(KBUILD_VMLINUX_OBJS) scripts/head-object-list.txt autoksyms_recursive FORCE
1218+
vmlinux.a: $(KBUILD_VMLINUX_OBJS) scripts/head-object-list.txt FORCE
12331219
$(call if_changed,ar_vmlinux.a)
12341220

12351221
PHONY += vmlinux_o
@@ -1285,7 +1271,7 @@ scripts: scripts_basic scripts_dtc
12851271
PHONY += prepare archprepare
12861272

12871273
archprepare: outputmakefile archheaders archscripts scripts include/config/kernel.release \
1288-
asm-generic $(version_h) $(autoksyms_h) include/generated/utsrelease.h \
1274+
asm-generic $(version_h) include/generated/utsrelease.h \
12891275
include/generated/compile.h include/generated/autoconf.h remove-stale-files
12901276

12911277
prepare0: archprepare
@@ -1567,6 +1553,8 @@ modules_sign_only := y
15671553
endif
15681554
endif
15691555

1556+
endif # CONFIG_MODULES
1557+
15701558
modinst_pre :=
15711559
ifneq ($(filter modules_install,$(MAKECMDGOALS)),)
15721560
modinst_pre := __modinst_pre
@@ -1577,18 +1565,18 @@ PHONY += __modinst_pre
15771565
__modinst_pre:
15781566
@rm -rf $(MODLIB)/kernel
15791567
@rm -f $(MODLIB)/source
1580-
@mkdir -p $(MODLIB)/kernel
1568+
@mkdir -p $(MODLIB)
1569+
ifdef CONFIG_MODULES
15811570
@ln -s $(abspath $(srctree)) $(MODLIB)/source
15821571
@if [ ! $(objtree) -ef $(MODLIB)/build ]; then \
15831572
rm -f $(MODLIB)/build ; \
15841573
ln -s $(CURDIR) $(MODLIB)/build ; \
15851574
fi
15861575
@sed 's:^\(.*\)\.o$$:kernel/\1.ko:' modules.order > $(MODLIB)/modules.order
1576+
endif
15871577
@cp -f modules.builtin $(MODLIB)/
15881578
@cp -f $(objtree)/modules.builtin.modinfo $(MODLIB)/
15891579

1590-
endif # CONFIG_MODULES
1591-
15921580
###
15931581
# Cleaning is done on three levels.
15941582
# make clean Delete most generated files
@@ -1930,6 +1918,13 @@ help:
19301918
@echo ' clean - remove generated files in module directory only'
19311919
@echo ''
19321920

1921+
__external_modules_error:
1922+
@echo >&2 '***'
1923+
@echo >&2 '*** The present kernel disabled CONFIG_MODULES.'
1924+
@echo >&2 '*** You cannot build or install external modules.'
1925+
@echo >&2 '***'
1926+
@false
1927+
19331928
endif # KBUILD_EXTMOD
19341929

19351930
# ---------------------------------------------------------------------------
@@ -1966,13 +1961,10 @@ else # CONFIG_MODULES
19661961
# Modules not configured
19671962
# ---------------------------------------------------------------------------
19681963

1969-
modules modules_install:
1970-
@echo >&2 '***'
1971-
@echo >&2 '*** The present kernel configuration has modules disabled.'
1972-
@echo >&2 '*** To use the module feature, please run "make menuconfig" etc.'
1973-
@echo >&2 '*** to enable CONFIG_MODULES.'
1974-
@echo >&2 '***'
1975-
@exit 1
1964+
PHONY += __external_modules_error
1965+
1966+
modules modules_install: __external_modules_error
1967+
@:
19761968

19771969
KBUILD_MODULES :=
19781970

@@ -2045,7 +2037,7 @@ clean: $(clean-dirs)
20452037
-o -name '*.dtb.S' -o -name '*.dtbo.S' \
20462038
-o -name '*.dt.yaml' \
20472039
-o -name '*.dwo' -o -name '*.lst' \
2048-
-o -name '*.su' -o -name '*.mod' -o -name '*.usyms' \
2040+
-o -name '*.su' -o -name '*.mod' \
20492041
-o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \
20502042
-o -name '*.lex.c' -o -name '*.tab.[ch]' \
20512043
-o -name '*.asn1.[ch]' \

arch/arc/include/asm/linkage.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88

99
#include <asm/dwarf.h>
1010

11+
#define ASM_NL ` /* use '`' to mark new line in macro */
12+
#define __ALIGN .align 4
13+
#define __ALIGN_STR __stringify(__ALIGN)
14+
1115
#ifdef __ASSEMBLY__
1216

1317
.macro ST2 e, o, off
@@ -28,10 +32,6 @@
2832
#endif
2933
.endm
3034

31-
#define ASM_NL ` /* use '`' to mark new line in macro */
32-
#define __ALIGN .align 4
33-
#define __ALIGN_STR __stringify(__ALIGN)
34-
3535
/* annotation for data we want in DCCM - if enabled in .config */
3636
.macro ARCFP_DATA nm
3737
#ifdef CONFIG_ARC_HAS_DCCM

arch/ia64/include/asm/Kbuild

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0
22
generated-y += syscall_table.h
33
generic-y += agp.h
4+
generic-y += export.h
45
generic-y += kvm_para.h
56
generic-y += mcs_spinlock.h
67
generic-y += vtime.h

arch/ia64/include/asm/export.h

Lines changed: 0 additions & 3 deletions
This file was deleted.

arch/ia64/kernel/head.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ RestRR: \
170170
__PAGE_ALIGNED_DATA
171171

172172
.global empty_zero_page
173-
EXPORT_DATA_SYMBOL_GPL(empty_zero_page)
173+
EXPORT_SYMBOL_GPL(empty_zero_page)
174174
empty_zero_page:
175175
.skip PAGE_SIZE
176176

arch/ia64/kernel/ivt.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787

8888
.align 32768 // align on 32KB boundary
8989
.global ia64_ivt
90-
EXPORT_DATA_SYMBOL(ia64_ivt)
90+
EXPORT_SYMBOL(ia64_ivt)
9191
ia64_ivt:
9292
/////////////////////////////////////////////////////////////////////////////////////////
9393
// 0x0000 Entry 0 (size 64 bundles) VHPT Translation (8,20,47)

arch/mips/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
346346
KBUILD_LDFLAGS += -m $(ld-emul)
347347

348348
ifdef CONFIG_MIPS
349-
CHECKFLAGS += $(shell $(CC) $(KBUILD_CFLAGS) -dM -E -x c /dev/null | \
349+
CHECKFLAGS += $(shell $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -dM -E -x c /dev/null | \
350350
grep -E -vw '__GNUC_(MINOR_|PATCHLEVEL_)?_' | \
351351
sed -e "s/^\#define /-D'/" -e "s/ /'='/" -e "s/$$/'/" -e 's/\$$/&&/g')
352352
endif

0 commit comments

Comments
 (0)