Skip to content

Commit 85e1ffb

Browse files
committed
Merge tag 'kbuild-v4.21-3' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
Pull more Kbuild updates from Masahiro Yamada: - improve boolinit.cocci and use_after_iter.cocci semantic patches - fix alignment for kallsyms - move 'asm goto' compiler test to Kconfig and clean up jump_label CONFIG option - generate asm-generic wrappers automatically if arch does not implement mandatory UAPI headers - remove redundant generic-y defines - misc cleanups * tag 'kbuild-v4.21-3' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: kconfig: rename generated .*conf-cfg to *conf-cfg kbuild: remove unnecessary stubs for archheader and archscripts kbuild: use assignment instead of define ... endef for filechk_* rules arch: remove redundant UAPI generic-y defines kbuild: generate asm-generic wrappers if mandatory headers are missing arch: remove stale comments "UAPI Header export list" riscv: remove redundant kernel-space generic-y kbuild: change filechk to surround the given command with { } kbuild: remove redundant target cleaning on failure kbuild: clean up rule_dtc_dt_yaml kbuild: remove UIMAGE_IN and UIMAGE_OUT jump_label: move 'asm goto' support test to Kconfig kallsyms: lower alignment on ARM scripts: coccinelle: boolinit: drop warnings on named constants scripts: coccinelle: check for redeclaration kconfig: remove unused "file" field of yylval union nds32: remove redundant kernel-space generic-y nios2: remove unneeded HAS_DMA define
2 parents ac5eed2 + d86271a commit 85e1ffb

File tree

94 files changed

+150
-694
lines changed

Some content is hidden

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

94 files changed

+150
-694
lines changed

Documentation/kbuild/makefiles.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1296,9 +1296,12 @@ See subsequent chapter for the syntax of the Kbuild file.
12961296

12971297
--- 7.4 mandatory-y
12981298

1299-
mandatory-y is essentially used by include/uapi/asm-generic/Kbuild.asm
1300-
to define the minimum set of headers that must be exported in
1301-
include/asm.
1299+
mandatory-y is essentially used by include/(uapi/)asm-generic/Kbuild.asm
1300+
to define the minimum set of ASM headers that all architectures must have.
1301+
1302+
This works like optional generic-y. If a mandatory header is missing
1303+
in arch/$(ARCH)/include/(uapi/)/asm, Kbuild will automatically generate
1304+
a wrapper of the asm-generic one.
13021305

13031306
The convention is to list one subdir per line and
13041307
preferably in alphabetic order.

Kbuild

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ timeconst-file := include/generated/timeconst.h
2626

2727
targets += $(timeconst-file)
2828

29-
define filechk_gentimeconst
30-
(echo $(CONFIG_HZ) | bc -q $< )
31-
endef
29+
filechk_gentimeconst = echo $(CONFIG_HZ) | bc -q $<
3230

3331
$(timeconst-file): kernel/time/timeconst.bc FORCE
3432
$(call filechk,gentimeconst)

Makefile

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -514,13 +514,6 @@ RETPOLINE_VDSO_CFLAGS := $(call cc-option,$(RETPOLINE_VDSO_CFLAGS_GCC),$(call cc
514514
export RETPOLINE_CFLAGS
515515
export RETPOLINE_VDSO_CFLAGS
516516

517-
# check for 'asm goto'
518-
ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC) $(KBUILD_CFLAGS)), y)
519-
CC_HAVE_ASM_GOTO := 1
520-
KBUILD_CFLAGS += -DCC_HAVE_ASM_GOTO
521-
KBUILD_AFLAGS += -DCC_HAVE_ASM_GOTO
522-
endif
523-
524517
# The expansion should be delayed until arch/$(SRCARCH)/Makefile is included.
525518
# Some architectures define CROSS_COMPILE in arch/$(SRCARCH)/Makefile.
526519
# CC_VERSION_TEXT is referenced from Kconfig (so it needs export),
@@ -1048,9 +1041,8 @@ PHONY += $(vmlinux-dirs)
10481041
$(vmlinux-dirs): prepare
10491042
$(Q)$(MAKE) $(build)=$@ need-builtin=1
10501043

1051-
define filechk_kernel.release
1044+
filechk_kernel.release = \
10521045
echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))"
1053-
endef
10541046

10551047
# Store (new) KERNELRELEASE string in include/config/kernel.release
10561048
include/config/kernel.release: $(srctree)/Makefile FORCE
@@ -1134,13 +1126,13 @@ define filechk_utsrelease.h
11341126
echo '"$(KERNELRELEASE)" exceeds $(uts_len) characters' >&2; \
11351127
exit 1; \
11361128
fi; \
1137-
(echo \#define UTS_RELEASE \"$(KERNELRELEASE)\";)
1129+
echo \#define UTS_RELEASE \"$(KERNELRELEASE)\"
11381130
endef
11391131

11401132
define filechk_version.h
1141-
(echo \#define LINUX_VERSION_CODE $(shell \
1133+
echo \#define LINUX_VERSION_CODE $(shell \
11421134
expr $(VERSION) \* 65536 + 0$(PATCHLEVEL) \* 256 + 0$(SUBLEVEL)); \
1143-
echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';)
1135+
echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))'
11441136
endef
11451137

11461138
$(version_h): FORCE
@@ -1164,11 +1156,7 @@ export INSTALL_HDR_PATH = $(objtree)/usr
11641156
# If we do an all arch process set dst to include/arch-$(SRCARCH)
11651157
hdr-dst = $(if $(KBUILD_HEADERS), dst=include/arch-$(SRCARCH), dst=include)
11661158

1167-
PHONY += archheaders
1168-
archheaders:
1169-
1170-
PHONY += archscripts
1171-
archscripts:
1159+
PHONY += archheaders archscripts
11721160

11731161
PHONY += __headers
11741162
__headers: $(version_h) scripts_basic uapi-asm-generic archheaders archscripts

arch/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ config KPROBES
7171
config JUMP_LABEL
7272
bool "Optimize very unlikely/likely branches"
7373
depends on HAVE_ARCH_JUMP_LABEL
74+
depends on CC_HAS_ASM_GOTO
7475
help
7576
This option enables a transparent branch optimization that
7677
makes certain almost-always-true or almost-always-false branch

arch/alpha/include/uapi/asm/Kbuild

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
# UAPI Header export list
21
include include/uapi/asm-generic/Kbuild.asm
32

43
generated-y += unistd_32.h
5-
generic-y += bpf_perf_event.h
6-
generic-y += ipcbuf.h
7-
generic-y += msgbuf.h
8-
generic-y += poll.h
9-
generic-y += sembuf.h
10-
generic-y += shmbuf.h

arch/arc/include/uapi/asm/Kbuild

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,4 @@
1-
# UAPI Header export list
21
include include/uapi/asm-generic/Kbuild.asm
32

4-
generic-y += auxvec.h
5-
generic-y += bitsperlong.h
6-
generic-y += bpf_perf_event.h
7-
generic-y += errno.h
8-
generic-y += fcntl.h
9-
generic-y += ioctl.h
10-
generic-y += ioctls.h
11-
generic-y += ipcbuf.h
123
generic-y += kvm_para.h
13-
generic-y += mman.h
14-
generic-y += msgbuf.h
15-
generic-y += param.h
16-
generic-y += poll.h
17-
generic-y += posix_types.h
18-
generic-y += resource.h
19-
generic-y += sembuf.h
20-
generic-y += shmbuf.h
21-
generic-y += siginfo.h
22-
generic-y += socket.h
23-
generic-y += sockios.h
24-
generic-y += stat.h
25-
generic-y += statfs.h
26-
generic-y += termbits.h
27-
generic-y += termios.h
28-
generic-y += types.h
294
generic-y += ucontext.h

arch/arm/boot/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ targets := Image zImage xipImage bootpImage uImage
3232
ifeq ($(CONFIG_XIP_KERNEL),y)
3333

3434
cmd_deflate_xip_data = $(CONFIG_SHELL) -c \
35-
'$(srctree)/$(src)/deflate_xip_data.sh $< $@ || { rm -f $@; false; }'
35+
'$(srctree)/$(src)/deflate_xip_data.sh $< $@'
3636

3737
ifeq ($(CONFIG_XIP_DEFLATED_DATA),y)
3838
quiet_cmd_mkxip = XIPZ $@

arch/arm/boot/compressed/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ check_for_bad_syms = \
170170
bad_syms=$$($(CROSS_COMPILE)nm $@ | sed -n 's/^.\{8\} [bc] \(.*\)/\1/p') && \
171171
[ -z "$$bad_syms" ] || \
172172
( echo "following symbols must have non local/private scope:" >&2; \
173-
echo "$$bad_syms" >&2; rm -f $@; false )
173+
echo "$$bad_syms" >&2; false )
174174

175175
check_for_multiple_zreladdr = \
176176
if [ $(words $(ZRELADDR)) -gt 1 -a "$(CONFIG_AUTO_ZRELADDR)" = "" ]; then \

arch/arm/include/uapi/asm/Kbuild

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,6 @@
11
# SPDX-License-Identifier: GPL-2.0
2-
# UAPI Header export list
32
include include/uapi/asm-generic/Kbuild.asm
43

54
generated-y += unistd-common.h
65
generated-y += unistd-oabi.h
76
generated-y += unistd-eabi.h
8-
9-
generic-y += bitsperlong.h
10-
generic-y += bpf_perf_event.h
11-
generic-y += errno.h
12-
generic-y += ioctl.h
13-
generic-y += ipcbuf.h
14-
generic-y += msgbuf.h
15-
generic-y += param.h
16-
generic-y += poll.h
17-
generic-y += resource.h
18-
generic-y += sembuf.h
19-
generic-y += shmbuf.h
20-
generic-y += siginfo.h
21-
generic-y += socket.h
22-
generic-y += sockios.h
23-
generic-y += termbits.h
24-
generic-y += termios.h

arch/arm/kernel/jump_label.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
#include <asm/patch.h>
55
#include <asm/insn.h>
66

7-
#ifdef HAVE_JUMP_LABEL
8-
97
static void __arch_jump_label_transform(struct jump_entry *entry,
108
enum jump_label_type type,
119
bool is_static)
@@ -35,5 +33,3 @@ void arch_jump_label_transform_static(struct jump_entry *entry,
3533
{
3634
__arch_jump_label_transform(entry, type, true);
3735
}
38-
39-
#endif

arch/arm/tools/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ _dummy := $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)') \
3535

3636
quiet_cmd_gen_mach = GEN $@
3737
cmd_gen_mach = mkdir -p $(dir $@) && \
38-
$(AWK) -f $(filter-out $(PHONY),$^) > $@ || \
39-
{ rm -f $@; /bin/false; }
38+
$(AWK) -f $(filter-out $(PHONY),$^) > $@
4039

4140
$(kapi)/mach-types.h: $(src)/gen-mach-types $(src)/mach-types FORCE
4241
$(call if_changed,gen_mach)

arch/arm64/include/uapi/asm/Kbuild

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,4 @@
11
# SPDX-License-Identifier: GPL-2.0
2-
# UAPI Header export list
32
include include/uapi/asm-generic/Kbuild.asm
43

5-
generic-y += errno.h
6-
generic-y += ioctl.h
7-
generic-y += ioctls.h
8-
generic-y += ipcbuf.h
94
generic-y += kvm_para.h
10-
generic-y += mman.h
11-
generic-y += msgbuf.h
12-
generic-y += poll.h
13-
generic-y += resource.h
14-
generic-y += sembuf.h
15-
generic-y += shmbuf.h
16-
generic-y += socket.h
17-
generic-y += sockios.h
18-
generic-y += swab.h
19-
generic-y += termbits.h
20-
generic-y += termios.h
21-
generic-y += types.h
22-
generic-y += siginfo.h

arch/arm64/kernel/jump_label.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
#include <linux/jump_label.h>
2121
#include <asm/insn.h>
2222

23-
#ifdef HAVE_JUMP_LABEL
24-
2523
void arch_jump_label_transform(struct jump_entry *entry,
2624
enum jump_label_type type)
2725
{
@@ -49,5 +47,3 @@ void arch_jump_label_transform_static(struct jump_entry *entry,
4947
* NOP needs to be replaced by a branch.
5048
*/
5149
}
52-
53-
#endif /* HAVE_JUMP_LABEL */

arch/c6x/include/uapi/asm/Kbuild

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,4 @@
1-
# UAPI Header export list
21
include include/uapi/asm-generic/Kbuild.asm
32

4-
generic-y += auxvec.h
5-
generic-y += bitsperlong.h
6-
generic-y += bpf_perf_event.h
7-
generic-y += errno.h
8-
generic-y += fcntl.h
9-
generic-y += ioctl.h
10-
generic-y += ioctls.h
11-
generic-y += ipcbuf.h
123
generic-y += kvm_para.h
13-
generic-y += mman.h
14-
generic-y += msgbuf.h
15-
generic-y += param.h
16-
generic-y += poll.h
17-
generic-y += posix_types.h
18-
generic-y += resource.h
19-
generic-y += sembuf.h
20-
generic-y += shmbuf.h
21-
generic-y += shmparam.h
22-
generic-y += siginfo.h
23-
generic-y += signal.h
24-
generic-y += socket.h
25-
generic-y += sockios.h
26-
generic-y += stat.h
27-
generic-y += statfs.h
28-
generic-y += termbits.h
29-
generic-y += termios.h
30-
generic-y += types.h
314
generic-y += ucontext.h

arch/csky/include/uapi/asm/Kbuild

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,3 @@
11
include include/uapi/asm-generic/Kbuild.asm
22

3-
generic-y += auxvec.h
4-
generic-y += param.h
5-
generic-y += bpf_perf_event.h
6-
generic-y += errno.h
7-
generic-y += fcntl.h
8-
generic-y += ioctl.h
9-
generic-y += ioctls.h
10-
generic-y += ipcbuf.h
11-
generic-y += shmbuf.h
12-
generic-y += bitsperlong.h
13-
generic-y += mman.h
14-
generic-y += msgbuf.h
15-
generic-y += poll.h
16-
generic-y += posix_types.h
17-
generic-y += resource.h
18-
generic-y += sembuf.h
19-
generic-y += siginfo.h
20-
generic-y += signal.h
21-
generic-y += socket.h
22-
generic-y += sockios.h
23-
generic-y += statfs.h
24-
generic-y += stat.h
25-
generic-y += setup.h
26-
generic-y += swab.h
27-
generic-y += termbits.h
28-
generic-y += termios.h
29-
generic-y += types.h
303
generic-y += ucontext.h

arch/h8300/include/uapi/asm/Kbuild

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,4 @@
1-
# UAPI Header export list
21
include include/uapi/asm-generic/Kbuild.asm
32

4-
generic-y += auxvec.h
5-
generic-y += bpf_perf_event.h
6-
generic-y += errno.h
7-
generic-y += fcntl.h
8-
generic-y += ioctl.h
9-
generic-y += ioctls.h
10-
generic-y += ipcbuf.h
113
generic-y += kvm_para.h
12-
generic-y += mman.h
13-
generic-y += msgbuf.h
14-
generic-y += param.h
15-
generic-y += poll.h
16-
generic-y += posix_types.h
17-
generic-y += resource.h
18-
generic-y += sembuf.h
19-
generic-y += setup.h
20-
generic-y += shmbuf.h
21-
generic-y += shmparam.h
22-
generic-y += siginfo.h
23-
generic-y += socket.h
24-
generic-y += sockios.h
25-
generic-y += stat.h
26-
generic-y += statfs.h
27-
generic-y += swab.h
28-
generic-y += termbits.h
29-
generic-y += termios.h
30-
generic-y += types.h
314
generic-y += ucontext.h

arch/hexagon/include/uapi/asm/Kbuild

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,3 @@
1-
# UAPI Header export list
21
include include/uapi/asm-generic/Kbuild.asm
32

4-
generic-y += auxvec.h
5-
generic-y += bpf_perf_event.h
6-
generic-y += errno.h
7-
generic-y += fcntl.h
8-
generic-y += ioctl.h
9-
generic-y += ioctls.h
10-
generic-y += ipcbuf.h
11-
generic-y += mman.h
12-
generic-y += msgbuf.h
13-
generic-y += poll.h
14-
generic-y += posix_types.h
15-
generic-y += resource.h
16-
generic-y += sembuf.h
17-
generic-y += shmbuf.h
18-
generic-y += shmparam.h
19-
generic-y += siginfo.h
20-
generic-y += socket.h
21-
generic-y += sockios.h
22-
generic-y += stat.h
23-
generic-y += statfs.h
24-
generic-y += termbits.h
25-
generic-y += termios.h
26-
generic-y += types.h
273
generic-y += ucontext.h

arch/ia64/include/uapi/asm/Kbuild

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
1-
# UAPI Header export list
21
include include/uapi/asm-generic/Kbuild.asm
32

43
generated-y += unistd_64.h
5-
generic-y += bpf_perf_event.h
6-
generic-y += ipcbuf.h
74
generic-y += kvm_para.h
8-
generic-y += msgbuf.h
9-
generic-y += poll.h
10-
generic-y += sembuf.h
11-
generic-y += shmbuf.h

arch/m68k/include/uapi/asm/Kbuild

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,4 @@
1-
# UAPI Header export list
21
include include/uapi/asm-generic/Kbuild.asm
32

43
generated-y += unistd_32.h
5-
generic-y += auxvec.h
6-
generic-y += bitsperlong.h
7-
generic-y += bpf_perf_event.h
8-
generic-y += errno.h
9-
generic-y += ioctl.h
10-
generic-y += ipcbuf.h
114
generic-y += kvm_para.h
12-
generic-y += mman.h
13-
generic-y += msgbuf.h
14-
generic-y += resource.h
15-
generic-y += sembuf.h
16-
generic-y += shmbuf.h
17-
generic-y += shmparam.h
18-
generic-y += siginfo.h
19-
generic-y += socket.h
20-
generic-y += sockios.h
21-
generic-y += statfs.h
22-
generic-y += termbits.h
23-
generic-y += termios.h
24-
generic-y += types.h

0 commit comments

Comments
 (0)