History

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

Pull Kbuild updates from Masahiro Yamada: "Build system: - add CONFIG_UNUSED_KSYMS_WHITELIST, which will be useful to define a fixed set of export symbols for Generic Kernel Image (GKI) - allow to run 'make dt_binding_check' without .config - use full schema for checking DT examples in *.yaml files - make modpost fail for missing MODULE_IMPORT_NS(), which makes more sense because we know the produced modules are never loadable - Remove unused 'AS' variable Kconfig: - sanitize DEFCONFIG_LIST, and remove ARCH_DEFCONFIG from Kconfig files - relax the 'imply' behavior so that symbols implied by 'y' can become 'm' - make 'imply' obey 'depends on' in order to make 'imply' really weak Misc: - add documentation on building the kernel with Clang/LLVM - revive __HAVE_ARCH_STRLEN for 32bit sparc to use optimized strlen() - fix warning from deb-pkg builds when CONFIG_DEBUG_INFO=n - various script and Makefile cleanups" * tag 'kbuild-v5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (34 commits) Makefile: Update kselftest help information kbuild: deb-pkg: fix warning when CONFIG_DEBUG_INFO is unset kbuild: add outputmakefile to no-dot-config-targets kbuild: remove AS variable net: wan: wanxl: refactor the firmware rebuild rule net: wan: wanxl: use $(M68KCC) instead of $(M68KAS) for rebuilding firmware net: wan: wanxl: use allow to pass CROSS_COMPILE_M68k for rebuilding firmware kbuild: add comment about grouped target kbuild: add -Wall to KBUILD_HOSTCXXFLAGS kconfig: remove unused variable in qconf.cc sparc: revive __HAVE_ARCH_STRLEN for 32bit sparc kbuild: refactor Makefile.dtbinst more kbuild: compute the dtbs_install destination more simply Makefile: disallow data races on gcc-10 as well kconfig: make 'imply' obey the direct dependency kconfig: allow symbols implied by y to become m net: drop_monitor: use IS_REACHABLE() to guard net_dm_hw_report() modpost: return error if module is missing ns imports and MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS=n modpost: rework and consolidate logging interface kbuild: allow to run dt_binding_check without kernel configuration ...

Linus Torvalds committed 6 years ago

Commit 5b67fbf2 parents a162984 e51d8da35 files · +356 −200Browse files

Unified · Split

35 files
  1. Documentation/Makefile +2 −1
  2. Documentation/devicetree/bindings/.gitignore +1 −1
  3. Documentation/devicetree/bindings/Makefile +20 −12
  4. Documentation/devicetree/writing-schema.rst +4 −0
  5. Documentation/kbuild/index.rst +1 −0
  6. Documentation/kbuild/kconfig-language.rst +24 −3
  7. Documentation/kbuild/llvm.rst +80 −0
  8. MAINTAINERS +1 −0
  9. Makefile +37 −18
  10. arch/sh/Kconfig +0 −5
  11. arch/sparc/Kconfig +0 −5
  12. arch/sparc/include/asm/string.h +4 −0
  13. arch/sparc/include/asm/string_64.h +0 −4
  14. arch/x86/Kconfig +0 −5
  15. arch/x86/um/Kconfig +0 −5
  16. drivers/net/wan/Kconfig +1 −1
  17. drivers/net/wan/Makefile +22 −13
  18. include/net/drop_monitor.h +1 −1
  19. init/Kconfig +14 −2
  20. lib/Kconfig.debug +1 −2
  21. scripts/Makefile.dtbinst +11 −15
  22. scripts/Makefile.lib +2 −1
  23. scripts/Makefile.modpost +8 −7
  24. scripts/adjust_autoksyms.sh +4 −20
  25. scripts/basic/fixdep.c +2 −8
  26. scripts/dtc/Makefile +3 −2
  27. scripts/gcc-plugins/Makefile +1 −1
  28. scripts/gen_autoksyms.sh +52 −0
  29. scripts/kconfig/Makefile +0 −4
  30. scripts/kconfig/qconf.cc +0 −2
  31. scripts/kconfig/symbol.c +4 −5
  32. scripts/mkcompile_h +0 −11
  33. scripts/mod/modpost.c +40 −43
  34. scripts/mod/modpost.h +11 −3
  35. scripts/package/mkdebian +5 −0
Documentation/Makefile+2−1
@@ -2,7 +2,8 @@ · 1 unmodified line
2# Makefile for Sphinx documentation2# Makefile for Sphinx documentation
3#3#
4 4
5subdir-y := devicetree/bindings/5# for cleaning
6subdir- := devicetree/bindings
6 7
7# Check for broken documentation file references8# Check for broken documentation file references
8ifeq ($(CONFIG_WARN_MISSING_DOCUMENTS),y)9ifeq ($(CONFIG_WARN_MISSING_DOCUMENTS),y)
Documentation/devicetree/bindings/.gitignore+1−1
@@ -1,2 +1,2 @@
1*.example.dts1*.example.dts
2processed-schema.yaml2processed-schema*.yaml
Documentation/devicetree/bindings/Makefile+20−12
@@ -2,7 +2,6 @@ · 1 unmodified line
2DT_DOC_CHECKER ?= dt-doc-validate2DT_DOC_CHECKER ?= dt-doc-validate
3DT_EXTRACT_EX ?= dt-extract-example3DT_EXTRACT_EX ?= dt-extract-example
4DT_MK_SCHEMA ?= dt-mk-schema4DT_MK_SCHEMA ?= dt-mk-schema
5DT_MK_SCHEMA_FLAGS := $(if $(DT_SCHEMA_FILES), -u)
6 5
7quiet_cmd_chk_binding = CHKDT $(patsubst $(srctree)/%,%,$<)6quiet_cmd_chk_binding = CHKDT $(patsubst $(srctree)/%,%,$<)
8 cmd_chk_binding = $(DT_DOC_CHECKER) -u $(srctree)/$(src) $< ; \7 cmd_chk_binding = $(DT_DOC_CHECKER) -u $(srctree)/$(src) $< ; \
@@ -11,26 +10,35 @@ quiet_cmd_chk_binding = CHKDT $(patsubst $(srctree)/%,%,$<) · 2 unmodified lines
11$(obj)/%.example.dts: $(src)/%.yaml FORCE10$(obj)/%.example.dts: $(src)/%.yaml FORCE
12 $(call if_changed,chk_binding)11 $(call if_changed,chk_binding)
13 12
14DT_TMP_SCHEMA := processed-schema.yaml13# Use full schemas when checking %.example.dts
14DT_TMP_SCHEMA := $(obj)/processed-schema-examples.yaml
15 15
16quiet_cmd_mk_schema = SCHEMA $@16quiet_cmd_mk_schema = SCHEMA $@
17 cmd_mk_schema = $(DT_MK_SCHEMA) $(DT_MK_SCHEMA_FLAGS) -o $@ $(real-prereqs)17 cmd_mk_schema = $(DT_MK_SCHEMA) $(DT_MK_SCHEMA_FLAGS) -o $@ $(real-prereqs)
18 18
19DT_DOCS = $(shell \19DT_DOCS = $(addprefix $(src)/, \
20 $(shell \
20 cd $(srctree)/$(src) && \21 cd $(srctree)/$(src) && \
21 find * \( -name '*.yaml' ! \22 find * \( -name '*.yaml' ! \
22 -name $(DT_TMP_SCHEMA) ! \23 -name 'processed-schema*' ! \
23 -name '*.example.dt.yaml' \) \24 -name '*.example.dt.yaml' \) \
24 )25 ))
25 26
26DT_SCHEMA_FILES ?= $(addprefix $(src)/,$(DT_DOCS))27DT_SCHEMA_FILES ?= $(DT_DOCS)
27 28
28ifeq ($(CHECK_DTBS),)29extra-$(CHECK_DT_BINDING) += $(patsubst $(src)/%.yaml,%.example.dts, $(DT_SCHEMA_FILES))
29extra-y += $(patsubst $(src)/%.yaml,%.example.dts, $(DT_SCHEMA_FILES))30extra-$(CHECK_DT_BINDING) += $(patsubst $(src)/%.yaml,%.example.dt.yaml, $(DT_SCHEMA_FILES))
30extra-y += $(patsubst $(src)/%.yaml,%.example.dt.yaml, $(DT_SCHEMA_FILES))31extra-$(CHECK_DT_BINDING) += processed-schema-examples.yaml
31endif
32 32
33$(obj)/$(DT_TMP_SCHEMA): $(DT_SCHEMA_FILES) FORCE33override DTC_FLAGS := \
34 -Wno-avoid_unnecessary_addr_size \
35 -Wno-graph_child_address
36
37$(obj)/processed-schema-examples.yaml: $(DT_DOCS) FORCE
38 $(call if_changed,mk_schema)
39
40$(obj)/processed-schema.yaml: DT_MK_SCHEMA_FLAGS := -u
41$(obj)/processed-schema.yaml: $(DT_SCHEMA_FILES) FORCE
34 $(call if_changed,mk_schema)42 $(call if_changed,mk_schema)
35 43
36extra-y += $(DT_TMP_SCHEMA)44extra-y += processed-schema.yaml
Documentation/devicetree/writing-schema.rst+4−0
@@ -147,6 +147,10 @@ Note that ``dtbs_check`` will skip any binding schema files with errors. It is · 146 unmodified lines
147necessary to use ``dt_binding_check`` to get all the validation errors in the147necessary to use ``dt_binding_check`` to get all the validation errors in the
148binding schema files.148binding schema files.
149 149
150It is possible to run both in a single command::
151
152 make dt_binding_check dtbs_check
153
150It is also possible to run checks with a single schema file by setting the154It is also possible to run checks with a single schema file by setting the
151``DT_SCHEMA_FILES`` variable to a specific schema file.155``DT_SCHEMA_FILES`` variable to a specific schema file.
152 156
Documentation/kbuild/index.rst+1−0
@@ -20,6 +20,7 @@ Kernel Build System · 19 unmodified lines
20 issues20 issues
21 reproducible-builds21 reproducible-builds
22 gcc-plugins22 gcc-plugins
23 llvm
23 24
24.. only:: subproject and html25.. only:: subproject and html
25 26
Documentation/kbuild/kconfig-language.rst+24−3
@@ -159,11 +159,11 @@ applicable everywhere (see syntax). · 158 unmodified lines
159 Given the following example::159 Given the following example::
160 160
161 config FOO161 config FOO
162 tristate162 tristate "foo"
163 imply BAZ163 imply BAZ
164 164
165 config BAZ165 config BAZ
166 tristate166 tristate "baz"
167 depends on BAR167 depends on BAR
168 168
169 The following values are possible:169 The following values are possible:
@@ -173,7 +173,10 @@ applicable everywhere (see syntax). · 3 unmodified lines
173 === === ============= ==============173 === === ============= ==============
174 n y n N/m/y174 n y n N/m/y
175 m y m M/y/n175 m y m M/y/n
176 y y y Y/n176 y y y Y/m/n
177 n m n N/m
178 m m m M/n
179 y m n M/n
177 y n * N180 y n * N
178 === === ============= ==============181 === === ============= ==============
179 182
@@ -181,6 +184,24 @@ applicable everywhere (see syntax). · 1 unmodified line
181 ability to hook into a secondary subsystem while allowing the user to184 ability to hook into a secondary subsystem while allowing the user to
182 configure that subsystem out without also having to unset these drivers.185 configure that subsystem out without also having to unset these drivers.
183 186
187 Note: If the combination of FOO=y and BAR=m causes a link error,
188 you can guard the function call with IS_REACHABLE()::
189
190 foo_init()
191 {
192 if (IS_REACHABLE(CONFIG_BAZ))
193 baz_register(&foo);
194 ...
195 }
196
197 Note: If the feature provided by BAZ is highly desirable for FOO,
198 FOO should imply not only BAZ, but also its dependency BAR::
199
200 config FOO
201 tristate "foo"
202 imply BAR
203 imply BAZ
204
184- limiting menu display: "visible if" <expr>205- limiting menu display: "visible if" <expr>
185 206
186 This attribute is only applicable to menu blocks, if the condition is207 This attribute is only applicable to menu blocks, if the condition is
Documentation/kbuild/llvm.rst+80−0
@@ -0,0 +1,80 @@
1==============================
2Building Linux with Clang/LLVM
3==============================
4
5This document covers how to build the Linux kernel with Clang and LLVM
6utilities.
7
8About
9-----
10
11The Linux kernel has always traditionally been compiled with GNU toolchains
12such as GCC and binutils. Ongoing work has allowed for `Clang
13<https://clang.llvm.org/>`_ and `LLVM <https://llvm.org/>`_ utilities to be
14used as viable substitutes. Distributions such as `Android
15<https://www.android.com/>`_, `ChromeOS
16<https://www.chromium.org/chromium-os>`_, and `OpenMandriva
17<https://www.openmandriva.org/>`_ use Clang built kernels. `LLVM is a
18collection of toolchain components implemented in terms of C++ objects
19<https://www.aosabook.org/en/llvm.html>`_. Clang is a front-end to LLVM that
20supports C and the GNU C extensions required by the kernel, and is pronounced
21"klang," not "see-lang."
22
23Clang
24-----
25
26The compiler used can be swapped out via `CC=` command line argument to `make`.
27`CC=` should be set when selecting a config and during a build.
28
29 make CC=clang defconfig
30
31 make CC=clang
32
33Cross Compiling
34---------------
35
36A single Clang compiler binary will typically contain all supported backends,
37which can help simplify cross compiling.
38
39 ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make CC=clang
40
41`CROSS_COMPILE` is not used to prefix the Clang compiler binary, instead
42`CROSS_COMPILE` is used to set a command line flag: `--target <triple>`. For
43example:
44
45 clang --target aarch64-linux-gnu foo.c
46
47LLVM Utilities
48--------------
49
50LLVM has substitutes for GNU binutils utilities. These can be invoked as
51additional parameters to `make`.
52
53 make CC=clang AS=clang LD=ld.lld AR=llvm-ar NM=llvm-nm STRIP=llvm-strip \\
54 OBJCOPY=llvm-objcopy OBJDUMP=llvm-objdump OBJSIZE=llvm-objsize \\
55 READELF=llvm-readelf HOSTCC=clang HOSTCXX=clang++ HOSTAR=llvm-ar \\
56 HOSTLD=ld.lld
57
58Getting Help
59------------
60
61- `Website <https://clangbuiltlinux.github.io/>`_
62- `Mailing List <https://groups.google.com/forum/#!forum/clang-built-linux>`_: <clang-built-linux@googlegroups.com>
63- `Issue Tracker <https://github.com/ClangBuiltLinux/linux/issues>`_
64- IRC: #clangbuiltlinux on chat.freenode.net
65- `Telegram <https://t.me/ClangBuiltLinux>`_: @ClangBuiltLinux
66- `Wiki <https://github.com/ClangBuiltLinux/linux/wiki>`_
67- `Beginner Bugs <https://github.com/ClangBuiltLinux/linux/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22>`_
68
69Getting LLVM
70-------------
71
72- http://releases.llvm.org/download.html
73- https://github.com/llvm/llvm-project
74- https://llvm.org/docs/GettingStarted.html
75- https://llvm.org/docs/CMake.html
76- https://apt.llvm.org/
77- https://www.archlinux.org/packages/extra/x86_64/llvm/
78- https://github.com/ClangBuiltLinux/tc-build
79- https://github.com/ClangBuiltLinux/linux/wiki/Building-Clang-from-source
80- https://android.googlesource.com/platform/prebuilts/clang/host/linux-x86/
MAINTAINERS+1−0
@@ -4139,6 +4139,7 @@ B: https://github.com/ClangBuiltLinux/linux/issues · 4138 unmodified lines
4139C: irc://chat.freenode.net/clangbuiltlinux4139C: irc://chat.freenode.net/clangbuiltlinux
4140S: Supported4140S: Supported
4141K: \b(?i:clang|llvm)\b4141K: \b(?i:clang|llvm)\b
4142F: Documentation/kbuild/llvm.rst
4142 4143
4143CLEANCACHE API4144CLEANCACHE API
4144M: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>4145M: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Makefile+37−18
@@ -255,7 +255,8 @@ clean-targets := %clean mrproper cleandocs · 254 unmodified lines
255no-dot-config-targets := $(clean-targets) \255no-dot-config-targets := $(clean-targets) \
256 cscope gtags TAGS tags help% %docs check% coccicheck \256 cscope gtags TAGS tags help% %docs check% coccicheck \
257 $(version_h) headers headers_% archheaders archscripts \257 $(version_h) headers headers_% archheaders archscripts \
258 %asm-generic kernelversion %src-pkg258 %asm-generic kernelversion %src-pkg dt_binding_check \
259 outputmakefile
259no-sync-config-targets := $(no-dot-config-targets) install %install \260no-sync-config-targets := $(no-dot-config-targets) install %install \
260 kernelrelease261 kernelrelease
261single-targets := %.a %.i %.ko %.lds %.ll %.lst %.mod %.o %.s %.symtypes %/262single-targets := %.a %.i %.ko %.lds %.ll %.lst %.mod %.o %.s %.symtypes %/
@@ -388,6 +389,9 @@ endif · 126 unmodified lines
388KCONFIG_CONFIG ?= .config389KCONFIG_CONFIG ?= .config
389export KCONFIG_CONFIG390export KCONFIG_CONFIG
390 391
392# Default file for 'make defconfig'. This may be overridden by arch-Makefile.
393export KBUILD_DEFCONFIG := defconfig
394
391# SHELL used by kbuild395# SHELL used by kbuild
392CONFIG_SHELL := sh396CONFIG_SHELL := sh
393 397
@@ -400,12 +404,11 @@ HOSTCXX = g++ · 6 unmodified lines
400KBUILD_HOSTCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 \404KBUILD_HOSTCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 \
401 -fomit-frame-pointer -std=gnu89 $(HOST_LFS_CFLAGS) \405 -fomit-frame-pointer -std=gnu89 $(HOST_LFS_CFLAGS) \
402 $(HOSTCFLAGS)406 $(HOSTCFLAGS)
403KBUILD_HOSTCXXFLAGS := -O2 $(HOST_LFS_CFLAGS) $(HOSTCXXFLAGS)407KBUILD_HOSTCXXFLAGS := -Wall -O2 $(HOST_LFS_CFLAGS) $(HOSTCXXFLAGS)
404KBUILD_HOSTLDFLAGS := $(HOST_LFS_LDFLAGS) $(HOSTLDFLAGS)408KBUILD_HOSTLDFLAGS := $(HOST_LFS_LDFLAGS) $(HOSTLDFLAGS)
405KBUILD_HOSTLDLIBS := $(HOST_LFS_LIBS) $(HOSTLDLIBS)409KBUILD_HOSTLDLIBS := $(HOST_LFS_LIBS) $(HOSTLDLIBS)
406 410
407# Make variables (CC, etc...)411# Make variables (CC, etc...)
408AS = $(CROSS_COMPILE)as
409LD = $(CROSS_COMPILE)ld412LD = $(CROSS_COMPILE)ld
410CC = $(CROSS_COMPILE)gcc413CC = $(CROSS_COMPILE)gcc
411CPP = $(CC) -E414CPP = $(CC) -E
@@ -472,7 +475,7 @@ KBUILD_LDFLAGS := · 60 unmodified lines
472GCC_PLUGINS_CFLAGS :=475GCC_PLUGINS_CFLAGS :=
473CLANG_FLAGS :=476CLANG_FLAGS :=
474 477
475export ARCH SRCARCH CONFIG_SHELL BASH HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE AS LD CC478export ARCH SRCARCH CONFIG_SHELL BASH HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE LD CC
476export CPP AR NM STRIP OBJCOPY OBJDUMP OBJSIZE READELF PAHOLE LEX YACC AWK INSTALLKERNEL479export CPP AR NM STRIP OBJCOPY OBJDUMP OBJSIZE READELF PAHOLE LEX YACC AWK INSTALLKERNEL
477export PERL PYTHON PYTHON3 CHECK CHECKFLAGS MAKE UTS_MACHINE HOSTCXX480export PERL PYTHON PYTHON3 CHECK CHECKFLAGS MAKE UTS_MACHINE HOSTCXX
478export KBUILD_HOSTCXXFLAGS KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS LDFLAGS_MODULE481export KBUILD_HOSTCXXFLAGS KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS LDFLAGS_MODULE
@@ -535,7 +538,7 @@ endif · 56 unmodified lines
535ifneq ($(GCC_TOOLCHAIN),)538ifneq ($(GCC_TOOLCHAIN),)
536CLANG_FLAGS += --gcc-toolchain=$(GCC_TOOLCHAIN)539CLANG_FLAGS += --gcc-toolchain=$(GCC_TOOLCHAIN)
537endif540endif
538ifeq ($(shell $(AS) --version 2>&1 | head -n 1 | grep clang),)541ifeq ($(if $(AS),$(shell $(AS) --version 2>&1 | head -n 1 | grep clang)),)
539CLANG_FLAGS += -no-integrated-as542CLANG_FLAGS += -no-integrated-as
540endif543endif
541CLANG_FLAGS += -Werror=unknown-warning-option544CLANG_FLAGS += -Werror=unknown-warning-option
@@ -674,6 +677,7 @@ $(KCONFIG_CONFIG): · 132 unmodified lines
674#677#
675# This exploits the 'multi-target pattern rule' trick.678# This exploits the 'multi-target pattern rule' trick.
676# The syncconfig should be executed only once to make all the targets.679# The syncconfig should be executed only once to make all the targets.
680# (Note: use the grouped target '&:' when we bump to GNU Make 4.3)
677%/auto.conf %/auto.conf.cmd: $(KCONFIG_CONFIG)681%/auto.conf %/auto.conf.cmd: $(KCONFIG_CONFIG)
678 $(Q)$(MAKE) -f $(srctree)/Makefile syncconfig682 $(Q)$(MAKE) -f $(srctree)/Makefile syncconfig
679else # !may-sync-config683else # !may-sync-config
@@ -714,6 +718,7 @@ endif · 34 unmodified lines
714 718
715# Tell gcc to never replace conditional load with a non-conditional one719# Tell gcc to never replace conditional load with a non-conditional one
716KBUILD_CFLAGS += $(call cc-option,--param=allow-store-data-races=0)720KBUILD_CFLAGS += $(call cc-option,--param=allow-store-data-races=0)
721KBUILD_CFLAGS += $(call cc-option,-fno-allow-store-data-races)
717 722
718include scripts/Makefile.kcov723include scripts/Makefile.kcov
719include scripts/Makefile.gcc-plugins724include scripts/Makefile.gcc-plugins
@@ -729,7 +734,7 @@ KBUILD_CFLAGS += $(call cc-option,-fno-reorder-blocks,) \ · 9 unmodified lines
729endif734endif
730 735
731ifneq ($(CONFIG_FRAME_WARN),0)736ifneq ($(CONFIG_FRAME_WARN),0)
732KBUILD_CFLAGS += $(call cc-option,-Wframe-larger-than=${CONFIG_FRAME_WARN})737KBUILD_CFLAGS += -Wframe-larger-than=$(CONFIG_FRAME_WARN)
733endif738endif
734 739
735stackp-flags-$(CONFIG_CC_HAS_STACKPROTECTOR_NONE) := -fno-stack-protector740stackp-flags-$(CONFIG_CC_HAS_STACKPROTECTOR_NONE) := -fno-stack-protector
@@ -1063,9 +1068,12 @@ endif · 327 unmodified lines
1063 1068
1064autoksyms_h := $(if $(CONFIG_TRIM_UNUSED_KSYMS), include/generated/autoksyms.h)1069autoksyms_h := $(if $(CONFIG_TRIM_UNUSED_KSYMS), include/generated/autoksyms.h)
1065 1070
1071quiet_cmd_autoksyms_h = GEN $@
1072 cmd_autoksyms_h = mkdir -p $(dir $@); \
1073 $(CONFIG_SHELL) $(srctree)/scripts/gen_autoksyms.sh $@
1074
1066$(autoksyms_h):1075$(autoksyms_h):
1067 $(Q)mkdir -p $(dir $@)1076 $(call cmd,autoksyms_h)
1068 $(Q)touch $@
1069 1077
1070ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(SRCARCH)/Makefile.postlink)1078ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(SRCARCH)/Makefile.postlink)
1071 1079
@@ -1240,14 +1248,18 @@ ifneq ($(dtstree),) · 168 unmodified lines
1240 $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@1248 $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@
1241 1249
1242PHONY += dtbs dtbs_install dtbs_check1250PHONY += dtbs dtbs_install dtbs_check
1243dtbs dtbs_check: include/config/kernel.release scripts_dtc1251dtbs: include/config/kernel.release scripts_dtc
1244 $(Q)$(MAKE) $(build)=$(dtstree)1252 $(Q)$(MAKE) $(build)=$(dtstree)
1245 1253
1246dtbs_check: export CHECK_DTBS=11254ifneq ($(filter dtbs_check, $(MAKECMDGOALS)),)
1247dtbs_check: dt_binding_check1255export CHECK_DTBS=y
1256dtbs: dt_binding_check
1257endif
1258
1259dtbs_check: dtbs
1248 1260
1249dtbs_install:1261dtbs_install:
1250 $(Q)$(MAKE) $(dtbinst)=$(dtstree)1262 $(Q)$(MAKE) $(dtbinst)=$(dtstree) dst=$(INSTALL_DTBS_PATH)
1251 1263
1252ifdef CONFIG_OF_EARLY_FLATTREE1264ifdef CONFIG_OF_EARLY_FLATTREE
1253all: dtbs1265all: dtbs
@@ -1259,6 +1271,10 @@ PHONY += scripts_dtc · 5 unmodified lines
1259scripts_dtc: scripts_basic1271scripts_dtc: scripts_basic
1260 $(Q)$(MAKE) $(build)=scripts/dtc1272 $(Q)$(MAKE) $(build)=scripts/dtc
1261 1273
1274ifneq ($(filter dt_binding_check, $(MAKECMDGOALS)),)
1275export CHECK_DT_BINDING=y
1276endif
1277
1262PHONY += dt_binding_check1278PHONY += dt_binding_check
1263dt_binding_check: scripts_dtc1279dt_binding_check: scripts_dtc
1264 $(Q)$(MAKE) $(build)=Documentation/devicetree/bindings1280 $(Q)$(MAKE) $(build)=Documentation/devicetree/bindings
@@ -1470,12 +1486,15 @@ help: · 205 unmodified lines
1470 @echo ' nsdeps - Generate missing symbol namespace dependencies'1486 @echo ' nsdeps - Generate missing symbol namespace dependencies'
1471 @echo ''1487 @echo ''
1472 @echo 'Kernel selftest:'1488 @echo 'Kernel selftest:'
1473 @echo ' kselftest - Build and run kernel selftest (run as root)'1489 @echo ' kselftest - Build and run kernel selftest'
1474 @echo ' Build, install, and boot kernel before'1490 @echo ' Build, install, and boot kernel before'
1475 @echo ' running kselftest on it'1491 @echo ' running kselftest on it'
1476 @echo ' kselftest-clean - Remove all generated kselftest files'1492 @echo ' Run as root for full coverage'
1477 @echo ' kselftest-merge - Merge all the config dependencies of kselftest to existing'1493 @echo ' kselftest-all - Build kernel selftest'
1478 @echo ' .config.'1494 @echo ' kselftest-install - Build and install kernel selftest'
1495 @echo ' kselftest-clean - Remove all generated kselftest files'
1496 @echo ' kselftest-merge - Merge all the config dependencies of'
1497 @echo ' kselftest to existing .config.'
1479 @echo ''1498 @echo ''
1480 @$(if $(dtstree), \1499 @$(if $(dtstree), \
1481 echo 'Devicetree:'; \1500 echo 'Devicetree:'; \
arch/sh/Kconfig+0−5
@@ -87,11 +87,6 @@ config SUPERH64 · 86 unmodified lines
87 select HAVE_EXIT_THREAD87 select HAVE_EXIT_THREAD
88 select KALLSYMS88 select KALLSYMS
89 89
90config ARCH_DEFCONFIG
91 string
92 default "arch/sh/configs/shx3_defconfig" if SUPERH32
93 default "arch/sh/configs/cayman_defconfig" if SUPERH64
94
95config GENERIC_BUG90config GENERIC_BUG
96 def_bool y91 def_bool y
97 depends on BUG && SUPERH3292 depends on BUG && SUPERH32
arch/sparc/Kconfig+0−5
@@ -96,11 +96,6 @@ config SPARC64 · 95 unmodified lines
96 select PCI_DOMAINS if PCI96 select PCI_DOMAINS if PCI
97 select ARCH_HAS_GIGANTIC_PAGE97 select ARCH_HAS_GIGANTIC_PAGE
98 98
99config ARCH_DEFCONFIG
100 string
101 default "arch/sparc/configs/sparc32_defconfig" if SPARC32
102 default "arch/sparc/configs/sparc64_defconfig" if SPARC64
103
104config ARCH_PROC_KCORE_TEXT99config ARCH_PROC_KCORE_TEXT
105 def_bool y100 def_bool y
106 101
arch/sparc/include/asm/string.h+4−0
@@ -37,6 +37,10 @@ void *memmove(void *, const void *, __kernel_size_t); · 36 unmodified lines
37#define __HAVE_ARCH_MEMCMP37#define __HAVE_ARCH_MEMCMP
38int memcmp(const void *,const void *,__kernel_size_t);38int memcmp(const void *,const void *,__kernel_size_t);
39 39
40/* Now the str*() stuff... */
41#define __HAVE_ARCH_STRLEN
42__kernel_size_t strlen(const char *);
43
40#define __HAVE_ARCH_STRNCMP44#define __HAVE_ARCH_STRNCMP
41int strncmp(const char *, const char *, __kernel_size_t);45int strncmp(const char *, const char *, __kernel_size_t);
42 46
arch/sparc/include/asm/string_64.h+0−4
@@ -12,8 +12,4 @@ · 11 unmodified lines
12 12
13#include <asm/asi.h>13#include <asm/asi.h>
14 14
15/* Now the str*() stuff... */
16#define __HAVE_ARCH_STRLEN
17__kernel_size_t strlen(const char *);
18
19#endif /* !(__SPARC64_STRING_H__) */15#endif /* !(__SPARC64_STRING_H__) */
arch/x86/Kconfig+0−5
@@ -240,11 +240,6 @@ config OUTPUT_FORMAT · 239 unmodified lines
240 default "elf32-i386" if X86_32240 default "elf32-i386" if X86_32
241 default "elf64-x86-64" if X86_64241 default "elf64-x86-64" if X86_64
242 242
243config ARCH_DEFCONFIG
244 string
245 default "arch/x86/configs/i386_defconfig" if X86_32
246 default "arch/x86/configs/x86_64_defconfig" if X86_64
247
248config LOCKDEP_SUPPORT243config LOCKDEP_SUPPORT
249 def_bool y244 def_bool y
250 245
arch/x86/um/Kconfig+0−5
@@ -27,11 +27,6 @@ config X86_64 · 26 unmodified lines
27 def_bool 64BIT27 def_bool 64BIT
28 select MODULES_USE_ELF_RELA28 select MODULES_USE_ELF_RELA
29 29
30config ARCH_DEFCONFIG
31 string
32 default "arch/um/configs/i386_defconfig" if X86_32
33 default "arch/um/configs/x86_64_defconfig" if X86_64
34
35config 3_LEVEL_PGTABLES30config 3_LEVEL_PGTABLES
36 bool "Three-level pagetables" if !64BIT31 bool "Three-level pagetables" if !64BIT
37 default 64BIT32 default 64BIT
drivers/net/wan/Kconfig+1−1
@@ -200,7 +200,7 @@ config WANXL_BUILD_FIRMWARE · 199 unmodified lines
200 depends on WANXL && !PREVENT_FIRMWARE_BUILD200 depends on WANXL && !PREVENT_FIRMWARE_BUILD
201 help201 help
202 Allows you to rebuild firmware run by the QUICC processor.202 Allows you to rebuild firmware run by the QUICC processor.
203 It requires as68k, ld68k and hexdump programs.203 It requires m68k toolchains and hexdump programs.
204 204
205 You should never need this option, say N.205 You should never need this option, say N.
206 206
drivers/net/wan/Makefile+22−13
@@ -40,21 +40,30 @@ $(obj)/wanxl.o: $(obj)/wanxlfw.inc · 39 unmodified lines
40 40
41ifeq ($(CONFIG_WANXL_BUILD_FIRMWARE),y)41ifeq ($(CONFIG_WANXL_BUILD_FIRMWARE),y)
42ifeq ($(ARCH),m68k)42ifeq ($(ARCH),m68k)
43 AS68K = $(AS)43 M68KCC = $(CC)
44 LD68K = $(LD)44 M68KLD = $(LD)
45else45else
46 AS68K = as68k46 M68KCC = $(CROSS_COMPILE_M68K)gcc
47 LD68K = ld68k47 M68KLD = $(CROSS_COMPILE_M68K)ld
48endif48endif
49 49
50quiet_cmd_build_wanxlfw = BLD FW $@50quiet_cmd_build_wanxlfw = BLDFW $@
51 cmd_build_wanxlfw = \51 cmd_build_wanxlfw = hexdump -ve '"\n" 16/1 "0x%02X,"' $< | \
52 $(CPP) -D__ASSEMBLY__ -Wp,-MD,$(depfile) -I$(srctree)/include/uapi $< | $(AS68K) -m68360 -o $(obj)/wanxlfw.o; \52 sed 's/0x ,//g;1s/^/static const u8 firmware[]={/;$$s/,$$/\n};\n/' > $@
53 $(LD68K) --oformat binary -Ttext 0x1000 $(obj)/wanxlfw.o -o $(obj)/wanxlfw.bin; \
54 hexdump -ve '"\n" 16/1 "0x%02X,"' $(obj)/wanxlfw.bin | sed 's/0x ,//g;1s/^/static const u8 firmware[]={/;$$s/,$$/\n};\n/' >$(obj)/wanxlfw.inc; \
55 rm -f $(obj)/wanxlfw.bin $(obj)/wanxlfw.o
56 53
57$(obj)/wanxlfw.inc: $(src)/wanxlfw.S54$(obj)/wanxlfw.inc: $(obj)/wanxlfw.bin FORCE
58 $(call if_changed_dep,build_wanxlfw)55 $(call if_changed,build_wanxlfw)
59targets += wanxlfw.inc56
57quiet_cmd_m68kld_bin_o = M68KLD $@
58 cmd_m68kld_bin_o = $(M68KLD) --oformat binary -Ttext 0x1000 $< -o $@
59
60$(obj)/wanxlfw.bin: $(obj)/wanxlfw.o FORCE
61 $(call if_changed,m68kld_bin_o)
62
63quiet_cmd_m68kas_o_S = M68KAS $@
64 cmd_m68kas_o_S = $(M68KCC) -D__ASSEMBLY__ -Wp,-MD,$(depfile) -I$(srctree)/include/uapi -c -o $@ $<
65
66$(obj)/wanxlfw.o: $(src)/wanxlfw.S FORCE
67 $(call if_changed_dep,m68kas_o_S)
60endif68endif
69targets += wanxlfw.inc wanxlfw.bin wanxlfw.o
include/net/drop_monitor.h+1−1
@@ -19,7 +19,7 @@ struct net_dm_hw_metadata { · 18 unmodified lines
19 struct net_device *input_dev;19 struct net_device *input_dev;
20};20};
21 21
22#if IS_ENABLED(CONFIG_NET_DROP_MONITOR)22#if IS_REACHABLE(CONFIG_NET_DROP_MONITOR)
23void net_dm_hw_report(struct sk_buff *skb,23void net_dm_hw_report(struct sk_buff *skb,
24 const struct net_dm_hw_metadata *hw_metadata);24 const struct net_dm_hw_metadata *hw_metadata);
25#else25#else
init/Kconfig+14−2
@@ -6,8 +6,7 @@ config DEFCONFIG_LIST · 5 unmodified lines
6 default "/lib/modules/$(shell,uname -r)/.config"6 default "/lib/modules/$(shell,uname -r)/.config"
7 default "/etc/kernel-config"7 default "/etc/kernel-config"
8 default "/boot/config-$(shell,uname -r)"8 default "/boot/config-$(shell,uname -r)"
9 default ARCH_DEFCONFIG9 default "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)"
10 default "arch/$(ARCH)/defconfig"
11 10
12config CC_IS_GCC11config CC_IS_GCC
13 def_bool $(success,$(CC) --version | head -n 1 | grep -q gcc)12 def_bool $(success,$(CC) --version | head -n 1 | grep -q gcc)
@@ -2211,6 +2210,19 @@ config TRIM_UNUSED_KSYMS · 2197 unmodified lines
2211 2210
2212 If unsure, or if you need to build out-of-tree modules, say N.2211 If unsure, or if you need to build out-of-tree modules, say N.
2213 2212
2213config UNUSED_KSYMS_WHITELIST
2214 string "Whitelist of symbols to keep in ksymtab"
2215 depends on TRIM_UNUSED_KSYMS
2216 help
2217 By default, all unused exported symbols will be un-exported from the
2218 build when TRIM_UNUSED_KSYMS is selected.
2219
2220 UNUSED_KSYMS_WHITELIST allows to whitelist symbols that must be kept
2221 exported at all times, even in absence of in-tree users. The value to
2222 set here is the path to a text file containing the list of symbols,
2223 one per line. The path can be absolute, or relative to the kernel
2224 source tree.
2225
2214endif # MODULES2226endif # MODULES
2215 2227
2216config MODULES_TREE_LOOKUP2228config MODULES_TREE_LOOKUP
lib/Kconfig.debug+1−2
@@ -266,7 +266,7 @@ config ENABLE_MUST_CHECK · 265 unmodified lines
266 attribute warn_unused_result" messages.266 attribute warn_unused_result" messages.
267 267
268config FRAME_WARN268config FRAME_WARN
269 int "Warn for stack frames larger than (needs gcc 4.4)"269 int "Warn for stack frames larger than"
270 range 0 8192270 range 0 8192
271 default 2048 if GCC_PLUGIN_LATENT_ENTROPY271 default 2048 if GCC_PLUGIN_LATENT_ENTROPY
272 default 1280 if (!64BIT && PARISC)272 default 1280 if (!64BIT && PARISC)
@@ -276,7 +276,6 @@ config FRAME_WARN · 3 unmodified lines
276 Tell gcc to warn at build time for stack frames larger than this.276 Tell gcc to warn at build time for stack frames larger than this.
277 Setting this too low will cause a lot of warnings.277 Setting this too low will cause a lot of warnings.
278 Setting it to 0 disables the warning.278 Setting it to 0 disables the warning.
279 Requires gcc 4.4
280 279
281config STRIP_ASM_SYMS280config STRIP_ASM_SYMS
282 bool "Strip assembler-generated symbols during link"281 bool "Strip assembler-generated symbols during link"
scripts/Makefile.dtbinst+11−15
@@ -13,28 +13,24 @@ src := $(obj) · 12 unmodified lines
13PHONY := __dtbs_install13PHONY := __dtbs_install
14__dtbs_install:14__dtbs_install:
15 15
16export dtbinst_root ?= $(obj)
17
18include include/config/auto.conf16include include/config/auto.conf
19include scripts/Kbuild.include17include scripts/Kbuild.include
20include $(src)/Makefile18include $(src)/Makefile
21 19
22dtbinst-files := $(sort $(dtb-y) $(if $(CONFIG_OF_ALL_DTBS), $(dtb-)))20dtbs := $(addprefix $(dst)/, $(dtb-y) $(if $(CONFIG_OF_ALL_DTBS),$(dtb-)))
23dtbinst-dirs := $(subdir-y) $(subdir-m)21subdirs := $(addprefix $(obj)/, $(subdir-y) $(subdir-m))
24
25# Helper targets for Installing DTBs into the boot directory
26quiet_cmd_dtb_install = INSTALL $<
27 cmd_dtb_install = mkdir -p $(2); cp $< $(2)
28 22
29install-dir = $(patsubst $(dtbinst_root)%,$(INSTALL_DTBS_PATH)%,$(obj))23__dtbs_install: $(dtbs) $(subdirs)
24 @:
30 25
31$(dtbinst-files): %.dtb: $(obj)/%.dtb26quiet_cmd_dtb_install = INSTALL $@
32 $(call cmd,dtb_install,$(install-dir))27 cmd_dtb_install = install -D $< $@
33 28
34$(dtbinst-dirs):29$(dst)/%.dtb: $(obj)/%.dtb
35 $(Q)$(MAKE) $(dtbinst)=$(obj)/$@30 $(call cmd,dtb_install)
36 31
37PHONY += $(dtbinst-files) $(dtbinst-dirs)32PHONY += $(subdirs)
38__dtbs_install: $(dtbinst-files) $(dtbinst-dirs)33$(subdirs):
34 $(Q)$(MAKE) $(dtbinst)=$@ dst=$(patsubst $(obj)/%,$(dst)/%,$@)
39 35
40.PHONY: $(PHONY)36.PHONY: $(PHONY)
scripts/Makefile.lib+2−1
@@ -297,7 +297,8 @@ $(obj)/%.dtb: $(src)/%.dts $(DTC) FORCE · 296 unmodified lines
297 297
298DT_CHECKER ?= dt-validate298DT_CHECKER ?= dt-validate
299DT_BINDING_DIR := Documentation/devicetree/bindings299DT_BINDING_DIR := Documentation/devicetree/bindings
300DT_TMP_SCHEMA := $(objtree)/$(DT_BINDING_DIR)/processed-schema.yaml300# DT_TMP_SCHEMA may be overridden from Documentation/devicetree/bindings/Makefile
301DT_TMP_SCHEMA ?= $(objtree)/$(DT_BINDING_DIR)/processed-schema.yaml
301 302
302quiet_cmd_dtb_check = CHECK $@303quiet_cmd_dtb_check = CHECK $@
303 cmd_dtb_check = $(DT_CHECKER) -u $(srctree)/$(DT_BINDING_DIR) -p $(DT_TMP_SCHEMA) $@304 cmd_dtb_check = $(DT_CHECKER) -u $(srctree)/$(DT_BINDING_DIR) -p $(DT_TMP_SCHEMA) $@
scripts/Makefile.modpost+8−7
@@ -46,13 +46,14 @@ include scripts/Kbuild.include · 45 unmodified lines
46kernelsymfile := $(objtree)/Module.symvers46kernelsymfile := $(objtree)/Module.symvers
47modulesymfile := $(firstword $(KBUILD_EXTMOD))/Module.symvers47modulesymfile := $(firstword $(KBUILD_EXTMOD))/Module.symvers
48 48
49MODPOST = scripts/mod/modpost \49MODPOST = scripts/mod/modpost \
50 $(if $(CONFIG_MODVERSIONS),-m) \50 $(if $(CONFIG_MODVERSIONS),-m) \
51 $(if $(CONFIG_MODULE_SRCVERSION_ALL),-a) \51 $(if $(CONFIG_MODULE_SRCVERSION_ALL),-a) \
52 $(if $(KBUILD_EXTMOD),-i,-o) $(kernelsymfile) \52 $(if $(KBUILD_EXTMOD),-i,-o) $(kernelsymfile) \
53 $(if $(KBUILD_EXTMOD),$(addprefix -e ,$(KBUILD_EXTRA_SYMBOLS))) \53 $(if $(KBUILD_EXTMOD),$(addprefix -e ,$(KBUILD_EXTRA_SYMBOLS))) \
54 $(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \54 $(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \
55 $(if $(CONFIG_SECTION_MISMATCH_WARN_ONLY),,-E) \55 $(if $(CONFIG_SECTION_MISMATCH_WARN_ONLY),,-E) \
56 $(if $(CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS)$(KBUILD_NSDEPS),-N) \
56 $(if $(KBUILD_MODPOST_WARN),-w)57 $(if $(KBUILD_MODPOST_WARN),-w)
57 58
58ifdef MODPOST_VMLINUX59ifdef MODPOST_VMLINUX
scripts/adjust_autoksyms.sh+4−20
@@ -1,14 +1,13 @@
1#!/bin/sh1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0-only2# SPDX-License-Identifier: GPL-2.0-only
3 3
4# Script to create/update include/generated/autoksyms.h and dependency files4# Script to update include/generated/autoksyms.h and dependency files
5#5#
6# Copyright: (C) 2016 Linaro Limited6# Copyright: (C) 2016 Linaro Limited
7# Created by: Nicolas Pitre, January 20167# Created by: Nicolas Pitre, January 2016
8#8#
9 9
10# Create/update the include/generated/autoksyms.h file from the list10# Update the include/generated/autoksyms.h file.
11# of all module's needed symbols as recorded on the second line of *.mod files.
12#11#
13# For each symbol being added or removed, the corresponding dependency12# For each symbol being added or removed, the corresponding dependency
14# file's timestamp is updated to force a rebuild of the affected source13# file's timestamp is updated to force a rebuild of the affected source
@@ -38,23 +37,8 @@ esac · 23 unmodified lines
38# We need access to CONFIG_ symbols37# We need access to CONFIG_ symbols
39. include/config/auto.conf38. include/config/auto.conf
40 39
41# Generate a new ksym list file with symbols needed by the current40# Generate a new symbol list file
42# set of modules.41$CONFIG_SHELL $srctree/scripts/gen_autoksyms.sh "$new_ksyms_file"
43cat > "$new_ksyms_file" << EOT
44/*
45 * Automatically generated file; DO NOT EDIT.
46 */
47
48EOT
49sed 's/ko$/mod/' modules.order |
50xargs -n1 sed -n -e '2{s/ /\n/g;/^$/!p;}' -- |
51sort -u |
52sed -e 's/\(.*\)/#define __KSYM_\1 1/' >> "$new_ksyms_file"
53
54# Special case for modversions (see modpost.c)
55if [ -n "$CONFIG_MODVERSIONS" ]; then
56 echo "#define __KSYM_module_layout 1" >> "$new_ksyms_file"
57fi
58 42
59# Extract changes between old and new list and touch corresponding43# Extract changes between old and new list and touch corresponding
60# dependency files.44# dependency files.
scripts/basic/fixdep.c+2−8
@@ -77,11 +77,6 @@ · 76 unmodified lines
77 * dependencies on include/config/my/option.h for every77 * dependencies on include/config/my/option.h for every
78 * CONFIG_MY_OPTION encountered in any of the prerequisites.78 * CONFIG_MY_OPTION encountered in any of the prerequisites.
79 *79 *
80 * It will also filter out all the dependencies on *.ver. We need
81 * to make sure that the generated version checksum are globally up
82 * to date before even starting the recursive build, so it's too late
83 * at this point anyway.
84 *
85 * We don't even try to really parse the header files, but80 * We don't even try to really parse the header files, but
86 * merely grep, i.e. if CONFIG_FOO is mentioned in a comment, it will81 * merely grep, i.e. if CONFIG_FOO is mentioned in a comment, it will
87 * be picked up as well. It's not a problem with respect to82 * be picked up as well. It's not a problem with respect to
@@ -251,7 +246,7 @@ static void parse_config_file(const char *p) · 163 unmodified lines
251 }246 }
252 p += 7;247 p += 7;
253 q = p;248 q = p;
254 while (*q && (isalnum(*q) || *q == '_'))249 while (isalnum(*q) || *q == '_')
255 q++;250 q++;
256 if (str_ends_with(p, q - p, "_MODULE"))251 if (str_ends_with(p, q - p, "_MODULE"))
257 r = q - 7;252 r = q - 7;
@@ -299,8 +294,7 @@ static void *read_file(const char *filename) · 41 unmodified lines
299static int is_ignored_file(const char *s, int len)294static int is_ignored_file(const char *s, int len)
300{295{
301 return str_ends_with(s, len, "include/generated/autoconf.h") ||296 return str_ends_with(s, len, "include/generated/autoconf.h") ||
302 str_ends_with(s, len, "include/generated/autoksyms.h") ||297 str_ends_with(s, len, "include/generated/autoksyms.h");
303 str_ends_with(s, len, ".ver");
304}298}
305 299
306/*300/*
scripts/dtc/Makefile+3−2
@@ -1,8 +1,9 @@
1# SPDX-License-Identifier: GPL-2.01# SPDX-License-Identifier: GPL-2.0
2# scripts/dtc makefile2# scripts/dtc makefile
3 3
4hostprogs := dtc4hostprogs := dtc
5always-$(CONFIG_DTC) := $(hostprogs)5always-$(CONFIG_DTC) += $(hostprogs)
6always-$(CHECK_DT_BINDING) += $(hostprogs)
6 7
7dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o \8dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o \
8 srcpos.o checks.o util.o9 srcpos.o checks.o util.o
scripts/gcc-plugins/Makefile+1−1
@@ -10,7 +10,7 @@ else · 9 unmodified lines
10 HOSTLIBS := hostcxxlibs10 HOSTLIBS := hostcxxlibs
11 HOST_EXTRACXXFLAGS += -I$(GCC_PLUGINS_DIR)/include -I$(src) -std=gnu++98 -fno-rtti11 HOST_EXTRACXXFLAGS += -I$(GCC_PLUGINS_DIR)/include -I$(src) -std=gnu++98 -fno-rtti
12 HOST_EXTRACXXFLAGS += -fno-exceptions -fasynchronous-unwind-tables -ggdb12 HOST_EXTRACXXFLAGS += -fno-exceptions -fasynchronous-unwind-tables -ggdb
13 HOST_EXTRACXXFLAGS += -Wno-narrowing -Wno-unused-variable13 HOST_EXTRACXXFLAGS += -Wno-narrowing -Wno-unused-variable -Wno-c++11-compat
14 export HOST_EXTRACXXFLAGS14 export HOST_EXTRACXXFLAGS
15endif15endif
16 16
scripts/gen_autoksyms.sh+52−0
@@ -0,0 +1,52 @@
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0-only
3
4# Create an autoksyms.h header file from the list of all module's needed symbols
5# as recorded on the second line of *.mod files and the user-provided symbol
6# whitelist.
7
8set -e
9
10output_file="$1"
11
12# Use "make V=1" to debug this script.
13case "$KBUILD_VERBOSE" in
14*1*)
15 set -x
16 ;;
17esac
18
19# We need access to CONFIG_ symbols
20. include/config/auto.conf
21
22ksym_wl=/dev/null
23if [ -n "$CONFIG_UNUSED_KSYMS_WHITELIST" ]; then
24 # Use 'eval' to expand the whitelist path and check if it is relative
25 eval ksym_wl="$CONFIG_UNUSED_KSYMS_WHITELIST"
26 [ "${ksym_wl}" != "${ksym_wl#/}" ] || ksym_wl="$abs_srctree/$ksym_wl"
27 if [ ! -f "$ksym_wl" ] || [ ! -r "$ksym_wl" ]; then
28 echo "ERROR: '$ksym_wl' whitelist file not found" >&2
29 exit 1
30 fi
31fi
32
33# Generate a new ksym list file with symbols needed by the current
34# set of modules.
35cat > "$output_file" << EOT
36/*
37 * Automatically generated file; DO NOT EDIT.
38 */
39
40EOT
41
42[ -f modules.order ] && modlist=modules.order || modlist=/dev/null
43sed 's/ko$/mod/' $modlist |
44xargs -n1 sed -n -e '2{s/ /\n/g;/^$/!p;}' -- |
45cat - "$ksym_wl" |
46sort -u |
47sed -e 's/\(.*\)/#define __KSYM_\1 1/' >> "$output_file"
48
49# Special case for modversions (see modpost.c)
50if [ -n "$CONFIG_MODVERSIONS" ]; then
51 echo "#define __KSYM_module_layout 1" >> "$output_file"
52fi
scripts/kconfig/Makefile+0−4
@@ -12,10 +12,6 @@ else · 11 unmodified lines
12Kconfig := Kconfig12Kconfig := Kconfig
13endif13endif
14 14
15ifndef KBUILD_DEFCONFIG
16KBUILD_DEFCONFIG := defconfig
17endif
18
19ifeq ($(quiet),silent_)15ifeq ($(quiet),silent_)
20silent := -s16silent := -s
21endif17endif
scripts/kconfig/qconf.cc+0−2
@@ -309,8 +309,6 @@ ConfigList::ConfigList(ConfigView* p, const char *name) · 308 unmodified lines
309 showName(false), showRange(false), showData(false), mode(singleMode), optMode(normalOpt),309 showName(false), showRange(false), showData(false), mode(singleMode), optMode(normalOpt),
310 rootEntry(0), headerPopup(0)310 rootEntry(0), headerPopup(0)
311{311{
312 int i;
313
314 setObjectName(name);312 setObjectName(name);
315 setSortingEnabled(false);313 setSortingEnabled(false);
316 setRootIsDecorated(true);314 setRootIsDecorated(true);
scripts/kconfig/symbol.c+4−5
@@ -221,7 +221,7 @@ static void sym_calc_visibility(struct symbol *sym) · 220 unmodified lines
221 sym_set_changed(sym);221 sym_set_changed(sym);
222 }222 }
223 tri = no;223 tri = no;
224 if (sym->implied.expr && sym->dir_dep.tri != no)224 if (sym->implied.expr)
225 tri = expr_calc_value(sym->implied.expr);225 tri = expr_calc_value(sym->implied.expr);
226 if (tri == mod && sym_get_type(sym) == S_BOOLEAN)226 if (tri == mod && sym_get_type(sym) == S_BOOLEAN)
227 tri = yes;227 tri = yes;
@@ -394,6 +394,8 @@ void sym_calc_value(struct symbol *sym) · 166 unmodified lines
394 if (sym->implied.tri != no) {394 if (sym->implied.tri != no) {
395 sym->flags |= SYMBOL_WRITE;395 sym->flags |= SYMBOL_WRITE;
396 newval.tri = EXPR_OR(newval.tri, sym->implied.tri);396 newval.tri = EXPR_OR(newval.tri, sym->implied.tri);
397 newval.tri = EXPR_AND(newval.tri,
398 sym->dir_dep.tri);
397 }399 }
398 }400 }
399 calc_newval:401 calc_newval:
@@ -401,8 +403,7 @@ void sym_calc_value(struct symbol *sym) · 1 unmodified line
401 sym_warn_unmet_dep(sym);403 sym_warn_unmet_dep(sym);
402 newval.tri = EXPR_OR(newval.tri, sym->rev_dep.tri);404 newval.tri = EXPR_OR(newval.tri, sym->rev_dep.tri);
403 }405 }
404 if (newval.tri == mod &&406 if (newval.tri == mod && sym_get_type(sym) == S_BOOLEAN)
405 (sym_get_type(sym) == S_BOOLEAN || sym->implied.tri == yes))
406 newval.tri = yes;407 newval.tri = yes;
407 break;408 break;
408 case S_STRING:409 case S_STRING:
@@ -484,8 +485,6 @@ bool sym_tristate_within_range(struct symbol *sym, tristate val) · 75 unmodified lines
484 return false;485 return false;
485 if (sym->visible <= sym->rev_dep.tri)486 if (sym->visible <= sym->rev_dep.tri)
486 return false;487 return false;
487 if (sym->implied.tri == yes && val == mod)
488 return false;
489 if (sym_is_choice_value(sym) && sym->visible == yes)488 if (sym_is_choice_value(sym) && sym->visible == yes)
490 return val == yes;489 return val == yes;
491 return val >= sym->rev_dep.tri && val <= sym->visible;490 return val >= sym->rev_dep.tri && val <= sym->visible;
scripts/mkcompile_h+0−11
@@ -10,17 +10,6 @@ CC=$6 · 9 unmodified lines
10 10
11vecho() { [ "${quiet}" = "silent_" ] || echo "$@" ; }11vecho() { [ "${quiet}" = "silent_" ] || echo "$@" ; }
12 12
13# If compile.h exists already and we don't own autoconf.h
14# (i.e. we're not the same user who did make *config), don't
15# modify compile.h
16# So "sudo make install" won't change the "compiled by <user>"
17# do "compiled by root"
18
19if [ -r $TARGET -a ! -O include/generated/autoconf.h ]; then
20 vecho " SKIPPED $TARGET"
21 exit 0
22fi
23
24# Do not expand names13# Do not expand names
25set -f14set -f
26 15
scripts/mod/modpost.c+40−43
@@ -39,6 +39,8 @@ static int sec_mismatch_count = 0; · 38 unmodified lines
39static int sec_mismatch_fatal = 0;39static int sec_mismatch_fatal = 0;
40/* ignore missing files */40/* ignore missing files */
41static int ignore_missing_files;41static int ignore_missing_files;
42/* If set to 1, only warn (instead of error) about missing ns imports */
43static int allow_missing_ns_imports;
42 44
43enum export {45enum export {
44 export_plain, export_unused, export_gpl,46 export_plain, export_unused, export_gpl,
@@ -51,41 +53,33 @@ enum export { · 6 unmodified lines
51 53
52#define MODULE_NAME_LEN (64 - sizeof(Elf_Addr))54#define MODULE_NAME_LEN (64 - sizeof(Elf_Addr))
53 55
54#define PRINTF __attribute__ ((format (printf, 1, 2)))56void __attribute__((format(printf, 2, 3)))
55 57modpost_log(enum loglevel loglevel, const char *fmt, ...)
56PRINTF void fatal(const char *fmt, ...)
57{58{
58 va_list arglist;59 va_list arglist;
59 60
60 fprintf(stderr, "FATAL: ");61 switch (loglevel) {
61 62 case LOG_WARN:
62 va_start(arglist, fmt);63 fprintf(stderr, "WARNING: ");
63 vfprintf(stderr, fmt, arglist);64 break;
64 va_end(arglist);65 case LOG_ERROR:
65 66 fprintf(stderr, "ERROR: ");
66 exit(1);67 break;
67}68 case LOG_FATAL:
68 69 fprintf(stderr, "FATAL: ");
69PRINTF void warn(const char *fmt, ...)70 break;
70{71 default: /* invalid loglevel, ignore */
71 va_list arglist;72 break;
73 }
72 74
73 fprintf(stderr, "WARNING: ");75 fprintf(stderr, "modpost: ");
74 76
75 va_start(arglist, fmt);77 va_start(arglist, fmt);
76 vfprintf(stderr, fmt, arglist);78 vfprintf(stderr, fmt, arglist);
77 va_end(arglist);79 va_end(arglist);
78}
79
80PRINTF void merror(const char *fmt, ...)
81{
82 va_list arglist;
83 80
84 fprintf(stderr, "ERROR: ");81 if (loglevel == LOG_FATAL)
85 82 exit(1);
86 va_start(arglist, fmt);
87 vfprintf(stderr, fmt, arglist);
88 va_end(arglist);
89}83}
90 84
91static inline bool strends(const char *str, const char *postfix)85static inline bool strends(const char *str, const char *postfix)
@@ -113,7 +107,7 @@ static int is_vmlinux(const char *modname) · 21 unmodified lines
113void *do_nofail(void *ptr, const char *expr)107void *do_nofail(void *ptr, const char *expr)
114{108{
115 if (!ptr)109 if (!ptr)
116 fatal("modpost: Memory allocation failure: %s.\n", expr);110 fatal("Memory allocation failure: %s.\n", expr);
117 111
118 return ptr;112 return ptr;
119}113}
@@ -2022,7 +2016,7 @@ static void read_symbols(const char *modname) · 1902 unmodified lines
2022 2016
2023 license = get_modinfo(&info, "license");2017 license = get_modinfo(&info, "license");
2024 if (!license && !is_vmlinux(modname))2018 if (!license && !is_vmlinux(modname))
2025 warn("modpost: missing MODULE_LICENSE() in %s\n"2019 warn("missing MODULE_LICENSE() in %s\n"
2026 "see include/linux/module.h for "2020 "see include/linux/module.h for "
2027 "more information\n", modname);2021 "more information\n", modname);
2028 while (license) {2022 while (license) {
@@ -2153,15 +2147,15 @@ static void check_for_gpl_usage(enum export exp, const char *m, const char *s) · 124 unmodified lines
2153 2147
2154 switch (exp) {2148 switch (exp) {
2155 case export_gpl:2149 case export_gpl:
2156 fatal("modpost: GPL-incompatible module %s%s "2150 fatal("GPL-incompatible module %s%s "
2157 "uses GPL-only symbol '%s'\n", m, e, s);2151 "uses GPL-only symbol '%s'\n", m, e, s);
2158 break;2152 break;
2159 case export_unused_gpl:2153 case export_unused_gpl:
2160 fatal("modpost: GPL-incompatible module %s%s "2154 fatal("GPL-incompatible module %s%s "
2161 "uses GPL-only symbol marked UNUSED '%s'\n", m, e, s);2155 "uses GPL-only symbol marked UNUSED '%s'\n", m, e, s);
2162 break;2156 break;
2163 case export_gpl_future:2157 case export_gpl_future:
2164 warn("modpost: GPL-incompatible module %s%s "2158 warn("GPL-incompatible module %s%s "
2165 "uses future GPL-only symbol '%s'\n", m, e, s);2159 "uses future GPL-only symbol '%s'\n", m, e, s);
2166 break;2160 break;
2167 case export_plain:2161 case export_plain:
@@ -2179,7 +2173,7 @@ static void check_for_unused(enum export exp, const char *m, const char *s) · 11 unmodified lines
2179 switch (exp) {2173 switch (exp) {
2180 case export_unused:2174 case export_unused:
2181 case export_unused_gpl:2175 case export_unused_gpl:
2182 warn("modpost: module %s%s "2176 warn("module %s%s "
2183 "uses symbol '%s' marked UNUSED\n", m, e, s);2177 "uses symbol '%s' marked UNUSED\n", m, e, s);
2184 break;2178 break;
2185 default:2179 default:
@@ -2198,14 +2192,11 @@ static int check_exports(struct module *mod) · 12 unmodified lines
2198 exp = find_symbol(s->name);2192 exp = find_symbol(s->name);
2199 if (!exp || exp->module == mod) {2193 if (!exp || exp->module == mod) {
2200 if (have_vmlinux && !s->weak) {2194 if (have_vmlinux && !s->weak) {
2201 if (warn_unresolved) {2195 modpost_log(warn_unresolved ? LOG_WARN : LOG_ERROR,
2202 warn("\"%s\" [%s.ko] undefined!\n",2196 "\"%s\" [%s.ko] undefined!\n",
2203 s->name, mod->name);2197 s->name, mod->name);
2204 } else {2198 if (!warn_unresolved)
2205 merror("\"%s\" [%s.ko] undefined!\n",
2206 s->name, mod->name);
2207 err = 1;2199 err = 1;
2208 }
2209 }2200 }
2210 continue;2201 continue;
2211 }2202 }
@@ -2217,8 +2208,11 @@ static int check_exports(struct module *mod) · 5 unmodified lines
2217 2208
2218 if (exp->namespace &&2209 if (exp->namespace &&
2219 !module_imports_namespace(mod, exp->namespace)) {2210 !module_imports_namespace(mod, exp->namespace)) {
2220 warn("module %s uses symbol %s from namespace %s, but does not import it.\n",2211 modpost_log(allow_missing_ns_imports ? LOG_WARN : LOG_ERROR,
2221 basename, exp->name, exp->namespace);2212 "module %s uses symbol %s from namespace %s, but does not import it.\n",
2213 basename, exp->name, exp->namespace);
2214 if (!allow_missing_ns_imports)
2215 err = 1;
2222 add_namespace(&mod->missing_namespaces, exp->namespace);2216 add_namespace(&mod->missing_namespaces, exp->namespace);
2223 }2217 }
2224 2218
@@ -2565,7 +2559,7 @@ int main(int argc, char **argv) · 340 unmodified lines
2565 struct ext_sym_list *extsym_iter;2559 struct ext_sym_list *extsym_iter;
2566 struct ext_sym_list *extsym_start = NULL;2560 struct ext_sym_list *extsym_start = NULL;
2567 2561
2568 while ((opt = getopt(argc, argv, "i:e:mnsT:o:awEd:")) != -1) {2562 while ((opt = getopt(argc, argv, "i:e:mnsT:o:awENd:")) != -1) {
2569 switch (opt) {2563 switch (opt) {
2570 case 'i':2564 case 'i':
2571 kernel_read = optarg;2565 kernel_read = optarg;
@@ -2603,6 +2597,9 @@ int main(int argc, char **argv) · 31 unmodified lines
2603 case 'E':2597 case 'E':
2604 sec_mismatch_fatal = 1;2598 sec_mismatch_fatal = 1;
2605 break;2599 break;
2600 case 'N':
2601 allow_missing_ns_imports = 1;
2602 break;
2606 case 'd':2603 case 'd':
2607 missing_namespace_deps = optarg;2604 missing_namespace_deps = optarg;
2608 break;2605 break;
@@ -2658,7 +2655,7 @@ int main(int argc, char **argv) · 49 unmodified lines
2658 if (dump_write)2655 if (dump_write)
2659 write_dump(dump_write);2656 write_dump(dump_write);
2660 if (sec_mismatch_count && sec_mismatch_fatal)2657 if (sec_mismatch_count && sec_mismatch_fatal)
2661 fatal("modpost: Section mismatches detected.\n"2658 fatal("Section mismatches detected.\n"
2662 "Set CONFIG_SECTION_MISMATCH_WARN_ONLY=y to allow them.\n");2659 "Set CONFIG_SECTION_MISMATCH_WARN_ONLY=y to allow them.\n");
2663 for (n = 0; n < SYMBOL_HASH_SIZE; n++) {2660 for (n = 0; n < SYMBOL_HASH_SIZE; n++) {
2664 struct symbol *s;2661 struct symbol *s;
scripts/mod/modpost.h+11−3
@@ -198,6 +198,14 @@ void *grab_file(const char *filename, unsigned long *size); · 197 unmodified lines
198char* get_next_line(unsigned long *pos, void *file, unsigned long size);198char* get_next_line(unsigned long *pos, void *file, unsigned long size);
199void release_file(void *file, unsigned long size);199void release_file(void *file, unsigned long size);
200 200
201void fatal(const char *fmt, ...);201enum loglevel {
202void warn(const char *fmt, ...);202 LOG_WARN,
203void merror(const char *fmt, ...);203 LOG_ERROR,
204 LOG_FATAL
205};
206
207void modpost_log(enum loglevel loglevel, const char *fmt, ...);
208
209#define warn(fmt, args...) modpost_log(LOG_WARN, fmt, ##args)
210#define merror(fmt, args...) modpost_log(LOG_ERROR, fmt, ##args)
211#define fatal(fmt, args...) modpost_log(LOG_FATAL, fmt, ##args)
scripts/package/mkdebian+5−0
@@ -198,6 +198,10 @@ Description: Linux support headers for userspace development · 197 unmodified lines
198 This package provides userspaces headers from the Linux kernel. These headers198 This package provides userspaces headers from the Linux kernel. These headers
199 are used by the installed headers for GNU glibc and other system libraries.199 are used by the installed headers for GNU glibc and other system libraries.
200Multi-Arch: same200Multi-Arch: same
201EOF
202
203if is_enabled CONFIG_DEBUG_INFO; then
204cat <<EOF >> debian/control
201 205
202Package: $dbg_packagename206Package: $dbg_packagename
203Section: debug207Section: debug
@@ -206,6 +210,7 @@ Description: Linux kernel debugging symbols for $version · 2 unmodified lines
206 This package will come in handy if you need to debug the kernel. It provides210 This package will come in handy if you need to debug the kernel. It provides
207 all the necessary debug symbols for the kernel and its modules.211 all the necessary debug symbols for the kernel and its modules.
208EOF212EOF
213fi
209 214
210cat <<EOF > debian/rules215cat <<EOF > debian/rules
211#!$(command -v $MAKE) -f216#!$(command -v $MAKE) -f