Skip to content

Commit

Permalink
kbuild: force all architectures except um to include mandatory-y
Browse files Browse the repository at this point in the history
Currently, every arch/*/include/uapi/asm/Kbuild explicitly includes
the common Kbuild.asm file. Factor out the duplicated include directives
to scripts/Makefile.asm-generic so that no architecture would opt out
of the mandatory-y mechanism.

um is not forced to include mandatory-y since it is a very exceptional
case which does not support UAPI.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
  • Loading branch information
masahir0y committed Mar 17, 2019
1 parent 7cbbbb8 commit 037fc33
Show file tree
Hide file tree
Showing 29 changed files with 18 additions and 47 deletions.
2 changes: 1 addition & 1 deletion Documentation/kbuild/makefiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1274,7 +1274,7 @@ 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
mandatory-y is essentially used by include/(uapi/)asm-generic/Kbuild
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
Expand Down
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1098,9 +1098,11 @@ asm-generic := -f $(srctree)/scripts/Makefile.asm-generic obj

PHONY += asm-generic uapi-asm-generic
asm-generic: uapi-asm-generic
$(Q)$(MAKE) $(asm-generic)=arch/$(SRCARCH)/include/generated/asm
$(Q)$(MAKE) $(asm-generic)=arch/$(SRCARCH)/include/generated/asm \
generic=include/asm-generic
uapi-asm-generic:
$(Q)$(MAKE) $(asm-generic)=arch/$(SRCARCH)/include/generated/uapi/asm
$(Q)$(MAKE) $(asm-generic)=arch/$(SRCARCH)/include/generated/uapi/asm \
generic=include/uapi/asm-generic

PHONY += prepare-objtool
prepare-objtool: $(objtool_target)
Expand Down
2 changes: 0 additions & 2 deletions arch/alpha/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
include include/uapi/asm-generic/Kbuild.asm

generated-y += unistd_32.h
2 changes: 0 additions & 2 deletions arch/arc/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
include include/uapi/asm-generic/Kbuild.asm

generic-y += kvm_para.h
generic-y += ucontext.h
1 change: 0 additions & 1 deletion arch/arm/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# SPDX-License-Identifier: GPL-2.0
include include/uapi/asm-generic/Kbuild.asm

generated-y += unistd-common.h
generated-y += unistd-oabi.h
Expand Down
1 change: 0 additions & 1 deletion arch/arm64/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# SPDX-License-Identifier: GPL-2.0
include include/uapi/asm-generic/Kbuild.asm

generic-y += kvm_para.h
2 changes: 0 additions & 2 deletions arch/c6x/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
include include/uapi/asm-generic/Kbuild.asm

generic-y += kvm_para.h
generic-y += ucontext.h
2 changes: 0 additions & 2 deletions arch/csky/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
include include/uapi/asm-generic/Kbuild.asm

generic-y += ucontext.h
2 changes: 0 additions & 2 deletions arch/h8300/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
include include/uapi/asm-generic/Kbuild.asm

generic-y += kvm_para.h
generic-y += ucontext.h
2 changes: 0 additions & 2 deletions arch/hexagon/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
include include/uapi/asm-generic/Kbuild.asm

generic-y += ucontext.h
2 changes: 0 additions & 2 deletions arch/ia64/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
include include/uapi/asm-generic/Kbuild.asm

generated-y += unistd_64.h
generic-y += kvm_para.h
2 changes: 0 additions & 2 deletions arch/m68k/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
include include/uapi/asm-generic/Kbuild.asm

generated-y += unistd_32.h
generic-y += kvm_para.h
2 changes: 0 additions & 2 deletions arch/microblaze/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include include/uapi/asm-generic/Kbuild.asm

generated-y += unistd_32.h
generic-y += kvm_para.h
generic-y += ucontext.h
2 changes: 0 additions & 2 deletions arch/mips/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include include/uapi/asm-generic/Kbuild.asm

generated-y += unistd_n32.h
generated-y += unistd_n64.h
generated-y += unistd_o32.h
Expand Down
2 changes: 0 additions & 2 deletions arch/nds32/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
include include/uapi/asm-generic/Kbuild.asm

generic-y += ucontext.h
2 changes: 0 additions & 2 deletions arch/nios2/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
include include/uapi/asm-generic/Kbuild.asm

generic-y += kvm_para.h
generic-y += ucontext.h
2 changes: 0 additions & 2 deletions arch/openrisc/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
include include/uapi/asm-generic/Kbuild.asm

generic-y += kvm_para.h
generic-y += ucontext.h
2 changes: 0 additions & 2 deletions arch/parisc/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include include/uapi/asm-generic/Kbuild.asm

generated-y += unistd_32.h
generated-y += unistd_64.h
generic-y += kvm_para.h
2 changes: 0 additions & 2 deletions arch/powerpc/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
include include/uapi/asm-generic/Kbuild.asm

generated-y += unistd_32.h
generated-y += unistd_64.h
1 change: 0 additions & 1 deletion arch/riscv/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
include include/uapi/asm-generic/Kbuild.asm
1 change: 0 additions & 1 deletion arch/s390/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# SPDX-License-Identifier: GPL-2.0
include include/uapi/asm-generic/Kbuild.asm

generated-y += unistd_32.h
generated-y += unistd_64.h
1 change: 0 additions & 1 deletion arch/sh/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# SPDX-License-Identifier: GPL-2.0
include include/uapi/asm-generic/Kbuild.asm

generated-y += unistd_32.h
generic-y += kvm_para.h
Expand Down
2 changes: 0 additions & 2 deletions arch/sparc/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
include include/uapi/asm-generic/Kbuild.asm

generated-y += unistd_32.h
generated-y += unistd_64.h
2 changes: 0 additions & 2 deletions arch/unicore32/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
include include/uapi/asm-generic/Kbuild.asm

generic-y += kvm_para.h
generic-y += ucontext.h
2 changes: 0 additions & 2 deletions arch/x86/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include include/uapi/asm-generic/Kbuild.asm

generated-y += unistd_32.h
generated-y += unistd_64.h
generated-y += unistd_x32.h
2 changes: 0 additions & 2 deletions arch/xtensa/include/uapi/asm/Kbuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
include include/uapi/asm-generic/Kbuild.asm

generated-y += unistd_32.h
generic-y += kvm_para.h
5 changes: 5 additions & 0 deletions include/asm-generic/Kbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# SPDX-License-Identifier: GPL-2.0
#
# asm headers that all architectures except um should have
# (This file is not included when SRCARCH=um since UML borrows several
# asm headers from the host architecutre.)
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# SPDX-License-Identifier: GPL-2.0
#
# Headers that are mandatory in usr/include/asm/
#
# (This file is not included when SRCARCH=um since UML does not support UAPI.)

mandatory-y += auxvec.h
mandatory-y += bitsperlong.h
mandatory-y += bpf_perf_event.h
Expand Down
5 changes: 5 additions & 0 deletions scripts/Makefile.asm-generic
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ all:
src := $(subst /generated,,$(obj))
-include $(src)/Kbuild

# $(generic)/Kbuild lists mandatory-y. Exclude um since it is a special case.
ifneq ($(SRCARCH),um)
include $(generic)/Kbuild
endif

include scripts/Kbuild.include

redundant := $(filter $(mandatory-y) $(generated-y), $(generic-y))
Expand Down

0 comments on commit 037fc33

Please sign in to comment.