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

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
...

+357 -201
+2 -1
Documentation/Makefile
··· 2 2 # Makefile for Sphinx documentation 3 3 # 4 4 5 - subdir-y := devicetree/bindings/ 5 + # for cleaning 6 + subdir- := devicetree/bindings 6 7 7 8 # Check for broken documentation file references 8 9 ifeq ($(CONFIG_WARN_MISSING_DOCUMENTS),y)
+1 -1
Documentation/devicetree/bindings/.gitignore
··· 1 1 *.example.dts 2 - processed-schema.yaml 2 + processed-schema*.yaml
+20 -12
Documentation/devicetree/bindings/Makefile
··· 2 2 DT_DOC_CHECKER ?= dt-doc-validate 3 3 DT_EXTRACT_EX ?= dt-extract-example 4 4 DT_MK_SCHEMA ?= dt-mk-schema 5 - DT_MK_SCHEMA_FLAGS := $(if $(DT_SCHEMA_FILES), -u) 6 5 7 6 quiet_cmd_chk_binding = CHKDT $(patsubst $(srctree)/%,%,$<) 8 7 cmd_chk_binding = $(DT_DOC_CHECKER) -u $(srctree)/$(src) $< ; \ ··· 10 11 $(obj)/%.example.dts: $(src)/%.yaml FORCE 11 12 $(call if_changed,chk_binding) 12 13 13 - DT_TMP_SCHEMA := processed-schema.yaml 14 + # Use full schemas when checking %.example.dts 15 + DT_TMP_SCHEMA := $(obj)/processed-schema-examples.yaml 14 16 15 17 quiet_cmd_mk_schema = SCHEMA $@ 16 18 cmd_mk_schema = $(DT_MK_SCHEMA) $(DT_MK_SCHEMA_FLAGS) -o $@ $(real-prereqs) 17 19 18 - DT_DOCS = $(shell \ 20 + DT_DOCS = $(addprefix $(src)/, \ 21 + $(shell \ 19 22 cd $(srctree)/$(src) && \ 20 23 find * \( -name '*.yaml' ! \ 21 - -name $(DT_TMP_SCHEMA) ! \ 24 + -name 'processed-schema*' ! \ 22 25 -name '*.example.dt.yaml' \) \ 23 - ) 26 + )) 24 27 25 - DT_SCHEMA_FILES ?= $(addprefix $(src)/,$(DT_DOCS)) 28 + DT_SCHEMA_FILES ?= $(DT_DOCS) 26 29 27 - ifeq ($(CHECK_DTBS),) 28 - extra-y += $(patsubst $(src)/%.yaml,%.example.dts, $(DT_SCHEMA_FILES)) 29 - extra-y += $(patsubst $(src)/%.yaml,%.example.dt.yaml, $(DT_SCHEMA_FILES)) 30 - endif 30 + extra-$(CHECK_DT_BINDING) += $(patsubst $(src)/%.yaml,%.example.dts, $(DT_SCHEMA_FILES)) 31 + extra-$(CHECK_DT_BINDING) += $(patsubst $(src)/%.yaml,%.example.dt.yaml, $(DT_SCHEMA_FILES)) 32 + extra-$(CHECK_DT_BINDING) += processed-schema-examples.yaml 31 33 32 - $(obj)/$(DT_TMP_SCHEMA): $(DT_SCHEMA_FILES) FORCE 34 + override DTC_FLAGS := \ 35 + -Wno-avoid_unnecessary_addr_size \ 36 + -Wno-graph_child_address 37 + 38 + $(obj)/processed-schema-examples.yaml: $(DT_DOCS) FORCE 33 39 $(call if_changed,mk_schema) 34 40 35 - extra-y += $(DT_TMP_SCHEMA) 41 + $(obj)/processed-schema.yaml: DT_MK_SCHEMA_FLAGS := -u 42 + $(obj)/processed-schema.yaml: $(DT_SCHEMA_FILES) FORCE 43 + $(call if_changed,mk_schema) 44 + 45 + extra-y += processed-schema.yaml
+4
Documentation/devicetree/writing-schema.rst
··· 147 147 necessary to use ``dt_binding_check`` to get all the validation errors in the 148 148 binding schema files. 149 149 150 + It is possible to run both in a single command:: 151 + 152 + make dt_binding_check dtbs_check 153 + 150 154 It is also possible to run checks with a single schema file by setting the 151 155 ``DT_SCHEMA_FILES`` variable to a specific schema file. 152 156
+1
Documentation/kbuild/index.rst
··· 20 20 issues 21 21 reproducible-builds 22 22 gcc-plugins 23 + llvm 23 24 24 25 .. only:: subproject and html 25 26
+24 -3
Documentation/kbuild/kconfig-language.rst
··· 159 159 Given the following example:: 160 160 161 161 config FOO 162 - tristate 162 + tristate "foo" 163 163 imply BAZ 164 164 165 165 config BAZ 166 - tristate 166 + tristate "baz" 167 167 depends on BAR 168 168 169 169 The following values are possible: ··· 173 173 === === ============= ============== 174 174 n y n N/m/y 175 175 m y m M/y/n 176 - y y y Y/n 176 + 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 180 y n * N 178 181 === === ============= ============== 179 182 180 183 This is useful e.g. with multiple drivers that want to indicate their 181 184 ability to hook into a secondary subsystem while allowing the user to 182 185 configure that subsystem out without also having to unset these drivers. 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 183 204 184 205 - limiting menu display: "visible if" <expr> 185 206
+80
Documentation/kbuild/llvm.rst
··· 1 + ============================== 2 + Building Linux with Clang/LLVM 3 + ============================== 4 + 5 + This document covers how to build the Linux kernel with Clang and LLVM 6 + utilities. 7 + 8 + About 9 + ----- 10 + 11 + The Linux kernel has always traditionally been compiled with GNU toolchains 12 + such as GCC and binutils. Ongoing work has allowed for `Clang 13 + <https://clang.llvm.org/>`_ and `LLVM <https://llvm.org/>`_ utilities to be 14 + used 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 18 + collection 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 20 + supports C and the GNU C extensions required by the kernel, and is pronounced 21 + "klang," not "see-lang." 22 + 23 + Clang 24 + ----- 25 + 26 + The 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 + 33 + Cross Compiling 34 + --------------- 35 + 36 + A single Clang compiler binary will typically contain all supported backends, 37 + which 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 43 + example: 44 + 45 + clang --target aarch64-linux-gnu foo.c 46 + 47 + LLVM Utilities 48 + -------------- 49 + 50 + LLVM has substitutes for GNU binutils utilities. These can be invoked as 51 + additional 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 + 58 + Getting 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 + 69 + Getting 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/
+1
MAINTAINERS
··· 4139 4139 C: irc://chat.freenode.net/clangbuiltlinux 4140 4140 S: Supported 4141 4141 K: \b(?i:clang|llvm)\b 4142 + F: Documentation/kbuild/llvm.rst 4142 4143 4143 4144 CLEANCACHE API 4144 4145 M: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
+37 -18
Makefile
··· 255 255 no-dot-config-targets := $(clean-targets) \ 256 256 cscope gtags TAGS tags help% %docs check% coccicheck \ 257 257 $(version_h) headers headers_% archheaders archscripts \ 258 - %asm-generic kernelversion %src-pkg 258 + %asm-generic kernelversion %src-pkg dt_binding_check \ 259 + outputmakefile 259 260 no-sync-config-targets := $(no-dot-config-targets) install %install \ 260 261 kernelrelease 261 262 single-targets := %.a %.i %.ko %.lds %.ll %.lst %.mod %.o %.s %.symtypes %/ ··· 389 388 KCONFIG_CONFIG ?= .config 390 389 export KCONFIG_CONFIG 391 390 391 + # Default file for 'make defconfig'. This may be overridden by arch-Makefile. 392 + export KBUILD_DEFCONFIG := defconfig 393 + 392 394 # SHELL used by kbuild 393 395 CONFIG_SHELL := sh 394 396 ··· 404 400 KBUILD_HOSTCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 \ 405 401 -fomit-frame-pointer -std=gnu89 $(HOST_LFS_CFLAGS) \ 406 402 $(HOSTCFLAGS) 407 - KBUILD_HOSTCXXFLAGS := -O2 $(HOST_LFS_CFLAGS) $(HOSTCXXFLAGS) 403 + KBUILD_HOSTCXXFLAGS := -Wall -O2 $(HOST_LFS_CFLAGS) $(HOSTCXXFLAGS) 408 404 KBUILD_HOSTLDFLAGS := $(HOST_LFS_LDFLAGS) $(HOSTLDFLAGS) 409 405 KBUILD_HOSTLDLIBS := $(HOST_LFS_LIBS) $(HOSTLDLIBS) 410 406 411 407 # Make variables (CC, etc...) 412 - AS = $(CROSS_COMPILE)as 413 408 LD = $(CROSS_COMPILE)ld 414 409 CC = $(CROSS_COMPILE)gcc 415 410 CPP = $(CC) -E ··· 475 472 GCC_PLUGINS_CFLAGS := 476 473 CLANG_FLAGS := 477 474 478 - export ARCH SRCARCH CONFIG_SHELL BASH HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE AS LD CC 475 + export ARCH SRCARCH CONFIG_SHELL BASH HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE LD CC 479 476 export CPP AR NM STRIP OBJCOPY OBJDUMP OBJSIZE READELF PAHOLE LEX YACC AWK INSTALLKERNEL 480 477 export PERL PYTHON PYTHON3 CHECK CHECKFLAGS MAKE UTS_MACHINE HOSTCXX 481 478 export KBUILD_HOSTCXXFLAGS KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS LDFLAGS_MODULE ··· 538 535 ifneq ($(GCC_TOOLCHAIN),) 539 536 CLANG_FLAGS += --gcc-toolchain=$(GCC_TOOLCHAIN) 540 537 endif 541 - ifeq ($(shell $(AS) --version 2>&1 | head -n 1 | grep clang),) 538 + ifeq ($(if $(AS),$(shell $(AS) --version 2>&1 | head -n 1 | grep clang)),) 542 539 CLANG_FLAGS += -no-integrated-as 543 540 endif 544 541 CLANG_FLAGS += -Werror=unknown-warning-option ··· 677 674 # 678 675 # This exploits the 'multi-target pattern rule' trick. 679 676 # The syncconfig should be executed only once to make all the targets. 677 + # (Note: use the grouped target '&:' when we bump to GNU Make 4.3) 680 678 %/auto.conf %/auto.conf.cmd: $(KCONFIG_CONFIG) 681 679 $(Q)$(MAKE) -f $(srctree)/Makefile syncconfig 682 680 else # !may-sync-config ··· 718 714 719 715 # Tell gcc to never replace conditional load with a non-conditional one 720 716 KBUILD_CFLAGS += $(call cc-option,--param=allow-store-data-races=0) 717 + KBUILD_CFLAGS += $(call cc-option,-fno-allow-store-data-races) 721 718 722 719 include scripts/Makefile.kcov 723 720 include scripts/Makefile.gcc-plugins ··· 734 729 endif 735 730 736 731 ifneq ($(CONFIG_FRAME_WARN),0) 737 - KBUILD_CFLAGS += $(call cc-option,-Wframe-larger-than=${CONFIG_FRAME_WARN}) 732 + KBUILD_CFLAGS += -Wframe-larger-than=$(CONFIG_FRAME_WARN) 738 733 endif 739 734 740 735 stackp-flags-$(CONFIG_CC_HAS_STACKPROTECTOR_NONE) := -fno-stack-protector ··· 1068 1063 1069 1064 autoksyms_h := $(if $(CONFIG_TRIM_UNUSED_KSYMS), include/generated/autoksyms.h) 1070 1065 1066 + quiet_cmd_autoksyms_h = GEN $@ 1067 + cmd_autoksyms_h = mkdir -p $(dir $@); \ 1068 + $(CONFIG_SHELL) $(srctree)/scripts/gen_autoksyms.sh $@ 1069 + 1071 1070 $(autoksyms_h): 1072 - $(Q)mkdir -p $(dir $@) 1073 - $(Q)touch $@ 1071 + $(call cmd,autoksyms_h) 1074 1072 1075 1073 ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(SRCARCH)/Makefile.postlink) 1076 1074 ··· 1248 1240 $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@ 1249 1241 1250 1242 PHONY += dtbs dtbs_install dtbs_check 1251 - dtbs dtbs_check: include/config/kernel.release scripts_dtc 1243 + dtbs: include/config/kernel.release scripts_dtc 1252 1244 $(Q)$(MAKE) $(build)=$(dtstree) 1253 1245 1254 - dtbs_check: export CHECK_DTBS=1 1255 - dtbs_check: dt_binding_check 1246 + ifneq ($(filter dtbs_check, $(MAKECMDGOALS)),) 1247 + export CHECK_DTBS=y 1248 + dtbs: dt_binding_check 1249 + endif 1250 + 1251 + dtbs_check: dtbs 1256 1252 1257 1253 dtbs_install: 1258 - $(Q)$(MAKE) $(dtbinst)=$(dtstree) 1254 + $(Q)$(MAKE) $(dtbinst)=$(dtstree) dst=$(INSTALL_DTBS_PATH) 1259 1255 1260 1256 ifdef CONFIG_OF_EARLY_FLATTREE 1261 1257 all: dtbs ··· 1270 1258 PHONY += scripts_dtc 1271 1259 scripts_dtc: scripts_basic 1272 1260 $(Q)$(MAKE) $(build)=scripts/dtc 1261 + 1262 + ifneq ($(filter dt_binding_check, $(MAKECMDGOALS)),) 1263 + export CHECK_DT_BINDING=y 1264 + endif 1273 1265 1274 1266 PHONY += dt_binding_check 1275 1267 dt_binding_check: scripts_dtc ··· 1486 1470 @echo ' nsdeps - Generate missing symbol namespace dependencies' 1487 1471 @echo '' 1488 1472 @echo 'Kernel selftest:' 1489 - @echo ' kselftest - Build and run kernel selftest (run as root)' 1490 - @echo ' Build, install, and boot kernel before' 1491 - @echo ' running kselftest on it' 1492 - @echo ' kselftest-clean - Remove all generated kselftest files' 1493 - @echo ' kselftest-merge - Merge all the config dependencies of kselftest to existing' 1494 - @echo ' .config.' 1473 + @echo ' kselftest - Build and run kernel selftest' 1474 + @echo ' Build, install, and boot kernel before' 1475 + @echo ' running kselftest on it' 1476 + @echo ' Run as root for full coverage' 1477 + @echo ' kselftest-all - Build kernel selftest' 1478 + @echo ' kselftest-install - Build and install kernel selftest' 1479 + @echo ' kselftest-clean - Remove all generated kselftest files' 1480 + @echo ' kselftest-merge - Merge all the config dependencies of' 1481 + @echo ' kselftest to existing .config.' 1495 1482 @echo '' 1496 1483 @$(if $(dtstree), \ 1497 1484 echo 'Devicetree:'; \
-5
arch/sh/Kconfig
··· 87 87 select HAVE_EXIT_THREAD 88 88 select KALLSYMS 89 89 90 - config ARCH_DEFCONFIG 91 - string 92 - default "arch/sh/configs/shx3_defconfig" if SUPERH32 93 - default "arch/sh/configs/cayman_defconfig" if SUPERH64 94 - 95 90 config GENERIC_BUG 96 91 def_bool y 97 92 depends on BUG && SUPERH32
-5
arch/sparc/Kconfig
··· 96 96 select PCI_DOMAINS if PCI 97 97 select ARCH_HAS_GIGANTIC_PAGE 98 98 99 - config ARCH_DEFCONFIG 100 - string 101 - default "arch/sparc/configs/sparc32_defconfig" if SPARC32 102 - default "arch/sparc/configs/sparc64_defconfig" if SPARC64 103 - 104 99 config ARCH_PROC_KCORE_TEXT 105 100 def_bool y 106 101
+4
arch/sparc/include/asm/string.h
··· 37 37 #define __HAVE_ARCH_MEMCMP 38 38 int 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 44 #define __HAVE_ARCH_STRNCMP 41 45 int strncmp(const char *, const char *, __kernel_size_t); 42 46
-4
arch/sparc/include/asm/string_64.h
··· 12 12 13 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 15 #endif /* !(__SPARC64_STRING_H__) */
-5
arch/x86/Kconfig
··· 240 240 default "elf32-i386" if X86_32 241 241 default "elf64-x86-64" if X86_64 242 242 243 - config 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 - 248 243 config LOCKDEP_SUPPORT 249 244 def_bool y 250 245
-5
arch/x86/um/Kconfig
··· 27 27 def_bool 64BIT 28 28 select MODULES_USE_ELF_RELA 29 29 30 - config 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 - 35 30 config 3_LEVEL_PGTABLES 36 31 bool "Three-level pagetables" if !64BIT 37 32 default 64BIT
+1 -1
drivers/net/wan/Kconfig
··· 200 200 depends on WANXL && !PREVENT_FIRMWARE_BUILD 201 201 help 202 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 205 You should never need this option, say N. 206 206
+22 -13
drivers/net/wan/Makefile
··· 40 40 41 41 ifeq ($(CONFIG_WANXL_BUILD_FIRMWARE),y) 42 42 ifeq ($(ARCH),m68k) 43 - AS68K = $(AS) 44 - LD68K = $(LD) 43 + M68KCC = $(CC) 44 + M68KLD = $(LD) 45 45 else 46 - AS68K = as68k 47 - LD68K = ld68k 46 + M68KCC = $(CROSS_COMPILE_M68K)gcc 47 + M68KLD = $(CROSS_COMPILE_M68K)ld 48 48 endif 49 49 50 - quiet_cmd_build_wanxlfw = BLD FW $@ 51 - cmd_build_wanxlfw = \ 52 - $(CPP) -D__ASSEMBLY__ -Wp,-MD,$(depfile) -I$(srctree)/include/uapi $< | $(AS68K) -m68360 -o $(obj)/wanxlfw.o; \ 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 50 + quiet_cmd_build_wanxlfw = BLDFW $@ 51 + cmd_build_wanxlfw = hexdump -ve '"\n" 16/1 "0x%02X,"' $< | \ 52 + sed 's/0x ,//g;1s/^/static const u8 firmware[]={/;$$s/,$$/\n};\n/' > $@ 56 53 57 - $(obj)/wanxlfw.inc: $(src)/wanxlfw.S 58 - $(call if_changed_dep,build_wanxlfw) 59 - targets += wanxlfw.inc 54 + $(obj)/wanxlfw.inc: $(obj)/wanxlfw.bin FORCE 55 + $(call if_changed,build_wanxlfw) 56 + 57 + quiet_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 + 63 + quiet_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) 60 68 endif 69 + targets += wanxlfw.inc wanxlfw.bin wanxlfw.o
+1 -1
include/net/drop_monitor.h
··· 19 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) 23 23 void net_dm_hw_report(struct sk_buff *skb, 24 24 const struct net_dm_hw_metadata *hw_metadata); 25 25 #else
+14 -2
init/Kconfig
··· 6 6 default "/lib/modules/$(shell,uname -r)/.config" 7 7 default "/etc/kernel-config" 8 8 default "/boot/config-$(shell,uname -r)" 9 - default ARCH_DEFCONFIG 10 - default "arch/$(ARCH)/defconfig" 9 + default "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)" 11 10 12 11 config CC_IS_GCC 13 12 def_bool $(success,$(CC) --version | head -n 1 | grep -q gcc) ··· 2209 2210 binary size. This might have some security advantages as well. 2210 2211 2211 2212 If unsure, or if you need to build out-of-tree modules, say N. 2213 + 2214 + config UNUSED_KSYMS_WHITELIST 2215 + string "Whitelist of symbols to keep in ksymtab" 2216 + depends on TRIM_UNUSED_KSYMS 2217 + help 2218 + By default, all unused exported symbols will be un-exported from the 2219 + build when TRIM_UNUSED_KSYMS is selected. 2220 + 2221 + UNUSED_KSYMS_WHITELIST allows to whitelist symbols that must be kept 2222 + exported at all times, even in absence of in-tree users. The value to 2223 + set here is the path to a text file containing the list of symbols, 2224 + one per line. The path can be absolute, or relative to the kernel 2225 + source tree. 2212 2226 2213 2227 endif # MODULES 2214 2228
+1 -2
lib/Kconfig.debug
··· 266 266 attribute warn_unused_result" messages. 267 267 268 268 config FRAME_WARN 269 - int "Warn for stack frames larger than (needs gcc 4.4)" 269 + int "Warn for stack frames larger than" 270 270 range 0 8192 271 271 default 2048 if GCC_PLUGIN_LATENT_ENTROPY 272 272 default 1280 if (!64BIT && PARISC) ··· 276 276 Tell gcc to warn at build time for stack frames larger than this. 277 277 Setting this too low will cause a lot of warnings. 278 278 Setting it to 0 disables the warning. 279 - Requires gcc 4.4 280 279 281 280 config STRIP_ASM_SYMS 282 281 bool "Strip assembler-generated symbols during link"
+11 -15
scripts/Makefile.dtbinst
··· 13 13 PHONY := __dtbs_install 14 14 __dtbs_install: 15 15 16 - export dtbinst_root ?= $(obj) 17 - 18 16 include include/config/auto.conf 19 17 include scripts/Kbuild.include 20 18 include $(src)/Makefile 21 19 22 - dtbinst-files := $(sort $(dtb-y) $(if $(CONFIG_OF_ALL_DTBS), $(dtb-))) 23 - dtbinst-dirs := $(subdir-y) $(subdir-m) 20 + dtbs := $(addprefix $(dst)/, $(dtb-y) $(if $(CONFIG_OF_ALL_DTBS),$(dtb-))) 21 + subdirs := $(addprefix $(obj)/, $(subdir-y) $(subdir-m)) 24 22 25 - # Helper targets for Installing DTBs into the boot directory 26 - quiet_cmd_dtb_install = INSTALL $< 27 - cmd_dtb_install = mkdir -p $(2); cp $< $(2) 23 + __dtbs_install: $(dtbs) $(subdirs) 24 + @: 28 25 29 - install-dir = $(patsubst $(dtbinst_root)%,$(INSTALL_DTBS_PATH)%,$(obj)) 26 + quiet_cmd_dtb_install = INSTALL $@ 27 + cmd_dtb_install = install -D $< $@ 30 28 31 - $(dtbinst-files): %.dtb: $(obj)/%.dtb 32 - $(call cmd,dtb_install,$(install-dir)) 29 + $(dst)/%.dtb: $(obj)/%.dtb 30 + $(call cmd,dtb_install) 33 31 34 - $(dtbinst-dirs): 35 - $(Q)$(MAKE) $(dtbinst)=$(obj)/$@ 36 - 37 - PHONY += $(dtbinst-files) $(dtbinst-dirs) 38 - __dtbs_install: $(dtbinst-files) $(dtbinst-dirs) 32 + PHONY += $(subdirs) 33 + $(subdirs): 34 + $(Q)$(MAKE) $(dtbinst)=$@ dst=$(patsubst $(obj)/%,$(dst)/%,$@) 39 35 40 36 .PHONY: $(PHONY)
+2 -1
scripts/Makefile.lib
··· 297 297 298 298 DT_CHECKER ?= dt-validate 299 299 DT_BINDING_DIR := Documentation/devicetree/bindings 300 - DT_TMP_SCHEMA := $(objtree)/$(DT_BINDING_DIR)/processed-schema.yaml 300 + # DT_TMP_SCHEMA may be overridden from Documentation/devicetree/bindings/Makefile 301 + DT_TMP_SCHEMA ?= $(objtree)/$(DT_BINDING_DIR)/processed-schema.yaml 301 302 302 303 quiet_cmd_dtb_check = CHECK $@ 303 304 cmd_dtb_check = $(DT_CHECKER) -u $(srctree)/$(DT_BINDING_DIR) -p $(DT_TMP_SCHEMA) $@
+8 -7
scripts/Makefile.modpost
··· 46 46 kernelsymfile := $(objtree)/Module.symvers 47 47 modulesymfile := $(firstword $(KBUILD_EXTMOD))/Module.symvers 48 48 49 - MODPOST = scripts/mod/modpost \ 50 - $(if $(CONFIG_MODVERSIONS),-m) \ 51 - $(if $(CONFIG_MODULE_SRCVERSION_ALL),-a) \ 52 - $(if $(KBUILD_EXTMOD),-i,-o) $(kernelsymfile) \ 53 - $(if $(KBUILD_EXTMOD),$(addprefix -e ,$(KBUILD_EXTRA_SYMBOLS))) \ 54 - $(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \ 55 - $(if $(CONFIG_SECTION_MISMATCH_WARN_ONLY),,-E) \ 49 + MODPOST = scripts/mod/modpost \ 50 + $(if $(CONFIG_MODVERSIONS),-m) \ 51 + $(if $(CONFIG_MODULE_SRCVERSION_ALL),-a) \ 52 + $(if $(KBUILD_EXTMOD),-i,-o) $(kernelsymfile) \ 53 + $(if $(KBUILD_EXTMOD),$(addprefix -e ,$(KBUILD_EXTRA_SYMBOLS))) \ 54 + $(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \ 55 + $(if $(CONFIG_SECTION_MISMATCH_WARN_ONLY),,-E) \ 56 + $(if $(CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS)$(KBUILD_NSDEPS),-N) \ 56 57 $(if $(KBUILD_MODPOST_WARN),-w) 57 58 58 59 ifdef MODPOST_VMLINUX
+4 -20
scripts/adjust_autoksyms.sh
··· 1 1 #!/bin/sh 2 2 # SPDX-License-Identifier: GPL-2.0-only 3 3 4 - # Script to create/update include/generated/autoksyms.h and dependency files 4 + # Script to update include/generated/autoksyms.h and dependency files 5 5 # 6 6 # Copyright: (C) 2016 Linaro Limited 7 7 # Created by: Nicolas Pitre, January 2016 8 8 # 9 9 10 - # Create/update the include/generated/autoksyms.h file from the list 11 - # of all module's needed symbols as recorded on the second line of *.mod files. 10 + # Update the include/generated/autoksyms.h file. 12 11 # 13 12 # For each symbol being added or removed, the corresponding dependency 14 13 # file's timestamp is updated to force a rebuild of the affected source ··· 37 38 # We need access to CONFIG_ symbols 38 39 . include/config/auto.conf 39 40 40 - # Generate a new ksym list file with symbols needed by the current 41 - # set of modules. 42 - cat > "$new_ksyms_file" << EOT 43 - /* 44 - * Automatically generated file; DO NOT EDIT. 45 - */ 46 - 47 - EOT 48 - sed 's/ko$/mod/' modules.order | 49 - xargs -n1 sed -n -e '2{s/ /\n/g;/^$/!p;}' -- | 50 - sort -u | 51 - sed -e 's/\(.*\)/#define __KSYM_\1 1/' >> "$new_ksyms_file" 52 - 53 - # Special case for modversions (see modpost.c) 54 - if [ -n "$CONFIG_MODVERSIONS" ]; then 55 - echo "#define __KSYM_module_layout 1" >> "$new_ksyms_file" 56 - fi 41 + # Generate a new symbol list file 42 + $CONFIG_SHELL $srctree/scripts/gen_autoksyms.sh "$new_ksyms_file" 57 43 58 44 # Extract changes between old and new list and touch corresponding 59 45 # dependency files.
+2 -8
scripts/basic/fixdep.c
··· 77 77 * dependencies on include/config/my/option.h for every 78 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 80 * We don't even try to really parse the header files, but 86 81 * merely grep, i.e. if CONFIG_FOO is mentioned in a comment, it will 87 82 * be picked up as well. It's not a problem with respect to ··· 246 251 } 247 252 p += 7; 248 253 q = p; 249 - while (*q && (isalnum(*q) || *q == '_')) 254 + while (isalnum(*q) || *q == '_') 250 255 q++; 251 256 if (str_ends_with(p, q - p, "_MODULE")) 252 257 r = q - 7; ··· 294 299 static int is_ignored_file(const char *s, int len) 295 300 { 296 301 return str_ends_with(s, len, "include/generated/autoconf.h") || 297 - str_ends_with(s, len, "include/generated/autoksyms.h") || 298 - str_ends_with(s, len, ".ver"); 302 + str_ends_with(s, len, "include/generated/autoksyms.h"); 299 303 } 300 304 301 305 /*
+3 -2
scripts/dtc/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 # scripts/dtc makefile 3 3 4 - hostprogs := dtc 5 - always-$(CONFIG_DTC) := $(hostprogs) 4 + hostprogs := dtc 5 + always-$(CONFIG_DTC) += $(hostprogs) 6 + always-$(CHECK_DT_BINDING) += $(hostprogs) 6 7 7 8 dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o \ 8 9 srcpos.o checks.o util.o
+1 -1
scripts/gcc-plugins/Makefile
··· 10 10 HOSTLIBS := hostcxxlibs 11 11 HOST_EXTRACXXFLAGS += -I$(GCC_PLUGINS_DIR)/include -I$(src) -std=gnu++98 -fno-rtti 12 12 HOST_EXTRACXXFLAGS += -fno-exceptions -fasynchronous-unwind-tables -ggdb 13 - HOST_EXTRACXXFLAGS += -Wno-narrowing -Wno-unused-variable 13 + HOST_EXTRACXXFLAGS += -Wno-narrowing -Wno-unused-variable -Wno-c++11-compat 14 14 export HOST_EXTRACXXFLAGS 15 15 endif 16 16
+52
scripts/gen_autoksyms.sh
··· 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 + 8 + set -e 9 + 10 + output_file="$1" 11 + 12 + # Use "make V=1" to debug this script. 13 + case "$KBUILD_VERBOSE" in 14 + *1*) 15 + set -x 16 + ;; 17 + esac 18 + 19 + # We need access to CONFIG_ symbols 20 + . include/config/auto.conf 21 + 22 + ksym_wl=/dev/null 23 + if [ -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 31 + fi 32 + 33 + # Generate a new ksym list file with symbols needed by the current 34 + # set of modules. 35 + cat > "$output_file" << EOT 36 + /* 37 + * Automatically generated file; DO NOT EDIT. 38 + */ 39 + 40 + EOT 41 + 42 + [ -f modules.order ] && modlist=modules.order || modlist=/dev/null 43 + sed 's/ko$/mod/' $modlist | 44 + xargs -n1 sed -n -e '2{s/ /\n/g;/^$/!p;}' -- | 45 + cat - "$ksym_wl" | 46 + sort -u | 47 + sed -e 's/\(.*\)/#define __KSYM_\1 1/' >> "$output_file" 48 + 49 + # Special case for modversions (see modpost.c) 50 + if [ -n "$CONFIG_MODVERSIONS" ]; then 51 + echo "#define __KSYM_module_layout 1" >> "$output_file" 52 + fi
-4
scripts/kconfig/Makefile
··· 12 12 Kconfig := Kconfig 13 13 endif 14 14 15 - ifndef KBUILD_DEFCONFIG 16 - KBUILD_DEFCONFIG := defconfig 17 - endif 18 - 19 15 ifeq ($(quiet),silent_) 20 16 silent := -s 21 17 endif
-2
scripts/kconfig/qconf.cc
··· 309 309 showName(false), showRange(false), showData(false), mode(singleMode), optMode(normalOpt), 310 310 rootEntry(0), headerPopup(0) 311 311 { 312 - int i; 313 - 314 312 setObjectName(name); 315 313 setSortingEnabled(false); 316 314 setRootIsDecorated(true);
+4 -5
scripts/kconfig/symbol.c
··· 221 221 sym_set_changed(sym); 222 222 } 223 223 tri = no; 224 - if (sym->implied.expr && sym->dir_dep.tri != no) 224 + if (sym->implied.expr) 225 225 tri = expr_calc_value(sym->implied.expr); 226 226 if (tri == mod && sym_get_type(sym) == S_BOOLEAN) 227 227 tri = yes; ··· 394 394 if (sym->implied.tri != no) { 395 395 sym->flags |= SYMBOL_WRITE; 396 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 401 calc_newval: ··· 403 401 sym_warn_unmet_dep(sym); 404 402 newval.tri = EXPR_OR(newval.tri, sym->rev_dep.tri); 405 403 } 406 - if (newval.tri == mod && 407 - (sym_get_type(sym) == S_BOOLEAN || sym->implied.tri == yes)) 404 + if (newval.tri == mod && sym_get_type(sym) == S_BOOLEAN) 408 405 newval.tri = yes; 409 406 break; 410 407 case S_STRING: ··· 484 483 if (type == S_BOOLEAN && val == mod) 485 484 return false; 486 485 if (sym->visible <= sym->rev_dep.tri) 487 - return false; 488 - if (sym->implied.tri == yes && val == mod) 489 486 return false; 490 487 if (sym_is_choice_value(sym) && sym->visible == yes) 491 488 return val == yes;
-11
scripts/mkcompile_h
··· 10 10 11 11 vecho() { [ "${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 - 19 - if [ -r $TARGET -a ! -O include/generated/autoconf.h ]; then 20 - vecho " SKIPPED $TARGET" 21 - exit 0 22 - fi 23 - 24 13 # Do not expand names 25 14 set -f 26 15
+41 -44
scripts/mod/modpost.c
··· 39 39 static int sec_mismatch_fatal = 0; 40 40 /* ignore missing files */ 41 41 static int ignore_missing_files; 42 + /* If set to 1, only warn (instead of error) about missing ns imports */ 43 + static int allow_missing_ns_imports; 42 44 43 45 enum export { 44 46 export_plain, export_unused, export_gpl, ··· 53 51 54 52 #define MODULE_NAME_LEN (64 - sizeof(Elf_Addr)) 55 53 56 - #define PRINTF __attribute__ ((format (printf, 1, 2))) 57 - 58 - PRINTF void fatal(const char *fmt, ...) 54 + void __attribute__((format(printf, 2, 3))) 55 + modpost_log(enum loglevel loglevel, const char *fmt, ...) 59 56 { 60 57 va_list arglist; 61 58 62 - fprintf(stderr, "FATAL: "); 59 + switch (loglevel) { 60 + case LOG_WARN: 61 + fprintf(stderr, "WARNING: "); 62 + break; 63 + case LOG_ERROR: 64 + fprintf(stderr, "ERROR: "); 65 + break; 66 + case LOG_FATAL: 67 + fprintf(stderr, "FATAL: "); 68 + break; 69 + default: /* invalid loglevel, ignore */ 70 + break; 71 + } 72 + 73 + fprintf(stderr, "modpost: "); 63 74 64 75 va_start(arglist, fmt); 65 76 vfprintf(stderr, fmt, arglist); 66 77 va_end(arglist); 67 78 68 - exit(1); 69 - } 70 - 71 - PRINTF void warn(const char *fmt, ...) 72 - { 73 - va_list arglist; 74 - 75 - fprintf(stderr, "WARNING: "); 76 - 77 - va_start(arglist, fmt); 78 - vfprintf(stderr, fmt, arglist); 79 - va_end(arglist); 80 - } 81 - 82 - PRINTF void merror(const char *fmt, ...) 83 - { 84 - va_list arglist; 85 - 86 - fprintf(stderr, "ERROR: "); 87 - 88 - va_start(arglist, fmt); 89 - vfprintf(stderr, fmt, arglist); 90 - va_end(arglist); 79 + if (loglevel == LOG_FATAL) 80 + exit(1); 91 81 } 92 82 93 83 static inline bool strends(const char *str, const char *postfix) ··· 107 113 void *do_nofail(void *ptr, const char *expr) 108 114 { 109 115 if (!ptr) 110 - fatal("modpost: Memory allocation failure: %s.\n", expr); 116 + fatal("Memory allocation failure: %s.\n", expr); 111 117 112 118 return ptr; 113 119 } ··· 2016 2022 2017 2023 license = get_modinfo(&info, "license"); 2018 2024 if (!license && !is_vmlinux(modname)) 2019 - warn("modpost: missing MODULE_LICENSE() in %s\n" 2025 + warn("missing MODULE_LICENSE() in %s\n" 2020 2026 "see include/linux/module.h for " 2021 2027 "more information\n", modname); 2022 2028 while (license) { ··· 2147 2153 2148 2154 switch (exp) { 2149 2155 case export_gpl: 2150 - fatal("modpost: GPL-incompatible module %s%s " 2156 + fatal("GPL-incompatible module %s%s " 2151 2157 "uses GPL-only symbol '%s'\n", m, e, s); 2152 2158 break; 2153 2159 case export_unused_gpl: 2154 - fatal("modpost: GPL-incompatible module %s%s " 2160 + fatal("GPL-incompatible module %s%s " 2155 2161 "uses GPL-only symbol marked UNUSED '%s'\n", m, e, s); 2156 2162 break; 2157 2163 case export_gpl_future: 2158 - warn("modpost: GPL-incompatible module %s%s " 2164 + warn("GPL-incompatible module %s%s " 2159 2165 "uses future GPL-only symbol '%s'\n", m, e, s); 2160 2166 break; 2161 2167 case export_plain: ··· 2173 2179 switch (exp) { 2174 2180 case export_unused: 2175 2181 case export_unused_gpl: 2176 - warn("modpost: module %s%s " 2182 + warn("module %s%s " 2177 2183 "uses symbol '%s' marked UNUSED\n", m, e, s); 2178 2184 break; 2179 2185 default: ··· 2192 2198 exp = find_symbol(s->name); 2193 2199 if (!exp || exp->module == mod) { 2194 2200 if (have_vmlinux && !s->weak) { 2195 - if (warn_unresolved) { 2196 - warn("\"%s\" [%s.ko] undefined!\n", 2197 - s->name, mod->name); 2198 - } else { 2199 - merror("\"%s\" [%s.ko] undefined!\n", 2200 - s->name, mod->name); 2201 + modpost_log(warn_unresolved ? LOG_WARN : LOG_ERROR, 2202 + "\"%s\" [%s.ko] undefined!\n", 2203 + s->name, mod->name); 2204 + if (!warn_unresolved) 2201 2205 err = 1; 2202 - } 2203 2206 } 2204 2207 continue; 2205 2208 } ··· 2208 2217 2209 2218 if (exp->namespace && 2210 2219 !module_imports_namespace(mod, exp->namespace)) { 2211 - warn("module %s uses symbol %s from namespace %s, but does not import it.\n", 2212 - basename, exp->name, exp->namespace); 2220 + modpost_log(allow_missing_ns_imports ? LOG_WARN : LOG_ERROR, 2221 + "module %s uses symbol %s from namespace %s, but does not import it.\n", 2222 + basename, exp->name, exp->namespace); 2223 + if (!allow_missing_ns_imports) 2224 + err = 1; 2213 2225 add_namespace(&mod->missing_namespaces, exp->namespace); 2214 2226 } 2215 2227 ··· 2559 2565 struct ext_sym_list *extsym_iter; 2560 2566 struct ext_sym_list *extsym_start = NULL; 2561 2567 2562 - while ((opt = getopt(argc, argv, "i:e:mnsT:o:awEd:")) != -1) { 2568 + while ((opt = getopt(argc, argv, "i:e:mnsT:o:awENd:")) != -1) { 2563 2569 switch (opt) { 2564 2570 case 'i': 2565 2571 kernel_read = optarg; ··· 2596 2602 break; 2597 2603 case 'E': 2598 2604 sec_mismatch_fatal = 1; 2605 + break; 2606 + case 'N': 2607 + allow_missing_ns_imports = 1; 2599 2608 break; 2600 2609 case 'd': 2601 2610 missing_namespace_deps = optarg; ··· 2655 2658 if (dump_write) 2656 2659 write_dump(dump_write); 2657 2660 if (sec_mismatch_count && sec_mismatch_fatal) 2658 - fatal("modpost: Section mismatches detected.\n" 2661 + fatal("Section mismatches detected.\n" 2659 2662 "Set CONFIG_SECTION_MISMATCH_WARN_ONLY=y to allow them.\n"); 2660 2663 for (n = 0; n < SYMBOL_HASH_SIZE; n++) { 2661 2664 struct symbol *s;
+11 -3
scripts/mod/modpost.h
··· 198 198 char* get_next_line(unsigned long *pos, void *file, unsigned long size); 199 199 void release_file(void *file, unsigned long size); 200 200 201 - void fatal(const char *fmt, ...); 202 - void warn(const char *fmt, ...); 203 - void merror(const char *fmt, ...); 201 + enum loglevel { 202 + LOG_WARN, 203 + LOG_ERROR, 204 + LOG_FATAL 205 + }; 206 + 207 + void 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)
+5
scripts/package/mkdebian
··· 198 198 This package provides userspaces headers from the Linux kernel. These headers 199 199 are used by the installed headers for GNU glibc and other system libraries. 200 200 Multi-Arch: same 201 + EOF 202 + 203 + if is_enabled CONFIG_DEBUG_INFO; then 204 + cat <<EOF >> debian/control 201 205 202 206 Package: $dbg_packagename 203 207 Section: debug ··· 210 206 This package will come in handy if you need to debug the kernel. It provides 211 207 all the necessary debug symbols for the kernel and its modules. 212 208 EOF 209 + fi 213 210 214 211 cat <<EOF > debian/rules 215 212 #!$(command -v $MAKE) -f