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-v5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild

Pull Kbuild updates from Masahiro Yamada:

- Increase the -falign-functions alignment for the debug option.

- Remove ugly libelf checks from the top Makefile.

- Make the silent build (-s) more silent.

- Re-compile the kernel if KBUILD_BUILD_TIMESTAMP is specified.

- Various script cleanups

* tag 'kbuild-v5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (27 commits)
scripts: add generic syscallnr.sh
scripts: check duplicated syscall number in syscall table
sparc: syscalls: use pattern rules to generate syscall headers
parisc: syscalls: use pattern rules to generate syscall headers
nds32: add arch/nds32/boot/.gitignore
kbuild: mkcompile_h: consider timestamp if KBUILD_BUILD_TIMESTAMP is set
kbuild: modpost: Explicitly warn about unprototyped symbols
kbuild: remove trailing slashes from $(KBUILD_EXTMOD)
kconfig.h: explain IS_MODULE(), IS_ENABLED()
kconfig: constify long_opts
scripts/setlocalversion: simplify the short version part
scripts/setlocalversion: factor out 12-chars hash construction
scripts/setlocalversion: add more comments to -dirty flag detection
scripts/setlocalversion: remove workaround for old make-kpkg
scripts/setlocalversion: remove mercurial, svn and git-svn supports
kbuild: clean up ${quiet} checks in shell scripts
kbuild: sink stdout from cmd for silent build
init: use $(call cmd,) for generating include/generated/compile.h
kbuild: merge scripts/mkmakefile to top Makefile
sh: move core-y in arch/sh/Makefile to arch/sh/Kbuild
...

+215 -252
+55 -75
Makefile
··· 129 129 $(if $(word 2, $(KBUILD_EXTMOD)), \ 130 130 $(error building multiple external modules is not supported)) 131 131 132 + # Remove trailing slashes 133 + ifneq ($(filter %/, $(KBUILD_EXTMOD)),) 134 + KBUILD_EXTMOD := $(shell dirname $(KBUILD_EXTMOD).) 135 + endif 136 + 132 137 export KBUILD_EXTMOD 133 138 134 139 # Kbuild will save output files in the current working directory. ··· 549 544 $(Q)rm -f .tmp_quiet_recordmcount 550 545 551 546 PHONY += outputmakefile 547 + ifdef building_out_of_srctree 552 548 # Before starting out-of-tree build, make sure the source tree is clean. 553 549 # outputmakefile generates a Makefile in the output directory, if using a 554 550 # separate output directory. This allows convenient use of make in the 555 551 # output directory. 556 552 # At the same time when output Makefile generated, generate .gitignore to 557 553 # ignore whole output directory 554 + 555 + quiet_cmd_makefile = GEN Makefile 556 + cmd_makefile = { \ 557 + echo "\# Automatically generated by $(srctree)/Makefile: don't edit"; \ 558 + echo "include $(srctree)/Makefile"; \ 559 + } > Makefile 560 + 558 561 outputmakefile: 559 - ifdef building_out_of_srctree 560 562 $(Q)if [ -f $(srctree)/.config -o \ 561 563 -d $(srctree)/include/config -o \ 562 564 -d $(srctree)/arch/$(SRCARCH)/include/generated ]; then \ ··· 574 562 false; \ 575 563 fi 576 564 $(Q)ln -fsn $(srctree) source 577 - $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile $(srctree) 565 + $(call cmd,makefile) 578 566 $(Q)test -e .gitignore || \ 579 567 { echo "# this is build directory, ignore it"; echo "*"; } > .gitignore 580 568 endif ··· 670 658 671 659 ifeq ($(KBUILD_EXTMOD),) 672 660 # Objects we will link into vmlinux / subdirs we need to visit 673 - core-y := init/ usr/ 661 + core-y := init/ usr/ arch/$(SRCARCH)/ 674 662 drivers-y := drivers/ sound/ 675 663 drivers-$(CONFIG_SAMPLES) += samples/ 676 664 drivers-$(CONFIG_NET) += net/ ··· 973 961 export CC_FLAGS_CFI 974 962 endif 975 963 976 - ifdef CONFIG_DEBUG_FORCE_FUNCTION_ALIGN_32B 977 - KBUILD_CFLAGS += -falign-functions=32 964 + ifdef CONFIG_DEBUG_FORCE_FUNCTION_ALIGN_64B 965 + KBUILD_CFLAGS += -falign-functions=64 978 966 endif 979 967 980 968 # arch Makefile may override CC so keep this after arch Makefile is included ··· 1101 1089 MODLIB = $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE) 1102 1090 export MODLIB 1103 1091 1104 - HOST_LIBELF_LIBS = $(shell pkg-config libelf --libs 2>/dev/null || echo -lelf) 1105 - 1106 - has_libelf = $(call try-run,\ 1107 - echo "int main() {}" | $(HOSTCC) $(KBUILD_HOSTLDFLAGS) -xc -o /dev/null $(HOST_LIBELF_LIBS) -,1,0) 1108 - 1109 - ifdef CONFIG_STACK_VALIDATION 1110 - ifeq ($(has_libelf),1) 1111 - objtool_target := tools/objtool FORCE 1112 - else 1113 - SKIP_STACK_VALIDATION := 1 1114 - export SKIP_STACK_VALIDATION 1115 - endif 1116 - endif 1117 - 1118 - PHONY += resolve_btfids_clean 1119 - 1120 - resolve_btfids_O = $(abspath $(objtree))/tools/bpf/resolve_btfids 1121 - 1122 - # tools/bpf/resolve_btfids directory might not exist 1123 - # in output directory, skip its clean in that case 1124 - resolve_btfids_clean: 1125 - ifneq ($(wildcard $(resolve_btfids_O)),) 1126 - $(Q)$(MAKE) -sC $(srctree)/tools/bpf/resolve_btfids O=$(resolve_btfids_O) clean 1127 - endif 1128 - 1129 - ifdef CONFIG_BPF 1130 - ifdef CONFIG_DEBUG_INFO_BTF 1131 - ifeq ($(has_libelf),1) 1132 - resolve_btfids_target := tools/bpf/resolve_btfids FORCE 1133 - else 1134 - ERROR_RESOLVE_BTFIDS := 1 1135 - endif 1136 - endif # CONFIG_DEBUG_INFO_BTF 1137 - endif # CONFIG_BPF 1138 - 1139 1092 PHONY += prepare0 1140 1093 1141 1094 export extmod_prefix = $(if $(KBUILD_EXTMOD),$(KBUILD_EXTMOD)/) ··· 1212 1235 $(Q)$(MAKE) $(build)=. 1213 1236 1214 1237 # All the preparing.. 1215 - prepare: prepare0 prepare-objtool prepare-resolve_btfids 1238 + prepare: prepare0 1216 1239 1217 1240 PHONY += remove-stale-files 1218 1241 remove-stale-files: ··· 1229 1252 $(Q)$(MAKE) $(asm-generic)=arch/$(SRCARCH)/include/generated/uapi/asm \ 1230 1253 generic=include/uapi/asm-generic 1231 1254 1232 - PHONY += prepare-objtool prepare-resolve_btfids 1233 - prepare-objtool: $(objtool_target) 1234 - ifeq ($(SKIP_STACK_VALIDATION),1) 1235 - ifdef CONFIG_FTRACE_MCOUNT_USE_OBJTOOL 1236 - @echo "error: Cannot generate __mcount_loc for CONFIG_DYNAMIC_FTRACE=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel" >&2 1237 - @false 1238 - endif 1239 - ifdef CONFIG_UNWINDER_ORC 1240 - @echo "error: Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel" >&2 1241 - @false 1242 - else 1243 - @echo "warning: Cannot use CONFIG_STACK_VALIDATION=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel" >&2 1244 - endif 1245 - endif 1246 - 1247 - prepare-resolve_btfids: $(resolve_btfids_target) 1248 - ifeq ($(ERROR_RESOLVE_BTFIDS),1) 1249 - @echo "error: Cannot resolve BTF IDs for CONFIG_DEBUG_INFO_BTF, please install libelf-dev, libelf-devel or elfutils-libelf-devel" >&2 1250 - @false 1251 - endif 1252 1255 # Generate some files 1253 1256 # --------------------------------------------------------------------------- 1254 1257 ··· 1315 1358 PHONY += scripts_unifdef 1316 1359 scripts_unifdef: scripts_basic 1317 1360 $(Q)$(MAKE) $(build)=scripts scripts/unifdef 1361 + 1362 + # --------------------------------------------------------------------------- 1363 + # Tools 1364 + 1365 + ifdef CONFIG_STACK_VALIDATION 1366 + prepare: tools/objtool 1367 + endif 1368 + 1369 + ifdef CONFIG_BPF 1370 + ifdef CONFIG_DEBUG_INFO_BTF 1371 + prepare: tools/bpf/resolve_btfids 1372 + endif 1373 + endif 1374 + 1375 + PHONY += resolve_btfids_clean 1376 + 1377 + resolve_btfids_O = $(abspath $(objtree))/tools/bpf/resolve_btfids 1378 + 1379 + # tools/bpf/resolve_btfids directory might not exist 1380 + # in output directory, skip its clean in that case 1381 + resolve_btfids_clean: 1382 + ifneq ($(wildcard $(resolve_btfids_O)),) 1383 + $(Q)$(MAKE) -sC $(srctree)/tools/bpf/resolve_btfids O=$(resolve_btfids_O) clean 1384 + endif 1385 + 1386 + # Clear a bunch of variables before executing the submake 1387 + ifeq ($(quiet),silent_) 1388 + tools_silent=s 1389 + endif 1390 + 1391 + tools/: FORCE 1392 + $(Q)mkdir -p $(objtree)/tools 1393 + $(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(tools_silent) $(filter --j% -j,$(MAKEFLAGS))" O=$(abspath $(objtree)) subdir=tools -C $(srctree)/tools/ 1394 + 1395 + tools/%: FORCE 1396 + $(Q)mkdir -p $(objtree)/tools 1397 + $(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(tools_silent) $(filter --j% -j,$(MAKEFLAGS))" O=$(abspath $(objtree)) subdir=tools -C $(srctree)/tools/ $* 1318 1398 1319 1399 # --------------------------------------------------------------------------- 1320 1400 # Kernel selftest ··· 1952 1958 1953 1959 image_name: 1954 1960 @echo $(KBUILD_IMAGE) 1955 - 1956 - # Clear a bunch of variables before executing the submake 1957 - 1958 - ifeq ($(quiet),silent_) 1959 - tools_silent=s 1960 - endif 1961 - 1962 - tools/: FORCE 1963 - $(Q)mkdir -p $(objtree)/tools 1964 - $(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(tools_silent) $(filter --j% -j,$(MAKEFLAGS))" O=$(abspath $(objtree)) subdir=tools -C $(srctree)/tools/ 1965 - 1966 - tools/%: FORCE 1967 - $(Q)mkdir -p $(objtree)/tools 1968 - $(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(tools_silent) $(filter --j% -j,$(MAKEFLAGS))" O=$(abspath $(objtree)) subdir=tools -C $(srctree)/tools/ $* 1969 1961 1970 1962 quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN $(wildcard $(rm-files))) 1971 1963 cmd_rmfiles = rm -rf $(rm-files)
+3
arch/alpha/Kbuild
··· 1 + # SPDX-License-Identifier: GPL-2.0-only 2 + obj-y += kernel/ mm/ 3 + obj-$(CONFIG_MATHEMU) += math-emu/
-2
arch/alpha/Makefile
··· 38 38 39 39 head-y := arch/alpha/kernel/head.o 40 40 41 - core-y += arch/alpha/kernel/ arch/alpha/mm/ 42 - core-$(CONFIG_MATHEMU) += arch/alpha/math-emu/ 43 41 libs-y += arch/alpha/lib/ 44 42 45 43 # export what is needed by arch/alpha/boot/Makefile
-3
arch/arc/Makefile
··· 85 85 86 86 head-y := arch/arc/kernel/head.o 87 87 88 - # See arch/arc/Kbuild for content of core part of the kernel 89 - core-y += arch/arc/ 90 - 91 88 # w/o this dtb won't embed into kernel binary 92 89 core-y += arch/arc/boot/dts/ 93 90
-1
arch/arm/Makefile
··· 252 252 253 253 export TEXT_OFFSET GZFLAGS MMUEXT 254 254 255 - core-y += arch/arm/ 256 255 # If we have a machine-specific directory, then include it in the build. 257 256 core-y += $(machdirs) $(platdirs) 258 257
-1
arch/arm64/Makefile
··· 149 149 KBUILD_CPPFLAGS += -DKASAN_SHADOW_SCALE_SHIFT=$(KASAN_SHADOW_SCALE_SHIFT) 150 150 KBUILD_AFLAGS += -DKASAN_SHADOW_SCALE_SHIFT=$(KASAN_SHADOW_SCALE_SHIFT) 151 151 152 - core-y += arch/arm64/ 153 152 libs-y := arch/arm64/lib/ $(libs-y) 154 153 libs-$(CONFIG_EFI_STUB) += $(objtree)/drivers/firmware/efi/libstub/lib.a 155 154
+1
arch/csky/Kbuild
··· 1 + # SPDX-License-Identifier: GPL-2.0-only
+2
arch/h8300/Kbuild
··· 1 + # SPDX-License-Identifier: GPL-2.0-only 2 + obj-y += kernel/ mm/ boot/dts/
-3
arch/h8300/Makefile
··· 30 30 CROSS_COMPILE := $(call cc-cross-prefix, h8300-unknown-linux- h8300-linux-) 31 31 endif 32 32 33 - core-y += arch/$(ARCH)/kernel/ arch/$(ARCH)/mm/ 34 - core-y += arch/$(ARCH)/boot/dts/ 35 - 36 33 libs-y += arch/$(ARCH)/lib/ 37 34 38 35 boot := arch/h8300/boot
+2
arch/hexagon/Kbuild
··· 1 + # SPDX-License-Identifier: GPL-2.0-only 2 + obj-y += kernel/ mm/ lib/
-4
arch/hexagon/Makefile
··· 34 34 KBUILD_AFLAGS += -DTHREADINFO_REG=$(TIR_NAME) 35 35 36 36 head-y := arch/hexagon/kernel/head.o 37 - 38 - core-y += arch/hexagon/kernel/ \ 39 - arch/hexagon/mm/ \ 40 - arch/hexagon/lib/
+1
arch/ia64/Kbuild
··· 1 + # SPDX-License-Identifier: GPL-2.0-only
-1
arch/m68k/Makefile
··· 97 97 head-$(CONFIG_M68000) := arch/m68k/68000/head.o 98 98 head-$(CONFIG_COLDFIRE) := arch/m68k/coldfire/head.o 99 99 100 - core-y += arch/m68k/ 101 100 libs-y += arch/m68k/lib/ 102 101 103 102
+1
arch/microblaze/Kbuild
··· 1 + # SPDX-License-Identifier: GPL-2.0-only
-3
arch/mips/Makefile
··· 332 332 libs-y += arch/mips/lib/ 333 333 libs-$(CONFIG_MIPS_FP_SUPPORT) += arch/mips/math-emu/ 334 334 335 - # See arch/mips/Kbuild for content of core part of the kernel 336 - core-y += arch/mips/ 337 - 338 335 drivers-y += arch/mips/crypto/ 339 336 340 337 # suspend and hibernation support
+1
arch/nds32/Kbuild
··· 1 + # SPDX-License-Identifier: GPL-2.0-only
+2
arch/nds32/boot/.gitignore
··· 1 + # SPDX-License-Identifier: GPL-2.0-only 2 + /Image
+1
arch/nios2/Kbuild
··· 1 + # SPDX-License-Identifier: GPL-2.0-only
-1
arch/openrisc/Makefile
··· 42 42 43 43 head-y := arch/openrisc/kernel/head.o 44 44 45 - core-y += arch/openrisc/ 46 45 libs-y += $(LIBGCC) 47 46 48 47 PHONY += vmlinux.bin
+1
arch/parisc/Kbuild
··· 1 + # SPDX-License-Identifier: GPL-2.0-only
+4 -14
arch/parisc/kernel/syscalls/Makefile
··· 10 10 systbl := $(srctree)/scripts/syscalltbl.sh 11 11 12 12 quiet_cmd_syshdr = SYSHDR $@ 13 - cmd_syshdr = $(CONFIG_SHELL) $(syshdr) --emit-nr --abis $(abis) $< $@ 13 + cmd_syshdr = $(CONFIG_SHELL) $(syshdr) --emit-nr --abis common,$* $< $@ 14 14 15 15 quiet_cmd_systbl = SYSTBL $@ 16 - cmd_systbl = $(CONFIG_SHELL) $(systbl) --abis $(abis) $< $@ 16 + cmd_systbl = $(CONFIG_SHELL) $(systbl) --abis common,$* $< $@ 17 17 18 - $(uapi)/unistd_32.h: abis := common,32 19 - $(uapi)/unistd_32.h: $(syscall) $(syshdr) FORCE 18 + $(uapi)/unistd_%.h: $(syscall) $(syshdr) FORCE 20 19 $(call if_changed,syshdr) 21 20 22 - $(uapi)/unistd_64.h: abis := common,64 23 - $(uapi)/unistd_64.h: $(syscall) $(syshdr) FORCE 24 - $(call if_changed,syshdr) 25 - 26 - $(kapi)/syscall_table_32.h: abis := common,32 27 - $(kapi)/syscall_table_32.h: $(syscall) $(systbl) FORCE 28 - $(call if_changed,systbl) 29 - 30 - $(kapi)/syscall_table_64.h: abis := common,64 31 - $(kapi)/syscall_table_64.h: $(syscall) $(systbl) FORCE 21 + $(kapi)/syscall_table_%.h: $(syscall) $(systbl) FORCE 32 22 $(call if_changed,systbl) 33 23 34 24 uapisyshdr-y += unistd_32.h unistd_64.h
-3
arch/powerpc/Makefile
··· 267 267 head-$(CONFIG_ALTIVEC) += arch/powerpc/kernel/vector.o 268 268 head-$(CONFIG_PPC_OF_BOOT_TRAMPOLINE) += arch/powerpc/kernel/prom_init.o 269 269 270 - # See arch/powerpc/Kbuild for content of core part of the kernel 271 - core-y += arch/powerpc/ 272 - 273 270 # Default to zImage, override when needed 274 271 all: zImage 275 272
-1
arch/riscv/Makefile
··· 99 99 100 100 head-y := arch/riscv/kernel/head.o 101 101 102 - core-y += arch/riscv/ 103 102 core-$(CONFIG_RISCV_ERRATA_ALTERNATIVE) += arch/riscv/errata/ 104 103 105 104 libs-y += arch/riscv/lib/
-3
arch/s390/Makefile
··· 129 129 130 130 head-y := arch/s390/kernel/head64.o 131 131 132 - # See arch/s390/Kbuild for content of core part of the kernel 133 - core-y += arch/s390/ 134 - 135 132 libs-y += arch/s390/lib/ 136 133 drivers-y += drivers/s390/ 137 134
+4
arch/sh/Kbuild
··· 1 + # SPDX-License-Identifier: GPL-2.0-only 2 + obj-y += kernel/ mm/ boards/ 3 + obj-$(CONFIG_SH_FPU_EMU) += math-emu/ 4 + obj-$(CONFIG_USE_BUILTIN_DTB) += boot/dts/
-5
arch/sh/Makefile
··· 116 116 117 117 head-y := arch/sh/kernel/head_32.o 118 118 119 - core-y += arch/sh/kernel/ arch/sh/mm/ arch/sh/boards/ 120 - core-$(CONFIG_SH_FPU_EMU) += arch/sh/math-emu/ 121 - 122 - core-$(CONFIG_USE_BUILTIN_DTB) += arch/sh/boot/dts/ 123 - 124 119 # Mach groups 125 120 machdir-$(CONFIG_SOLUTION_ENGINE) += mach-se 126 121 machdir-$(CONFIG_SH_HP6XX) += mach-hp6xx
-3
arch/sparc/Makefile
··· 58 58 59 59 head-y := arch/sparc/kernel/head_$(BITS).o 60 60 61 - # See arch/sparc/Kbuild for the core part of the kernel 62 - core-y += arch/sparc/ 63 - 64 61 libs-y += arch/sparc/prom/ 65 62 libs-y += arch/sparc/lib/ 66 63
+4 -14
arch/sparc/kernel/syscalls/Makefile
··· 10 10 systbl := $(srctree)/scripts/syscalltbl.sh 11 11 12 12 quiet_cmd_syshdr = SYSHDR $@ 13 - cmd_syshdr = $(CONFIG_SHELL) $(syshdr) --emit-nr --abis $(abis) $< $@ 13 + cmd_syshdr = $(CONFIG_SHELL) $(syshdr) --emit-nr --abis common,$* $< $@ 14 14 15 15 quiet_cmd_systbl = SYSTBL $@ 16 - cmd_systbl = $(CONFIG_SHELL) $(systbl) --abis $(abis) $< $@ 16 + cmd_systbl = $(CONFIG_SHELL) $(systbl) --abis common,$* $< $@ 17 17 18 - $(uapi)/unistd_32.h: abis := common,32 19 - $(uapi)/unistd_32.h: $(syscall) $(syshdr) FORCE 18 + $(uapi)/unistd_%.h: $(syscall) $(syshdr) FORCE 20 19 $(call if_changed,syshdr) 21 20 22 - $(uapi)/unistd_64.h: abis := common,64 23 - $(uapi)/unistd_64.h: $(syscall) $(syshdr) FORCE 24 - $(call if_changed,syshdr) 25 - 26 - $(kapi)/syscall_table_32.h: abis := common,32 27 - $(kapi)/syscall_table_32.h: $(syscall) $(systbl) FORCE 28 - $(call if_changed,systbl) 29 - 30 - $(kapi)/syscall_table_64.h: abis := common,64 31 - $(kapi)/syscall_table_64.h: $(syscall) $(systbl) FORCE 21 + $(kapi)/syscall_table_%.h: $(syscall) $(systbl) FORCE 32 22 $(call if_changed,systbl) 33 23 34 24 uapisyshdr-y += unistd_32.h unistd_64.h
+1
arch/um/Kbuild
··· 1 + # SPDX-License-Identifier: GPL-2.0-only
-3
arch/x86/Makefile
··· 240 240 241 241 libs-y += arch/x86/lib/ 242 242 243 - # See arch/x86/Kbuild for content of core part of the kernel 244 - core-y += arch/x86/ 245 - 246 243 # drivers-y are linked after core-y 247 244 drivers-$(CONFIG_MATH_EMULATION) += arch/x86/math-emu/ 248 245 drivers-$(CONFIG_PCI) += arch/x86/pci/
+1
arch/xtensa/Kbuild
··· 1 + # SPDX-License-Identifier: GPL-2.0-only
+4 -2
include/linux/kconfig.h
··· 51 51 52 52 /* 53 53 * IS_MODULE(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'm', 0 54 - * otherwise. 54 + * otherwise. CONFIG_FOO=m results in "#define CONFIG_FOO_MODULE 1" in 55 + * autoconf.h. 55 56 */ 56 57 #define IS_MODULE(option) __is_defined(option##_MODULE) 57 58 ··· 67 66 68 67 /* 69 68 * IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm', 70 - * 0 otherwise. 69 + * 0 otherwise. Note that CONFIG_FOO=y results in "#define CONFIG_FOO 1" in 70 + * autoconf.h, while CONFIG_FOO=m results in "#define CONFIG_FOO_MODULE 1". 71 71 */ 72 72 #define IS_ENABLED(option) __or(IS_BUILTIN(option), IS_MODULE(option)) 73 73
+6 -6
init/Makefile
··· 27 27 # mkcompile_h will make sure to only update the 28 28 # actual file if its content has changed. 29 29 30 - chk_compile.h = : 31 - quiet_chk_compile.h = echo ' CHK $@' 32 - silent_chk_compile.h = : 33 - include/generated/compile.h: FORCE 34 - @$($(quiet)chk_compile.h) 35 - $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ \ 30 + quiet_cmd_compile.h = CHK $@ 31 + cmd_compile.h = \ 32 + $(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ \ 36 33 "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT)" \ 37 34 "$(CONFIG_PREEMPT_RT)" $(CONFIG_CC_VERSION_TEXT) "$(LD)" 35 + 36 + include/generated/compile.h: FORCE 37 + $(call cmd,compile.h)
+1 -3
kernel/gen_kheaders.sh
··· 56 56 exit 57 57 fi 58 58 59 - if [ "${quiet}" != "silent_" ]; then 60 - echo " GEN $tarfile" 61 - fi 59 + echo " GEN $tarfile" 62 60 63 61 rm -rf $cpio_dir 64 62 mkdir $cpio_dir
+2 -2
lib/Kconfig.debug
··· 414 414 415 415 If unsure, say Y. 416 416 417 - config DEBUG_FORCE_FUNCTION_ALIGN_32B 418 - bool "Force all function address 32B aligned" if EXPERT 417 + config DEBUG_FORCE_FUNCTION_ALIGN_64B 418 + bool "Force all function address 64B aligned" if EXPERT 419 419 help 420 420 There are cases that a commit from one domain changes the function 421 421 address alignment of other domains, and cause magic performance
+6 -1
scripts/Kbuild.include
··· 90 90 echo-cmd = $(if $($(quiet)cmd_$(1)),\ 91 91 echo ' $(call escsq,$($(quiet)cmd_$(1)))$(echo-why)';) 92 92 93 + # sink stdout for 'make -s' 94 + redirect := 95 + quiet_redirect := 96 + silent_redirect := exec >/dev/null; 97 + 93 98 # printing commands 94 - cmd = @set -e; $(echo-cmd) $(cmd_$(1)) 99 + cmd = @set -e; $(echo-cmd) $($(quiet)redirect) $(cmd_$(1)) 95 100 96 101 ### 97 102 # if_changed - execute command if any prerequisite is newer than
-2
scripts/Makefile.build
··· 219 219 220 220 ifdef CONFIG_STACK_VALIDATION 221 221 ifndef CONFIG_LTO_CLANG 222 - ifneq ($(SKIP_STACK_VALIDATION),1) 223 222 224 223 __objtool_obj := $(objtree)/tools/objtool/objtool 225 224 ··· 232 233 $(OBJECT_FILES_NON_STANDARD_$(basetarget).o)$(OBJECT_FILES_NON_STANDARD)n), \ 233 234 $(__objtool_obj)) 234 235 235 - endif # SKIP_STACK_VALIDATION 236 236 endif # CONFIG_LTO_CLANG 237 237 endif # CONFIG_STACK_VALIDATION 238 238
-2
scripts/Makefile.modfinal
··· 39 39 # so let's now process the prelinked binary before we link the module. 40 40 41 41 ifdef CONFIG_STACK_VALIDATION 42 - ifneq ($(SKIP_STACK_VALIDATION),1) 43 42 cmd_ld_ko_o += \ 44 43 $(objtree)/tools/objtool/objtool $(objtool_args) \ 45 44 $(@:.ko=$(prelink-ext).o); 46 45 47 - endif # SKIP_STACK_VALIDATION 48 46 endif # CONFIG_STACK_VALIDATION 49 47 50 48 endif # CONFIG_LTO_CLANG
+1 -1
scripts/kconfig/conf.c
··· 678 678 check_conf(child); 679 679 } 680 680 681 - static struct option long_opts[] = { 681 + static const struct option long_opts[] = { 682 682 {"help", no_argument, NULL, 'h'}, 683 683 {"silent", no_argument, NULL, 's'}, 684 684 {"oldaskconfig", no_argument, &input_mode_opt, oldaskconfig},
+12 -6
scripts/mkcompile_h
··· 9 9 CC_VERSION="$6" 10 10 LD=$7 11 11 12 - vecho() { [ "${quiet}" = "silent_" ] || echo "$@" ; } 13 - 14 12 # Do not expand names 15 13 set -f 16 14 ··· 68 70 # Only replace the real compile.h if the new one is different, 69 71 # in order to preserve the timestamp and avoid unnecessary 70 72 # recompilations. 71 - # We don't consider the file changed if only the date/time changed. 73 + # We don't consider the file changed if only the date/time changed, 74 + # unless KBUILD_BUILD_TIMESTAMP was explicitly set (e.g. for 75 + # reproducible builds with that value referring to a commit timestamp). 72 76 # A kernel config change will increase the generation number, thus 73 77 # causing compile.h to be updated (including date/time) due to the 74 78 # changed comment in the 75 79 # first line. 76 80 81 + if [ -z "$KBUILD_BUILD_TIMESTAMP" ]; then 82 + IGNORE_PATTERN="UTS_VERSION" 83 + else 84 + IGNORE_PATTERN="NOT_A_PATTERN_TO_BE_MATCHED" 85 + fi 86 + 77 87 if [ -r $TARGET ] && \ 78 - grep -v 'UTS_VERSION' $TARGET > .tmpver.1 && \ 79 - grep -v 'UTS_VERSION' .tmpcompile > .tmpver.2 && \ 88 + grep -v $IGNORE_PATTERN $TARGET > .tmpver.1 && \ 89 + grep -v $IGNORE_PATTERN .tmpcompile > .tmpver.2 && \ 80 90 cmp -s .tmpver.1 .tmpver.2; then 81 91 rm -f .tmpcompile 82 92 else 83 - vecho " UPD $TARGET" 93 + echo " UPD $TARGET" 84 94 mv -f .tmpcompile $TARGET 85 95 fi 86 96 rm -f .tmpver.1 .tmpver.2
-17
scripts/mkmakefile
··· 1 - #!/bin/sh 2 - # SPDX-License-Identifier: GPL-2.0 3 - # Generates a small Makefile used in the root of the output 4 - # directory, to allow make to be started from there. 5 - # The Makefile also allow for more convinient build of external modules 6 - 7 - # Usage 8 - # $1 - Kernel src directory 9 - 10 - if [ "${quiet}" != "silent_" ]; then 11 - echo " GEN Makefile" 12 - fi 13 - 14 - cat << EOF > Makefile 15 - # Automatically generated by $0: don't edit 16 - include $1/Makefile 17 - EOF
+5 -2
scripts/mod/modpost.c
··· 660 660 unsigned int crc; 661 661 662 662 if (sym->st_shndx == SHN_UNDEF) { 663 - warn("EXPORT symbol \"%s\" [%s%s] version generation failed, symbol will not be versioned.\n", 664 - symname, mod->name, mod->is_vmlinux ? "" : ".ko"); 663 + warn("EXPORT symbol \"%s\" [%s%s] version ...\n" 664 + "Is \"%s\" prototyped in <asm/asm-prototypes.h>?\n", 665 + symname, mod->name, mod->is_vmlinux ? "" : ".ko", 666 + symname); 667 + 665 668 return; 666 669 } 667 670
+12 -63
scripts/setlocalversion
··· 59 59 fi 60 60 # If we are past a tagged commit (like 61 61 # "v2.6.30-rc5-302-g72357d5"), we pretty print it. 62 - # 63 - # Ensure the abbreviated sha1 has exactly 12 64 - # hex characters, to make the output 65 - # independent of git version, local 66 - # core.abbrev settings and/or total number of 67 - # objects in the current repository - passing 68 - # --abbrev=12 ensures a minimum of 12, and the 69 - # awk substr() then picks the 'g' and first 12 70 - # hex chars. 71 - if atag="$(git describe --abbrev=12 2>/dev/null)"; then 72 - echo "$atag" | awk -F- '{printf("-%05d-%s", $(NF-1),substr($(NF),0,13))}' 73 - 74 - # If we don't have a tag at all we print -g{commitish}, 75 - # again using exactly 12 hex chars. 76 - else 77 - head="$(echo $head | cut -c1-12)" 78 - printf '%s%s' -g $head 62 + if atag="$(git describe 2>/dev/null)"; then 63 + echo "$atag" | awk -F- '{printf("-%05d", $(NF-1))}' 79 64 fi 80 - fi 81 65 82 - # Is this git on svn? 83 - if git config --get svn-remote.svn.url >/dev/null; then 84 - printf -- '-svn%s' "$(git svn find-rev $head)" 66 + # Add -g and exactly 12 hex chars. 67 + printf '%s%s' -g "$(echo $head | cut -c1-12)" 85 68 fi 86 69 87 70 # Check for uncommitted changes. 71 + # This script must avoid any write attempt to the source tree, 72 + # which might be read-only. 73 + # You cannot use 'git describe --dirty' because it tries to 74 + # create .git/index.lock . 88 75 # First, with git-status, but --no-optional-locks is only 89 76 # supported in git >= 2.14, so fall back to git-diff-index if 90 77 # it fails. Note that git-diff-index does not refresh the ··· 80 93 if { 81 94 git --no-optional-locks status -uno --porcelain 2>/dev/null || 82 95 git diff-index --name-only HEAD 83 - } | grep -qvE '^(.. )?scripts/package'; then 96 + } | read dummy; then 84 97 printf '%s' -dirty 85 98 fi 86 - 87 - # All done with git 88 - return 89 - fi 90 - 91 - # Check for mercurial and a mercurial repo. 92 - if test -d .hg && hgid=$(hg id 2>/dev/null); then 93 - # Do we have an tagged version? If so, latesttagdistance == 1 94 - if [ "$(hg log -r . --template '{latesttagdistance}')" = "1" ]; then 95 - id=$(hg log -r . --template '{latesttag}') 96 - printf '%s%s' -hg "$id" 97 - else 98 - tag=$(printf '%s' "$hgid" | cut -d' ' -f2) 99 - if [ -z "$tag" -o "$tag" = tip ]; then 100 - id=$(printf '%s' "$hgid" | sed 's/[+ ].*//') 101 - printf '%s%s' -hg "$id" 102 - fi 103 - fi 104 - 105 - # Are there uncommitted changes? 106 - # These are represented by + after the changeset id. 107 - case "$hgid" in 108 - *+|*+\ *) printf '%s' -dirty ;; 109 - esac 110 - 111 - # All done with mercurial 112 - return 113 - fi 114 - 115 - # Check for svn and a svn repo. 116 - if rev=$(LC_ALL=C svn info 2>/dev/null | grep '^Last Changed Rev'); then 117 - rev=$(echo $rev | awk '{print $NF}') 118 - printf -- '-svn%s' "$rev" 119 - 120 - # All done with svn 121 - return 122 99 fi 123 100 } 124 101 ··· 131 180 if test "$CONFIG_LOCALVERSION_AUTO" = "y"; then 132 181 # full scm version string 133 182 res="$res$(scm_version)" 134 - else 183 + elif [ -z "${LOCALVERSION}" ]; then 135 184 # append a plus sign if the repository is not in a clean 136 185 # annotated or signed tagged state (as git describe only 137 186 # looks at signed or annotated tags - git tag -a/-s) and 138 187 # LOCALVERSION= is not specified 139 - if test "${LOCALVERSION+set}" != "set"; then 140 - scm=$(scm_version --short) 141 - res="$res${scm:++}" 142 - fi 188 + scm=$(scm_version --short) 189 + res="$res${scm:++}" 143 190 fi 144 191 145 192 echo "$res"
+1 -1
scripts/syscallhdr.sh
··· 69 69 sed -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ 70 70 -e 's/[^A-Z0-9_]/_/g' -e 's/__/_/g') 71 71 72 - grep -E "^[0-9A-Fa-fXx]+[[:space:]]+$abis" "$infile" | sort -n | { 72 + grep -E "^[0-9A-Fa-fXx]+[[:space:]]+$abis" "$infile" | { 73 73 echo "#ifndef $guard" 74 74 echo "#define $guard" 75 75 echo
+74
scripts/syscallnr.sh
··· 1 + #!/bin/sh 2 + # SPDX-License-Identifier: GPL-2.0-only 3 + # 4 + # Generate a syscall number header. 5 + # 6 + # Each line of the syscall table should have the following format: 7 + # 8 + # NR ABI NAME [NATIVE] [COMPAT] 9 + # 10 + # NR syscall number 11 + # ABI ABI name 12 + # NAME syscall name 13 + # NATIVE native entry point (optional) 14 + # COMPAT compat entry point (optional) 15 + set -e 16 + 17 + usage() { 18 + echo >&2 "usage: $0 [--abis ABIS] [--prefix PREFIX] INFILE OUTFILE" >&2 19 + echo >&2 20 + echo >&2 " INFILE input syscall table" 21 + echo >&2 " OUTFILE output header file" 22 + echo >&2 23 + echo >&2 "options:" 24 + echo >&2 " --abis ABIS ABI(s) to handle (By default, all lines are handled)" 25 + echo >&2 " --prefix PREFIX The prefix to the macro like __NR_<PREFIX><NAME>" 26 + exit 1 27 + } 28 + 29 + # default unless specified by options 30 + abis= 31 + prefix= 32 + 33 + while [ $# -gt 0 ] 34 + do 35 + case $1 in 36 + --abis) 37 + abis=$(echo "($2)" | tr ',' '|') 38 + shift 2;; 39 + --prefix) 40 + prefix=$2 41 + shift 2;; 42 + -*) 43 + echo "$1: unknown option" >&2 44 + usage;; 45 + *) 46 + break;; 47 + esac 48 + done 49 + 50 + if [ $# -ne 2 ]; then 51 + usage 52 + fi 53 + 54 + infile="$1" 55 + outfile="$2" 56 + 57 + guard=_ASM_$(basename "$outfile" | 58 + sed -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ 59 + -e 's/[^A-Z0-9_]/_/g' -e 's/__/_/g') 60 + 61 + grep -E "^[0-9A-Fa-fXx]+[[:space:]]+$abis" "$infile" | sort -n | { 62 + echo "#ifndef $guard" 63 + echo "#define $guard" 64 + echo 65 + 66 + max=0 67 + while read nr abi name native compat ; do 68 + max=$nr 69 + done 70 + 71 + echo "#define __NR_${prefix}syscalls $(($max + 1))" 72 + echo 73 + echo "#endif /* $guard */" 74 + } > "$outfile"
+6 -1
scripts/syscalltbl.sh
··· 52 52 53 53 nxt=0 54 54 55 - grep -E "^[0-9]+[[:space:]]+$abis" "$infile" | sort -n | { 55 + grep -E "^[0-9]+[[:space:]]+$abis" "$infile" | { 56 56 57 57 while read nr abi name native compat ; do 58 + 59 + if [ $nxt -gt $nr ]; then 60 + echo "error: $infile: syscall table is not sorted or duplicates the same syscall number" >&2 61 + exit 1 62 + fi 58 63 59 64 while [ $nxt -lt $nr ]; do 60 65 echo "__SYSCALL($nxt, sys_ni_syscall)"