kbuild: force all architectures except um to include mandatory-y
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Sun, 17 Mar 2019 02:01:09 +0000 (11:01 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Sun, 17 Mar 2019 03:56:32 +0000 (12:56 +0900)
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>
30 files changed:
Documentation/kbuild/makefiles.txt
Makefile
arch/alpha/include/uapi/asm/Kbuild
arch/arc/include/uapi/asm/Kbuild
arch/arm/include/uapi/asm/Kbuild
arch/arm64/include/uapi/asm/Kbuild
arch/c6x/include/uapi/asm/Kbuild
arch/csky/include/uapi/asm/Kbuild
arch/h8300/include/uapi/asm/Kbuild
arch/hexagon/include/uapi/asm/Kbuild
arch/ia64/include/uapi/asm/Kbuild
arch/m68k/include/uapi/asm/Kbuild
arch/microblaze/include/uapi/asm/Kbuild
arch/mips/include/uapi/asm/Kbuild
arch/nds32/include/uapi/asm/Kbuild
arch/nios2/include/uapi/asm/Kbuild
arch/openrisc/include/uapi/asm/Kbuild
arch/parisc/include/uapi/asm/Kbuild
arch/powerpc/include/uapi/asm/Kbuild
arch/riscv/include/uapi/asm/Kbuild
arch/s390/include/uapi/asm/Kbuild
arch/sh/include/uapi/asm/Kbuild
arch/sparc/include/uapi/asm/Kbuild
arch/unicore32/include/uapi/asm/Kbuild
arch/x86/include/uapi/asm/Kbuild
arch/xtensa/include/uapi/asm/Kbuild
include/asm-generic/Kbuild [new file with mode: 0644]
include/uapi/asm-generic/Kbuild [new file with mode: 0644]
include/uapi/asm-generic/Kbuild.asm [deleted file]
scripts/Makefile.asm-generic

index f124be6e4c3a8d59e854d45df5d9314b0db48aa2..03c065855eafb39e00179626bfd2a5106a945079 100644 (file)
@@ -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
index 08a01add09a6606bcf0dae19923fbfa5a6cb79c6..4f45ae628f5415100a34b5f950101bdeeaa7647c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -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)
index 439f5157aa35fe373149a61a9391e838598a99ac..7417847dc438e5ff6aff14f04094a1323d6b933f 100644 (file)
@@ -1,3 +1 @@
-include include/uapi/asm-generic/Kbuild.asm
-
 generated-y += unistd_32.h
index 0febf1a07c30a7df64bd64806151f91de123da45..755bb11323d8feb92d12349bf444f151cd8acc29 100644 (file)
@@ -1,4 +1,2 @@
-include include/uapi/asm-generic/Kbuild.asm
-
 generic-y += kvm_para.h
 generic-y += ucontext.h
index eee8f7d23899295350959c5e60c47d52d7ff424f..23b4464c0995ab3ed1673f7aa36e16a3554e296a 100644 (file)
@@ -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
index 87eea29b24ab9d110d5f078e8295fee40ebea8f2..602d137932dcef659fc39c6eef6160bc2182f25b 100644 (file)
@@ -1,4 +1,3 @@
 # SPDX-License-Identifier: GPL-2.0
-include include/uapi/asm-generic/Kbuild.asm
 
 generic-y += kvm_para.h
index 0febf1a07c30a7df64bd64806151f91de123da45..755bb11323d8feb92d12349bf444f151cd8acc29 100644 (file)
@@ -1,4 +1,2 @@
-include include/uapi/asm-generic/Kbuild.asm
-
 generic-y += kvm_para.h
 generic-y += ucontext.h
index c1b06dcf6cf8e816552895882094f09e44afc77b..1c72f04ff75da1a7f6918f00b14116a183a79313 100644 (file)
@@ -1,3 +1 @@
-include include/uapi/asm-generic/Kbuild.asm
-
 generic-y += ucontext.h
index 0febf1a07c30a7df64bd64806151f91de123da45..755bb11323d8feb92d12349bf444f151cd8acc29 100644 (file)
@@ -1,4 +1,2 @@
-include include/uapi/asm-generic/Kbuild.asm
-
 generic-y += kvm_para.h
 generic-y += ucontext.h
index c1b06dcf6cf8e816552895882094f09e44afc77b..1c72f04ff75da1a7f6918f00b14116a183a79313 100644 (file)
@@ -1,3 +1 @@
-include include/uapi/asm-generic/Kbuild.asm
-
 generic-y += ucontext.h
index 5b819e53c397cd9afe570aa64a2f777d85fd6cb9..20018cb883a90981565284ac1d5d9df51c38e987 100644 (file)
@@ -1,4 +1,2 @@
-include include/uapi/asm-generic/Kbuild.asm
-
 generated-y += unistd_64.h
 generic-y += kvm_para.h
index 960bf1e4be530b383da54074990d7a05dd9f34e2..8a7ad40be463656854310b85dbba06d5f9b8e189 100644 (file)
@@ -1,4 +1,2 @@
-include include/uapi/asm-generic/Kbuild.asm
-
 generated-y += unistd_32.h
 generic-y += kvm_para.h
index 97823ec46e97c02d45cd30168b930e3a9904d733..3ce84fbb2678f2194de4e81504494045a00915ed 100644 (file)
@@ -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
index 0851c103a8cedcd965dc8f2d6133d28860a83fcf..c3798bfe04862f182ee059ce1122d05e13c47166 100644 (file)
@@ -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
index c1b06dcf6cf8e816552895882094f09e44afc77b..1c72f04ff75da1a7f6918f00b14116a183a79313 100644 (file)
@@ -1,3 +1 @@
-include include/uapi/asm-generic/Kbuild.asm
-
 generic-y += ucontext.h
index 0febf1a07c30a7df64bd64806151f91de123da45..755bb11323d8feb92d12349bf444f151cd8acc29 100644 (file)
@@ -1,4 +1,2 @@
-include include/uapi/asm-generic/Kbuild.asm
-
 generic-y += kvm_para.h
 generic-y += ucontext.h
index 0febf1a07c30a7df64bd64806151f91de123da45..755bb11323d8feb92d12349bf444f151cd8acc29 100644 (file)
@@ -1,4 +1,2 @@
-include include/uapi/asm-generic/Kbuild.asm
-
 generic-y += kvm_para.h
 generic-y += ucontext.h
index c54353d390ff1fc37daacada4e60a2b14770e972..22fdbd08cdc8551777459efe75c49bbfa1e3f95a 100644 (file)
@@ -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
index 214a39acdf256527c81fd0b9def42fcbf16ae422..2bd5b392277c2cf5c4a52f3d0b7d9aaed7382f44 100644 (file)
@@ -1,4 +1,2 @@
-include include/uapi/asm-generic/Kbuild.asm
-
 generated-y += unistd_32.h
 generated-y += unistd_64.h
index d2ee86b4c091c7bcde862f8b34cb822570468d98..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1 +0,0 @@
-include include/uapi/asm-generic/Kbuild.asm
index da3e0d48abbc3314269dcc5b3069e8759ce16ec4..46c1ff0b842a17d379c37eb4ad5420777d2e39d8 100644 (file)
@@ -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
index eaa30bcd93bf0e4a7c04a385cf17518c4c723375..ecfbd40924dd948f97985e65daa18216c123c424 100644 (file)
@@ -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
index 214a39acdf256527c81fd0b9def42fcbf16ae422..2bd5b392277c2cf5c4a52f3d0b7d9aaed7382f44 100644 (file)
@@ -1,4 +1,2 @@
-include include/uapi/asm-generic/Kbuild.asm
-
 generated-y += unistd_32.h
 generated-y += unistd_64.h
index 0febf1a07c30a7df64bd64806151f91de123da45..755bb11323d8feb92d12349bf444f151cd8acc29 100644 (file)
@@ -1,4 +1,2 @@
-include include/uapi/asm-generic/Kbuild.asm
-
 generic-y += kvm_para.h
 generic-y += ucontext.h
index f6648e9928b316b79f7fa7fffe55284d26466283..59b5ad310f780d07f4f321a84c322f9b230c040f 100644 (file)
@@ -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
index 960bf1e4be530b383da54074990d7a05dd9f34e2..8a7ad40be463656854310b85dbba06d5f9b8e189 100644 (file)
@@ -1,4 +1,2 @@
-include include/uapi/asm-generic/Kbuild.asm
-
 generated-y += unistd_32.h
 generic-y += kvm_para.h
diff --git a/include/asm-generic/Kbuild b/include/asm-generic/Kbuild
new file mode 100644 (file)
index 0000000..6f4536d
--- /dev/null
@@ -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.)
diff --git a/include/uapi/asm-generic/Kbuild b/include/uapi/asm-generic/Kbuild
new file mode 100644 (file)
index 0000000..ebb180a
--- /dev/null
@@ -0,0 +1,36 @@
+# 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
+mandatory-y += byteorder.h
+mandatory-y += errno.h
+mandatory-y += fcntl.h
+mandatory-y += ioctl.h
+mandatory-y += ioctls.h
+mandatory-y += ipcbuf.h
+mandatory-y += mman.h
+mandatory-y += msgbuf.h
+mandatory-y += param.h
+mandatory-y += poll.h
+mandatory-y += posix_types.h
+mandatory-y += ptrace.h
+mandatory-y += resource.h
+mandatory-y += sembuf.h
+mandatory-y += setup.h
+mandatory-y += shmbuf.h
+mandatory-y += sigcontext.h
+mandatory-y += siginfo.h
+mandatory-y += signal.h
+mandatory-y += socket.h
+mandatory-y += sockios.h
+mandatory-y += stat.h
+mandatory-y += statfs.h
+mandatory-y += swab.h
+mandatory-y += termbits.h
+mandatory-y += termios.h
+mandatory-y += types.h
+mandatory-y += unistd.h
diff --git a/include/uapi/asm-generic/Kbuild.asm b/include/uapi/asm-generic/Kbuild.asm
deleted file mode 100644 (file)
index 355c4ac..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-# Headers that are mandatory in usr/include/asm/
-#
-mandatory-y += auxvec.h
-mandatory-y += bitsperlong.h
-mandatory-y += bpf_perf_event.h
-mandatory-y += byteorder.h
-mandatory-y += errno.h
-mandatory-y += fcntl.h
-mandatory-y += ioctl.h
-mandatory-y += ioctls.h
-mandatory-y += ipcbuf.h
-mandatory-y += mman.h
-mandatory-y += msgbuf.h
-mandatory-y += param.h
-mandatory-y += poll.h
-mandatory-y += posix_types.h
-mandatory-y += ptrace.h
-mandatory-y += resource.h
-mandatory-y += sembuf.h
-mandatory-y += setup.h
-mandatory-y += shmbuf.h
-mandatory-y += sigcontext.h
-mandatory-y += siginfo.h
-mandatory-y += signal.h
-mandatory-y += socket.h
-mandatory-y += sockios.h
-mandatory-y += stat.h
-mandatory-y += statfs.h
-mandatory-y += swab.h
-mandatory-y += termbits.h
-mandatory-y += termios.h
-mandatory-y += types.h
-mandatory-y += unistd.h
index c7d2b7acad26c2a2bf52c0d66f5c086d6a51a99c..82ad63dcd62b4733ab7370306ceb4407575651eb 100644 (file)
@@ -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))