History

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

Pull more Kbuild updates from Masahiro Yamada: - Convert sh and sparc to use generic shell scripts to generate the syscall headers - refactor .gitignore files - Update kernel/config_data.gz only when the content of the .config is really changed, which avoids the unneeded re-link of vmlinux - move "remove stale files" workarounds to scripts/remove-stale-files - suppress unused-but-set-variable warnings by default for Clang as well - fix locale setting LANG=C to LC_ALL=C - improve 'make distclean' - always keep intermediate objects from scripts/link-vmlinux.sh - move IF_ENABLED out of <linux/kconfig.h> to make it self-contained - misc cleanups * tag 'kbuild-v5.13-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (25 commits) linux/kconfig.h: replace IF_ENABLED() with PTR_IF() in <linux/kernel.h> kbuild: Don't remove link-vmlinux temporary files on exit/signal kbuild: remove the unneeded comments for external module builds kbuild: make distclean remove tag files in sub-directories kbuild: make distclean work against $(objtree) instead of $(srctree) kbuild: refactor modname-multi by using suffix-search kbuild: refactor fdtoverlay rule kbuild: parameterize the .o part of suffix-search arch: use cross_compiling to check whether it is a cross build or not kbuild: remove ARCH=sh64 support from top Makefile .gitignore: prefix local generated files with a slash kbuild: replace LANG=C with LC_ALL=C Makefile: Move -Wno-unused-but-set-variable out of GCC only block kbuild: add a script to remove stale generated files kbuild: update config_data.gz only when the content of .config is changed .gitignore: ignore only top-level modules.builtin .gitignore: move tags and TAGS close to other tag files kernel/.gitgnore: remove stale timeconst.h and hz.bc usr/include: refactor .gitignore genksyms: fix stale comment ...

Linus Torvalds committed 5 years ago

Commit 0f979d82 parents ab159ac 0ab143861 files · +183 −342Browse files

Unified · Split

61 files
  1. .gitignore +5 −3
  2. Documentation/devicetree/bindings/.gitignore +2 −2
  3. Makefile +13 −29
  4. arch/.gitignore +2 −2
  5. arch/arm/boot/compressed/Makefile +0 −7
  6. arch/m68k/Makefile +1 −1
  7. arch/mips/Makefile +1 −1
  8. arch/parisc/Makefile +1 −1
  9. arch/powerpc/boot/wrapper +1 −1
  10. arch/sh/Makefile +1 −1
  11. arch/sh/kernel/syscalls/Makefile +4 −10
  12. arch/sh/kernel/syscalls/syscallhdr.sh +0 −36
  13. arch/sh/kernel/syscalls/syscalltbl.sh +0 −32
  14. arch/sparc/include/asm/Kbuild +0 −1
  15. arch/sparc/kernel/syscalls/Makefile +9 −21
  16. arch/sparc/kernel/syscalls/syscallhdr.sh +0 −36
  17. arch/sparc/kernel/syscalls/syscalltbl.sh +0 −36
  18. arch/sparc/kernel/systbls_32.S +2 −2
  19. arch/sparc/kernel/systbls_64.S +5 −3
  20. arch/xtensa/Makefile +1 −5
  21. certs/.gitignore +2 −2
  22. drivers/memory/.gitignore +1 −1
  23. drivers/pinctrl/pinctrl-ingenic.c +3 −0
  24. drivers/tty/vt/.gitignore +3 −3
  25. fs/unicode/.gitignore +2 −2
  26. include/linux/kconfig.h +0 −6
  27. include/linux/kernel.h +2 −0
  28. kernel/.gitignore +2 −3
  29. kernel/Makefile +7 −2
  30. lib/.gitignore +5 −5
  31. samples/auxdisplay/.gitignore +1 −1
  32. samples/binderfs/.gitignore +2 −1
  33. samples/connector/.gitignore +1 −1
  34. samples/hidraw/.gitignore +1 −1
  35. samples/mei/.gitignore +1 −1
  36. samples/nitro_enclaves/.gitignore +1 −1
  37. samples/pidfd/.gitignore +1 −1
  38. samples/seccomp/.gitignore +4 −4
  39. samples/timers/.gitignore +1 −1
  40. samples/vfs/.gitignore +2 −2
  41. samples/watch_queue/.gitignore +2 −1
  42. samples/watchdog/.gitignore +1 −1
  43. scripts/.gitignore +9 −9
  44. scripts/Makefile.build +1 −1
  45. scripts/Makefile.lib +30 −27
  46. scripts/basic/.gitignore +1 −1
  47. scripts/dtc/.gitignore +2 −2
  48. scripts/gcc-plugins/.gitignore +1 −1
  49. scripts/genksyms/.gitignore +1 −1
  50. scripts/genksyms/Makefile +1 −1
  51. scripts/link-vmlinux.sh +0 −14
  52. scripts/mod/.gitignore +4 −4
  53. scripts/nsdeps +1 −1
  54. scripts/recordmcount.pl +1 −1
  55. scripts/remove-stale-files +31 −0
  56. scripts/setlocalversion +1 −1
  57. scripts/tags.sh +1 −1
  58. tools/testing/selftests/net/mptcp/mptcp_connect.sh +1 −1
  59. usr/.gitignore +2 −2
  60. usr/gen_initramfs.sh +1 −1
  61. usr/include/.gitignore +1 −3
.gitignore+5−3
@@ -48,14 +48,11 @@ · 47 unmodified lines
48*.xz48*.xz
49*.zst49*.zst
50Module.symvers50Module.symvers
51modules.builtin
52modules.order51modules.order
53 52
54#53#
55# Top-level generic files54# Top-level generic files
56#55#
57/tags
58/TAGS
59/linux56/linux
60/modules-only.symvers57/modules-only.symvers
61/vmlinux58/vmlinux
@@ -66,6 +63,7 @@ modules.order · 4 unmodified lines
66/vmlinuz63/vmlinuz
67/System.map64/System.map
68/Module.markers65/Module.markers
66/modules.builtin
69/modules.builtin.modinfo67/modules.builtin.modinfo
70/modules.nsdeps68/modules.nsdeps
71 69
@@ -114,6 +112,10 @@ patches-* · 42 unmodified lines
114patches112patches
115series113series
116 114
115# ctags files
116tags
117TAGS
118
117# cscope files119# cscope files
118cscope.*120cscope.*
119ncscope.*121ncscope.*
Documentation/devicetree/bindings/.gitignore+2−2
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0-only1# SPDX-License-Identifier: GPL-2.0-only
2*.example.dts2*.example.dts
3processed-schema*.yaml3/processed-schema*.yaml
4processed-schema*.json4/processed-schema*.json
Makefile+13−29
@@ -399,11 +399,6 @@ ifeq ($(ARCH),sparc64) · 398 unmodified lines
399 SRCARCH := sparc399 SRCARCH := sparc
400endif400endif
401 401
402# Additional ARCH settings for sh
403ifeq ($(ARCH),sh64)
404 SRCARCH := sh
405endif
406
407export cross_compiling :=402export cross_compiling :=
408ifneq ($(SRCARCH),$(SUBARCH))403ifneq ($(SRCARCH),$(SUBARCH))
409cross_compiling := 1404cross_compiling := 1
@@ -792,16 +787,16 @@ KBUILD_CFLAGS += -Wno-gnu · 382 unmodified lines
792KBUILD_CFLAGS += -mno-global-merge787KBUILD_CFLAGS += -mno-global-merge
793else788else
794 789
795# These warnings generated too much noise in a regular build.
796# Use make W=1 to enable them (see scripts/Makefile.extrawarn)
797KBUILD_CFLAGS += -Wno-unused-but-set-variable
798
799# Warn about unmarked fall-throughs in switch statement.790# Warn about unmarked fall-throughs in switch statement.
800# Disabled for clang while comment to attribute conversion happens and791# Disabled for clang while comment to attribute conversion happens and
801# https://github.com/ClangBuiltLinux/linux/issues/636 is discussed.792# https://github.com/ClangBuiltLinux/linux/issues/636 is discussed.
802KBUILD_CFLAGS += $(call cc-option,-Wimplicit-fallthrough,)793KBUILD_CFLAGS += $(call cc-option,-Wimplicit-fallthrough,)
803endif794endif
804 795
796# These warnings generated too much noise in a regular build.
797# Use make W=1 to enable them (see scripts/Makefile.extrawarn)
798KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable)
799
805KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable)800KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable)
806ifdef CONFIG_FRAME_POINTER801ifdef CONFIG_FRAME_POINTER
807KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls802KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
@@ -1225,7 +1220,7 @@ PHONY += prepare archprepare · 417 unmodified lines
1225 1220
1226archprepare: outputmakefile archheaders archscripts scripts include/config/kernel.release \1221archprepare: outputmakefile archheaders archscripts scripts include/config/kernel.release \
1227 asm-generic $(version_h) $(autoksyms_h) include/generated/utsrelease.h \1222 asm-generic $(version_h) $(autoksyms_h) include/generated/utsrelease.h \
1228 include/generated/autoconf.h1223 include/generated/autoconf.h remove-stale-files
1229 1224
1230prepare0: archprepare1225prepare0: archprepare
1231 $(Q)$(MAKE) $(build)=scripts/mod1226 $(Q)$(MAKE) $(build)=scripts/mod
@@ -1234,6 +1229,10 @@ prepare0: archprepare · 2 unmodified lines
1234# All the preparing..1229# All the preparing..
1235prepare: prepare0 prepare-objtool prepare-resolve_btfids1230prepare: prepare0 prepare-objtool prepare-resolve_btfids
1236 1231
1232PHONY += remove-stale-files
1233remove-stale-files:
1234 $(Q)$(srctree)/scripts/remove-stale-files
1235
1237# Support for using generic headers in asm-generic1236# Support for using generic headers in asm-generic
1238asm-generic := -f $(srctree)/scripts/Makefile.asm-generic obj1237asm-generic := -f $(srctree)/scripts/Makefile.asm-generic obj
1239 1238
@@ -1512,9 +1511,6 @@ MRPROPER_FILES += include/config include/generated \ · 272 unmodified lines
1512 vmlinux-gdb.py \1511 vmlinux-gdb.py \
1513 *.spec1512 *.spec
1514 1513
1515# Directories & files removed with 'make distclean'
1516DISTCLEAN_FILES += tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS
1517
1518# clean - Delete most, but leave enough to build external modules1514# clean - Delete most, but leave enough to build external modules
1519#1515#
1520clean: rm-files := $(CLEAN_FILES)1516clean: rm-files := $(CLEAN_FILES)
@@ -1541,16 +1537,14 @@ mrproper: clean $(mrproper-dirs) · 20 unmodified lines
1541 1537
1542# distclean1538# distclean
1543#1539#
1544distclean: rm-files := $(wildcard $(DISTCLEAN_FILES))
1545
1546PHONY += distclean1540PHONY += distclean
1547 1541
1548distclean: mrproper1542distclean: mrproper
1549 $(call cmd,rmfiles)1543 @find . $(RCS_FIND_IGNORE) \
1550 @find $(srctree) $(RCS_FIND_IGNORE) \
1551 \( -name '*.orig' -o -name '*.rej' -o -name '*~' \1544 \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
1552 -o -name '*.bak' -o -name '#*#' -o -name '*%' \1545 -o -name '*.bak' -o -name '#*#' -o -name '*%' \
1553 -o -name 'core' \) \1546 -o -name 'core' -o -name tags -o -name TAGS -o -name 'cscope*' \
1547 -o -name GPATH -o -name GRTAGS -o -name GSYMS -o -name GTAGS \) \
1554 -type f -print | xargs rm -f1548 -type f -print | xargs rm -f
1555 1549
1556 1550
@@ -1717,17 +1711,7 @@ else # KBUILD_EXTMOD · 160 unmodified lines
1717# When building external modules the kernel used as basis is considered1711# When building external modules the kernel used as basis is considered
1718# read-only, and no consistency checks are made and the make1712# read-only, and no consistency checks are made and the make
1719# system is not used on the basis kernel. If updates are required1713# system is not used on the basis kernel. If updates are required
1720# in the basis kernel ordinary make commands (without M=...) must1714# in the basis kernel ordinary make commands (without M=...) must be used.
1721# be used.
1722#
1723# The following are the only valid targets when building external
1724# modules.
1725# make M=dir clean Delete all automatically generated files
1726# make M=dir modules Make all modules in specified dir
1727# make M=dir Same as 'make M=dir modules'
1728# make M=dir modules_install
1729# Install the modules built in the module directory
1730# Assumes install directory is already created
1731 1715
1732# We are always building only modules.1716# We are always building only modules.
1733KBUILD_BUILTIN :=1717KBUILD_BUILTIN :=
arch/.gitignore+2−2
@@ -1,3 +1,3 @@
1# SPDX-License-Identifier: GPL-2.0-only1# SPDX-License-Identifier: GPL-2.0-only
2i3862/i386/
3x86_643/x86_64/
arch/arm/boot/compressed/Makefile+0−7
@@ -96,13 +96,6 @@ endif · 95 unmodified lines
96$(foreach o, $(libfdt_objs) atags_to_fdt.o fdt_check_mem_start.o, \96$(foreach o, $(libfdt_objs) atags_to_fdt.o fdt_check_mem_start.o, \
97 $(eval CFLAGS_$(o) := -I $(srctree)/scripts/dtc/libfdt -fno-stack-protector))97 $(eval CFLAGS_$(o) := -I $(srctree)/scripts/dtc/libfdt -fno-stack-protector))
98 98
99# These were previously generated C files. When you are building the kernel
100# with O=, make sure to remove the stale files in the output tree. Otherwise,
101# the build system wrongly compiles the stale ones.
102ifdef building_out_of_srctree
103$(shell rm -f $(addprefix $(obj)/, fdt_rw.c fdt_ro.c fdt_wip.c fdt.c))
104endif
105
106targets := vmlinux vmlinux.lds piggy_data piggy.o \99targets := vmlinux vmlinux.lds piggy_data piggy.o \
107 lib1funcs.o ashldi3.o bswapsdi2.o \100 lib1funcs.o ashldi3.o bswapsdi2.o \
108 head.o $(OBJS)101 head.o $(OBJS)
arch/m68k/Makefile+1−1
@@ -16,7 +16,7 @@ · 15 unmodified lines
16 16
17KBUILD_DEFCONFIG := multi_defconfig17KBUILD_DEFCONFIG := multi_defconfig
18 18
19ifneq ($(SUBARCH),$(ARCH))19ifdef cross_compiling
20 ifeq ($(CROSS_COMPILE),)20 ifeq ($(CROSS_COMPILE),)
21 CROSS_COMPILE := $(call cc-cross-prefix, \21 CROSS_COMPILE := $(call cc-cross-prefix, \
22 m68k-linux-gnu- m68k-linux- m68k-unknown-linux-gnu-)22 m68k-linux-gnu- m68k-linux- m68k-unknown-linux-gnu-)
arch/mips/Makefile+1−1
@@ -50,7 +50,7 @@ tool-archpref = $(64bit-tool-archpref) · 49 unmodified lines
50UTS_MACHINE := mips6450UTS_MACHINE := mips64
51endif51endif
52 52
53ifneq ($(SUBARCH),$(ARCH))53ifdef cross_compiling
54 ifeq ($(CROSS_COMPILE),)54 ifeq ($(CROSS_COMPILE),)
55 CROSS_COMPILE := $(call cc-cross-prefix, $(tool-archpref)-linux- $(tool-archpref)-linux-gnu- $(tool-archpref)-unknown-linux-gnu-)55 CROSS_COMPILE := $(call cc-cross-prefix, $(tool-archpref)-linux- $(tool-archpref)-linux-gnu- $(tool-archpref)-unknown-linux-gnu-)
56 endif56 endif
arch/parisc/Makefile+1−1
@@ -41,7 +41,7 @@ endif · 40 unmodified lines
41 41
42export LD_BFD42export LD_BFD
43 43
44ifneq ($(SUBARCH),$(UTS_MACHINE))44ifdef cross_compiling
45 ifeq ($(CROSS_COMPILE),)45 ifeq ($(CROSS_COMPILE),)
46 CC_SUFFIXES = linux linux-gnu unknown-linux-gnu46 CC_SUFFIXES = linux linux-gnu unknown-linux-gnu
47 CROSS_COMPILE := $(call cc-cross-prefix, \47 CROSS_COMPILE := $(call cc-cross-prefix, \
arch/powerpc/boot/wrapper+1−1
@@ -191,7 +191,7 @@ if [ -z "$kernel" ]; then · 190 unmodified lines
191 kernel=vmlinux191 kernel=vmlinux
192fi192fi
193 193
194LANG=C elfformat="`${CROSS}objdump -p "$kernel" | grep 'file format' | awk '{print $4}'`"194LC_ALL=C elfformat="`${CROSS}objdump -p "$kernel" | grep 'file format' | awk '{print $4}'`"
195case "$elfformat" in195case "$elfformat" in
196 elf64-powerpcle) format=elf64lppc ;;196 elf64-powerpcle) format=elf64lppc ;;
197 elf64-powerpc) format=elf32ppc ;;197 elf64-powerpc) format=elf32ppc ;;
arch/sh/Makefile+1−1
@@ -9,7 +9,7 @@ · 8 unmodified lines
9# License. See the file "COPYING" in the main directory of this archive9# License. See the file "COPYING" in the main directory of this archive
10# for more details.10# for more details.
11#11#
12ifneq ($(SUBARCH),$(ARCH))12ifdef cross_compiling
13 ifeq ($(CROSS_COMPILE),)13 ifeq ($(CROSS_COMPILE),)
14 CROSS_COMPILE := $(call cc-cross-prefix, sh-linux- sh-linux-gnu- sh-unknown-linux-gnu-)14 CROSS_COMPILE := $(call cc-cross-prefix, sh-linux- sh-linux-gnu- sh-unknown-linux-gnu-)
15 endif15 endif
arch/sh/kernel/syscalls/Makefile+4−10
@@ -6,20 +6,14 @@ _dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)') \ · 5 unmodified lines
6 $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)')6 $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)')
7 7
8syscall := $(src)/syscall.tbl8syscall := $(src)/syscall.tbl
9syshdr := $(srctree)/$(src)/syscallhdr.sh9syshdr := $(srctree)/scripts/syscallhdr.sh
10systbl := $(srctree)/$(src)/syscalltbl.sh10systbl := $(srctree)/scripts/syscalltbl.sh
11 11
12quiet_cmd_syshdr = SYSHDR $@12quiet_cmd_syshdr = SYSHDR $@
13 cmd_syshdr = $(CONFIG_SHELL) '$(syshdr)' '$<' '$@' \13 cmd_syshdr = $(CONFIG_SHELL) $(syshdr) --emit-nr $< $@
14 '$(syshdr_abis_$(basetarget))' \
15 '$(syshdr_pfx_$(basetarget))' \
16 '$(syshdr_offset_$(basetarget))'
17 14
18quiet_cmd_systbl = SYSTBL $@15quiet_cmd_systbl = SYSTBL $@
19 cmd_systbl = $(CONFIG_SHELL) '$(systbl)' '$<' '$@' \16 cmd_systbl = $(CONFIG_SHELL) $(systbl) $< $@
20 '$(systbl_abis_$(basetarget))' \
21 '$(systbl_abi_$(basetarget))' \
22 '$(systbl_offset_$(basetarget))'
23 17
24$(uapi)/unistd_32.h: $(syscall) $(syshdr) FORCE18$(uapi)/unistd_32.h: $(syscall) $(syshdr) FORCE
25 $(call if_changed,syshdr)19 $(call if_changed,syshdr)
arch/sh/kernel/syscalls/syscallhdr.sh+0−36
@@ -1,36 +0,0 @@
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0
3
4in="$1"
5out="$2"
6my_abis=`echo "($3)" | tr ',' '|'`
7prefix="$4"
8offset="$5"
9
10fileguard=_UAPI_ASM_SH_`basename "$out" | sed \
11 -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \
12 -e 's/[^A-Z0-9_]/_/g' -e 's/__/_/g'`
13grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | (
14 printf "#ifndef %s\n" "${fileguard}"
15 printf "#define %s\n" "${fileguard}"
16 printf "\n"
17
18 nxt=0
19 while read nr abi name entry ; do
20 if [ -z "$offset" ]; then
21 printf "#define __NR_%s%s\t%s\n" \
22 "${prefix}" "${name}" "${nr}"
23 else
24 printf "#define __NR_%s%s\t(%s + %s)\n" \
25 "${prefix}" "${name}" "${offset}" "${nr}"
26 fi
27 nxt=$((nr+1))
28 done
29
30 printf "\n"
31 printf "#ifdef __KERNEL__\n"
32 printf "#define __NR_syscalls\t%s\n" "${nxt}"
33 printf "#endif\n"
34 printf "\n"
35 printf "#endif /* %s */\n" "${fileguard}"
36) > "$out"
arch/sh/kernel/syscalls/syscalltbl.sh+0−32
@@ -1,32 +0,0 @@
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0
3
4in="$1"
5out="$2"
6my_abis=`echo "($3)" | tr ',' '|'`
7my_abi="$4"
8offset="$5"
9
10emit() {
11 t_nxt="$1"
12 t_nr="$2"
13 t_entry="$3"
14
15 while [ $t_nxt -lt $t_nr ]; do
16 printf "__SYSCALL(%s,sys_ni_syscall)\n" "${t_nxt}"
17 t_nxt=$((t_nxt+1))
18 done
19 printf "__SYSCALL(%s,%s)\n" "${t_nxt}" "${t_entry}"
20}
21
22grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | (
23 nxt=0
24 if [ -z "$offset" ]; then
25 offset=0
26 fi
27
28 while read nr abi name entry ; do
29 emit $((nxt+offset)) $((nr+offset)) $entry
30 nxt=$((nr+1))
31 done
32) > "$out"
arch/sparc/include/asm/Kbuild+0−1
@@ -1,7 +1,6 @@
1# SPDX-License-Identifier: GPL-2.01# SPDX-License-Identifier: GPL-2.0
2generated-y += syscall_table_32.h2generated-y += syscall_table_32.h
3generated-y += syscall_table_64.h3generated-y += syscall_table_64.h
4generated-y += syscall_table_c32.h
5generic-y += export.h4generic-y += export.h
6generic-y += kvm_para.h5generic-y += kvm_para.h
7generic-y += mcs_spinlock.h6generic-y += mcs_spinlock.h
arch/sparc/kernel/syscalls/Makefile+9−21
@@ -6,46 +6,34 @@ _dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)') \ · 5 unmodified lines
6 $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)')6 $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)')
7 7
8syscall := $(src)/syscall.tbl8syscall := $(src)/syscall.tbl
9syshdr := $(srctree)/$(src)/syscallhdr.sh9syshdr := $(srctree)/scripts/syscallhdr.sh
10systbl := $(srctree)/$(src)/syscalltbl.sh10systbl := $(srctree)/scripts/syscalltbl.sh
11 11
12quiet_cmd_syshdr = SYSHDR $@12quiet_cmd_syshdr = SYSHDR $@
13 cmd_syshdr = $(CONFIG_SHELL) '$(syshdr)' '$<' '$@' \13 cmd_syshdr = $(CONFIG_SHELL) $(syshdr) --emit-nr --abis $(abis) $< $@
14 '$(syshdr_abis_$(basetarget))' \
15 '$(syshdr_pfx_$(basetarget))' \
16 '$(syshdr_offset_$(basetarget))'
17 14
18quiet_cmd_systbl = SYSTBL $@15quiet_cmd_systbl = SYSTBL $@
19 cmd_systbl = $(CONFIG_SHELL) '$(systbl)' '$<' '$@' \16 cmd_systbl = $(CONFIG_SHELL) $(systbl) --abis $(abis) $< $@
20 '$(systbl_abis_$(basetarget))' \
21 '$(systbl_abi_$(basetarget))' \
22 '$(systbl_offset_$(basetarget))'
23 17
24syshdr_abis_unistd_32 := common,3218$(uapi)/unistd_32.h: abis := common,32
25$(uapi)/unistd_32.h: $(syscall) $(syshdr) FORCE19$(uapi)/unistd_32.h: $(syscall) $(syshdr) FORCE
26 $(call if_changed,syshdr)20 $(call if_changed,syshdr)
27 21
28syshdr_abis_unistd_64 := common,6422$(uapi)/unistd_64.h: abis := common,64
29$(uapi)/unistd_64.h: $(syscall) $(syshdr) FORCE23$(uapi)/unistd_64.h: $(syscall) $(syshdr) FORCE
30 $(call if_changed,syshdr)24 $(call if_changed,syshdr)
31 25
32systbl_abis_syscall_table_32 := common,3226$(kapi)/syscall_table_32.h: abis := common,32
33$(kapi)/syscall_table_32.h: $(syscall) $(systbl) FORCE27$(kapi)/syscall_table_32.h: $(syscall) $(systbl) FORCE
34 $(call if_changed,systbl)28 $(call if_changed,systbl)
35 29
36systbl_abis_syscall_table_64 := common,6430$(kapi)/syscall_table_64.h: abis := common,64
37$(kapi)/syscall_table_64.h: $(syscall) $(systbl) FORCE31$(kapi)/syscall_table_64.h: $(syscall) $(systbl) FORCE
38 $(call if_changed,systbl)32 $(call if_changed,systbl)
39 33
40systbl_abis_syscall_table_c32 := common,32
41systbl_abi_syscall_table_c32 := c32
42$(kapi)/syscall_table_c32.h: $(syscall) $(systbl) FORCE
43 $(call if_changed,systbl)
44
45uapisyshdr-y += unistd_32.h unistd_64.h34uapisyshdr-y += unistd_32.h unistd_64.h
46kapisyshdr-y += syscall_table_32.h \35kapisyshdr-y += syscall_table_32.h \
47 syscall_table_64.h \36 syscall_table_64.h
48 syscall_table_c32.h
49 37
50uapisyshdr-y := $(addprefix $(uapi)/, $(uapisyshdr-y))38uapisyshdr-y := $(addprefix $(uapi)/, $(uapisyshdr-y))
51kapisyshdr-y := $(addprefix $(kapi)/, $(kapisyshdr-y))39kapisyshdr-y := $(addprefix $(kapi)/, $(kapisyshdr-y))
arch/sparc/kernel/syscalls/syscallhdr.sh+0−36
@@ -1,36 +0,0 @@
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0
3
4in="$1"
5out="$2"
6my_abis=`echo "($3)" | tr ',' '|'`
7prefix="$4"
8offset="$5"
9
10fileguard=_UAPI_ASM_SPARC_`basename "$out" | sed \
11 -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \
12 -e 's/[^A-Z0-9_]/_/g' -e 's/__/_/g'`
13grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | (
14 printf "#ifndef %s\n" "${fileguard}"
15 printf "#define %s\n" "${fileguard}"
16 printf "\n"
17
18 nxt=0
19 while read nr abi name entry compat ; do
20 if [ -z "$offset" ]; then
21 printf "#define __NR_%s%s\t%s\n" \
22 "${prefix}" "${name}" "${nr}"
23 else
24 printf "#define __NR_%s%s\t(%s + %s)\n" \
25 "${prefix}" "${name}" "${offset}" "${nr}"
26 fi
27 nxt=$((nr+1))
28 done
29
30 printf "\n"
31 printf "#ifdef __KERNEL__\n"
32 printf "#define __NR_syscalls\t%s\n" "${nxt}"
33 printf "#endif\n"
34 printf "\n"
35 printf "#endif /* %s */\n" "${fileguard}"
36) > "$out"
arch/sparc/kernel/syscalls/syscalltbl.sh+0−36
@@ -1,36 +0,0 @@
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0
3
4in="$1"
5out="$2"
6my_abis=`echo "($3)" | tr ',' '|'`
7my_abi="$4"
8offset="$5"
9
10emit() {
11 t_nxt="$1"
12 t_nr="$2"
13 t_entry="$3"
14
15 while [ $t_nxt -lt $t_nr ]; do
16 printf "__SYSCALL(%s, sys_nis_syscall, )\n" "${t_nxt}"
17 t_nxt=$((t_nxt+1))
18 done
19 printf "__SYSCALL(%s, %s, )\n" "${t_nxt}" "${t_entry}"
20}
21
22grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | (
23 nxt=0
24 if [ -z "$offset" ]; then
25 offset=0
26 fi
27
28 while read nr abi name entry compat ; do
29 if [ "$my_abi" = "c32" ] && [ ! -z "$compat" ]; then
30 emit $((nxt+offset)) $((nr+offset)) $compat
31 else
32 emit $((nxt+offset)) $((nr+offset)) $entry
33 fi
34 nxt=$((nr+1))
35 done
36) > "$out"
arch/sparc/kernel/systbls_32.S+2−2
@@ -9,10 +9,10 @@ · 8 unmodified lines
9 * Copyright (C) 1995 Adrian M. Rodriguez (adrian@remus.rutgers.edu)9 * Copyright (C) 1995 Adrian M. Rodriguez (adrian@remus.rutgers.edu)
10 */10 */
11 11
12#define __SYSCALL(nr, entry, nargs) .long entry12#define __SYSCALL_WITH_COMPAT(nr, native, compat) __SYSCALL(nr, native)
13#define __SYSCALL(nr, entry) .long entry
13 .data14 .data
14 .align 415 .align 4
15 .globl sys_call_table16 .globl sys_call_table
16sys_call_table:17sys_call_table:
17#include <asm/syscall_table_32.h> /* 32-bit native syscalls */18#include <asm/syscall_table_32.h> /* 32-bit native syscalls */
18#undef __SYSCALL
arch/sparc/kernel/systbls_64.S+5−3
@@ -10,18 +10,20 @@ · 9 unmodified lines
10 * Copyright (C) 1995 Adrian M. Rodriguez (adrian@remus.rutgers.edu)10 * Copyright (C) 1995 Adrian M. Rodriguez (adrian@remus.rutgers.edu)
11 */11 */
12 12
13#define __SYSCALL(nr, entry, nargs) .word entry13#define __SYSCALL(nr, entry) .word entry
14 .text14 .text
15 .align 415 .align 4
16#ifdef CONFIG_COMPAT16#ifdef CONFIG_COMPAT
17 .globl sys_call_table3217 .globl sys_call_table32
18sys_call_table32:18sys_call_table32:
19#include <asm/syscall_table_c32.h> /* Compat syscalls */19#define __SYSCALL_WITH_COMPAT(nr, native, compat) __SYSCALL(nr, compat)
20#include <asm/syscall_table_32.h> /* Compat syscalls */
21#undef __SYSCALL_WITH_COMPAT
20#endif /* CONFIG_COMPAT */22#endif /* CONFIG_COMPAT */
21 23
22 .align 424 .align 4
23 .globl sys_call_table64, sys_call_table25 .globl sys_call_table64, sys_call_table
24sys_call_table64:26sys_call_table64:
25sys_call_table:27sys_call_table:
28#define __SYSCALL_WITH_COMPAT(nr, native, compat) __SYSCALL(nr, native)
26#include <asm/syscall_table_64.h> /* 64-bit native syscalls */29#include <asm/syscall_table_64.h> /* 64-bit native syscalls */
27#undef __SYSCALL
arch/xtensa/Makefile+1−5
@@ -19,12 +19,8 @@ variant-y := $(patsubst "%",%,$(CONFIG_XTENSA_VARIANT_NAME)) · 18 unmodified lines
19VARIANT = $(variant-y)19VARIANT = $(variant-y)
20export VARIANT20export VARIANT
21 21
22# Test for cross compiling
23
24ifneq ($(VARIANT),)22ifneq ($(VARIANT),)
25 COMPILE_ARCH = $(shell uname -m)23 ifdef cross_compiling
26
27 ifneq ($(COMPILE_ARCH), xtensa)
28 ifndef CROSS_COMPILE24 ifndef CROSS_COMPILE
29 CROSS_COMPILE = xtensa_$(VARIANT)-25 CROSS_COMPILE = xtensa_$(VARIANT)-
30 endif26 endif
certs/.gitignore+2−2
@@ -1,3 +1,3 @@
1# SPDX-License-Identifier: GPL-2.0-only1# SPDX-License-Identifier: GPL-2.0-only
2x509_certificate_list2/x509_certificate_list
3x509_revocation_list3/x509_revocation_list
drivers/memory/.gitignore+1−1
@@ -1,2 +1,2 @@
1# SPDX-License-Identifier: GPL-2.0-only1# SPDX-License-Identifier: GPL-2.0-only
2ti-emif-asm-offsets.h2/ti-emif-asm-offsets.h
drivers/pinctrl/pinctrl-ingenic.c+3−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
11#include <linux/gpio/driver.h>11#include <linux/gpio/driver.h>
12#include <linux/interrupt.h>12#include <linux/interrupt.h>
13#include <linux/io.h>13#include <linux/io.h>
14#include <linux/kernel.h>
14#include <linux/of_device.h>15#include <linux/of_device.h>
15#include <linux/of_irq.h>16#include <linux/of_irq.h>
16#include <linux/of_platform.h>17#include <linux/of_platform.h>
@@ -3854,6 +3855,8 @@ static int __init ingenic_pinctrl_probe(struct platform_device *pdev) · 3837 unmodified lines
3854 return 0;3855 return 0;
3855}3856}
3856 3857
3858#define IF_ENABLED(cfg, ptr) PTR_IF(IS_ENABLED(cfg), (ptr))
3859
3857static const struct of_device_id ingenic_pinctrl_of_match[] = {3860static const struct of_device_id ingenic_pinctrl_of_match[] = {
3858 {3861 {
3859 .compatible = "ingenic,jz4730-pinctrl",3862 .compatible = "ingenic,jz4730-pinctrl",
drivers/tty/vt/.gitignore+3−3
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.01# SPDX-License-Identifier: GPL-2.0
2conmakehash2/conmakehash
3consolemap_deftbl.c3/consolemap_deftbl.c
4defkeymap.c4/defkeymap.c
fs/unicode/.gitignore+2−2
@@ -1,3 +1,3 @@
1# SPDX-License-Identifier: GPL-2.0-only1# SPDX-License-Identifier: GPL-2.0-only
2mkutf8data2/mkutf8data
3utf8data.h3/utf8data.h
include/linux/kconfig.h+0−6
@@ -70,10 +70,4 @@ · 69 unmodified lines
70 */70 */
71#define IS_ENABLED(option) __or(IS_BUILTIN(option), IS_MODULE(option))71#define IS_ENABLED(option) __or(IS_BUILTIN(option), IS_MODULE(option))
72 72
73/*
74 * IF_ENABLED(CONFIG_FOO, ptr) evaluates to (ptr) if CONFIG_FOO is set to 'y'
75 * or 'm', NULL otherwise.
76 */
77#define IF_ENABLED(option, ptr) (IS_ENABLED(option) ? (ptr) : NULL)
78
79#endif /* __LINUX_KCONFIG_H */73#endif /* __LINUX_KCONFIG_H */
include/linux/kernel.h+2−0
@@ -41,6 +41,8 @@ · 40 unmodified lines
41 */41 */
42#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))42#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
43 43
44#define PTR_IF(cond, ptr) ((cond) ? (ptr) : NULL)
45
44#define u64_to_user_ptr(x) ( \46#define u64_to_user_ptr(x) ( \
45{ \47{ \
46 typecheck(u64, (x)); \48 typecheck(u64, (x)); \
kernel/.gitignore+2−3
@@ -1,4 +1,3 @@
1# SPDX-License-Identifier: GPL-2.0-only1# SPDX-License-Identifier: GPL-2.0-only
2kheaders.md52/config_data
3timeconst.h3/kheaders.md5
4hz.bc
kernel/Makefile+7−2
@@ -142,10 +142,15 @@ obj-$(CONFIG_SCF_TORTURE_TEST) += scftorture.o · 141 unmodified lines
142 142
143$(obj)/configs.o: $(obj)/config_data.gz143$(obj)/configs.o: $(obj)/config_data.gz
144 144
145targets += config_data.gz145targets += config_data config_data.gz
146$(obj)/config_data.gz: $(KCONFIG_CONFIG) FORCE146$(obj)/config_data.gz: $(obj)/config_data FORCE
147 $(call if_changed,gzip)147 $(call if_changed,gzip)
148 148
149filechk_cat = cat $<
150
151$(obj)/config_data: $(KCONFIG_CONFIG) FORCE
152 $(call filechk,cat)
153
149$(obj)/kheaders.o: $(obj)/kheaders_data.tar.xz154$(obj)/kheaders.o: $(obj)/kheaders_data.tar.xz
150 155
151quiet_cmd_genikh = CHK $(obj)/kheaders_data.tar.xz156quiet_cmd_genikh = CHK $(obj)/kheaders_data.tar.xz
lib/.gitignore+5−5
@@ -1,6 +1,6 @@
1# SPDX-License-Identifier: GPL-2.0-only1# SPDX-License-Identifier: GPL-2.0-only
2gen_crc32table2/crc32table.h
3gen_crc64table3/crc64table.h
4crc32table.h4/gen_crc32table
5crc64table.h5/gen_crc64table
6oid_registry_data.c6/oid_registry_data.c
samples/auxdisplay/.gitignore+1−1
@@ -1,2 +1,2 @@
1# SPDX-License-Identifier: GPL-2.0-only1# SPDX-License-Identifier: GPL-2.0-only
2cfag12864b-example2/cfag12864b-example
samples/binderfs/.gitignore+2−1
@@ -1 +1,2 @@
1binderfs_example1# SPDX-License-Identifier: GPL-2.0
2/binderfs_example
samples/connector/.gitignore+1−1
@@ -1,2 +1,2 @@
1# SPDX-License-Identifier: GPL-2.0-only1# SPDX-License-Identifier: GPL-2.0-only
2ucon2/ucon
samples/hidraw/.gitignore+1−1
@@ -1,2 +1,2 @@
1# SPDX-License-Identifier: GPL-2.0-only1# SPDX-License-Identifier: GPL-2.0-only
2hid-example2/hid-example
samples/mei/.gitignore+1−1
@@ -1,2 +1,2 @@
1# SPDX-License-Identifier: GPL-2.0-only1# SPDX-License-Identifier: GPL-2.0-only
2mei-amt-version2/mei-amt-version
samples/nitro_enclaves/.gitignore+1−1
@@ -1,2 +1,2 @@
1# SPDX-License-Identifier: GPL-2.01# SPDX-License-Identifier: GPL-2.0
2ne_ioctl_sample2/ne_ioctl_sample
samples/pidfd/.gitignore+1−1
@@ -1,2 +1,2 @@
1# SPDX-License-Identifier: GPL-2.0-only1# SPDX-License-Identifier: GPL-2.0-only
2pidfd-metadata2/pidfd-metadata
samples/seccomp/.gitignore+4−4
@@ -1,5 +1,5 @@
1# SPDX-License-Identifier: GPL-2.0-only1# SPDX-License-Identifier: GPL-2.0-only
2bpf-direct2/bpf-direct
3bpf-fancy3/bpf-fancy
4dropper4/dropper
5user-trap5/user-trap
samples/timers/.gitignore+1−1
@@ -1,2 +1,2 @@
1# SPDX-License-Identifier: GPL-2.0-only1# SPDX-License-Identifier: GPL-2.0-only
2hpet_example2/hpet_example
samples/vfs/.gitignore+2−2
@@ -1,3 +1,3 @@
1# SPDX-License-Identifier: GPL-2.0-only1# SPDX-License-Identifier: GPL-2.0-only
2test-fsmount2/test-fsmount
3test-statx3/test-statx
samples/watch_queue/.gitignore+2−1
@@ -1 +1,2 @@
1watch_test1# SPDX-License-Identifier: GPL-2.0-only
2/watch_test
samples/watchdog/.gitignore+1−1
@@ -1,2 +1,2 @@
1# SPDX-License-Identifier: GPL-2.0-only1# SPDX-License-Identifier: GPL-2.0-only
2watchdog-simple2/watchdog-simple
scripts/.gitignore+9−9
@@ -1,11 +1,11 @@
1# SPDX-License-Identifier: GPL-2.0-only1# SPDX-License-Identifier: GPL-2.0-only
2bin2c2/asn1_compiler
3kallsyms3/bin2c
4unifdef4/extract-cert
5recordmcount5/insert-sys-cert
6sorttable6/kallsyms
7asn1_compiler
8extract-cert
9sign-file
10insert-sys-cert
11/module.lds7/module.lds
8/recordmcount
9/sign-file
10/sorttable
11/unifdef
scripts/Makefile.build+1−1
@@ -354,7 +354,7 @@ $(obj)/%.o: $(src)/%.S $(objtool_dep) FORCE · 353 unmodified lines
354 354
355targets += $(filter-out $(subdir-builtin), $(real-obj-y))355targets += $(filter-out $(subdir-builtin), $(real-obj-y))
356targets += $(filter-out $(subdir-modorder), $(real-obj-m))356targets += $(filter-out $(subdir-modorder), $(real-obj-m))
357targets += $(lib-y) $(always-y) $(MAKECMDGOALS)357targets += $(real-dtb-y) $(lib-y) $(always-y) $(MAKECMDGOALS)
358 358
359# Linker scripts preprocessor (.lds.S -> .lds)359# Linker scripts preprocessor (.lds.S -> .lds)
360# ---------------------------------------------------------------------------360# ---------------------------------------------------------------------------
scripts/Makefile.lib+30−27
@@ -44,19 +44,22 @@ else · 43 unmodified lines
44obj-y := $(filter-out %/, $(obj-y))44obj-y := $(filter-out %/, $(obj-y))
45endif45endif
46 46
47# Expand $(foo-objs) $(foo-y) by calling $(call suffix-search,foo.o,-objs -y)47# Expand $(foo-objs) $(foo-y) etc. by replacing their individuals
48suffix-search = $(strip $(foreach s, $2, $($(1:.o=$s))))48suffix-search = $(strip $(foreach s, $3, $($(1:%$(strip $2)=%$s))))
49# List composite targets that are constructed by combining other targets
50multi-search = $(sort $(foreach m, $1, $(if $(call suffix-search, $m, $2, $3 -), $m)))
51# List primitive targets that are compiled from source files
52real-search = $(foreach m, $1, $(if $(call suffix-search, $m, $2, $3 -), $(call suffix-search, $m, $2, $3), $m))
53
49# If $(foo-objs), $(foo-y), $(foo-m), or $(foo-) exists, foo.o is a composite object54# If $(foo-objs), $(foo-y), $(foo-m), or $(foo-) exists, foo.o is a composite object
50multi-search = $(sort $(foreach m, $1, $(if $(call suffix-search, $m, $2 -), $m)))55multi-obj-y := $(call multi-search, $(obj-y), .o, -objs -y)
51multi-obj-y := $(call multi-search,$(obj-y),-objs -y)56multi-obj-m := $(call multi-search, $(obj-m), .o, -objs -y -m)
52multi-obj-m := $(call multi-search,$(obj-m),-objs -y -m)
53multi-obj-ym := $(multi-obj-y) $(multi-obj-m)57multi-obj-ym := $(multi-obj-y) $(multi-obj-m)
54 58
55# Replace multi-part objects by their individual parts,59# Replace multi-part objects by their individual parts,
56# including built-in.a from subdirectories60# including built-in.a from subdirectories
57real-search = $(foreach m, $1, $(if $(call suffix-search, $m, $2 -), $(call suffix-search, $m, $2), $m))61real-obj-y := $(call real-search, $(obj-y), .o, -objs -y)
58real-obj-y := $(call real-search, $(obj-y),-objs -y)62real-obj-m := $(call real-search, $(obj-m), .o, -objs -y -m)
59real-obj-m := $(call real-search, $(obj-m),-objs -y -m)
60 63
61always-y += $(always-m)64always-y += $(always-m)
62 65
@@ -75,24 +78,18 @@ always-y += $(userprogs-always-y) $(userprogs-always-m) · 12 unmodified lines
75# If CONFIG_OF_ALL_DTBS is enabled, all DT blobs are built78# If CONFIG_OF_ALL_DTBS is enabled, all DT blobs are built
76dtb-$(CONFIG_OF_ALL_DTBS) += $(dtb-)79dtb-$(CONFIG_OF_ALL_DTBS) += $(dtb-)
77 80
78# List all dtbs to be generated by fdtoverlay81# Composite DTB (i.e. DTB constructed by overlay)
79overlay-y := $(foreach m,$(dtb-y), $(if $(strip $($(m:.dtb=-dtbs))),$(m),))82multi-dtb-y := $(call multi-search, $(dtb-y), .dtb, -dtbs)
80 83# Primitive DTB compiled from *.dts
81# Generate symbols for the base files so overlays can be applied to them.84real-dtb-y := $(call real-search, $(dtb-y), .dtb, -dtbs)
82$(foreach m,$(overlay-y), $(eval DTC_FLAGS_$(basename $(firstword $($(m:.dtb=-dtbs)))) += -@))85# Base DTB that overlay is applied onto (each first word of $(*-dtbs) expansion)
83 86base-dtb-y := $(foreach m, $(multi-dtb-y), $(firstword $(call suffix-search, $m, .dtb, -dtbs)))
84# Add base dtb and overlay dtbo
85dtb-y += $(foreach m,$(overlay-y), $($(m:.dtb=-dtbs)))
86 87
87always-y += $(dtb-y)88always-y += $(dtb-y)
88 89
89ifneq ($(CHECK_DTBS),)90ifneq ($(CHECK_DTBS),)
90# Don't run schema checks for dtbs created by fdtoverlay as they don't91always-y += $(patsubst %.dtb,%.dt.yaml, $(real-dtb-y))
91# have corresponding dts files.92always-y += $(patsubst %.dtbo,%.dt.yaml, $(real-dtb-y))
92dt-yaml-y := $(filter-out $(overlay-y),$(dtb-y))
93
94always-y += $(patsubst %.dtb,%.dt.yaml, $(dt-yaml-y))
95always-y += $(patsubst %.dtbo,%.dt.yaml, $(dt-yaml-y))
96endif93endif
97 94
98# Add subdir path95# Add subdir path
@@ -105,12 +102,14 @@ lib-y := $(addprefix $(obj)/,$(lib-y)) · 6 unmodified lines
105real-obj-y := $(addprefix $(obj)/,$(real-obj-y))102real-obj-y := $(addprefix $(obj)/,$(real-obj-y))
106real-obj-m := $(addprefix $(obj)/,$(real-obj-m))103real-obj-m := $(addprefix $(obj)/,$(real-obj-m))
107multi-obj-m := $(addprefix $(obj)/, $(multi-obj-m))104multi-obj-m := $(addprefix $(obj)/, $(multi-obj-m))
105multi-dtb-y := $(addprefix $(obj)/, $(multi-dtb-y))
106real-dtb-y := $(addprefix $(obj)/, $(real-dtb-y))
108subdir-ym := $(addprefix $(obj)/,$(subdir-ym))107subdir-ym := $(addprefix $(obj)/,$(subdir-ym))
109 108
110# Finds the multi-part object the current object will be linked into.109# Finds the multi-part object the current object will be linked into.
111# If the object belongs to two or more multi-part objects, list them all.110# If the object belongs to two or more multi-part objects, list them all.
112modname-multi = $(sort $(foreach m,$(multi-obj-ym),\111modname-multi = $(sort $(foreach m,$(multi-obj-ym),\
113 $(if $(filter $*.o, $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m))),$(m:.o=))))112 $(if $(filter $*.o, $(call suffix-search, $m, .o, -objs -y -m)),$(m:.o=))))
114 113
115__modname = $(if $(modname-multi),$(modname-multi),$(basetarget))114__modname = $(if $(modname-multi),$(modname-multi),$(basetarget))
116 115
@@ -252,6 +251,9 @@ quiet_cmd_copy = COPY $@ · 135 unmodified lines
252 251
253# Shipped files252# Shipped files
254# ===========================================================================253# ===========================================================================
254# 'cp' preserves permissions. If you use it to copy a file in read-only srctree,
255# the copy would be read-only as well, leading to an error when executing the
256# rule next time. Use 'cat' instead in order to generate a writable file.
255 257
256quiet_cmd_shipped = SHIPPED $@258quiet_cmd_shipped = SHIPPED $@
257cmd_shipped = cat $< > $@259cmd_shipped = cat $< > $@
@@ -319,6 +321,9 @@ endif · 61 unmodified lines
319 321
320DTC_FLAGS += $(DTC_FLAGS_$(basetarget))322DTC_FLAGS += $(DTC_FLAGS_$(basetarget))
321 323
324# Set -@ if the target is a base DTB that overlay is applied onto
325DTC_FLAGS += $(if $(filter $(patsubst $(obj)/%,%,$@), $(base-dtb-y)), -@)
326
322# Generate an assembly file to wrap the output of the device tree compiler327# Generate an assembly file to wrap the output of the device tree compiler
323quiet_cmd_dt_S_dtb= DTB $@328quiet_cmd_dt_S_dtb= DTB $@
324cmd_dt_S_dtb= \329cmd_dt_S_dtb= \
@@ -350,14 +355,12 @@ $(obj)/%.dtb: $(src)/%.dts $(DTC) FORCE · 25 unmodified lines
350$(obj)/%.dtbo: $(src)/%.dts $(DTC) FORCE355$(obj)/%.dtbo: $(src)/%.dts $(DTC) FORCE
351 $(call if_changed_dep,dtc)356 $(call if_changed_dep,dtc)
352 357
353overlay-y := $(addprefix $(obj)/, $(overlay-y))
354
355quiet_cmd_fdtoverlay = DTOVL $@358quiet_cmd_fdtoverlay = DTOVL $@
356 cmd_fdtoverlay = $(objtree)/scripts/dtc/fdtoverlay -o $@ -i $(real-prereqs)359 cmd_fdtoverlay = $(objtree)/scripts/dtc/fdtoverlay -o $@ -i $(real-prereqs)
357 360
358$(overlay-y): FORCE361$(multi-dtb-y): FORCE
359 $(call if_changed,fdtoverlay)362 $(call if_changed,fdtoverlay)
360$(call multi_depend, $(overlay-y), .dtb, -dtbs)363$(call multi_depend, $(multi-dtb-y), .dtb, -dtbs)
361 364
362DT_CHECKER ?= dt-validate365DT_CHECKER ?= dt-validate
363DT_CHECKER_FLAGS ?= $(if $(DT_SCHEMA_FILES),,-m)366DT_CHECKER_FLAGS ?= $(if $(DT_SCHEMA_FILES),,-m)
scripts/basic/.gitignore+1−1
@@ -1,2 +1,2 @@
1# SPDX-License-Identifier: GPL-2.0-only1# SPDX-License-Identifier: GPL-2.0-only
2fixdep2/fixdep
scripts/dtc/.gitignore+2−2
@@ -1,3 +1,3 @@
1# SPDX-License-Identifier: GPL-2.0-only1# SPDX-License-Identifier: GPL-2.0-only
2dtc2/dtc
3fdtoverlay3/fdtoverlay
scripts/gcc-plugins/.gitignore+1−1
@@ -1,2 +1,2 @@
1# SPDX-License-Identifier: GPL-2.0-only1# SPDX-License-Identifier: GPL-2.0-only
2randomize_layout_seed.h2/randomize_layout_seed.h
scripts/genksyms/.gitignore+1−1
@@ -1,2 +1,2 @@
1# SPDX-License-Identifier: GPL-2.0-only1# SPDX-License-Identifier: GPL-2.0-only
2genksyms2/genksyms
scripts/genksyms/Makefile+1−1
@@ -22,7 +22,7 @@ $(obj)/pars%.tab.c $(obj)/pars%.tab.h: $(src)/pars%.y FORCE · 21 unmodified lines
22 22
23endif23endif
24 24
25# -I needed for generated C source (shipped source)25# -I needed for generated C source to include headers in source tree
26HOSTCFLAGS_parse.tab.o := -I $(srctree)/$(src)26HOSTCFLAGS_parse.tab.o := -I $(srctree)/$(src)
27HOSTCFLAGS_lex.lex.o := -I $(srctree)/$(src)27HOSTCFLAGS_lex.lex.o := -I $(srctree)/$(src)
28 28
scripts/link-vmlinux.sh+0−14
@@ -320,20 +320,6 @@ cleanup() · 319 unmodified lines
320 rm -f .vmlinux.d320 rm -f .vmlinux.d
321}321}
322 322
323on_exit()
324{
325 if [ $? -ne 0 ]; then
326 cleanup
327 fi
328}
329trap on_exit EXIT
330
331on_signals()
332{
333 exit 1
334}
335trap on_signals HUP INT QUIT TERM
336
337# Use "make V=1" to debug this script323# Use "make V=1" to debug this script
338case "${KBUILD_VERBOSE}" in324case "${KBUILD_VERBOSE}" in
339*1*)325*1*)
scripts/mod/.gitignore+4−4
@@ -1,5 +1,5 @@
1# SPDX-License-Identifier: GPL-2.0-only1# SPDX-License-Identifier: GPL-2.0-only
2elfconfig.h2/devicetable-offsets.h
3mk_elfconfig3/elfconfig.h
4modpost4/mk_elfconfig
5devicetable-offsets.h5/modpost
scripts/nsdeps+1−1
@@ -44,7 +44,7 @@ generate_deps() { · 43 unmodified lines
44 for source_file in $mod_source_files; do44 for source_file in $mod_source_files; do
45 sed '/MODULE_IMPORT_NS/Q' $source_file > ${source_file}.tmp45 sed '/MODULE_IMPORT_NS/Q' $source_file > ${source_file}.tmp
46 offset=$(wc -l ${source_file}.tmp | awk '{print $1;}')46 offset=$(wc -l ${source_file}.tmp | awk '{print $1;}')
47 cat $source_file | grep MODULE_IMPORT_NS | LANG=C sort -u >> ${source_file}.tmp47 cat $source_file | grep MODULE_IMPORT_NS | LC_ALL=C sort -u >> ${source_file}.tmp
48 tail -n +$((offset +1)) ${source_file} | grep -v MODULE_IMPORT_NS >> ${source_file}.tmp48 tail -n +$((offset +1)) ${source_file} | grep -v MODULE_IMPORT_NS >> ${source_file}.tmp
49 if ! diff -q ${source_file} ${source_file}.tmp; then49 if ! diff -q ${source_file} ${source_file}.tmp; then
50 mv ${source_file}.tmp ${source_file}50 mv ${source_file}.tmp ${source_file}
scripts/recordmcount.pl+1−1
@@ -497,7 +497,7 @@ sub update_funcs · 496 unmodified lines
497#497#
498# Step 2: find the sections and mcount call sites498# Step 2: find the sections and mcount call sites
499#499#
500open(IN, "LANG=C $objdump -hdr $inputfile|") || die "error running $objdump";500open(IN, "LC_ALL=C $objdump -hdr $inputfile|") || die "error running $objdump";
501 501
502my $text;502my $text;
503 503
scripts/remove-stale-files+31−0
@@ -0,0 +1,31 @@
1#!/bin/sh
2
3set -e
4
5# When you move, remove or rename generated files, you probably also update
6# .gitignore and cleaning rules in the Makefile. This is the right thing
7# to do. However, people usually do 'git pull', 'git bisect', etc. without
8# running 'make clean'. Then, the stale generated files are left over, often
9# causing build issues.
10#
11# Also, 'git status' shows such stale build artifacts as untracked files.
12# What is worse, some people send a wrong patch to get them back to .gitignore
13# without checking the commit history.
14#
15# So, when you (re)move generated files, please move the cleaning rules from
16# the Makefile to this script. This is run before Kbuild starts building
17# anything, so people will not be annoyed by such garbage files.
18#
19# This script is not intended to grow endlessly. Rather, it is a temporary scrap
20# yard. Stale files stay in this file for a while (for some release cycles?),
21# then will be really dead and removed from the code base entirely.
22
23# These were previously generated source files. When you are building the kernel
24# with O=, make sure to remove the stale files in the output tree. Otherwise,
25# the build system wrongly compiles the stale ones.
26if [ -n "${building_out_of_srctree}" ]; then
27 for f in fdt_rw.c fdt_ro.c fdt_wip.c fdt.c
28 do
29 rm -f arch/arm/boot/compressed/${f}
30 done
31fi
scripts/setlocalversion+1−1
@@ -126,7 +126,7 @@ scm_version() · 125 unmodified lines
126 fi126 fi
127 127
128 # Check for svn and a svn repo.128 # Check for svn and a svn repo.
129 if rev=$(LANG= LC_ALL= LC_MESSAGES=C svn info 2>/dev/null | grep '^Last Changed Rev'); then129 if rev=$(LC_ALL=C svn info 2>/dev/null | grep '^Last Changed Rev'); then
130 rev=$(echo $rev | awk '{print $NF}')130 rev=$(echo $rev | awk '{print $NF}')
131 printf -- '-svn%s' "$rev"131 printf -- '-svn%s' "$rev"
132 132
scripts/tags.sh+1−1
@@ -326,5 +326,5 @@ esac · 325 unmodified lines
326 326
327# Remove structure forward declarations.327# Remove structure forward declarations.
328if [ -n "$remove_structs" ]; then328if [ -n "$remove_structs" ]; then
329 LANG=C sed -i -e '/^\([a-zA-Z_][a-zA-Z0-9_]*\)\t.*\t\/\^struct \1;.*\$\/;"\tx$/d' $1329 LC_ALL=C sed -i -e '/^\([a-zA-Z_][a-zA-Z0-9_]*\)\t.*\t\/\^struct \1;.*\$\/;"\tx$/d' $1
330fi330fi
tools/testing/selftests/net/mptcp/mptcp_connect.sh+1−1
@@ -274,7 +274,7 @@ check_mptcp_disabled() · 273 unmodified lines
274 ip netns exec ${disabled_ns} sysctl -q net.mptcp.enabled=0274 ip netns exec ${disabled_ns} sysctl -q net.mptcp.enabled=0
275 275
276 local err=0276 local err=0
277 LANG=C ip netns exec ${disabled_ns} ./mptcp_connect -p 10000 -s MPTCP 127.0.0.1 < "$cin" 2>&1 | \277 LC_ALL=C ip netns exec ${disabled_ns} ./mptcp_connect -p 10000 -s MPTCP 127.0.0.1 < "$cin" 2>&1 | \
278 grep -q "^socket: Protocol not available$" && err=1278 grep -q "^socket: Protocol not available$" && err=1
279 ip netns delete ${disabled_ns}279 ip netns delete ${disabled_ns}
280 280
usr/.gitignore+2−2
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0-only1# SPDX-License-Identifier: GPL-2.0-only
2gen_init_cpio2/gen_init_cpio
3initramfs_data.cpio3/initramfs_data.cpio
4/initramfs_inc_data4/initramfs_inc_data
usr/gen_initramfs.sh+1−1
@@ -147,7 +147,7 @@ dir_filelist() { · 146 unmodified lines
147 header "$1"147 header "$1"
148 148
149 srcdir=$(echo "$1" | sed -e 's://*:/:g')149 srcdir=$(echo "$1" | sed -e 's://*:/:g')
150 dirlist=$(find "${srcdir}" -printf "%p %m %U %G\n" | LANG=C sort)150 dirlist=$(find "${srcdir}" -printf "%p %m %U %G\n" | LC_ALL=C sort)
151 151
152 # If $dirlist is only one line, then the directory is empty152 # If $dirlist is only one line, then the directory is empty
153 if [ "$(echo "${dirlist}" | wc -l)" -gt 1 ]; then153 if [ "$(echo "${dirlist}" | wc -l)" -gt 1 ]; then
usr/include/.gitignore+1−3
@@ -1,4 +1,2 @@
1# SPDX-License-Identifier: GPL-2.0-only1# SPDX-License-Identifier: GPL-2.0-only
2*2/*/
3!.gitignore
4!Makefile