Skip to content

Commit

Permalink
Merge tag 'kbuild-v4.21-3' of git://git.kernel.org/pub/scm/linux/kern…
Browse files Browse the repository at this point in the history
…el/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
  • Loading branch information
torvalds committed Jan 7, 2019
2 parents ac5eed2 + d86271a commit 85e1ffb
Show file tree
Hide file tree
Showing 94 changed files with 150 additions and 694 deletions.
9 changes: 6 additions & 3 deletions Documentation/kbuild/makefiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1296,9 +1296,12 @@ See subsequent chapter for the syntax of the Kbuild file.

--- 7.4 mandatory-y

mandatory-y is essentially used by include/uapi/asm-generic/Kbuild.asm
to define the minimum set of headers that must be exported in
include/asm.
mandatory-y is essentially used by include/(uapi/)asm-generic/Kbuild.asm
to define the minimum set of ASM headers that all architectures must have.

This works like optional generic-y. If a mandatory header is missing
in arch/$(ARCH)/include/(uapi/)/asm, Kbuild will automatically generate
a wrapper of the asm-generic one.

The convention is to list one subdir per line and
preferably in alphabetic order.
Expand Down
4 changes: 1 addition & 3 deletions Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ timeconst-file := include/generated/timeconst.h

targets += $(timeconst-file)

define filechk_gentimeconst
(echo $(CONFIG_HZ) | bc -q $< )
endef
filechk_gentimeconst = echo $(CONFIG_HZ) | bc -q $<

$(timeconst-file): kernel/time/timeconst.bc FORCE
$(call filechk,gentimeconst)
Expand Down
22 changes: 5 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -514,13 +514,6 @@ RETPOLINE_VDSO_CFLAGS := $(call cc-option,$(RETPOLINE_VDSO_CFLAGS_GCC),$(call cc
export RETPOLINE_CFLAGS
export RETPOLINE_VDSO_CFLAGS

# check for 'asm goto'
ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC) $(KBUILD_CFLAGS)), y)
CC_HAVE_ASM_GOTO := 1
KBUILD_CFLAGS += -DCC_HAVE_ASM_GOTO
KBUILD_AFLAGS += -DCC_HAVE_ASM_GOTO
endif

# The expansion should be delayed until arch/$(SRCARCH)/Makefile is included.
# Some architectures define CROSS_COMPILE in arch/$(SRCARCH)/Makefile.
# CC_VERSION_TEXT is referenced from Kconfig (so it needs export),
Expand Down Expand Up @@ -1048,9 +1041,8 @@ PHONY += $(vmlinux-dirs)
$(vmlinux-dirs): prepare
$(Q)$(MAKE) $(build)=$@ need-builtin=1

define filechk_kernel.release
filechk_kernel.release = \
echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))"
endef

# Store (new) KERNELRELEASE string in include/config/kernel.release
include/config/kernel.release: $(srctree)/Makefile FORCE
Expand Down Expand Up @@ -1134,13 +1126,13 @@ define filechk_utsrelease.h
echo '"$(KERNELRELEASE)" exceeds $(uts_len) characters' >&2; \
exit 1; \
fi; \
(echo \#define UTS_RELEASE \"$(KERNELRELEASE)\";)
echo \#define UTS_RELEASE \"$(KERNELRELEASE)\"
endef

define filechk_version.h
(echo \#define LINUX_VERSION_CODE $(shell \
echo \#define LINUX_VERSION_CODE $(shell \
expr $(VERSION) \* 65536 + 0$(PATCHLEVEL) \* 256 + 0$(SUBLEVEL)); \
echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';)
echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))'
endef

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

PHONY += archheaders
archheaders:

PHONY += archscripts
archscripts:
PHONY += archheaders archscripts

PHONY += __headers
__headers: $(version_h) scripts_basic uapi-asm-generic archheaders archscripts
Expand Down
1 change: 1 addition & 0 deletions arch/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ config KPROBES
config JUMP_LABEL
bool "Optimize very unlikely/likely branches"
depends on HAVE_ARCH_JUMP_LABEL
depends on CC_HAS_ASM_GOTO
help
This option enables a transparent branch optimization that
makes certain almost-always-true or almost-always-false branch
Expand Down
7 changes: 0 additions & 7 deletions arch/alpha/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
# UAPI Header export list
include include/uapi/asm-generic/Kbuild.asm

generated-y += unistd_32.h
generic-y += bpf_perf_event.h
generic-y += ipcbuf.h
generic-y += msgbuf.h
generic-y += poll.h
generic-y += sembuf.h
generic-y += shmbuf.h
25 changes: 0 additions & 25 deletions arch/arc/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,29 +1,4 @@
# UAPI Header export list
include include/uapi/asm-generic/Kbuild.asm

generic-y += auxvec.h
generic-y += bitsperlong.h
generic-y += bpf_perf_event.h
generic-y += errno.h
generic-y += fcntl.h
generic-y += ioctl.h
generic-y += ioctls.h
generic-y += ipcbuf.h
generic-y += kvm_para.h
generic-y += mman.h
generic-y += msgbuf.h
generic-y += param.h
generic-y += poll.h
generic-y += posix_types.h
generic-y += resource.h
generic-y += sembuf.h
generic-y += shmbuf.h
generic-y += siginfo.h
generic-y += socket.h
generic-y += sockios.h
generic-y += stat.h
generic-y += statfs.h
generic-y += termbits.h
generic-y += termios.h
generic-y += types.h
generic-y += ucontext.h
2 changes: 1 addition & 1 deletion arch/arm/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ targets := Image zImage xipImage bootpImage uImage
ifeq ($(CONFIG_XIP_KERNEL),y)

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

ifeq ($(CONFIG_XIP_DEFLATED_DATA),y)
quiet_cmd_mkxip = XIPZ $@
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boot/compressed/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ check_for_bad_syms = \
bad_syms=$$($(CROSS_COMPILE)nm $@ | sed -n 's/^.\{8\} [bc] \(.*\)/\1/p') && \
[ -z "$$bad_syms" ] || \
( echo "following symbols must have non local/private scope:" >&2; \
echo "$$bad_syms" >&2; rm -f $@; false )
echo "$$bad_syms" >&2; false )

check_for_multiple_zreladdr = \
if [ $(words $(ZRELADDR)) -gt 1 -a "$(CONFIG_AUTO_ZRELADDR)" = "" ]; then \
Expand Down
18 changes: 0 additions & 18 deletions arch/arm/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,24 +1,6 @@
# SPDX-License-Identifier: GPL-2.0
# UAPI Header export list
include include/uapi/asm-generic/Kbuild.asm

generated-y += unistd-common.h
generated-y += unistd-oabi.h
generated-y += unistd-eabi.h

generic-y += bitsperlong.h
generic-y += bpf_perf_event.h
generic-y += errno.h
generic-y += ioctl.h
generic-y += ipcbuf.h
generic-y += msgbuf.h
generic-y += param.h
generic-y += poll.h
generic-y += resource.h
generic-y += sembuf.h
generic-y += shmbuf.h
generic-y += siginfo.h
generic-y += socket.h
generic-y += sockios.h
generic-y += termbits.h
generic-y += termios.h
4 changes: 0 additions & 4 deletions arch/arm/kernel/jump_label.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
#include <asm/patch.h>
#include <asm/insn.h>

#ifdef HAVE_JUMP_LABEL

static void __arch_jump_label_transform(struct jump_entry *entry,
enum jump_label_type type,
bool is_static)
Expand Down Expand Up @@ -35,5 +33,3 @@ void arch_jump_label_transform_static(struct jump_entry *entry,
{
__arch_jump_label_transform(entry, type, true);
}

#endif
3 changes: 1 addition & 2 deletions arch/arm/tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ _dummy := $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)') \

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

$(kapi)/mach-types.h: $(src)/gen-mach-types $(src)/mach-types FORCE
$(call if_changed,gen_mach)
Expand Down
18 changes: 0 additions & 18 deletions arch/arm64/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,22 +1,4 @@
# SPDX-License-Identifier: GPL-2.0
# UAPI Header export list
include include/uapi/asm-generic/Kbuild.asm

generic-y += errno.h
generic-y += ioctl.h
generic-y += ioctls.h
generic-y += ipcbuf.h
generic-y += kvm_para.h
generic-y += mman.h
generic-y += msgbuf.h
generic-y += poll.h
generic-y += resource.h
generic-y += sembuf.h
generic-y += shmbuf.h
generic-y += socket.h
generic-y += sockios.h
generic-y += swab.h
generic-y += termbits.h
generic-y += termios.h
generic-y += types.h
generic-y += siginfo.h
4 changes: 0 additions & 4 deletions arch/arm64/kernel/jump_label.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
#include <linux/jump_label.h>
#include <asm/insn.h>

#ifdef HAVE_JUMP_LABEL

void arch_jump_label_transform(struct jump_entry *entry,
enum jump_label_type type)
{
Expand Down Expand Up @@ -49,5 +47,3 @@ void arch_jump_label_transform_static(struct jump_entry *entry,
* NOP needs to be replaced by a branch.
*/
}

#endif /* HAVE_JUMP_LABEL */
27 changes: 0 additions & 27 deletions arch/c6x/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,31 +1,4 @@
# UAPI Header export list
include include/uapi/asm-generic/Kbuild.asm

generic-y += auxvec.h
generic-y += bitsperlong.h
generic-y += bpf_perf_event.h
generic-y += errno.h
generic-y += fcntl.h
generic-y += ioctl.h
generic-y += ioctls.h
generic-y += ipcbuf.h
generic-y += kvm_para.h
generic-y += mman.h
generic-y += msgbuf.h
generic-y += param.h
generic-y += poll.h
generic-y += posix_types.h
generic-y += resource.h
generic-y += sembuf.h
generic-y += shmbuf.h
generic-y += shmparam.h
generic-y += siginfo.h
generic-y += signal.h
generic-y += socket.h
generic-y += sockios.h
generic-y += stat.h
generic-y += statfs.h
generic-y += termbits.h
generic-y += termios.h
generic-y += types.h
generic-y += ucontext.h
27 changes: 0 additions & 27 deletions arch/csky/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,30 +1,3 @@
include include/uapi/asm-generic/Kbuild.asm

generic-y += auxvec.h
generic-y += param.h
generic-y += bpf_perf_event.h
generic-y += errno.h
generic-y += fcntl.h
generic-y += ioctl.h
generic-y += ioctls.h
generic-y += ipcbuf.h
generic-y += shmbuf.h
generic-y += bitsperlong.h
generic-y += mman.h
generic-y += msgbuf.h
generic-y += poll.h
generic-y += posix_types.h
generic-y += resource.h
generic-y += sembuf.h
generic-y += siginfo.h
generic-y += signal.h
generic-y += socket.h
generic-y += sockios.h
generic-y += statfs.h
generic-y += stat.h
generic-y += setup.h
generic-y += swab.h
generic-y += termbits.h
generic-y += termios.h
generic-y += types.h
generic-y += ucontext.h
27 changes: 0 additions & 27 deletions arch/h8300/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,31 +1,4 @@
# UAPI Header export list
include include/uapi/asm-generic/Kbuild.asm

generic-y += auxvec.h
generic-y += bpf_perf_event.h
generic-y += errno.h
generic-y += fcntl.h
generic-y += ioctl.h
generic-y += ioctls.h
generic-y += ipcbuf.h
generic-y += kvm_para.h
generic-y += mman.h
generic-y += msgbuf.h
generic-y += param.h
generic-y += poll.h
generic-y += posix_types.h
generic-y += resource.h
generic-y += sembuf.h
generic-y += setup.h
generic-y += shmbuf.h
generic-y += shmparam.h
generic-y += siginfo.h
generic-y += socket.h
generic-y += sockios.h
generic-y += stat.h
generic-y += statfs.h
generic-y += swab.h
generic-y += termbits.h
generic-y += termios.h
generic-y += types.h
generic-y += ucontext.h
24 changes: 0 additions & 24 deletions arch/hexagon/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,27 +1,3 @@
# UAPI Header export list
include include/uapi/asm-generic/Kbuild.asm

generic-y += auxvec.h
generic-y += bpf_perf_event.h
generic-y += errno.h
generic-y += fcntl.h
generic-y += ioctl.h
generic-y += ioctls.h
generic-y += ipcbuf.h
generic-y += mman.h
generic-y += msgbuf.h
generic-y += poll.h
generic-y += posix_types.h
generic-y += resource.h
generic-y += sembuf.h
generic-y += shmbuf.h
generic-y += shmparam.h
generic-y += siginfo.h
generic-y += socket.h
generic-y += sockios.h
generic-y += stat.h
generic-y += statfs.h
generic-y += termbits.h
generic-y += termios.h
generic-y += types.h
generic-y += ucontext.h
7 changes: 0 additions & 7 deletions arch/ia64/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
# UAPI Header export list
include include/uapi/asm-generic/Kbuild.asm

generated-y += unistd_64.h
generic-y += bpf_perf_event.h
generic-y += ipcbuf.h
generic-y += kvm_para.h
generic-y += msgbuf.h
generic-y += poll.h
generic-y += sembuf.h
generic-y += shmbuf.h
20 changes: 0 additions & 20 deletions arch/m68k/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,24 +1,4 @@
# UAPI Header export list
include include/uapi/asm-generic/Kbuild.asm

generated-y += unistd_32.h
generic-y += auxvec.h
generic-y += bitsperlong.h
generic-y += bpf_perf_event.h
generic-y += errno.h
generic-y += ioctl.h
generic-y += ipcbuf.h
generic-y += kvm_para.h
generic-y += mman.h
generic-y += msgbuf.h
generic-y += resource.h
generic-y += sembuf.h
generic-y += shmbuf.h
generic-y += shmparam.h
generic-y += siginfo.h
generic-y += socket.h
generic-y += sockios.h
generic-y += statfs.h
generic-y += termbits.h
generic-y += termios.h
generic-y += types.h
Loading

0 comments on commit 85e1ffb

Please sign in to comment.