1
0
Fork 0

kbuild: force all architectures except um to include mandatory-y

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>
hifive-unleashed-5.1
Masahiro Yamada 2019-03-17 11:01:09 +09:00
parent 7cbbbb8bc2
commit 037fc3368b
29 changed files with 18 additions and 47 deletions

View File

@ -1274,7 +1274,7 @@ See subsequent chapter for the syntax of the Kbuild file.
--- 7.4 mandatory-y --- 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. 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 This works like optional generic-y. If a mandatory header is missing

View File

@ -1098,9 +1098,11 @@ asm-generic := -f $(srctree)/scripts/Makefile.asm-generic obj
PHONY += asm-generic uapi-asm-generic PHONY += asm-generic uapi-asm-generic
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: 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 PHONY += prepare-objtool
prepare-objtool: $(objtool_target) prepare-objtool: $(objtool_target)

View File

@ -1,3 +1 @@
include include/uapi/asm-generic/Kbuild.asm
generated-y += unistd_32.h generated-y += unistd_32.h

View File

@ -1,4 +1,2 @@
include include/uapi/asm-generic/Kbuild.asm
generic-y += kvm_para.h generic-y += kvm_para.h
generic-y += ucontext.h generic-y += ucontext.h

View File

@ -1,5 +1,4 @@
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
include include/uapi/asm-generic/Kbuild.asm
generated-y += unistd-common.h generated-y += unistd-common.h
generated-y += unistd-oabi.h generated-y += unistd-oabi.h

View File

@ -1,4 +1,3 @@
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
include include/uapi/asm-generic/Kbuild.asm
generic-y += kvm_para.h generic-y += kvm_para.h

View File

@ -1,4 +1,2 @@
include include/uapi/asm-generic/Kbuild.asm
generic-y += kvm_para.h generic-y += kvm_para.h
generic-y += ucontext.h generic-y += ucontext.h

View File

@ -1,3 +1 @@
include include/uapi/asm-generic/Kbuild.asm
generic-y += ucontext.h generic-y += ucontext.h

View File

@ -1,4 +1,2 @@
include include/uapi/asm-generic/Kbuild.asm
generic-y += kvm_para.h generic-y += kvm_para.h
generic-y += ucontext.h generic-y += ucontext.h

View File

@ -1,3 +1 @@
include include/uapi/asm-generic/Kbuild.asm
generic-y += ucontext.h generic-y += ucontext.h

View File

@ -1,4 +1,2 @@
include include/uapi/asm-generic/Kbuild.asm
generated-y += unistd_64.h generated-y += unistd_64.h
generic-y += kvm_para.h generic-y += kvm_para.h

View File

@ -1,4 +1,2 @@
include include/uapi/asm-generic/Kbuild.asm
generated-y += unistd_32.h generated-y += unistd_32.h
generic-y += kvm_para.h generic-y += kvm_para.h

View File

@ -1,5 +1,3 @@
include include/uapi/asm-generic/Kbuild.asm
generated-y += unistd_32.h generated-y += unistd_32.h
generic-y += kvm_para.h generic-y += kvm_para.h
generic-y += ucontext.h generic-y += ucontext.h

View File

@ -1,5 +1,3 @@
include include/uapi/asm-generic/Kbuild.asm
generated-y += unistd_n32.h generated-y += unistd_n32.h
generated-y += unistd_n64.h generated-y += unistd_n64.h
generated-y += unistd_o32.h generated-y += unistd_o32.h

View File

@ -1,3 +1 @@
include include/uapi/asm-generic/Kbuild.asm
generic-y += ucontext.h generic-y += ucontext.h

View File

@ -1,4 +1,2 @@
include include/uapi/asm-generic/Kbuild.asm
generic-y += kvm_para.h generic-y += kvm_para.h
generic-y += ucontext.h generic-y += ucontext.h

View File

@ -1,4 +1,2 @@
include include/uapi/asm-generic/Kbuild.asm
generic-y += kvm_para.h generic-y += kvm_para.h
generic-y += ucontext.h generic-y += ucontext.h

View File

@ -1,5 +1,3 @@
include include/uapi/asm-generic/Kbuild.asm
generated-y += unistd_32.h generated-y += unistd_32.h
generated-y += unistd_64.h generated-y += unistd_64.h
generic-y += kvm_para.h generic-y += kvm_para.h

View File

@ -1,4 +1,2 @@
include include/uapi/asm-generic/Kbuild.asm
generated-y += unistd_32.h generated-y += unistd_32.h
generated-y += unistd_64.h generated-y += unistd_64.h

View File

@ -1 +0,0 @@
include include/uapi/asm-generic/Kbuild.asm

View File

@ -1,5 +1,4 @@
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
include include/uapi/asm-generic/Kbuild.asm
generated-y += unistd_32.h generated-y += unistd_32.h
generated-y += unistd_64.h generated-y += unistd_64.h

View File

@ -1,5 +1,4 @@
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
include include/uapi/asm-generic/Kbuild.asm
generated-y += unistd_32.h generated-y += unistd_32.h
generic-y += kvm_para.h generic-y += kvm_para.h

View File

@ -1,4 +1,2 @@
include include/uapi/asm-generic/Kbuild.asm
generated-y += unistd_32.h generated-y += unistd_32.h
generated-y += unistd_64.h generated-y += unistd_64.h

View File

@ -1,4 +1,2 @@
include include/uapi/asm-generic/Kbuild.asm
generic-y += kvm_para.h generic-y += kvm_para.h
generic-y += ucontext.h generic-y += ucontext.h

View File

@ -1,5 +1,3 @@
include include/uapi/asm-generic/Kbuild.asm
generated-y += unistd_32.h generated-y += unistd_32.h
generated-y += unistd_64.h generated-y += unistd_64.h
generated-y += unistd_x32.h generated-y += unistd_x32.h

View File

@ -1,4 +1,2 @@
include include/uapi/asm-generic/Kbuild.asm
generated-y += unistd_32.h generated-y += unistd_32.h
generic-y += kvm_para.h generic-y += kvm_para.h

View File

@ -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.)

View File

@ -1,6 +1,8 @@
# SPDX-License-Identifier: GPL-2.0
# #
# Headers that are mandatory in usr/include/asm/ # 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 += auxvec.h
mandatory-y += bitsperlong.h mandatory-y += bitsperlong.h
mandatory-y += bpf_perf_event.h mandatory-y += bpf_perf_event.h

View File

@ -12,6 +12,11 @@ all:
src := $(subst /generated,,$(obj)) src := $(subst /generated,,$(obj))
-include $(src)/Kbuild -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 include scripts/Kbuild.include
redundant := $(filter $(mandatory-y) $(generated-y), $(generic-y)) redundant := $(filter $(mandatory-y) $(generated-y), $(generic-y))