diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2019-08-19 01:54:20 -0400 |
---|---|---|
committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2019-08-21 12:14:11 -0400 |
commit | 2ff2b7ec65dcea2261bdf404654975f44ad6323d (patch) | |
tree | 43ef958cd89c58f0d02c132d97302b7df03eb98a | |
parent | a564bdeb5e0d79dbcebb9a138e7b9f2d7ed97df9 (diff) |
kbuild: add CONFIG_ASM_MODVERSIONS
Add CONFIG_ASM_MODVERSIONS. This allows to remove one if-conditional
nesting in scripts/Makefile.build.
scripts/Makefile.build is run every time Kbuild descends into a
sub-directory. So, I want to avoid $(wildcard ...) evaluation
where possible although computing $(wildcard ...) is so cheap that
it may not make measurable performance difference.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
-rw-r--r-- | arch/Kconfig | 7 | ||||
-rw-r--r-- | arch/alpha/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm64/Kconfig | 1 | ||||
-rw-r--r-- | arch/ia64/Kconfig | 1 | ||||
-rw-r--r-- | arch/m68k/Kconfig | 1 | ||||
-rw-r--r-- | arch/mips/Kconfig | 1 | ||||
-rw-r--r-- | arch/powerpc/Kconfig | 1 | ||||
-rw-r--r-- | arch/riscv/Kconfig | 1 | ||||
-rw-r--r-- | arch/s390/Kconfig | 1 | ||||
-rw-r--r-- | arch/sparc/Kconfig | 1 | ||||
-rw-r--r-- | arch/um/Kconfig | 1 | ||||
-rw-r--r-- | arch/x86/Kconfig | 1 | ||||
-rw-r--r-- | init/Kconfig | 8 | ||||
-rw-r--r-- | scripts/Makefile.build | 7 |
14 files changed, 27 insertions, 6 deletions
diff --git a/arch/Kconfig b/arch/Kconfig index a7b57dd42c26..7d7b1b6af851 100644 --- a/arch/Kconfig +++ b/arch/Kconfig | |||
@@ -289,6 +289,13 @@ config ARCH_32BIT_OFF_T | |||
289 | still support 32-bit off_t. This option is enabled for all such | 289 | still support 32-bit off_t. This option is enabled for all such |
290 | architectures explicitly. | 290 | architectures explicitly. |
291 | 291 | ||
292 | config HAVE_ASM_MODVERSIONS | ||
293 | bool | ||
294 | help | ||
295 | This symbol should be selected by an architecure if it provides | ||
296 | <asm/asm-prototypes.h> to support the module versioning for symbols | ||
297 | exported from assembly code. | ||
298 | |||
292 | config HAVE_REGS_AND_STACK_ACCESS_API | 299 | config HAVE_REGS_AND_STACK_ACCESS_API |
293 | bool | 300 | bool |
294 | help | 301 | help |
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig index f7b19b813a70..ef179033a7c2 100644 --- a/arch/alpha/Kconfig +++ b/arch/alpha/Kconfig | |||
@@ -11,6 +11,7 @@ config ALPHA | |||
11 | select PCI_DOMAINS if PCI | 11 | select PCI_DOMAINS if PCI |
12 | select PCI_SYSCALL if PCI | 12 | select PCI_SYSCALL if PCI |
13 | select HAVE_AOUT | 13 | select HAVE_AOUT |
14 | select HAVE_ASM_MODVERSIONS | ||
14 | select HAVE_IDE | 15 | select HAVE_IDE |
15 | select HAVE_OPROFILE | 16 | select HAVE_OPROFILE |
16 | select HAVE_PCSPKR_PLATFORM | 17 | select HAVE_PCSPKR_PLATFORM |
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 3adcec05b1f6..cb16d4ade6aa 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig | |||
@@ -135,6 +135,7 @@ config ARM64 | |||
135 | select HAVE_ARCH_TRANSPARENT_HUGEPAGE | 135 | select HAVE_ARCH_TRANSPARENT_HUGEPAGE |
136 | select HAVE_ARCH_VMAP_STACK | 136 | select HAVE_ARCH_VMAP_STACK |
137 | select HAVE_ARM_SMCCC | 137 | select HAVE_ARM_SMCCC |
138 | select HAVE_ASM_MODVERSIONS | ||
138 | select HAVE_EBPF_JIT | 139 | select HAVE_EBPF_JIT |
139 | select HAVE_C_RECORDMCOUNT | 140 | select HAVE_C_RECORDMCOUNT |
140 | select HAVE_CMPXCHG_DOUBLE | 141 | select HAVE_CMPXCHG_DOUBLE |
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig index 7468d8e50467..3dead116a6d7 100644 --- a/arch/ia64/Kconfig +++ b/arch/ia64/Kconfig | |||
@@ -17,6 +17,7 @@ config IA64 | |||
17 | select FORCE_PCI if (!IA64_HP_SIM) | 17 | select FORCE_PCI if (!IA64_HP_SIM) |
18 | select PCI_DOMAINS if PCI | 18 | select PCI_DOMAINS if PCI |
19 | select PCI_SYSCALL if PCI | 19 | select PCI_SYSCALL if PCI |
20 | select HAVE_ASM_MODVERSIONS | ||
20 | select HAVE_UNSTABLE_SCHED_CLOCK | 21 | select HAVE_UNSTABLE_SCHED_CLOCK |
21 | select HAVE_EXIT_THREAD | 22 | select HAVE_EXIT_THREAD |
22 | select HAVE_IDE | 23 | select HAVE_IDE |
diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig index c518d695c376..00a20fa0bdcc 100644 --- a/arch/m68k/Kconfig +++ b/arch/m68k/Kconfig | |||
@@ -14,6 +14,7 @@ config M68K | |||
14 | select DMA_DIRECT_REMAP if HAS_DMA && MMU && !COLDFIRE | 14 | select DMA_DIRECT_REMAP if HAS_DMA && MMU && !COLDFIRE |
15 | select HAVE_IDE | 15 | select HAVE_IDE |
16 | select HAVE_AOUT if MMU | 16 | select HAVE_AOUT if MMU |
17 | select HAVE_ASM_MODVERSIONS | ||
17 | select HAVE_DEBUG_BUGVERBOSE | 18 | select HAVE_DEBUG_BUGVERBOSE |
18 | select GENERIC_IRQ_SHOW | 19 | select GENERIC_IRQ_SHOW |
19 | select GENERIC_ATOMIC64 | 20 | select GENERIC_ATOMIC64 |
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index d50fafd7bf3a..3db919b5c93a 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig | |||
@@ -44,6 +44,7 @@ config MIPS | |||
44 | select HAVE_ARCH_SECCOMP_FILTER | 44 | select HAVE_ARCH_SECCOMP_FILTER |
45 | select HAVE_ARCH_TRACEHOOK | 45 | select HAVE_ARCH_TRACEHOOK |
46 | select HAVE_ARCH_TRANSPARENT_HUGEPAGE if CPU_SUPPORTS_HUGEPAGES && 64BIT | 46 | select HAVE_ARCH_TRANSPARENT_HUGEPAGE if CPU_SUPPORTS_HUGEPAGES && 64BIT |
47 | select HAVE_ASM_MODVERSIONS | ||
47 | select HAVE_EBPF_JIT if (!CPU_MICROMIPS) | 48 | select HAVE_EBPF_JIT if (!CPU_MICROMIPS) |
48 | select HAVE_CONTEXT_TRACKING | 49 | select HAVE_CONTEXT_TRACKING |
49 | select HAVE_COPY_THREAD_TLS | 50 | select HAVE_COPY_THREAD_TLS |
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 77f6ebf97113..5be32ad8f47b 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig | |||
@@ -178,6 +178,7 @@ config PPC | |||
178 | select HAVE_ARCH_NVRAM_OPS | 178 | select HAVE_ARCH_NVRAM_OPS |
179 | select HAVE_ARCH_SECCOMP_FILTER | 179 | select HAVE_ARCH_SECCOMP_FILTER |
180 | select HAVE_ARCH_TRACEHOOK | 180 | select HAVE_ARCH_TRACEHOOK |
181 | select HAVE_ASM_MODVERSIONS | ||
181 | select HAVE_C_RECORDMCOUNT | 182 | select HAVE_C_RECORDMCOUNT |
182 | select HAVE_CBPF_JIT if !PPC64 | 183 | select HAVE_CBPF_JIT if !PPC64 |
183 | select HAVE_STACKPROTECTOR if PPC64 && $(cc-option,-mstack-protector-guard=tls -mstack-protector-guard-reg=r13) | 184 | select HAVE_STACKPROTECTOR if PPC64 && $(cc-option,-mstack-protector-guard=tls -mstack-protector-guard-reg=r13) |
diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 59a4727ecd6c..66603f02675a 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig | |||
@@ -31,6 +31,7 @@ config RISCV | |||
31 | select GENERIC_SMP_IDLE_THREAD | 31 | select GENERIC_SMP_IDLE_THREAD |
32 | select GENERIC_ATOMIC64 if !64BIT | 32 | select GENERIC_ATOMIC64 if !64BIT |
33 | select HAVE_ARCH_AUDITSYSCALL | 33 | select HAVE_ARCH_AUDITSYSCALL |
34 | select HAVE_ASM_MODVERSIONS | ||
34 | select HAVE_MEMBLOCK_NODE_MAP | 35 | select HAVE_MEMBLOCK_NODE_MAP |
35 | select HAVE_DMA_CONTIGUOUS | 36 | select HAVE_DMA_CONTIGUOUS |
36 | select HAVE_FUTEX_CMPXCHG if FUTEX | 37 | select HAVE_FUTEX_CMPXCHG if FUTEX |
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index a4ad2733eedf..c06ebe34e0f9 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig | |||
@@ -131,6 +131,7 @@ config S390 | |||
131 | select HAVE_ARCH_TRACEHOOK | 131 | select HAVE_ARCH_TRACEHOOK |
132 | select HAVE_ARCH_TRANSPARENT_HUGEPAGE | 132 | select HAVE_ARCH_TRANSPARENT_HUGEPAGE |
133 | select HAVE_ARCH_VMAP_STACK | 133 | select HAVE_ARCH_VMAP_STACK |
134 | select HAVE_ASM_MODVERSIONS | ||
134 | select HAVE_EBPF_JIT if PACK_STACK && HAVE_MARCH_Z196_FEATURES | 135 | select HAVE_EBPF_JIT if PACK_STACK && HAVE_MARCH_Z196_FEATURES |
135 | select HAVE_CMPXCHG_DOUBLE | 136 | select HAVE_CMPXCHG_DOUBLE |
136 | select HAVE_CMPXCHG_LOCAL | 137 | select HAVE_CMPXCHG_LOCAL |
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index 7926a2e11bdc..fbc1aecf0f94 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig | |||
@@ -17,6 +17,7 @@ config SPARC | |||
17 | select ARCH_MIGHT_HAVE_PC_SERIO | 17 | select ARCH_MIGHT_HAVE_PC_SERIO |
18 | select OF | 18 | select OF |
19 | select OF_PROMTREE | 19 | select OF_PROMTREE |
20 | select HAVE_ASM_MODVERSIONS | ||
20 | select HAVE_IDE | 21 | select HAVE_IDE |
21 | select HAVE_OPROFILE | 22 | select HAVE_OPROFILE |
22 | select HAVE_ARCH_KGDB if !SMP || SPARC64 | 23 | select HAVE_ARCH_KGDB if !SMP || SPARC64 |
diff --git a/arch/um/Kconfig b/arch/um/Kconfig index 3c3adfc486f2..fec6b4ca2b6e 100644 --- a/arch/um/Kconfig +++ b/arch/um/Kconfig | |||
@@ -9,6 +9,7 @@ config UML | |||
9 | select ARCH_NO_PREEMPT | 9 | select ARCH_NO_PREEMPT |
10 | select HAVE_ARCH_AUDITSYSCALL | 10 | select HAVE_ARCH_AUDITSYSCALL |
11 | select HAVE_ARCH_SECCOMP_FILTER | 11 | select HAVE_ARCH_SECCOMP_FILTER |
12 | select HAVE_ASM_MODVERSIONS | ||
12 | select HAVE_UID16 | 13 | select HAVE_UID16 |
13 | select HAVE_FUTEX_CMPXCHG if FUTEX | 14 | select HAVE_FUTEX_CMPXCHG if FUTEX |
14 | select HAVE_DEBUG_KMEMLEAK | 15 | select HAVE_DEBUG_KMEMLEAK |
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 222855cc0158..66bb9f25e9df 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
@@ -147,6 +147,7 @@ config X86 | |||
147 | select HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD if X86_64 | 147 | select HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD if X86_64 |
148 | select HAVE_ARCH_VMAP_STACK if X86_64 | 148 | select HAVE_ARCH_VMAP_STACK if X86_64 |
149 | select HAVE_ARCH_WITHIN_STACK_FRAMES | 149 | select HAVE_ARCH_WITHIN_STACK_FRAMES |
150 | select HAVE_ASM_MODVERSIONS | ||
150 | select HAVE_CMPXCHG_DOUBLE | 151 | select HAVE_CMPXCHG_DOUBLE |
151 | select HAVE_CMPXCHG_LOCAL | 152 | select HAVE_CMPXCHG_LOCAL |
152 | select HAVE_CONTEXT_TRACKING if X86_64 | 153 | select HAVE_CONTEXT_TRACKING if X86_64 |
diff --git a/init/Kconfig b/init/Kconfig index bd7d650d4a99..bf971b5c707d 100644 --- a/init/Kconfig +++ b/init/Kconfig | |||
@@ -1989,6 +1989,14 @@ config MODVERSIONS | |||
1989 | make them incompatible with the kernel you are running. If | 1989 | make them incompatible with the kernel you are running. If |
1990 | unsure, say N. | 1990 | unsure, say N. |
1991 | 1991 | ||
1992 | config ASM_MODVERSIONS | ||
1993 | bool | ||
1994 | default HAVE_ASM_MODVERSIONS && MODVERSIONS | ||
1995 | help | ||
1996 | This enables module versioning for exported symbols also from | ||
1997 | assembly. This can be enabled only when the target architecture | ||
1998 | supports it. | ||
1999 | |||
1992 | config MODULE_REL_CRCS | 2000 | config MODULE_REL_CRCS |
1993 | bool | 2001 | bool |
1994 | depends on MODVERSIONS | 2002 | depends on MODVERSIONS |
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 10adf3b558de..9fa09361aa5d 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build | |||
@@ -349,11 +349,7 @@ $(obj)/%.s: $(src)/%.S FORCE | |||
349 | quiet_cmd_as_o_S = AS $(quiet_modtag) $@ | 349 | quiet_cmd_as_o_S = AS $(quiet_modtag) $@ |
350 | cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $< | 350 | cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $< |
351 | 351 | ||
352 | ifdef CONFIG_MODVERSIONS | 352 | ifdef CONFIG_ASM_MODVERSIONS |
353 | |||
354 | ASM_PROTOTYPES := $(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/asm-prototypes.h) | ||
355 | |||
356 | ifneq ($(ASM_PROTOTYPES),) | ||
357 | 353 | ||
358 | # versioning matches the C process described above, with difference that | 354 | # versioning matches the C process described above, with difference that |
359 | # we parse asm-prototypes.h C header to get function definitions. | 355 | # we parse asm-prototypes.h C header to get function definitions. |
@@ -369,7 +365,6 @@ cmd_modversions_S = \ | |||
369 | rm -f $(@D)/.tmp_$(@F:.o=.ver); \ | 365 | rm -f $(@D)/.tmp_$(@F:.o=.ver); \ |
370 | fi | 366 | fi |
371 | endif | 367 | endif |
372 | endif | ||
373 | 368 | ||
374 | $(obj)/%.o: $(src)/%.S $(objtool_dep) FORCE | 369 | $(obj)/%.o: $(src)/%.S $(objtool_dep) FORCE |
375 | $(call if_changed_rule,as_o_S) | 370 | $(call if_changed_rule,as_o_S) |