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 ...
Unified · Split
| @@ -48,14 +48,11 @@ · 47 unmodified lines | |||
| 48 | *.xz | 48 | *.xz |
| 49 | *.zst | 49 | *.zst |
| 50 | Module.symvers | 50 | Module.symvers |
| 51 | modules.builtin | ||
| 52 | modules.order | 51 | modules.order |
| 53 | 52 | ||
| 54 | # | 53 | # |
| 55 | # Top-level generic files | 54 | # Top-level generic files |
| 56 | # | 55 | # |
| 57 | /tags | ||
| 58 | /TAGS | ||
| 59 | /linux | 56 | /linux |
| 60 | /modules-only.symvers | 57 | /modules-only.symvers |
| 61 | /vmlinux | 58 | /vmlinux |
| @@ -66,6 +63,7 @@ modules.order · 4 unmodified lines | |||
| 66 | /vmlinuz | 63 | /vmlinuz |
| 67 | /System.map | 64 | /System.map |
| 68 | /Module.markers | 65 | /Module.markers |
| 66 | /modules.builtin | ||
| 69 | /modules.builtin.modinfo | 67 | /modules.builtin.modinfo |
| 70 | /modules.nsdeps | 68 | /modules.nsdeps |
| 71 | 69 | ||
| @@ -114,6 +112,10 @@ patches-* · 42 unmodified lines | |||
| 114 | patches | 112 | patches |
| 115 | series | 113 | series |
| 116 | 114 | ||
| 115 | # ctags files | ||
| 116 | tags | ||
| 117 | TAGS | ||
| 118 | |||
| 117 | # cscope files | 119 | # cscope files |
| 118 | cscope.* | 120 | cscope.* |
| 119 | ncscope.* | 121 | ncscope.* |
| @@ -1,4 +1,4 @@ | |||
| 1 | # SPDX-License-Identifier: GPL-2.0-only | 1 | # SPDX-License-Identifier: GPL-2.0-only |
| 2 | *.example.dts | 2 | *.example.dts |
| 3 | processed-schema*.yaml | 3 | /processed-schema*.yaml |
| 4 | processed-schema*.json | 4 | /processed-schema*.json |
| @@ -399,11 +399,6 @@ ifeq ($(ARCH),sparc64) · 398 unmodified lines | |||
| 399 | SRCARCH := sparc | 399 | SRCARCH := sparc |
| 400 | endif | 400 | endif |
| 401 | 401 | ||
| 402 | # Additional ARCH settings for sh | ||
| 403 | ifeq ($(ARCH),sh64) | ||
| 404 | SRCARCH := sh | ||
| 405 | endif | ||
| 406 | |||
| 407 | export cross_compiling := | 402 | export cross_compiling := |
| 408 | ifneq ($(SRCARCH),$(SUBARCH)) | 403 | ifneq ($(SRCARCH),$(SUBARCH)) |
| 409 | cross_compiling := 1 | 404 | cross_compiling := 1 |
| @@ -792,16 +787,16 @@ KBUILD_CFLAGS += -Wno-gnu · 382 unmodified lines | |||
| 792 | KBUILD_CFLAGS += -mno-global-merge | 787 | KBUILD_CFLAGS += -mno-global-merge |
| 793 | else | 788 | else |
| 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) | ||
| 797 | KBUILD_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 and | 791 | # 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. |
| 802 | KBUILD_CFLAGS += $(call cc-option,-Wimplicit-fallthrough,) | 793 | KBUILD_CFLAGS += $(call cc-option,-Wimplicit-fallthrough,) |
| 803 | endif | 794 | endif |
| 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) | ||
| 798 | KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable) | ||
| 799 | |||
| 805 | KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable) | 800 | KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable) |
| 806 | ifdef CONFIG_FRAME_POINTER | 801 | ifdef CONFIG_FRAME_POINTER |
| 807 | KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls | 802 | KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls |
| @@ -1225,7 +1220,7 @@ PHONY += prepare archprepare · 417 unmodified lines | |||
| 1225 | 1220 | ||
| 1226 | archprepare: outputmakefile archheaders archscripts scripts include/config/kernel.release \ | 1221 | archprepare: 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.h | 1223 | include/generated/autoconf.h remove-stale-files |
| 1229 | 1224 | ||
| 1230 | prepare0: archprepare | 1225 | prepare0: archprepare |
| 1231 | $(Q)$(MAKE) $(build)=scripts/mod | 1226 | $(Q)$(MAKE) $(build)=scripts/mod |
| @@ -1234,6 +1229,10 @@ prepare0: archprepare · 2 unmodified lines | |||
| 1234 | # All the preparing.. | 1229 | # All the preparing.. |
| 1235 | prepare: prepare0 prepare-objtool prepare-resolve_btfids | 1230 | prepare: prepare0 prepare-objtool prepare-resolve_btfids |
| 1236 | 1231 | ||
| 1232 | PHONY += remove-stale-files | ||
| 1233 | remove-stale-files: | ||
| 1234 | $(Q)$(srctree)/scripts/remove-stale-files | ||
| 1235 | |||
| 1237 | # Support for using generic headers in asm-generic | 1236 | # Support for using generic headers in asm-generic |
| 1238 | asm-generic := -f $(srctree)/scripts/Makefile.asm-generic obj | 1237 | asm-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 | *.spec | 1512 | *.spec |
| 1514 | 1513 | ||
| 1515 | # Directories & files removed with 'make distclean' | ||
| 1516 | DISTCLEAN_FILES += tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS | ||
| 1517 | |||
| 1518 | # clean - Delete most, but leave enough to build external modules | 1514 | # clean - Delete most, but leave enough to build external modules |
| 1519 | # | 1515 | # |
| 1520 | clean: rm-files := $(CLEAN_FILES) | 1516 | clean: rm-files := $(CLEAN_FILES) |
| @@ -1541,16 +1537,14 @@ mrproper: clean $(mrproper-dirs) · 20 unmodified lines | |||
| 1541 | 1537 | ||
| 1542 | # distclean | 1538 | # distclean |
| 1543 | # | 1539 | # |
| 1544 | distclean: rm-files := $(wildcard $(DISTCLEAN_FILES)) | ||
| 1545 | |||
| 1546 | PHONY += distclean | 1540 | PHONY += distclean |
| 1547 | 1541 | ||
| 1548 | distclean: mrproper | 1542 | distclean: 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 -f | 1548 | -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 considered | 1711 | # When building external modules the kernel used as basis is considered |
| 1718 | # read-only, and no consistency checks are made and the make | 1712 | # read-only, and no consistency checks are made and the make |
| 1719 | # system is not used on the basis kernel. If updates are required | 1713 | # system is not used on the basis kernel. If updates are required |
| 1720 | # in the basis kernel ordinary make commands (without M=...) must | 1714 | # 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. |
| 1733 | KBUILD_BUILTIN := | 1717 | KBUILD_BUILTIN := |
| @@ -1,3 +1,3 @@ | |||
| 1 | # SPDX-License-Identifier: GPL-2.0-only | 1 | # SPDX-License-Identifier: GPL-2.0-only |
| 2 | i386 | 2 | /i386/ |
| 3 | x86_64 | 3 | /x86_64/ |
| @@ -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. | ||
| 102 | ifdef building_out_of_srctree | ||
| 103 | $(shell rm -f $(addprefix $(obj)/, fdt_rw.c fdt_ro.c fdt_wip.c fdt.c)) | ||
| 104 | endif | ||
| 105 | |||
| 106 | targets := vmlinux vmlinux.lds piggy_data piggy.o \ | 99 | targets := 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) |
| @@ -16,7 +16,7 @@ · 15 unmodified lines | |||
| 16 | 16 | ||
| 17 | KBUILD_DEFCONFIG := multi_defconfig | 17 | KBUILD_DEFCONFIG := multi_defconfig |
| 18 | 18 | ||
| 19 | ifneq ($(SUBARCH),$(ARCH)) | 19 | ifdef 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-) |
| @@ -50,7 +50,7 @@ tool-archpref = $(64bit-tool-archpref) · 49 unmodified lines | |||
| 50 | UTS_MACHINE := mips64 | 50 | UTS_MACHINE := mips64 |
| 51 | endif | 51 | endif |
| 52 | 52 | ||
| 53 | ifneq ($(SUBARCH),$(ARCH)) | 53 | ifdef 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 | endif | 56 | endif |
| @@ -41,7 +41,7 @@ endif · 40 unmodified lines | |||
| 41 | 41 | ||
| 42 | export LD_BFD | 42 | export LD_BFD |
| 43 | 43 | ||
| 44 | ifneq ($(SUBARCH),$(UTS_MACHINE)) | 44 | ifdef cross_compiling |
| 45 | ifeq ($(CROSS_COMPILE),) | 45 | ifeq ($(CROSS_COMPILE),) |
| 46 | CC_SUFFIXES = linux linux-gnu unknown-linux-gnu | 46 | CC_SUFFIXES = linux linux-gnu unknown-linux-gnu |
| 47 | CROSS_COMPILE := $(call cc-cross-prefix, \ | 47 | CROSS_COMPILE := $(call cc-cross-prefix, \ |
| @@ -191,7 +191,7 @@ if [ -z "$kernel" ]; then · 190 unmodified lines | |||
| 191 | kernel=vmlinux | 191 | kernel=vmlinux |
| 192 | fi | 192 | fi |
| 193 | 193 | ||
| 194 | LANG=C elfformat="`${CROSS}objdump -p "$kernel" | grep 'file format' | awk '{print $4}'`" | 194 | LC_ALL=C elfformat="`${CROSS}objdump -p "$kernel" | grep 'file format' | awk '{print $4}'`" |
| 195 | case "$elfformat" in | 195 | case "$elfformat" in |
| 196 | elf64-powerpcle) format=elf64lppc ;; | 196 | elf64-powerpcle) format=elf64lppc ;; |
| 197 | elf64-powerpc) format=elf32ppc ;; | 197 | elf64-powerpc) format=elf32ppc ;; |
| @@ -9,7 +9,7 @@ · 8 unmodified lines | |||
| 9 | # License. See the file "COPYING" in the main directory of this archive | 9 | # License. See the file "COPYING" in the main directory of this archive |
| 10 | # for more details. | 10 | # for more details. |
| 11 | # | 11 | # |
| 12 | ifneq ($(SUBARCH),$(ARCH)) | 12 | ifdef 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 | endif | 15 | endif |
| @@ -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 | ||
| 8 | syscall := $(src)/syscall.tbl | 8 | syscall := $(src)/syscall.tbl |
| 9 | syshdr := $(srctree)/$(src)/syscallhdr.sh | 9 | syshdr := $(srctree)/scripts/syscallhdr.sh |
| 10 | systbl := $(srctree)/$(src)/syscalltbl.sh | 10 | systbl := $(srctree)/scripts/syscalltbl.sh |
| 11 | 11 | ||
| 12 | quiet_cmd_syshdr = SYSHDR $@ | 12 | quiet_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 | ||
| 18 | quiet_cmd_systbl = SYSTBL $@ | 15 | quiet_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) FORCE | 18 | $(uapi)/unistd_32.h: $(syscall) $(syshdr) FORCE |
| 25 | $(call if_changed,syshdr) | 19 | $(call if_changed,syshdr) |
| @@ -1,36 +0,0 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | # SPDX-License-Identifier: GPL-2.0 | ||
| 3 | |||
| 4 | in="$1" | ||
| 5 | out="$2" | ||
| 6 | my_abis=`echo "($3)" | tr ',' '|'` | ||
| 7 | prefix="$4" | ||
| 8 | offset="$5" | ||
| 9 | |||
| 10 | fileguard=_UAPI_ASM_SH_`basename "$out" | sed \ | ||
| 11 | -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ | ||
| 12 | -e 's/[^A-Z0-9_]/_/g' -e 's/__/_/g'` | ||
| 13 | grep -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" | ||
| @@ -1,32 +0,0 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | # SPDX-License-Identifier: GPL-2.0 | ||
| 3 | |||
| 4 | in="$1" | ||
| 5 | out="$2" | ||
| 6 | my_abis=`echo "($3)" | tr ',' '|'` | ||
| 7 | my_abi="$4" | ||
| 8 | offset="$5" | ||
| 9 | |||
| 10 | emit() { | ||
| 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 | |||
| 22 | grep -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" | ||
| @@ -1,7 +1,6 @@ | |||
| 1 | # SPDX-License-Identifier: GPL-2.0 | 1 | # SPDX-License-Identifier: GPL-2.0 |
| 2 | generated-y += syscall_table_32.h | 2 | generated-y += syscall_table_32.h |
| 3 | generated-y += syscall_table_64.h | 3 | generated-y += syscall_table_64.h |
| 4 | generated-y += syscall_table_c32.h | ||
| 5 | generic-y += export.h | 4 | generic-y += export.h |
| 6 | generic-y += kvm_para.h | 5 | generic-y += kvm_para.h |
| 7 | generic-y += mcs_spinlock.h | 6 | generic-y += mcs_spinlock.h |
| @@ -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 | ||
| 8 | syscall := $(src)/syscall.tbl | 8 | syscall := $(src)/syscall.tbl |
| 9 | syshdr := $(srctree)/$(src)/syscallhdr.sh | 9 | syshdr := $(srctree)/scripts/syscallhdr.sh |
| 10 | systbl := $(srctree)/$(src)/syscalltbl.sh | 10 | systbl := $(srctree)/scripts/syscalltbl.sh |
| 11 | 11 | ||
| 12 | quiet_cmd_syshdr = SYSHDR $@ | 12 | quiet_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 | ||
| 18 | quiet_cmd_systbl = SYSTBL $@ | 15 | quiet_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 | ||
| 24 | syshdr_abis_unistd_32 := common,32 | 18 | $(uapi)/unistd_32.h: abis := common,32 |
| 25 | $(uapi)/unistd_32.h: $(syscall) $(syshdr) FORCE | 19 | $(uapi)/unistd_32.h: $(syscall) $(syshdr) FORCE |
| 26 | $(call if_changed,syshdr) | 20 | $(call if_changed,syshdr) |
| 27 | 21 | ||
| 28 | syshdr_abis_unistd_64 := common,64 | 22 | $(uapi)/unistd_64.h: abis := common,64 |
| 29 | $(uapi)/unistd_64.h: $(syscall) $(syshdr) FORCE | 23 | $(uapi)/unistd_64.h: $(syscall) $(syshdr) FORCE |
| 30 | $(call if_changed,syshdr) | 24 | $(call if_changed,syshdr) |
| 31 | 25 | ||
| 32 | systbl_abis_syscall_table_32 := common,32 | 26 | $(kapi)/syscall_table_32.h: abis := common,32 |
| 33 | $(kapi)/syscall_table_32.h: $(syscall) $(systbl) FORCE | 27 | $(kapi)/syscall_table_32.h: $(syscall) $(systbl) FORCE |
| 34 | $(call if_changed,systbl) | 28 | $(call if_changed,systbl) |
| 35 | 29 | ||
| 36 | systbl_abis_syscall_table_64 := common,64 | 30 | $(kapi)/syscall_table_64.h: abis := common,64 |
| 37 | $(kapi)/syscall_table_64.h: $(syscall) $(systbl) FORCE | 31 | $(kapi)/syscall_table_64.h: $(syscall) $(systbl) FORCE |
| 38 | $(call if_changed,systbl) | 32 | $(call if_changed,systbl) |
| 39 | 33 | ||
| 40 | systbl_abis_syscall_table_c32 := common,32 | ||
| 41 | systbl_abi_syscall_table_c32 := c32 | ||
| 42 | $(kapi)/syscall_table_c32.h: $(syscall) $(systbl) FORCE | ||
| 43 | $(call if_changed,systbl) | ||
| 44 | |||
| 45 | uapisyshdr-y += unistd_32.h unistd_64.h | 34 | uapisyshdr-y += unistd_32.h unistd_64.h |
| 46 | kapisyshdr-y += syscall_table_32.h \ | 35 | kapisyshdr-y += syscall_table_32.h \ |
| 47 | syscall_table_64.h \ | 36 | syscall_table_64.h |
| 48 | syscall_table_c32.h | ||
| 49 | 37 | ||
| 50 | uapisyshdr-y := $(addprefix $(uapi)/, $(uapisyshdr-y)) | 38 | uapisyshdr-y := $(addprefix $(uapi)/, $(uapisyshdr-y)) |
| 51 | kapisyshdr-y := $(addprefix $(kapi)/, $(kapisyshdr-y)) | 39 | kapisyshdr-y := $(addprefix $(kapi)/, $(kapisyshdr-y)) |
| @@ -1,36 +0,0 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | # SPDX-License-Identifier: GPL-2.0 | ||
| 3 | |||
| 4 | in="$1" | ||
| 5 | out="$2" | ||
| 6 | my_abis=`echo "($3)" | tr ',' '|'` | ||
| 7 | prefix="$4" | ||
| 8 | offset="$5" | ||
| 9 | |||
| 10 | fileguard=_UAPI_ASM_SPARC_`basename "$out" | sed \ | ||
| 11 | -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ | ||
| 12 | -e 's/[^A-Z0-9_]/_/g' -e 's/__/_/g'` | ||
| 13 | grep -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" | ||
| @@ -1,36 +0,0 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | # SPDX-License-Identifier: GPL-2.0 | ||
| 3 | |||
| 4 | in="$1" | ||
| 5 | out="$2" | ||
| 6 | my_abis=`echo "($3)" | tr ',' '|'` | ||
| 7 | my_abi="$4" | ||
| 8 | offset="$5" | ||
| 9 | |||
| 10 | emit() { | ||
| 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 | |||
| 22 | grep -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" | ||
| @@ -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 entry | 12 | #define __SYSCALL_WITH_COMPAT(nr, native, compat) __SYSCALL(nr, native) |
| 13 | #define __SYSCALL(nr, entry) .long entry | ||
| 13 | .data | 14 | .data |
| 14 | .align 4 | 15 | .align 4 |
| 15 | .globl sys_call_table | 16 | .globl sys_call_table |
| 16 | sys_call_table: | 17 | sys_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 | ||
| @@ -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 entry | 13 | #define __SYSCALL(nr, entry) .word entry |
| 14 | .text | 14 | .text |
| 15 | .align 4 | 15 | .align 4 |
| 16 | #ifdef CONFIG_COMPAT | 16 | #ifdef CONFIG_COMPAT |
| 17 | .globl sys_call_table32 | 17 | .globl sys_call_table32 |
| 18 | sys_call_table32: | 18 | sys_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 4 | 24 | .align 4 |
| 23 | .globl sys_call_table64, sys_call_table | 25 | .globl sys_call_table64, sys_call_table |
| 24 | sys_call_table64: | 26 | sys_call_table64: |
| 25 | sys_call_table: | 27 | sys_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 | ||
| @@ -19,12 +19,8 @@ variant-y := $(patsubst "%",%,$(CONFIG_XTENSA_VARIANT_NAME)) · 18 unmodified lines | |||
| 19 | VARIANT = $(variant-y) | 19 | VARIANT = $(variant-y) |
| 20 | export VARIANT | 20 | export VARIANT |
| 21 | 21 | ||
| 22 | # Test for cross compiling | ||
| 23 | |||
| 24 | ifneq ($(VARIANT),) | 22 | ifneq ($(VARIANT),) |
| 25 | COMPILE_ARCH = $(shell uname -m) | 23 | ifdef cross_compiling |
| 26 | |||
| 27 | ifneq ($(COMPILE_ARCH), xtensa) | ||
| 28 | ifndef CROSS_COMPILE | 24 | ifndef CROSS_COMPILE |
| 29 | CROSS_COMPILE = xtensa_$(VARIANT)- | 25 | CROSS_COMPILE = xtensa_$(VARIANT)- |
| 30 | endif | 26 | endif |
| @@ -1,3 +1,3 @@ | |||
| 1 | # SPDX-License-Identifier: GPL-2.0-only | 1 | # SPDX-License-Identifier: GPL-2.0-only |
| 2 | x509_certificate_list | 2 | /x509_certificate_list |
| 3 | x509_revocation_list | 3 | /x509_revocation_list |
| @@ -1,2 +1,2 @@ | |||
| 1 | # SPDX-License-Identifier: GPL-2.0-only | 1 | # SPDX-License-Identifier: GPL-2.0-only |
| 2 | ti-emif-asm-offsets.h | 2 | /ti-emif-asm-offsets.h |
| @@ -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 | |||
| 3857 | static const struct of_device_id ingenic_pinctrl_of_match[] = { | 3860 | static const struct of_device_id ingenic_pinctrl_of_match[] = { |
| 3858 | { | 3861 | { |
| 3859 | .compatible = "ingenic,jz4730-pinctrl", | 3862 | .compatible = "ingenic,jz4730-pinctrl", |
| @@ -1,4 +1,4 @@ | |||
| 1 | # SPDX-License-Identifier: GPL-2.0 | 1 | # SPDX-License-Identifier: GPL-2.0 |
| 2 | conmakehash | 2 | /conmakehash |
| 3 | consolemap_deftbl.c | 3 | /consolemap_deftbl.c |
| 4 | defkeymap.c | 4 | /defkeymap.c |
| @@ -1,3 +1,3 @@ | |||
| 1 | # SPDX-License-Identifier: GPL-2.0-only | 1 | # SPDX-License-Identifier: GPL-2.0-only |
| 2 | mkutf8data | 2 | /mkutf8data |
| 3 | utf8data.h | 3 | /utf8data.h |
| @@ -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 */ |
| @@ -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)); \ |
| @@ -1,4 +1,3 @@ | |||
| 1 | # SPDX-License-Identifier: GPL-2.0-only | 1 | # SPDX-License-Identifier: GPL-2.0-only |
| 2 | kheaders.md5 | 2 | /config_data |
| 3 | timeconst.h | 3 | /kheaders.md5 |
| 4 | hz.bc | ||
| @@ -142,10 +142,15 @@ obj-$(CONFIG_SCF_TORTURE_TEST) += scftorture.o · 141 unmodified lines | |||
| 142 | 142 | ||
| 143 | $(obj)/configs.o: $(obj)/config_data.gz | 143 | $(obj)/configs.o: $(obj)/config_data.gz |
| 144 | 144 | ||
| 145 | targets += config_data.gz | 145 | targets += config_data config_data.gz |
| 146 | $(obj)/config_data.gz: $(KCONFIG_CONFIG) FORCE | 146 | $(obj)/config_data.gz: $(obj)/config_data FORCE |
| 147 | $(call if_changed,gzip) | 147 | $(call if_changed,gzip) |
| 148 | 148 | ||
| 149 | filechk_cat = cat $< | ||
| 150 | |||
| 151 | $(obj)/config_data: $(KCONFIG_CONFIG) FORCE | ||
| 152 | $(call filechk,cat) | ||
| 153 | |||
| 149 | $(obj)/kheaders.o: $(obj)/kheaders_data.tar.xz | 154 | $(obj)/kheaders.o: $(obj)/kheaders_data.tar.xz |
| 150 | 155 | ||
| 151 | quiet_cmd_genikh = CHK $(obj)/kheaders_data.tar.xz | 156 | quiet_cmd_genikh = CHK $(obj)/kheaders_data.tar.xz |
| @@ -1,6 +1,6 @@ | |||
| 1 | # SPDX-License-Identifier: GPL-2.0-only | 1 | # SPDX-License-Identifier: GPL-2.0-only |
| 2 | gen_crc32table | 2 | /crc32table.h |
| 3 | gen_crc64table | 3 | /crc64table.h |
| 4 | crc32table.h | 4 | /gen_crc32table |
| 5 | crc64table.h | 5 | /gen_crc64table |
| 6 | oid_registry_data.c | 6 | /oid_registry_data.c |
| @@ -1,2 +1,2 @@ | |||
| 1 | # SPDX-License-Identifier: GPL-2.0-only | 1 | # SPDX-License-Identifier: GPL-2.0-only |
| 2 | cfag12864b-example | 2 | /cfag12864b-example |
| @@ -1 +1,2 @@ | |||
| 1 | binderfs_example | 1 | # SPDX-License-Identifier: GPL-2.0 |
| 2 | /binderfs_example | ||
| @@ -1,2 +1,2 @@ | |||
| 1 | # SPDX-License-Identifier: GPL-2.0-only | 1 | # SPDX-License-Identifier: GPL-2.0-only |
| 2 | ucon | 2 | /ucon |
| @@ -1,2 +1,2 @@ | |||
| 1 | # SPDX-License-Identifier: GPL-2.0-only | 1 | # SPDX-License-Identifier: GPL-2.0-only |
| 2 | hid-example | 2 | /hid-example |
| @@ -1,2 +1,2 @@ | |||
| 1 | # SPDX-License-Identifier: GPL-2.0-only | 1 | # SPDX-License-Identifier: GPL-2.0-only |
| 2 | mei-amt-version | 2 | /mei-amt-version |
| @@ -1,2 +1,2 @@ | |||
| 1 | # SPDX-License-Identifier: GPL-2.0 | 1 | # SPDX-License-Identifier: GPL-2.0 |
| 2 | ne_ioctl_sample | 2 | /ne_ioctl_sample |
| @@ -1,2 +1,2 @@ | |||
| 1 | # SPDX-License-Identifier: GPL-2.0-only | 1 | # SPDX-License-Identifier: GPL-2.0-only |
| 2 | pidfd-metadata | 2 | /pidfd-metadata |
| @@ -1,5 +1,5 @@ | |||
| 1 | # SPDX-License-Identifier: GPL-2.0-only | 1 | # SPDX-License-Identifier: GPL-2.0-only |
| 2 | bpf-direct | 2 | /bpf-direct |
| 3 | bpf-fancy | 3 | /bpf-fancy |
| 4 | dropper | 4 | /dropper |
| 5 | user-trap | 5 | /user-trap |
| @@ -1,2 +1,2 @@ | |||
| 1 | # SPDX-License-Identifier: GPL-2.0-only | 1 | # SPDX-License-Identifier: GPL-2.0-only |
| 2 | hpet_example | 2 | /hpet_example |
| @@ -1,3 +1,3 @@ | |||
| 1 | # SPDX-License-Identifier: GPL-2.0-only | 1 | # SPDX-License-Identifier: GPL-2.0-only |
| 2 | test-fsmount | 2 | /test-fsmount |
| 3 | test-statx | 3 | /test-statx |
| @@ -1 +1,2 @@ | |||
| 1 | watch_test | 1 | # SPDX-License-Identifier: GPL-2.0-only |
| 2 | /watch_test | ||
| @@ -1,2 +1,2 @@ | |||
| 1 | # SPDX-License-Identifier: GPL-2.0-only | 1 | # SPDX-License-Identifier: GPL-2.0-only |
| 2 | watchdog-simple | 2 | /watchdog-simple |
| @@ -1,11 +1,11 @@ | |||
| 1 | # SPDX-License-Identifier: GPL-2.0-only | 1 | # SPDX-License-Identifier: GPL-2.0-only |
| 2 | bin2c | 2 | /asn1_compiler |
| 3 | kallsyms | 3 | /bin2c |
| 4 | unifdef | 4 | /extract-cert |
| 5 | recordmcount | 5 | /insert-sys-cert |
| 6 | sorttable | 6 | /kallsyms |
| 7 | asn1_compiler | ||
| 8 | extract-cert | ||
| 9 | sign-file | ||
| 10 | insert-sys-cert | ||
| 11 | /module.lds | 7 | /module.lds |
| 8 | /recordmcount | ||
| 9 | /sign-file | ||
| 10 | /sorttable | ||
| 11 | /unifdef | ||
| @@ -354,7 +354,7 @@ $(obj)/%.o: $(src)/%.S $(objtool_dep) FORCE · 353 unmodified lines | |||
| 354 | 354 | ||
| 355 | targets += $(filter-out $(subdir-builtin), $(real-obj-y)) | 355 | targets += $(filter-out $(subdir-builtin), $(real-obj-y)) |
| 356 | targets += $(filter-out $(subdir-modorder), $(real-obj-m)) | 356 | targets += $(filter-out $(subdir-modorder), $(real-obj-m)) |
| 357 | targets += $(lib-y) $(always-y) $(MAKECMDGOALS) | 357 | targets += $(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 | # --------------------------------------------------------------------------- |
| @@ -44,19 +44,22 @@ else · 43 unmodified lines | |||
| 44 | obj-y := $(filter-out %/, $(obj-y)) | 44 | obj-y := $(filter-out %/, $(obj-y)) |
| 45 | endif | 45 | endif |
| 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 |
| 48 | suffix-search = $(strip $(foreach s, $2, $($(1:.o=$s)))) | 48 | suffix-search = $(strip $(foreach s, $3, $($(1:%$(strip $2)=%$s)))) |
| 49 | # List composite targets that are constructed by combining other targets | ||
| 50 | multi-search = $(sort $(foreach m, $1, $(if $(call suffix-search, $m, $2, $3 -), $m))) | ||
| 51 | # List primitive targets that are compiled from source files | ||
| 52 | real-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 object | 54 | # If $(foo-objs), $(foo-y), $(foo-m), or $(foo-) exists, foo.o is a composite object |
| 50 | multi-search = $(sort $(foreach m, $1, $(if $(call suffix-search, $m, $2 -), $m))) | 55 | multi-obj-y := $(call multi-search, $(obj-y), .o, -objs -y) |
| 51 | multi-obj-y := $(call multi-search,$(obj-y),-objs -y) | 56 | multi-obj-m := $(call multi-search, $(obj-m), .o, -objs -y -m) |
| 52 | multi-obj-m := $(call multi-search,$(obj-m),-objs -y -m) | ||
| 53 | multi-obj-ym := $(multi-obj-y) $(multi-obj-m) | 57 | multi-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 subdirectories | 60 | # including built-in.a from subdirectories |
| 57 | real-search = $(foreach m, $1, $(if $(call suffix-search, $m, $2 -), $(call suffix-search, $m, $2), $m)) | 61 | real-obj-y := $(call real-search, $(obj-y), .o, -objs -y) |
| 58 | real-obj-y := $(call real-search, $(obj-y),-objs -y) | 62 | real-obj-m := $(call real-search, $(obj-m), .o, -objs -y -m) |
| 59 | real-obj-m := $(call real-search, $(obj-m),-objs -y -m) | ||
| 60 | 63 | ||
| 61 | always-y += $(always-m) | 64 | always-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 built | 78 | # If CONFIG_OF_ALL_DTBS is enabled, all DT blobs are built |
| 76 | dtb-$(CONFIG_OF_ALL_DTBS) += $(dtb-) | 79 | dtb-$(CONFIG_OF_ALL_DTBS) += $(dtb-) |
| 77 | 80 | ||
| 78 | # List all dtbs to be generated by fdtoverlay | 81 | # Composite DTB (i.e. DTB constructed by overlay) |
| 79 | overlay-y := $(foreach m,$(dtb-y), $(if $(strip $($(m:.dtb=-dtbs))),$(m),)) | 82 | multi-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. | 84 | real-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 | 86 | base-dtb-y := $(foreach m, $(multi-dtb-y), $(firstword $(call suffix-search, $m, .dtb, -dtbs))) | |
| 84 | # Add base dtb and overlay dtbo | ||
| 85 | dtb-y += $(foreach m,$(overlay-y), $($(m:.dtb=-dtbs))) | ||
| 86 | 87 | ||
| 87 | always-y += $(dtb-y) | 88 | always-y += $(dtb-y) |
| 88 | 89 | ||
| 89 | ifneq ($(CHECK_DTBS),) | 90 | ifneq ($(CHECK_DTBS),) |
| 90 | # Don't run schema checks for dtbs created by fdtoverlay as they don't | 91 | always-y += $(patsubst %.dtb,%.dt.yaml, $(real-dtb-y)) |
| 91 | # have corresponding dts files. | 92 | always-y += $(patsubst %.dtbo,%.dt.yaml, $(real-dtb-y)) |
| 92 | dt-yaml-y := $(filter-out $(overlay-y),$(dtb-y)) | ||
| 93 | |||
| 94 | always-y += $(patsubst %.dtb,%.dt.yaml, $(dt-yaml-y)) | ||
| 95 | always-y += $(patsubst %.dtbo,%.dt.yaml, $(dt-yaml-y)) | ||
| 96 | endif | 93 | endif |
| 97 | 94 | ||
| 98 | # Add subdir path | 95 | # Add subdir path |
| @@ -105,12 +102,14 @@ lib-y := $(addprefix $(obj)/,$(lib-y)) · 6 unmodified lines | |||
| 105 | real-obj-y := $(addprefix $(obj)/,$(real-obj-y)) | 102 | real-obj-y := $(addprefix $(obj)/,$(real-obj-y)) |
| 106 | real-obj-m := $(addprefix $(obj)/,$(real-obj-m)) | 103 | real-obj-m := $(addprefix $(obj)/,$(real-obj-m)) |
| 107 | multi-obj-m := $(addprefix $(obj)/, $(multi-obj-m)) | 104 | multi-obj-m := $(addprefix $(obj)/, $(multi-obj-m)) |
| 105 | multi-dtb-y := $(addprefix $(obj)/, $(multi-dtb-y)) | ||
| 106 | real-dtb-y := $(addprefix $(obj)/, $(real-dtb-y)) | ||
| 108 | subdir-ym := $(addprefix $(obj)/,$(subdir-ym)) | 107 | subdir-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. |
| 112 | modname-multi = $(sort $(foreach m,$(multi-obj-ym),\ | 111 | modname-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 files | 252 | # 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 | ||
| 256 | quiet_cmd_shipped = SHIPPED $@ | 258 | quiet_cmd_shipped = SHIPPED $@ |
| 257 | cmd_shipped = cat $< > $@ | 259 | cmd_shipped = cat $< > $@ |
| @@ -319,6 +321,9 @@ endif · 61 unmodified lines | |||
| 319 | 321 | ||
| 320 | DTC_FLAGS += $(DTC_FLAGS_$(basetarget)) | 322 | DTC_FLAGS += $(DTC_FLAGS_$(basetarget)) |
| 321 | 323 | ||
| 324 | # Set -@ if the target is a base DTB that overlay is applied onto | ||
| 325 | DTC_FLAGS += $(if $(filter $(patsubst $(obj)/%,%,$@), $(base-dtb-y)), -@) | ||
| 326 | |||
| 322 | # Generate an assembly file to wrap the output of the device tree compiler | 327 | # Generate an assembly file to wrap the output of the device tree compiler |
| 323 | quiet_cmd_dt_S_dtb= DTB $@ | 328 | quiet_cmd_dt_S_dtb= DTB $@ |
| 324 | cmd_dt_S_dtb= \ | 329 | cmd_dt_S_dtb= \ |
| @@ -350,14 +355,12 @@ $(obj)/%.dtb: $(src)/%.dts $(DTC) FORCE · 25 unmodified lines | |||
| 350 | $(obj)/%.dtbo: $(src)/%.dts $(DTC) FORCE | 355 | $(obj)/%.dtbo: $(src)/%.dts $(DTC) FORCE |
| 351 | $(call if_changed_dep,dtc) | 356 | $(call if_changed_dep,dtc) |
| 352 | 357 | ||
| 353 | overlay-y := $(addprefix $(obj)/, $(overlay-y)) | ||
| 354 | |||
| 355 | quiet_cmd_fdtoverlay = DTOVL $@ | 358 | quiet_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): FORCE | 361 | $(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 | ||
| 362 | DT_CHECKER ?= dt-validate | 365 | DT_CHECKER ?= dt-validate |
| 363 | DT_CHECKER_FLAGS ?= $(if $(DT_SCHEMA_FILES),,-m) | 366 | DT_CHECKER_FLAGS ?= $(if $(DT_SCHEMA_FILES),,-m) |
| @@ -1,2 +1,2 @@ | |||
| 1 | # SPDX-License-Identifier: GPL-2.0-only | 1 | # SPDX-License-Identifier: GPL-2.0-only |
| 2 | fixdep | 2 | /fixdep |
| @@ -1,3 +1,3 @@ | |||
| 1 | # SPDX-License-Identifier: GPL-2.0-only | 1 | # SPDX-License-Identifier: GPL-2.0-only |
| 2 | dtc | 2 | /dtc |
| 3 | fdtoverlay | 3 | /fdtoverlay |
| @@ -1,2 +1,2 @@ | |||
| 1 | # SPDX-License-Identifier: GPL-2.0-only | 1 | # SPDX-License-Identifier: GPL-2.0-only |
| 2 | randomize_layout_seed.h | 2 | /randomize_layout_seed.h |
| @@ -1,2 +1,2 @@ | |||
| 1 | # SPDX-License-Identifier: GPL-2.0-only | 1 | # SPDX-License-Identifier: GPL-2.0-only |
| 2 | genksyms | 2 | /genksyms |
| @@ -22,7 +22,7 @@ $(obj)/pars%.tab.c $(obj)/pars%.tab.h: $(src)/pars%.y FORCE · 21 unmodified lines | |||
| 22 | 22 | ||
| 23 | endif | 23 | endif |
| 24 | 24 | ||
| 25 | # -I needed for generated C source (shipped source) | 25 | # -I needed for generated C source to include headers in source tree |
| 26 | HOSTCFLAGS_parse.tab.o := -I $(srctree)/$(src) | 26 | HOSTCFLAGS_parse.tab.o := -I $(srctree)/$(src) |
| 27 | HOSTCFLAGS_lex.lex.o := -I $(srctree)/$(src) | 27 | HOSTCFLAGS_lex.lex.o := -I $(srctree)/$(src) |
| 28 | 28 | ||
| @@ -320,20 +320,6 @@ cleanup() · 319 unmodified lines | |||
| 320 | rm -f .vmlinux.d | 320 | rm -f .vmlinux.d |
| 321 | } | 321 | } |
| 322 | 322 | ||
| 323 | on_exit() | ||
| 324 | { | ||
| 325 | if [ $? -ne 0 ]; then | ||
| 326 | cleanup | ||
| 327 | fi | ||
| 328 | } | ||
| 329 | trap on_exit EXIT | ||
| 330 | |||
| 331 | on_signals() | ||
| 332 | { | ||
| 333 | exit 1 | ||
| 334 | } | ||
| 335 | trap on_signals HUP INT QUIT TERM | ||
| 336 | |||
| 337 | # Use "make V=1" to debug this script | 323 | # Use "make V=1" to debug this script |
| 338 | case "${KBUILD_VERBOSE}" in | 324 | case "${KBUILD_VERBOSE}" in |
| 339 | *1*) | 325 | *1*) |
| @@ -1,5 +1,5 @@ | |||
| 1 | # SPDX-License-Identifier: GPL-2.0-only | 1 | # SPDX-License-Identifier: GPL-2.0-only |
| 2 | elfconfig.h | 2 | /devicetable-offsets.h |
| 3 | mk_elfconfig | 3 | /elfconfig.h |
| 4 | modpost | 4 | /mk_elfconfig |
| 5 | devicetable-offsets.h | 5 | /modpost |
| @@ -44,7 +44,7 @@ generate_deps() { · 43 unmodified lines | |||
| 44 | for source_file in $mod_source_files; do | 44 | for source_file in $mod_source_files; do |
| 45 | sed '/MODULE_IMPORT_NS/Q' $source_file > ${source_file}.tmp | 45 | 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}.tmp | 47 | 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}.tmp | 48 | tail -n +$((offset +1)) ${source_file} | grep -v MODULE_IMPORT_NS >> ${source_file}.tmp |
| 49 | if ! diff -q ${source_file} ${source_file}.tmp; then | 49 | if ! diff -q ${source_file} ${source_file}.tmp; then |
| 50 | mv ${source_file}.tmp ${source_file} | 50 | mv ${source_file}.tmp ${source_file} |
| @@ -497,7 +497,7 @@ sub update_funcs · 496 unmodified lines | |||
| 497 | # | 497 | # |
| 498 | # Step 2: find the sections and mcount call sites | 498 | # Step 2: find the sections and mcount call sites |
| 499 | # | 499 | # |
| 500 | open(IN, "LANG=C $objdump -hdr $inputfile|") || die "error running $objdump"; | 500 | open(IN, "LC_ALL=C $objdump -hdr $inputfile|") || die "error running $objdump"; |
| 501 | 501 | ||
| 502 | my $text; | 502 | my $text; |
| 503 | 503 | ||
| @@ -0,0 +1,31 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | set -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. | ||
| 26 | if [ -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 | ||
| 31 | fi | ||
| @@ -126,7 +126,7 @@ scm_version() · 125 unmodified lines | |||
| 126 | fi | 126 | 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'); then | 129 | 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 | ||
| @@ -326,5 +326,5 @@ esac · 325 unmodified lines | |||
| 326 | 326 | ||
| 327 | # Remove structure forward declarations. | 327 | # Remove structure forward declarations. |
| 328 | if [ -n "$remove_structs" ]; then | 328 | if [ -n "$remove_structs" ]; then |
| 329 | LANG=C sed -i -e '/^\([a-zA-Z_][a-zA-Z0-9_]*\)\t.*\t\/\^struct \1;.*\$\/;"\tx$/d' $1 | 329 | LC_ALL=C sed -i -e '/^\([a-zA-Z_][a-zA-Z0-9_]*\)\t.*\t\/\^struct \1;.*\$\/;"\tx$/d' $1 |
| 330 | fi | 330 | fi |
| @@ -274,7 +274,7 @@ check_mptcp_disabled() · 273 unmodified lines | |||
| 274 | ip netns exec ${disabled_ns} sysctl -q net.mptcp.enabled=0 | 274 | ip netns exec ${disabled_ns} sysctl -q net.mptcp.enabled=0 |
| 275 | 275 | ||
| 276 | local err=0 | 276 | 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=1 | 278 | grep -q "^socket: Protocol not available$" && err=1 |
| 279 | ip netns delete ${disabled_ns} | 279 | ip netns delete ${disabled_ns} |
| 280 | 280 | ||
| @@ -1,4 +1,4 @@ | |||
| 1 | # SPDX-License-Identifier: GPL-2.0-only | 1 | # SPDX-License-Identifier: GPL-2.0-only |
| 2 | gen_init_cpio | 2 | /gen_init_cpio |
| 3 | initramfs_data.cpio | 3 | /initramfs_data.cpio |
| 4 | /initramfs_inc_data | 4 | /initramfs_inc_data |
| @@ -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 empty | 152 | # If $dirlist is only one line, then the directory is empty |
| 153 | if [ "$(echo "${dirlist}" | wc -l)" -gt 1 ]; then | 153 | if [ "$(echo "${dirlist}" | wc -l)" -gt 1 ]; then |
| @@ -1,4 +1,2 @@ | |||
| 1 | # SPDX-License-Identifier: GPL-2.0-only | 1 | # SPDX-License-Identifier: GPL-2.0-only |
| 2 | * | 2 | /*/ |
| 3 | !.gitignore | ||
| 4 | !Makefile | ||