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

Configure Feed

Select the types of activity you want to include in your feed.

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

Pull Kbuild updates from Masahiro Yamada:

- Support zstd-compressed debug info

- Allow W=1 builds to detect objects shared among multiple modules

- Add srcrpm-pkg target to generate a source RPM package

- Make the -s option detection work for future GNU Make versions

- Add -Werror to KBUILD_CPPFLAGS when CONFIG_WERROR=y

- Allow W=1 builds to detect -Wundef warnings in any preprocessed files

- Raise the minimum supported version of binutils to 2.25

- Use $(intcmp ...) to compare integers if GNU Make >= 4.4 is used

- Use $(file ...) to read a file if GNU Make >= 4.2 is used

- Print error if GNU Make older than 3.82 is used

- Allow modpost to detect section mismatches with Clang LTO

- Include vmlinuz.efi into kernel tarballs for arm64 CONFIG_EFI_ZBOOT=y

* tag 'kbuild-v6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (29 commits)
buildtar: fix tarballs with EFI_ZBOOT enabled
modpost: Include '.text.*' in TEXT_SECTIONS
padata: Mark padata_work_init() as __ref
kbuild: ensure Make >= 3.82 is used
kbuild: refactor the prerequisites of the modpost rule
kbuild: change module.order to list *.o instead of *.ko
kbuild: use .NOTINTERMEDIATE for future GNU Make versions
kconfig: refactor Makefile to reduce process forks
kbuild: add read-file macro
kbuild: do not sort after reading modules.order
kbuild: add test-{ge,gt,le,lt} macros
Documentation: raise minimum supported version of binutils to 2.25
kbuild: add -Wundef to KBUILD_CPPFLAGS for W=1 builds
kbuild: move -Werror from KBUILD_CFLAGS to KBUILD_CPPFLAGS
kbuild: Port silent mode detection to future gnu make.
init/version.c: remove #include <generated/utsrelease.h>
firmware_loader: remove #include <generated/utsrelease.h>
modpost: Mark uuid_le type to be suitable only for MEI
kbuild: add ability to make source rpm buildable using koji
kbuild: warn objects shared among multiple modules
...

+286 -156
+2 -2
Documentation/process/changes.rst
··· 35 35 bindgen (optional) 0.56.0 bindgen --version 36 36 GNU make 3.82 make --version 37 37 bash 4.2 bash --version 38 - binutils 2.23 ld -v 38 + binutils 2.25 ld -v 39 39 flex 2.5.35 flex --version 40 40 bison 2.0 bison --version 41 41 pahole 1.16 pahole --version ··· 119 119 Binutils 120 120 -------- 121 121 122 - Binutils 2.23 or newer is needed to build the kernel. 122 + Binutils 2.25 or newer is needed to build the kernel. 123 123 124 124 pkg-config 125 125 ----------
+19 -7
Makefile
··· 11 11 # Comments in this file are targeted only to the developer, do not 12 12 # expect to learn how to build the kernel reading this file. 13 13 14 + ifeq ($(filter undefine,$(.FEATURES)),) 15 + $(error GNU Make >= 3.82 is required. Your Make version is $(MAKE_VERSION)) 16 + endif 17 + 14 18 $(if $(filter __%, $(MAKECMDGOALS)), \ 15 19 $(error targets prefixed with '__' are only for internal use)) 16 20 ··· 97 93 98 94 # If the user is running make -s (silent mode), suppress echoing of 99 95 # commands 96 + # make-4.0 (and later) keep single letter options in the 1st word of MAKEFLAGS. 100 97 101 - ifneq ($(findstring s,$(filter-out --%,$(MAKEFLAGS))),) 102 - quiet=silent_ 103 - KBUILD_VERBOSE = 0 98 + ifeq ($(filter 3.%,$(MAKE_VERSION)),) 99 + silence:=$(findstring s,$(firstword -$(MAKEFLAGS))) 100 + else 101 + silence:=$(findstring s,$(filter-out --%,$(MAKEFLAGS))) 102 + endif 103 + 104 + ifeq ($(silence),s) 105 + quiet=silent_ 106 + KBUILD_VERBOSE = 0 104 107 endif 105 108 106 109 export quiet Q KBUILD_VERBOSE ··· 380 369 include $(srctree)/scripts/Kbuild.include 381 370 382 371 # Read KERNELRELEASE from include/config/kernel.release (if it exists) 383 - KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) 372 + KERNELRELEASE = $(call read-file, include/config/kernel.release) 384 373 KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION) 385 374 export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION 386 375 ··· 870 859 871 860 KBUILD_CFLAGS += $(stackp-flags-y) 872 861 873 - KBUILD_CFLAGS-$(CONFIG_WERROR) += -Werror 862 + KBUILD_CPPFLAGS-$(CONFIG_WERROR) += -Werror 863 + KBUILD_CPPFLAGS += $(KBUILD_CPPFLAGS-y) 874 864 KBUILD_CFLAGS-$(CONFIG_CC_NO_ARRAY_BOUNDS) += -Wno-array-bounds 875 865 876 866 KBUILD_RUSTFLAGS-$(CONFIG_WERROR) += -Dwarnings ··· 1002 990 # Check for frame size exceeding threshold during prolog/epilog insertion 1003 991 # when using lld < 13.0.0. 1004 992 ifneq ($(CONFIG_FRAME_WARN),0) 1005 - ifeq ($(shell test $(CONFIG_LLD_VERSION) -lt 130000; echo $$?),0) 993 + ifeq ($(call test-lt, $(CONFIG_LLD_VERSION), 130000),y) 1006 994 KBUILD_LDFLAGS += -plugin-opt=-warn-stack-size=$(CONFIG_FRAME_WARN) 1007 995 endif 1008 996 endif ··· 1572 1560 rm -f $(MODLIB)/build ; \ 1573 1561 ln -s $(CURDIR) $(MODLIB)/build ; \ 1574 1562 fi 1575 - @sed 's:^:kernel/:' modules.order > $(MODLIB)/modules.order 1563 + @sed 's:^\(.*\)\.o$$:kernel/\1.ko:' modules.order > $(MODLIB)/modules.order 1576 1564 @cp -f modules.builtin $(MODLIB)/ 1577 1565 @cp -f $(objtree)/modules.builtin.modinfo $(MODLIB)/ 1578 1566
+1 -1
arch/riscv/Makefile
··· 37 37 endif 38 38 39 39 ifeq ($(CONFIG_LD_IS_LLD),y) 40 - ifeq ($(shell test $(CONFIG_LLD_VERSION) -lt 150000; echo $$?),0) 40 + ifeq ($(call test-lt, $(CONFIG_LLD_VERSION), 150000),y) 41 41 KBUILD_CFLAGS += -mno-relax 42 42 KBUILD_AFLAGS += -mno-relax 43 43 ifndef CONFIG_AS_IS_LLVM
+1 -1
arch/x86/Makefile
··· 217 217 KBUILD_LDFLAGS += -m elf_$(UTS_MACHINE) 218 218 219 219 ifdef CONFIG_LTO_CLANG 220 - ifeq ($(shell test $(CONFIG_LLD_VERSION) -lt 130000; echo $$?),0) 220 + ifeq ($(call test-lt, $(CONFIG_LLD_VERSION), 130000),y) 221 221 KBUILD_LDFLAGS += -plugin-opt=-stack-alignment=$(if $(CONFIG_X86_32),4,8) 222 222 endif 223 223 endif
-2
drivers/base/firmware_loader/firmware.h
··· 9 9 #include <linux/list.h> 10 10 #include <linux/completion.h> 11 11 12 - #include <generated/utsrelease.h> 13 - 14 12 /** 15 13 * enum fw_opt - options to control firmware loading behaviour 16 14 *
-1
init/version.c
··· 15 15 #include <linux/printk.h> 16 16 #include <linux/uts.h> 17 17 #include <linux/utsname.h> 18 - #include <generated/utsrelease.h> 19 18 #include <linux/proc_ns.h> 20 19 21 20 static int __init early_hostname(char *arg)
+10 -2
kernel/padata.c
··· 83 83 return pw; 84 84 } 85 85 86 - static void padata_work_init(struct padata_work *pw, work_func_t work_fn, 87 - void *data, int flags) 86 + /* 87 + * This function is marked __ref because this function may be optimized in such 88 + * a way that it directly refers to work_fn's address, which causes modpost to 89 + * complain when work_fn is marked __init. This scenario was observed with clang 90 + * LTO, where padata_work_init() was optimized to refer directly to 91 + * padata_mt_helper() because the calls to padata_work_init() with other work_fn 92 + * values were eliminated or inlined. 93 + */ 94 + static void __ref padata_work_init(struct padata_work *pw, work_func_t work_fn, 95 + void *data, int flags) 88 96 { 89 97 if (flags & PADATA_WORK_ONSTACK) 90 98 INIT_WORK_ONSTACK(&pw->pw_work, work_fn);
+27 -2
lib/Kconfig.debug
··· 312 312 DEBUG_INFO build and compile times are reduced too. 313 313 Only works with newer gcc versions. 314 314 315 - config DEBUG_INFO_COMPRESSED 316 - bool "Compressed debugging information" 315 + choice 316 + prompt "Compressed Debug information" 317 + help 318 + Compress the resulting debug info. Results in smaller debug info sections, 319 + but requires that consumers are able to decompress the results. 320 + 321 + If unsure, choose DEBUG_INFO_COMPRESSED_NONE. 322 + 323 + config DEBUG_INFO_COMPRESSED_NONE 324 + bool "Don't compress debug information" 325 + help 326 + Don't compress debug info sections. 327 + 328 + config DEBUG_INFO_COMPRESSED_ZLIB 329 + bool "Compress debugging information with zlib" 317 330 depends on $(cc-option,-gz=zlib) 318 331 depends on $(ld-option,--compress-debug-sections=zlib) 319 332 help ··· 339 326 recompressed with a different compression scheme. But this is still 340 327 preferable to setting $KDEB_COMPRESS to "none" which would be even 341 328 larger. 329 + 330 + config DEBUG_INFO_COMPRESSED_ZSTD 331 + bool "Compress debugging information with zstd" 332 + depends on $(cc-option,-gz=zstd) 333 + depends on $(ld-option,--compress-debug-sections=zstd) 334 + help 335 + Compress the debug information using zstd. This may provide better 336 + compression than zlib, for about the same time costs, but requires newer 337 + toolchain support. Requires GCC 13.0+ or Clang 16.0+, binutils 2.40+, and 338 + zstd. 339 + 340 + endchoice # "Compressed Debug information" 342 341 343 342 config DEBUG_INFO_SPLIT 344 343 bool "Produce split debuginfo in .dwo files"
+45 -3
scripts/Kbuild.include
··· 10 10 space := $(empty) $(empty) 11 11 space_escape := _-_SPACE_-_ 12 12 pound := \# 13 + define newline 14 + 15 + 16 + endef 17 + 18 + ### 19 + # Comparison macros. 20 + # Usage: $(call test-lt, $(CONFIG_LLD_VERSION), 150000) 21 + # 22 + # Use $(intcmp ...) if supported. (Make >= 4.4) 23 + # Otherwise, fall back to the 'test' shell command. 24 + ifeq ($(intcmp 1,0,,,y),y) 25 + test-ge = $(intcmp $(strip $1)0, $(strip $2)0,,y,y) 26 + test-gt = $(intcmp $(strip $1)0, $(strip $2)0,,,y) 27 + else 28 + test-ge = $(shell test $(strip $1)0 -ge $(strip $2)0 && echo y) 29 + test-gt = $(shell test $(strip $1)0 -gt $(strip $2)0 && echo y) 30 + endif 31 + test-le = $(call test-ge, $2, $1) 32 + test-lt = $(call test-gt, $2, $1) 13 33 14 34 ### 15 35 # Name of target with a '.' as filename prefix. foo/bar.o => foo/.bar.o ··· 59 39 ### 60 40 # Quote a string to pass it to C files. foo => '"foo"' 61 41 stringify = $(squote)$(quote)$1$(quote)$(squote) 42 + 43 + ### 44 + # The path to Kbuild or Makefile. Kbuild has precedence over Makefile. 45 + kbuild-dir = $(if $(filter /%,$(src)),$(src),$(srctree)/$(src)) 46 + kbuild-file = $(or $(wildcard $(kbuild-dir)/Kbuild),$(kbuild-dir)/Makefile) 47 + 48 + ### 49 + # Read a file, replacing newlines with spaces 50 + # 51 + # Make 4.2 or later can read a file by using its builtin function. 52 + ifneq ($(filter-out 3.% 4.0 4.1, $(MAKE_VERSION)),) 53 + read-file = $(subst $(newline),$(space),$(file < $1)) 54 + else 55 + read-file = $(shell cat $1 2>/dev/null) 56 + endif 62 57 63 58 ### 64 59 # Easy method for doing a status message ··· 185 150 make-cmd = $(call escsq,$(subst $(pound),$$(pound),$(subst $$,$$$$,$(cmd_$(1))))) 186 151 187 152 # Find any prerequisites that are newer than target or that do not exist. 188 - # (This is not true for now; $? should contain any non-existent prerequisites, 189 - # but it does not work as expected when .SECONDARY is present. This seems a bug 190 - # of GNU Make.) 191 153 # PHONY targets skipped in both cases. 192 154 newer-prereqs = $(filter-out $(PHONY),$?) 193 155 ··· 260 228 .DELETE_ON_ERROR: 261 229 262 230 # do not delete intermediate files automatically 231 + # 232 + # .NOTINTERMEDIATE is more correct, but only available on newer Make versions. 233 + # Make 4.4 introduced .NOTINTERMEDIATE, and it appears in .FEATURES, but the 234 + # global .NOTINTERMEDIATE does not work. We can use it on Make > 4.4. 235 + # Use .SECONDARY for older Make versions, but "newer-prereq" cannot detect 236 + # deleted files. 237 + ifneq ($(and $(filter notintermediate, $(.FEATURES)),$(filter-out 4.4,$(MAKE_VERSION))),) 238 + .NOTINTERMEDIATE: 239 + else 263 240 .SECONDARY: 241 + endif
+3 -3
scripts/Makefile.asm-generic
··· 10 10 all: 11 11 12 12 src := $(subst /generated,,$(obj)) 13 - -include $(src)/Kbuild 13 + 14 + include $(srctree)/scripts/Kbuild.include 15 + -include $(kbuild-file) 14 16 15 17 # $(generic)/Kbuild lists mandatory-y. Exclude um since it is a special case. 16 18 ifneq ($(SRCARCH),um) 17 19 include $(srctree)/$(generic)/Kbuild 18 20 endif 19 - 20 - include $(srctree)/scripts/Kbuild.include 21 21 22 22 redundant := $(filter $(mandatory-y) $(generated-y), $(generic-y)) 23 23 redundant += $(foreach f, $(generic-y), $(if $(wildcard $(srctree)/$(src)/$(f)),$(f)))
+8 -6
scripts/Makefile.build
··· 38 38 39 39 include $(srctree)/scripts/Kbuild.include 40 40 include $(srctree)/scripts/Makefile.compiler 41 - 42 - # The filename Kbuild has precedence over Makefile 43 - kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src)) 44 - include $(or $(wildcard $(kbuild-dir)/Kbuild),$(kbuild-dir)/Makefile) 45 - 41 + include $(kbuild-file) 46 42 include $(srctree)/scripts/Makefile.lib 47 43 48 44 # Do not include hostprogs rules unless needed. ··· 222 226 223 227 cmd_check_local_export = $(srctree)/scripts/check-local-export $@ 224 228 229 + ifneq ($(findstring 1, $(KBUILD_EXTRA_WARN)),) 230 + cmd_warn_shared_object = $(if $(word 2, $(modname-multi)),$(warning $(kbuild-file): $*.o is added to multiple modules: $(modname-multi))) 231 + endif 232 + 225 233 define rule_cc_o_c 226 234 $(call cmd_and_fixdep,cc_o_c) 227 235 $(call cmd,gen_ksymdeps) ··· 235 235 $(call cmd,gen_objtooldep) 236 236 $(call cmd,gen_symversions_c) 237 237 $(call cmd,record_mcount) 238 + $(call cmd,warn_shared_object) 238 239 endef 239 240 240 241 define rule_as_o_S ··· 244 243 $(call cmd,check_local_export) 245 244 $(call cmd,gen_objtooldep) 246 245 $(call cmd,gen_symversions_S) 246 + $(call cmd,warn_shared_object) 247 247 endef 248 248 249 249 # Built-in and composite module parts ··· 435 433 # modules.order unless contained modules are updated. 436 434 437 435 cmd_modules_order = { $(foreach m, $(real-prereqs), \ 438 - $(if $(filter %/modules.order, $m), cat $m, echo $(patsubst %.o,%.ko,$m));) :; } \ 436 + $(if $(filter %/modules.order, $m), cat $m, echo $m);) :; } \ 439 437 > $@ 440 438 441 439 $(obj)/modules.order: $(obj-m) FORCE
+1 -4
scripts/Makefile.clean
··· 9 9 __clean: 10 10 11 11 include $(srctree)/scripts/Kbuild.include 12 - 13 - # The filename Kbuild has precedence over Makefile 14 - kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src)) 15 - include $(or $(wildcard $(kbuild-dir)/Kbuild),$(kbuild-dir)/Makefile) 12 + include $(kbuild-file) 16 13 17 14 # Figure out what we need to build from the various variables 18 15 # ==========================================================================
+2 -2
scripts/Makefile.compiler
··· 63 63 64 64 # gcc-min-version 65 65 # Usage: cflags-$(call gcc-min-version, 70100) += -foo 66 - gcc-min-version = $(shell [ $(CONFIG_GCC_VERSION)0 -ge $(1)0 ] && echo y) 66 + gcc-min-version = $(call test-ge, $(CONFIG_GCC_VERSION), $1) 67 67 68 68 # clang-min-version 69 69 # Usage: cflags-$(call clang-min-version, 110000) += -foo 70 - clang-min-version = $(shell [ $(CONFIG_CLANG_VERSION)0 -ge $(1)0 ] && echo y) 70 + clang-min-version = $(call test-ge, $(CONFIG_CLANG_VERSION), $1) 71 71 72 72 # ld-option 73 73 # Usage: KBUILD_LDFLAGS += $(call ld-option, -X, -Y)
+5 -1
scripts/Makefile.debug
··· 27 27 DEBUG_RUSTFLAGS += -Cdebuginfo=2 28 28 endif 29 29 30 - ifdef CONFIG_DEBUG_INFO_COMPRESSED 30 + ifdef CONFIG_DEBUG_INFO_COMPRESSED_ZLIB 31 31 DEBUG_CFLAGS += -gz=zlib 32 32 KBUILD_AFLAGS += -gz=zlib 33 33 KBUILD_LDFLAGS += --compress-debug-sections=zlib 34 + else ifdef CONFIG_DEBUG_INFO_COMPRESSED_ZSTD 35 + DEBUG_CFLAGS += -gz=zstd 36 + KBUILD_AFLAGS += -gz=zstd 37 + KBUILD_LDFLAGS += --compress-debug-sections=zstd 34 38 endif 35 39 36 40 KBUILD_CFLAGS += $(DEBUG_CFLAGS)
+1 -1
scripts/Makefile.dtbinst
··· 15 15 16 16 include include/config/auto.conf 17 17 include $(srctree)/scripts/Kbuild.include 18 - include $(src)/Makefile 18 + include $(kbuild-file) 19 19 20 20 dtbs := $(addprefix $(dst)/, $(dtb-y) $(if $(CONFIG_OF_ALL_DTBS),$(dtb-))) 21 21 subdirs := $(addprefix $(obj)/, $(subdir-y) $(subdir-m))
+1
scripts/Makefile.extrawarn
··· 38 38 KBUILD_CFLAGS += -Wno-type-limits 39 39 KBUILD_CFLAGS += -Wno-shift-negative-value 40 40 41 + KBUILD_CPPFLAGS += -Wundef 41 42 KBUILD_CPPFLAGS += -DKBUILD_EXTRA_WARN1 42 43 43 44 else
+4 -4
scripts/Makefile.modfinal
··· 13 13 include $(srctree)/scripts/Makefile.lib 14 14 15 15 # find all modules listed in modules.order 16 - modules := $(sort $(shell cat $(MODORDER))) 16 + modules := $(call read-file, $(MODORDER)) 17 17 18 - __modfinal: $(modules) 18 + __modfinal: $(modules:%.o=%.ko) 19 19 @: 20 20 21 21 # modname and part-of-module are set to make c_flags define proper module flags ··· 57 57 printf '%s\n' 'cmd_$@ := $(make-cmd)' > $(dot-target).cmd, @:) 58 58 59 59 # Re-generate module BTFs if either module's .ko or vmlinux changed 60 - $(modules): %.ko: %.o %.mod.o scripts/module.lds $(and $(CONFIG_DEBUG_INFO_BTF_MODULES),$(KBUILD_BUILTIN),vmlinux) FORCE 60 + %.ko: %.o %.mod.o scripts/module.lds $(and $(CONFIG_DEBUG_INFO_BTF_MODULES),$(KBUILD_BUILTIN),vmlinux) FORCE 61 61 +$(call if_changed_except,ld_ko_o,vmlinux) 62 62 ifdef CONFIG_DEBUG_INFO_BTF_MODULES 63 63 +$(if $(newer-prereqs),$(call cmd,btf_ko)) 64 64 endif 65 65 66 - targets += $(modules) $(modules:.ko=.mod.o) 66 + targets += $(modules:%.o=%.ko) $(modules:%.o=%.mod.o) 67 67 68 68 # Add FORCE to the prequisites of a target to force it to be always rebuilt. 69 69 # ---------------------------------------------------------------------------
+2 -2
scripts/Makefile.modinst
··· 9 9 include include/config/auto.conf 10 10 include $(srctree)/scripts/Kbuild.include 11 11 12 - modules := $(sort $(shell cat $(MODORDER))) 12 + modules := $(call read-file, $(MODORDER)) 13 13 14 14 ifeq ($(KBUILD_EXTMOD),) 15 15 dst := $(MODLIB)/kernel ··· 26 26 suffix-$(CONFIG_MODULE_COMPRESS_XZ) := .xz 27 27 suffix-$(CONFIG_MODULE_COMPRESS_ZSTD) := .zst 28 28 29 - modules := $(patsubst $(extmod_prefix)%, $(dst)/%$(suffix-y), $(modules)) 29 + modules := $(patsubst $(extmod_prefix)%.o, $(dst)/%.ko$(suffix-y), $(modules)) 30 30 31 31 __modinst: $(modules) 32 32 @:
+26 -15
scripts/Makefile.modpost
··· 38 38 include include/config/auto.conf 39 39 include $(srctree)/scripts/Kbuild.include 40 40 41 + MODPOST = scripts/mod/modpost 42 + 41 43 modpost-args = \ 42 44 $(if $(CONFIG_MODVERSIONS),-m) \ 43 45 $(if $(CONFIG_MODULE_SRCVERSION_ALL),-a) \ ··· 47 45 $(if $(KBUILD_NSDEPS),-d $(MODULES_NSDEPS)) \ 48 46 $(if $(CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS)$(KBUILD_NSDEPS),-N) \ 49 47 -o $@ 48 + 49 + modpost-deps := $(MODPOST) 50 50 51 51 # 'make -i -k' ignores compile errors, and builds as many modules as possible. 52 52 ifneq ($(findstring i,$(filter-out --%,$(MAKEFLAGS))),) ··· 82 78 .vmlinux.objs: vmlinux.a $(KBUILD_VMLINUX_LIBS) FORCE 83 79 $(call if_changed,vmlinux_objs) 84 80 85 - vmlinux.o-if-present := $(wildcard vmlinux.o) 86 - output-symdump := vmlinux.symvers 87 - 88 - ifdef KBUILD_MODULES 89 - output-symdump := $(if $(vmlinux.o-if-present), Module.symvers, modules-only.symvers) 90 - missing-input := $(filter-out $(vmlinux.o-if-present),vmlinux.o) 81 + ifeq ($(wildcard vmlinux.o),) 82 + missing-input := vmlinux.o 83 + output-symdump := modules-only.symvers 84 + else 85 + modpost-args += vmlinux.o 86 + modpost-deps += vmlinux.o 87 + output-symdump := $(if $(KBUILD_MODULES), Module.symvers, vmlinux.symvers) 91 88 endif 92 89 93 90 else ··· 98 93 src := $(obj) 99 94 100 95 # Include the module's Makefile to find KBUILD_EXTRA_SYMBOLS 101 - include $(or $(wildcard $(src)/Kbuild), $(src)/Makefile) 96 + include $(kbuild-file) 102 97 103 - module.symvers-if-present := $(wildcard Module.symvers) 104 98 output-symdump := $(KBUILD_EXTMOD)/Module.symvers 105 - missing-input := $(filter-out $(module.symvers-if-present), Module.symvers) 106 99 107 - modpost-args += -e $(addprefix -i ,$(module.symvers-if-present) $(KBUILD_EXTRA_SYMBOLS)) 100 + ifeq ($(wildcard Module.symvers),) 101 + missing-input := Module.symvers 102 + else 103 + modpost-args += -i Module.symvers 104 + modpost-deps += Module.symvers 105 + endif 106 + 107 + modpost-args += -e $(addprefix -i , $(KBUILD_EXTRA_SYMBOLS)) 108 108 109 109 endif # ($(KBUILD_EXTMOD),) 110 110 ··· 117 107 modpost-args += -w 118 108 endif 119 109 120 - modorder-if-needed := $(if $(KBUILD_MODULES), $(MODORDER)) 121 - 122 - MODPOST = scripts/mod/modpost 110 + ifdef KBUILD_MODULES 111 + modpost-args += -T $(MODORDER) 112 + modpost-deps += $(MODORDER) 113 + endif 123 114 124 115 # Read out modules.order to pass in modpost. 125 116 # Otherwise, allmodconfig would fail with "Argument list too long". ··· 130 119 echo >&2 "WARNING: $(missing-input) is missing."; \ 131 120 echo >&2 " Modules may not have dependencies or modversions."; \ 132 121 echo >&2 " You may get many unresolved symbol warnings.";) \ 133 - sed 's/ko$$/o/' $(or $(modorder-if-needed), /dev/null) | $(MODPOST) $(modpost-args) -T - $(vmlinux.o-if-present) 122 + $(MODPOST) $(modpost-args) 134 123 135 124 targets += $(output-symdump) 136 - $(output-symdump): $(modorder-if-needed) $(vmlinux.o-if-present) $(module.symvers-if-present) $(MODPOST) FORCE 125 + $(output-symdump): $(modpost-deps) FORCE 137 126 $(call if_changed,modpost) 138 127 139 128 __modpost: $(output-symdump)
+10
scripts/Makefile.package
··· 62 62 +rpmbuild $(RPMOPTS) --target $(UTS_MACHINE)-linux -ta $(KERNELPATH).tar.gz \ 63 63 --define='_smp_mflags %{nil}' 64 64 65 + # srcrpm-pkg 66 + # --------------------------------------------------------------------------- 67 + PHONY += srcrpm-pkg 68 + srcrpm-pkg: 69 + $(MAKE) clean 70 + $(CONFIG_SHELL) $(MKSPEC) >$(objtree)/kernel.spec 71 + $(call cmd,src_tar,$(KERNELPATH),kernel.spec) 72 + +rpmbuild $(RPMOPTS) --target $(UTS_MACHINE)-linux -ts $(KERNELPATH).tar.gz \ 73 + --define='_smp_mflags %{nil}' --define='_srcrpmdir $(srctree)' 74 + 65 75 # binrpm-pkg 66 76 # --------------------------------------------------------------------------- 67 77 PHONY += binrpm-pkg
+4 -4
scripts/clang-tools/gen_compile_commands.py
··· 138 138 """ 139 139 with open(modorder) as f: 140 140 for line in f: 141 - ko = line.rstrip() 142 - base, ext = os.path.splitext(ko) 143 - if ext != '.ko': 144 - sys.exit('{}: module path must end with .ko'.format(ko)) 141 + obj = line.rstrip() 142 + base, ext = os.path.splitext(obj) 143 + if ext != '.o': 144 + sys.exit('{}: module path must end with .o'.format(obj)) 145 145 mod = base + '.mod' 146 146 # Read from *.mod, to get a list of objects that compose the module. 147 147 with open(mod) as m:
+1 -1
scripts/gen_autoksyms.sh
··· 48 48 EOT 49 49 50 50 { 51 - [ -n "${read_modorder}" ] && sed 's/ko$/usyms/' modules.order | xargs cat 51 + [ -n "${read_modorder}" ] && sed 's/o$/usyms/' modules.order | xargs cat 52 52 echo "$needed_symbols" 53 53 [ -n "$ksym_wl" ] && cat "$ksym_wl" 54 54 } | sed -e 's/ /\n/g' | sed -n -e '/^$/!p' |
+3 -1
scripts/jobserver-exec
··· 23 23 opts = [x for x in flags.split(" ") if x.startswith("--jobserver")] 24 24 25 25 # Parse out R,W file descriptor numbers and set them nonblocking. 26 - fds = opts[0].split("=", 1)[1] 26 + # If the MAKEFLAGS variable contains multiple instances of the 27 + # --jobserver-auth= option, the last one is relevant. 28 + fds = opts[-1].split("=", 1)[1] 27 29 reader, writer = [int(x) for x in fds.split(",", 1)] 28 30 # Open a private copy of reader to avoid setting nonblocking 29 31 # on an unexpecting process with the same reader fd.
+3 -1
scripts/kconfig/.gitignore
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 2 /conf 3 3 /[gmnq]conf 4 - /[gmnq]conf-cfg 4 + /[gmnq]conf-cflags 5 + /[gmnq]conf-libs 6 + /qconf-bin 5 7 /qconf-moc.cc
+24 -21
scripts/kconfig/Makefile
··· 159 159 hostprogs += nconf 160 160 nconf-objs := nconf.o nconf.gui.o $(common-objs) 161 161 162 - HOSTLDLIBS_nconf = $(shell . $(obj)/nconf-cfg && echo $$libs) 163 - HOSTCFLAGS_nconf.o = $(shell . $(obj)/nconf-cfg && echo $$cflags) 164 - HOSTCFLAGS_nconf.gui.o = $(shell . $(obj)/nconf-cfg && echo $$cflags) 162 + HOSTLDLIBS_nconf = $(call read-file, $(obj)/nconf-libs) 163 + HOSTCFLAGS_nconf.o = $(call read-file, $(obj)/nconf-cflags) 164 + HOSTCFLAGS_nconf.gui.o = $(call read-file, $(obj)/nconf-cflags) 165 165 166 - $(obj)/nconf.o $(obj)/nconf.gui.o: $(obj)/nconf-cfg 166 + $(obj)/nconf: | $(obj)/nconf-libs 167 + $(obj)/nconf.o $(obj)/nconf.gui.o: | $(obj)/nconf-cflags 167 168 168 169 # mconf: Used for the menuconfig target based on lxdialog 169 170 hostprogs += mconf ··· 172 171 checklist.o inputbox.o menubox.o textbox.o util.o yesno.o) 173 172 mconf-objs := mconf.o $(lxdialog) $(common-objs) 174 173 175 - HOSTLDLIBS_mconf = $(shell . $(obj)/mconf-cfg && echo $$libs) 174 + HOSTLDLIBS_mconf = $(call read-file, $(obj)/mconf-libs) 176 175 $(foreach f, mconf.o $(lxdialog), \ 177 - $(eval HOSTCFLAGS_$f = $$(shell . $(obj)/mconf-cfg && echo $$$$cflags))) 176 + $(eval HOSTCFLAGS_$f = $$(call read-file, $(obj)/mconf-cflags))) 178 177 179 - $(addprefix $(obj)/, mconf.o $(lxdialog)): $(obj)/mconf-cfg 178 + $(obj)/mconf: | $(obj)/mconf-libs 179 + $(addprefix $(obj)/, mconf.o $(lxdialog)): | $(obj)/mconf-cflags 180 180 181 181 # qconf: Used for the xconfig target based on Qt 182 182 hostprogs += qconf 183 183 qconf-cxxobjs := qconf.o qconf-moc.o 184 184 qconf-objs := images.o $(common-objs) 185 185 186 - HOSTLDLIBS_qconf = $(shell . $(obj)/qconf-cfg && echo $$libs) 187 - HOSTCXXFLAGS_qconf.o = $(shell . $(obj)/qconf-cfg && echo $$cflags) 188 - HOSTCXXFLAGS_qconf-moc.o = $(shell . $(obj)/qconf-cfg && echo $$cflags) 189 - 190 - $(obj)/qconf.o: $(obj)/qconf-cfg 186 + HOSTLDLIBS_qconf = $(call read-file, $(obj)/qconf-libs) 187 + HOSTCXXFLAGS_qconf.o = -std=c++11 -fPIC $(call read-file, $(obj)/qconf-cflags) 188 + HOSTCXXFLAGS_qconf-moc.o = -std=c++11 -fPIC $(call read-file, $(obj)/qconf-cflags) 189 + $(obj)/qconf: | $(obj)/qconf-libs 190 + $(obj)/qconf.o $(obj)/qconf-moc.o: | $(obj)/qconf-cflags 191 191 192 192 quiet_cmd_moc = MOC $@ 193 - cmd_moc = $(shell . $(obj)/qconf-cfg && echo $$moc) $< -o $@ 193 + cmd_moc = $(call read-file, $(obj)/qconf-bin)/moc $< -o $@ 194 194 195 - $(obj)/qconf-moc.cc: $(src)/qconf.h $(obj)/qconf-cfg FORCE 195 + $(obj)/qconf-moc.cc: $(src)/qconf.h FORCE | $(obj)/qconf-bin 196 196 $(call if_changed,moc) 197 197 198 198 targets += qconf-moc.cc ··· 202 200 hostprogs += gconf 203 201 gconf-objs := gconf.o images.o $(common-objs) 204 202 205 - HOSTLDLIBS_gconf = $(shell . $(obj)/gconf-cfg && echo $$libs) 206 - HOSTCFLAGS_gconf.o = $(shell . $(obj)/gconf-cfg && echo $$cflags) 203 + HOSTLDLIBS_gconf = $(call read-file, $(obj)/gconf-libs) 204 + HOSTCFLAGS_gconf.o = $(call read-file, $(obj)/gconf-cflags) 207 205 208 - $(obj)/gconf.o: $(obj)/gconf-cfg 206 + $(obj)/gconf: | $(obj)/gconf-libs 207 + $(obj)/gconf.o: | $(obj)/gconf-cflags 209 208 210 209 # check if necessary packages are available, and configure build flags 211 - filechk_conf_cfg = $(CONFIG_SHELL) $< 210 + cmd_conf_cfg = $< $(addprefix $(obj)/$*conf-, cflags libs bin) 212 211 213 - $(obj)/%conf-cfg: $(src)/%conf-cfg.sh FORCE 214 - $(call filechk,conf_cfg) 212 + $(obj)/%conf-cflags $(obj)/%conf-libs $(obj)/%conf-bin: $(src)/%conf-cfg.sh 213 + $(call cmd,conf_cfg) 215 214 216 - clean-files += *conf-cfg 215 + clean-files += *conf-cflags *conf-libs *conf-bin
+5 -2
scripts/kconfig/gconf-cfg.sh
··· 1 1 #!/bin/sh 2 2 # SPDX-License-Identifier: GPL-2.0 3 3 4 + cflags=$1 5 + libs=$2 6 + 4 7 PKG="gtk+-2.0 gmodule-2.0 libglade-2.0" 5 8 6 9 if [ -z "$(command -v ${HOSTPKG_CONFIG})" ]; then ··· 29 26 exit 1 30 27 fi 31 28 32 - echo cflags=\"$(${HOSTPKG_CONFIG} --cflags $PKG)\" 33 - echo libs=\"$(${HOSTPKG_CONFIG} --libs $PKG)\" 29 + ${HOSTPKG_CONFIG} --cflags ${PKG} > ${cflags} 30 + ${HOSTPKG_CONFIG} --libs ${PKG} > ${libs}
+1 -1
scripts/kconfig/lkc.h
··· 76 76 void str_free(struct gstr *gs); 77 77 void str_append(struct gstr *gs, const char *s); 78 78 void str_printf(struct gstr *gs, const char *fmt, ...); 79 - const char *str_get(struct gstr *gs); 79 + char *str_get(struct gstr *gs); 80 80 81 81 /* menu.c */ 82 82 void _menu_init(void);
+14 -11
scripts/kconfig/mconf-cfg.sh
··· 1 1 #!/bin/sh 2 2 # SPDX-License-Identifier: GPL-2.0 3 3 4 + cflags=$1 5 + libs=$2 6 + 4 7 PKG="ncursesw" 5 8 PKG2="ncurses" 6 9 7 10 if [ -n "$(command -v ${HOSTPKG_CONFIG})" ]; then 8 11 if ${HOSTPKG_CONFIG} --exists $PKG; then 9 - echo cflags=\"$(${HOSTPKG_CONFIG} --cflags $PKG)\" 10 - echo libs=\"$(${HOSTPKG_CONFIG} --libs $PKG)\" 12 + ${HOSTPKG_CONFIG} --cflags ${PKG} > ${cflags} 13 + ${HOSTPKG_CONFIG} --libs ${PKG} > ${libs} 11 14 exit 0 12 15 fi 13 16 14 - if ${HOSTPKG_CONFIG} --exists $PKG2; then 15 - echo cflags=\"$(${HOSTPKG_CONFIG} --cflags $PKG2)\" 16 - echo libs=\"$(${HOSTPKG_CONFIG} --libs $PKG2)\" 17 + if ${HOSTPKG_CONFIG} --exists ${PKG2}; then 18 + ${HOSTPKG_CONFIG} --cflags ${PKG2} > ${cflags} 19 + ${HOSTPKG_CONFIG} --libs ${PKG2} > ${libs} 17 20 exit 0 18 21 fi 19 22 fi ··· 25 22 # (Even if it is installed, some distributions such as openSUSE cannot 26 23 # find ncurses by pkg-config.) 27 24 if [ -f /usr/include/ncursesw/ncurses.h ]; then 28 - echo cflags=\"-D_GNU_SOURCE -I/usr/include/ncursesw\" 29 - echo libs=\"-lncursesw\" 25 + echo -D_GNU_SOURCE -I/usr/include/ncursesw > ${cflags} 26 + echo -lncursesw > ${libs} 30 27 exit 0 31 28 fi 32 29 33 30 if [ -f /usr/include/ncurses/ncurses.h ]; then 34 - echo cflags=\"-D_GNU_SOURCE -I/usr/include/ncurses\" 35 - echo libs=\"-lncurses\" 31 + echo -D_GNU_SOURCE -I/usr/include/ncurses > ${cflags} 32 + echo -lncurses > ${libs} 36 33 exit 0 37 34 fi 38 35 39 36 # As a final fallback before giving up, check if $HOSTCC knows of a default 40 37 # ncurses installation (e.g. from a vendor-specific sysroot). 41 38 if echo '#include <ncurses.h>' | ${HOSTCC} -E - >/dev/null 2>&1; then 42 - echo cflags=\"-D_GNU_SOURCE\" 43 - echo libs=\"-lncurses\" 39 + echo -D_GNU_SOURCE > ${cflags} 40 + echo -lncurses > ${libs} 44 41 exit 0 45 42 fi 46 43
+2 -3
scripts/kconfig/mconf.c
··· 440 440 441 441 res = get_relations_str(sym_arr, &head); 442 442 set_subtitle(); 443 - dres = show_textbox_ext("Search Results", (char *) 444 - str_get(&res), 0, 0, keys, &vscroll, 445 - &hscroll, &update_text, (void *) 443 + dres = show_textbox_ext("Search Results", str_get(&res), 0, 0, 444 + keys, &vscroll, &hscroll, &update_text, 446 445 &data); 447 446 again = false; 448 447 for (i = 0; i < JUMP_NB && keys[i]; i++)
+1 -3
scripts/kconfig/menu.c
··· 724 724 725 725 menu = prop->menu; 726 726 for (i = 0; menu != &rootmenu && i < 8; menu = menu->parent) { 727 - bool accessible = menu_is_visible(menu); 728 - 729 727 submenu[i++] = menu; 730 - if (location == NULL && accessible) 728 + if (location == NULL && menu_is_visible(menu)) 731 729 location = menu; 732 730 } 733 731 if (head && location) {
+13 -10
scripts/kconfig/nconf-cfg.sh
··· 1 1 #!/bin/sh 2 2 # SPDX-License-Identifier: GPL-2.0 3 3 4 + cflags=$1 5 + libs=$2 6 + 4 7 PKG="ncursesw menuw panelw" 5 8 PKG2="ncurses menu panel" 6 9 7 10 if [ -n "$(command -v ${HOSTPKG_CONFIG})" ]; then 8 11 if ${HOSTPKG_CONFIG} --exists $PKG; then 9 - echo cflags=\"$(${HOSTPKG_CONFIG} --cflags $PKG)\" 10 - echo libs=\"$(${HOSTPKG_CONFIG} --libs $PKG)\" 12 + ${HOSTPKG_CONFIG} --cflags ${PKG} > ${cflags} 13 + ${HOSTPKG_CONFIG} --libs ${PKG} > ${libs} 11 14 exit 0 12 15 fi 13 16 14 17 if ${HOSTPKG_CONFIG} --exists $PKG2; then 15 - echo cflags=\"$(${HOSTPKG_CONFIG} --cflags $PKG2)\" 16 - echo libs=\"$(${HOSTPKG_CONFIG} --libs $PKG2)\" 18 + ${HOSTPKG_CONFIG} --cflags ${PKG2} > ${cflags} 19 + ${HOSTPKG_CONFIG} --libs ${PKG2} > ${libs} 17 20 exit 0 18 21 fi 19 22 fi ··· 25 22 # (Even if it is installed, some distributions such as openSUSE cannot 26 23 # find ncurses by pkg-config.) 27 24 if [ -f /usr/include/ncursesw/ncurses.h ]; then 28 - echo cflags=\"-D_GNU_SOURCE -I/usr/include/ncursesw\" 29 - echo libs=\"-lncursesw -lmenuw -lpanelw\" 25 + echo -D_GNU_SOURCE -I/usr/include/ncursesw > ${cflags} 26 + echo -lncursesw -lmenuw -lpanelw > ${libs} 30 27 exit 0 31 28 fi 32 29 33 30 if [ -f /usr/include/ncurses/ncurses.h ]; then 34 - echo cflags=\"-D_GNU_SOURCE -I/usr/include/ncurses\" 35 - echo libs=\"-lncurses -lmenu -lpanel\" 31 + echo -D_GNU_SOURCE -I/usr/include/ncurses > ${cflags} 32 + echo -lncurses -lmenu -lpanel > ${libs} 36 33 exit 0 37 34 fi 38 35 39 36 if [ -f /usr/include/ncurses.h ]; then 40 - echo cflags=\"-D_GNU_SOURCE\" 41 - echo libs=\"-lncurses -lmenu -lpanel\" 37 + echo -D_GNU_SOURCE > ${cflags} 38 + echo -lncurses -lmenu -lpanel > ${libs} 42 39 exit 0 43 40 fi 44 41
+7 -3
scripts/kconfig/qconf-cfg.sh
··· 1 1 #!/bin/sh 2 2 # SPDX-License-Identifier: GPL-2.0 3 3 4 + cflags=$1 5 + libs=$2 6 + bin=$3 7 + 4 8 PKG="Qt5Core Qt5Gui Qt5Widgets" 5 9 6 10 if [ -z "$(command -v ${HOSTPKG_CONFIG})" ]; then ··· 15 11 fi 16 12 17 13 if ${HOSTPKG_CONFIG} --exists $PKG; then 18 - echo cflags=\"-std=c++11 -fPIC $(${HOSTPKG_CONFIG} --cflags $PKG)\" 19 - echo libs=\"$(${HOSTPKG_CONFIG} --libs $PKG)\" 20 - echo moc=\"$(${HOSTPKG_CONFIG} --variable=host_bins Qt5Core)/moc\" 14 + ${HOSTPKG_CONFIG} --cflags ${PKG} > ${cflags} 15 + ${HOSTPKG_CONFIG} --libs ${PKG} > ${libs} 16 + ${HOSTPKG_CONFIG} --variable=host_bins Qt5Core > ${bin} 21 17 exit 0 22 18 fi 23 19
+1 -1
scripts/kconfig/util.c
··· 74 74 } 75 75 76 76 /* Retrieve value of growable string */ 77 - const char *str_get(struct gstr *gs) 77 + char *str_get(struct gstr *gs) 78 78 { 79 79 return gs->s; 80 80 }
+1 -1
scripts/min-tool-version.sh
··· 14 14 15 15 case "$1" in 16 16 binutils) 17 - echo 2.23.0 17 + echo 2.25.0 18 18 ;; 19 19 gcc) 20 20 echo 5.1.0
+15 -15
scripts/mod/file2alias.c
··· 34 34 typedef uint32_t __u32; 35 35 typedef uint16_t __u16; 36 36 typedef unsigned char __u8; 37 + 38 + /* UUID types for backward compatibility, don't use in new code */ 37 39 typedef struct { 38 40 __u8 b[16]; 39 41 } guid_t; 40 42 41 - /* backwards compatibility, don't use in new code */ 42 - typedef struct { 43 - __u8 b[16]; 44 - } uuid_le; 45 43 typedef struct { 46 44 __u8 b[16]; 47 45 } uuid_t; 46 + 48 47 #define UUID_STRING_LEN 36 48 + 49 + /* MEI UUID type, don't use anywhere else */ 50 + typedef struct { 51 + __u8 b[16]; 52 + } uuid_le; 49 53 50 54 /* Big exception to the "don't include kernel headers into userspace, which 51 55 * even potentially has different endianness and word sizes, since ··· 144 140 int i; 145 141 146 142 if (size % id_size || size < id_size) { 147 - fatal("%s: sizeof(struct %s_device_id)=%lu is not a modulo " 148 - "of the size of " 149 - "section __mod_%s__<identifier>_device_table=%lu.\n" 150 - "Fix definition of struct %s_device_id " 151 - "in mod_devicetable.h\n", 143 + fatal("%s: sizeof(struct %s_device_id)=%lu is not a modulo of the size of section __mod_%s__<identifier>_device_table=%lu.\n" 144 + "Fix definition of struct %s_device_id in mod_devicetable.h\n", 152 145 modname, device_id, id_size, device_id, size, device_id); 153 146 } 154 147 /* Verify last one is a terminator */ 155 148 for (i = 0; i < id_size; i++ ) { 156 149 if (*(uint8_t*)(symval+size-id_size+i)) { 157 - fprintf(stderr,"%s: struct %s_device_id is %lu bytes. " 158 - "The last of %lu is:\n", 150 + fprintf(stderr, 151 + "%s: struct %s_device_id is %lu bytes. The last of %lu is:\n", 159 152 modname, device_id, id_size, size / id_size); 160 153 for (i = 0; i < id_size; i++ ) 161 154 fprintf(stderr,"0x%02x ", 162 155 *(uint8_t*)(symval+size-id_size+i) ); 163 156 fprintf(stderr,"\n"); 164 - fatal("%s: struct %s_device_id is not terminated " 165 - "with a NULL entry!\n", modname, device_id); 157 + fatal("%s: struct %s_device_id is not terminated with a NULL entry!\n", 158 + modname, device_id); 166 159 } 167 160 } 168 161 } ··· 1155 1154 DEF_FIELD(symval, amba_id, mask); 1156 1155 1157 1156 if ((id & mask) != id) 1158 - fatal("%s: Masked-off bit(s) of AMBA device ID are non-zero: " 1159 - "id=0x%08X, mask=0x%08X. Please fix this driver.\n", 1157 + fatal("%s: Masked-off bit(s) of AMBA device ID are non-zero: id=0x%08X, mask=0x%08X. Please fix this driver.\n", 1160 1158 filename, id, mask); 1161 1159 1162 1160 p += sprintf(alias, "amba:d");
+9 -14
scripts/mod/modpost.c
··· 519 519 int nobits = sechdrs[i].sh_type == SHT_NOBITS; 520 520 521 521 if (!nobits && sechdrs[i].sh_offset > info->size) { 522 - fatal("%s is truncated. sechdrs[i].sh_offset=%lu > " 523 - "sizeof(*hrd)=%zu\n", filename, 524 - (unsigned long)sechdrs[i].sh_offset, 522 + fatal("%s is truncated. sechdrs[i].sh_offset=%lu > sizeof(*hrd)=%zu\n", 523 + filename, (unsigned long)sechdrs[i].sh_offset, 525 524 sizeof(*hdr)); 526 525 return 0; 527 526 } ··· 822 823 #define ALL_EXIT_SECTIONS EXIT_SECTIONS, ALL_XXXEXIT_SECTIONS 823 824 824 825 #define DATA_SECTIONS ".data", ".data.rel" 825 - #define TEXT_SECTIONS ".text", ".text.unlikely", ".sched.text", \ 826 + #define TEXT_SECTIONS ".text", ".text.*", ".sched.text", \ 826 827 ".kprobes.text", ".cpuidle.text", ".noinstr.text" 827 828 #define OTHER_TEXT_SECTIONS ".ref.text", ".head.text", ".spinlock.text", \ 828 - ".fixup", ".entry.text", ".exception.text", ".text.*", \ 829 + ".fixup", ".entry.text", ".exception.text", \ 829 830 ".coldtext", ".softirqentry.text" 830 831 831 832 #define INIT_SECTIONS ".init.*" ··· 1354 1355 get_pretty_name(is_function(tosym), 1355 1356 &to_pretty_name, &to_pretty_name_p); 1356 1357 1357 - warn("%s(%s+0x%lx): Section mismatch in reference" 1358 - " from the %s %s%s to the %s %s:%s%s\n", 1358 + warn("%s(%s+0x%lx): Section mismatch in reference from the %s %s%s to the %s %s:%s%s\n", 1359 1359 modname, fromsec, (long)r->r_offset, from_pretty_name, 1360 1360 fromsym_name, from_pretty_name_p, 1361 1361 to_pretty_name, tosec, tosym_name, to_pretty_name_p); ··· 1869 1871 FILE *in = stdin; 1870 1872 char fname[PATH_MAX]; 1871 1873 1872 - if (strcmp(filename, "-") != 0) { 1873 - in = fopen(filename, "r"); 1874 - if (!in) 1875 - fatal("Can't open filenames file %s: %m", filename); 1876 - } 1874 + in = fopen(filename, "r"); 1875 + if (!in) 1876 + fatal("Can't open filenames file %s: %m", filename); 1877 1877 1878 1878 while (fgets(fname, PATH_MAX, in) != NULL) { 1879 1879 if (strends(fname, "\n")) ··· 1879 1883 read_symbols(fname); 1880 1884 } 1881 1885 1882 - if (in != stdin) 1883 - fclose(in); 1886 + fclose(in); 1884 1887 } 1885 1888 1886 1889 #define SZ 500
+2 -2
scripts/mod/sumversion.c
··· 153 153 154 154 static inline void md4_transform_helper(struct md4_ctx *ctx) 155 155 { 156 - le32_to_cpu_array(ctx->block, sizeof(ctx->block) / sizeof(uint32_t)); 156 + le32_to_cpu_array(ctx->block, ARRAY_SIZE(ctx->block)); 157 157 md4_transform(ctx->hash, ctx->block); 158 158 } 159 159 ··· 216 216 le32_to_cpu_array(mctx->block, (sizeof(mctx->block) - 217 217 sizeof(uint64_t)) / sizeof(uint32_t)); 218 218 md4_transform(mctx->hash, mctx->block); 219 - cpu_to_le32_array(mctx->hash, sizeof(mctx->hash) / sizeof(uint32_t)); 219 + cpu_to_le32_array(mctx->hash, ARRAY_SIZE(mctx->hash)); 220 220 221 221 snprintf(out, len, "%08X%08X%08X%08X", 222 222 mctx->hash[0], mctx->hash[1], mctx->hash[2], mctx->hash[3]);
+1 -1
scripts/modules-check.sh
··· 16 16 for m in $(sed 's:.*/::' "$1" | sort | uniq -d) 17 17 do 18 18 echo "error: the following would cause module name conflict:" >&2 19 - sed -n "/\/$m/s:^: :p" "$1" >&2 19 + sed -n "/\/$m/s:^\(.*\)\.o\$: \1.ko:p" "$1" >&2 20 20 exit_code=1 21 21 done 22 22 }
+1 -1
scripts/package/buildtar
··· 122 122 fi 123 123 ;; 124 124 arm64) 125 - for i in Image.bz2 Image.gz Image.lz4 Image.lzma Image.lzo ; do 125 + for i in Image.bz2 Image.gz Image.lz4 Image.lzma Image.lzo vmlinuz.efi ; do 126 126 if [ -f "${objtree}/arch/arm64/boot/${i}" ] ; then 127 127 cp -v -- "${objtree}/arch/arm64/boot/${i}" "${tmpdir}/boot/vmlinuz-${KERNELRELEASE}" 128 128 break
+1 -1
scripts/package/mkdebian
··· 175 175 Priority: optional 176 176 Maintainer: $maintainer 177 177 Rules-Requires-Root: no 178 - Build-Depends: bc, rsync, kmod, cpio, bison, flex | flex:native $extra_build_depends 178 + Build-Depends: bc, rsync, kmod, cpio, bison, flex $extra_build_depends 179 179 Homepage: https://www.kernel.org/ 180 180 181 181 Package: $packagename-$version
+7
scripts/package/mkspec
··· 33 33 --exclude=*.o --exclude=*.ko --exclude=*.cmd --exclude=Documentation \ 34 34 --exclude=.config.old --exclude=.missing-syscalls.d --exclude=*.s" 35 35 36 + test -n "$LOCALVERSION" && MAKE="$MAKE LOCALVERSION=$LOCALVERSION" 37 + 36 38 # We can label the here-doc lines for conditional output to the spec file 37 39 # 38 40 # Labels: ··· 51 49 URL: https://www.kernel.org 52 50 $S Source: kernel-$__KERNELRELEASE.tar.gz 53 51 Provides: $PROVIDES 52 + $S BuildRequires: bc binutils bison dwarves elfutils-libelf-devel flex 53 + $S BuildRequires: gcc make openssl openssl-devel perl python3 rsync 54 + 54 55 # $UTS_MACHINE as a fallback of _arch in case 55 56 # /usr/lib/rpm/platform/*/macros was not included. 56 57 %define _arch %{?_arch:$UTS_MACHINE} ··· 85 80 $S$M 86 81 $S %prep 87 82 $S %setup -q 83 + $S rm -f scripts/basic/fixdep scripts/kconfig/conf 84 + $S rm -f tools/objtool/{fixdep,objtool} 88 85 $S 89 86 $S %build 90 87 $S $MAKE %{?_smp_mflags} KBUILD_BUILD_VERSION=%{release}
+2
scripts/remove-stale-files
··· 47 47 rm -f scripts/extract-cert 48 48 49 49 rm -f arch/x86/purgatory/kexec-purgatory.c 50 + 51 + rm -f scripts/kconfig/[gmnq]conf-cfg