Skip to content

Commit 0f979d8

Browse files
committed
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 ...
2 parents ab159ac + 0ab1438 commit 0f979d8

File tree

61 files changed

+183
-342
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+183
-342
lines changed

.gitignore

+5-3
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,11 @@
4848
*.xz
4949
*.zst
5050
Module.symvers
51-
modules.builtin
5251
modules.order
5352

5453
#
5554
# Top-level generic files
5655
#
57-
/tags
58-
/TAGS
5956
/linux
6057
/modules-only.symvers
6158
/vmlinux
@@ -66,6 +63,7 @@ modules.order
6663
/vmlinuz
6764
/System.map
6865
/Module.markers
66+
/modules.builtin
6967
/modules.builtin.modinfo
7068
/modules.nsdeps
7169

@@ -114,6 +112,10 @@ patches-*
114112
patches
115113
series
116114

115+
# ctags files
116+
tags
117+
TAGS
118+
117119
# cscope files
118120
cscope.*
119121
ncscope.*
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# SPDX-License-Identifier: GPL-2.0-only
22
*.example.dts
3-
processed-schema*.yaml
4-
processed-schema*.json
3+
/processed-schema*.yaml
4+
/processed-schema*.json

Makefile

+13-29
Original file line numberDiff line numberDiff line change
@@ -399,11 +399,6 @@ ifeq ($(ARCH),sparc64)
399399
SRCARCH := sparc
400400
endif
401401

402-
# Additional ARCH settings for sh
403-
ifeq ($(ARCH),sh64)
404-
SRCARCH := sh
405-
endif
406-
407402
export cross_compiling :=
408403
ifneq ($(SRCARCH),$(SUBARCH))
409404
cross_compiling := 1
@@ -792,16 +787,16 @@ KBUILD_CFLAGS += -Wno-gnu
792787
KBUILD_CFLAGS += -mno-global-merge
793788
else
794789

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-
799790
# Warn about unmarked fall-throughs in switch statement.
800791
# Disabled for clang while comment to attribute conversion happens and
801792
# https://github.com/ClangBuiltLinux/linux/issues/636 is discussed.
802793
KBUILD_CFLAGS += $(call cc-option,-Wimplicit-fallthrough,)
803794
endif
804795

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+
805800
KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable)
806801
ifdef CONFIG_FRAME_POINTER
807802
KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
@@ -1225,7 +1220,7 @@ PHONY += prepare archprepare
12251220

12261221
archprepare: outputmakefile archheaders archscripts scripts include/config/kernel.release \
12271222
asm-generic $(version_h) $(autoksyms_h) include/generated/utsrelease.h \
1228-
include/generated/autoconf.h
1223+
include/generated/autoconf.h remove-stale-files
12291224

12301225
prepare0: archprepare
12311226
$(Q)$(MAKE) $(build)=scripts/mod
@@ -1234,6 +1229,10 @@ prepare0: archprepare
12341229
# All the preparing..
12351230
prepare: prepare0 prepare-objtool prepare-resolve_btfids
12361231

1232+
PHONY += remove-stale-files
1233+
remove-stale-files:
1234+
$(Q)$(srctree)/scripts/remove-stale-files
1235+
12371236
# Support for using generic headers in asm-generic
12381237
asm-generic := -f $(srctree)/scripts/Makefile.asm-generic obj
12391238

@@ -1512,9 +1511,6 @@ MRPROPER_FILES += include/config include/generated \
15121511
vmlinux-gdb.py \
15131512
*.spec
15141513

1515-
# Directories & files removed with 'make distclean'
1516-
DISTCLEAN_FILES += tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS
1517-
15181514
# clean - Delete most, but leave enough to build external modules
15191515
#
15201516
clean: rm-files := $(CLEAN_FILES)
@@ -1541,16 +1537,14 @@ mrproper: clean $(mrproper-dirs)
15411537

15421538
# distclean
15431539
#
1544-
distclean: rm-files := $(wildcard $(DISTCLEAN_FILES))
1545-
15461540
PHONY += distclean
15471541

15481542
distclean: mrproper
1549-
$(call cmd,rmfiles)
1550-
@find $(srctree) $(RCS_FIND_IGNORE) \
1543+
@find . $(RCS_FIND_IGNORE) \
15511544
\( -name '*.orig' -o -name '*.rej' -o -name '*~' \
15521545
-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 \) \
15541548
-type f -print | xargs rm -f
15551549

15561550

@@ -1717,17 +1711,7 @@ else # KBUILD_EXTMOD
17171711
# When building external modules the kernel used as basis is considered
17181712
# read-only, and no consistency checks are made and the make
17191713
# system is not used on the basis kernel. If updates are required
1720-
# in the basis kernel ordinary make commands (without M=...) must
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
1714+
# in the basis kernel ordinary make commands (without M=...) must be used.
17311715

17321716
# We are always building only modules.
17331717
KBUILD_BUILTIN :=

arch/.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# SPDX-License-Identifier: GPL-2.0-only
2-
i386
3-
x86_64
2+
/i386/
3+
/x86_64/

arch/arm/boot/compressed/Makefile

-7
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,6 @@ endif
9696
$(foreach o, $(libfdt_objs) atags_to_fdt.o fdt_check_mem_start.o, \
9797
$(eval CFLAGS_$(o) := -I $(srctree)/scripts/dtc/libfdt -fno-stack-protector))
9898

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-
10699
targets := vmlinux vmlinux.lds piggy_data piggy.o \
107100
lib1funcs.o ashldi3.o bswapsdi2.o \
108101
head.o $(OBJS)

arch/m68k/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
KBUILD_DEFCONFIG := multi_defconfig
1818

19-
ifneq ($(SUBARCH),$(ARCH))
19+
ifdef cross_compiling
2020
ifeq ($(CROSS_COMPILE),)
2121
CROSS_COMPILE := $(call cc-cross-prefix, \
2222
m68k-linux-gnu- m68k-linux- m68k-unknown-linux-gnu-)

arch/mips/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ tool-archpref = $(64bit-tool-archpref)
5050
UTS_MACHINE := mips64
5151
endif
5252

53-
ifneq ($(SUBARCH),$(ARCH))
53+
ifdef cross_compiling
5454
ifeq ($(CROSS_COMPILE),)
5555
CROSS_COMPILE := $(call cc-cross-prefix, $(tool-archpref)-linux- $(tool-archpref)-linux-gnu- $(tool-archpref)-unknown-linux-gnu-)
5656
endif

arch/parisc/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ endif
4141

4242
export LD_BFD
4343

44-
ifneq ($(SUBARCH),$(UTS_MACHINE))
44+
ifdef cross_compiling
4545
ifeq ($(CROSS_COMPILE),)
4646
CC_SUFFIXES = linux linux-gnu unknown-linux-gnu
4747
CROSS_COMPILE := $(call cc-cross-prefix, \

arch/powerpc/boot/wrapper

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ if [ -z "$kernel" ]; then
191191
kernel=vmlinux
192192
fi
193193

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}'`"
195195
case "$elfformat" in
196196
elf64-powerpcle) format=elf64lppc ;;
197197
elf64-powerpc) format=elf32ppc ;;

arch/sh/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# License. See the file "COPYING" in the main directory of this archive
1010
# for more details.
1111
#
12-
ifneq ($(SUBARCH),$(ARCH))
12+
ifdef cross_compiling
1313
ifeq ($(CROSS_COMPILE),)
1414
CROSS_COMPILE := $(call cc-cross-prefix, sh-linux- sh-linux-gnu- sh-unknown-linux-gnu-)
1515
endif

arch/sh/kernel/syscalls/Makefile

+4-10
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,14 @@ _dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)') \
66
$(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)')
77

88
syscall := $(src)/syscall.tbl
9-
syshdr := $(srctree)/$(src)/syscallhdr.sh
10-
systbl := $(srctree)/$(src)/syscalltbl.sh
9+
syshdr := $(srctree)/scripts/syscallhdr.sh
10+
systbl := $(srctree)/scripts/syscalltbl.sh
1111

1212
quiet_cmd_syshdr = SYSHDR $@
13-
cmd_syshdr = $(CONFIG_SHELL) '$(syshdr)' '$<' '$@' \
14-
'$(syshdr_abis_$(basetarget))' \
15-
'$(syshdr_pfx_$(basetarget))' \
16-
'$(syshdr_offset_$(basetarget))'
13+
cmd_syshdr = $(CONFIG_SHELL) $(syshdr) --emit-nr $< $@
1714

1815
quiet_cmd_systbl = SYSTBL $@
19-
cmd_systbl = $(CONFIG_SHELL) '$(systbl)' '$<' '$@' \
20-
'$(systbl_abis_$(basetarget))' \
21-
'$(systbl_abi_$(basetarget))' \
22-
'$(systbl_offset_$(basetarget))'
16+
cmd_systbl = $(CONFIG_SHELL) $(systbl) $< $@
2317

2418
$(uapi)/unistd_32.h: $(syscall) $(syshdr) FORCE
2519
$(call if_changed,syshdr)

arch/sh/kernel/syscalls/syscallhdr.sh

-36
This file was deleted.

arch/sh/kernel/syscalls/syscalltbl.sh

-32
This file was deleted.

arch/sparc/include/asm/Kbuild

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# SPDX-License-Identifier: GPL-2.0
22
generated-y += syscall_table_32.h
33
generated-y += syscall_table_64.h
4-
generated-y += syscall_table_c32.h
54
generic-y += export.h
65
generic-y += kvm_para.h
76
generic-y += mcs_spinlock.h

arch/sparc/kernel/syscalls/Makefile

+9-21
Original file line numberDiff line numberDiff line change
@@ -6,46 +6,34 @@ _dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)') \
66
$(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)')
77

88
syscall := $(src)/syscall.tbl
9-
syshdr := $(srctree)/$(src)/syscallhdr.sh
10-
systbl := $(srctree)/$(src)/syscalltbl.sh
9+
syshdr := $(srctree)/scripts/syscallhdr.sh
10+
systbl := $(srctree)/scripts/syscalltbl.sh
1111

1212
quiet_cmd_syshdr = SYSHDR $@
13-
cmd_syshdr = $(CONFIG_SHELL) '$(syshdr)' '$<' '$@' \
14-
'$(syshdr_abis_$(basetarget))' \
15-
'$(syshdr_pfx_$(basetarget))' \
16-
'$(syshdr_offset_$(basetarget))'
13+
cmd_syshdr = $(CONFIG_SHELL) $(syshdr) --emit-nr --abis $(abis) $< $@
1714

1815
quiet_cmd_systbl = SYSTBL $@
19-
cmd_systbl = $(CONFIG_SHELL) '$(systbl)' '$<' '$@' \
20-
'$(systbl_abis_$(basetarget))' \
21-
'$(systbl_abi_$(basetarget))' \
22-
'$(systbl_offset_$(basetarget))'
16+
cmd_systbl = $(CONFIG_SHELL) $(systbl) --abis $(abis) $< $@
2317

24-
syshdr_abis_unistd_32 := common,32
18+
$(uapi)/unistd_32.h: abis := common,32
2519
$(uapi)/unistd_32.h: $(syscall) $(syshdr) FORCE
2620
$(call if_changed,syshdr)
2721

28-
syshdr_abis_unistd_64 := common,64
22+
$(uapi)/unistd_64.h: abis := common,64
2923
$(uapi)/unistd_64.h: $(syscall) $(syshdr) FORCE
3024
$(call if_changed,syshdr)
3125

32-
systbl_abis_syscall_table_32 := common,32
26+
$(kapi)/syscall_table_32.h: abis := common,32
3327
$(kapi)/syscall_table_32.h: $(syscall) $(systbl) FORCE
3428
$(call if_changed,systbl)
3529

36-
systbl_abis_syscall_table_64 := common,64
30+
$(kapi)/syscall_table_64.h: abis := common,64
3731
$(kapi)/syscall_table_64.h: $(syscall) $(systbl) FORCE
3832
$(call if_changed,systbl)
3933

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-
4534
uapisyshdr-y += unistd_32.h unistd_64.h
4635
kapisyshdr-y += syscall_table_32.h \
47-
syscall_table_64.h \
48-
syscall_table_c32.h
36+
syscall_table_64.h
4937

5038
uapisyshdr-y := $(addprefix $(uapi)/, $(uapisyshdr-y))
5139
kapisyshdr-y := $(addprefix $(kapi)/, $(kapisyshdr-y))

0 commit comments

Comments
 (0)