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.
Unified · Split
| @@ -289,6 +289,13 @@ config ARCH_32BIT_OFF_T · 288 unmodified lines | ||
| 289 | 289 | still support 32-bit off_t. This option is enabled for all such |
| 290 | 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 | 299 | config HAVE_REGS_AND_STACK_ACCESS_API |
| 293 | 300 | bool |
| 294 | 301 | help |
| @@ -11,6 +11,7 @@ config ALPHA · 10 unmodified lines | ||
| 11 | 11 | select PCI_DOMAINS if PCI |
| 12 | 12 | select PCI_SYSCALL if PCI |
| 13 | 13 | select HAVE_AOUT |
| 14 | + select HAVE_ASM_MODVERSIONS | |
| 14 | 15 | select HAVE_IDE |
| 15 | 16 | select HAVE_OPROFILE |
| 16 | 17 | select HAVE_PCSPKR_PLATFORM |
| @@ -135,6 +135,7 @@ config ARM64 · 134 unmodified lines | ||
| 135 | 135 | select HAVE_ARCH_TRANSPARENT_HUGEPAGE |
| 136 | 136 | select HAVE_ARCH_VMAP_STACK |
| 137 | 137 | select HAVE_ARM_SMCCC |
| 138 | + select HAVE_ASM_MODVERSIONS | |
| 138 | 139 | select HAVE_EBPF_JIT |
| 139 | 140 | select HAVE_C_RECORDMCOUNT |
| 140 | 141 | select HAVE_CMPXCHG_DOUBLE |
| @@ -17,6 +17,7 @@ config IA64 · 16 unmodified lines | ||
| 17 | 17 | select FORCE_PCI if (!IA64_HP_SIM) |
| 18 | 18 | select PCI_DOMAINS if PCI |
| 19 | 19 | select PCI_SYSCALL if PCI |
| 20 | + select HAVE_ASM_MODVERSIONS | |
| 20 | 21 | select HAVE_UNSTABLE_SCHED_CLOCK |
| 21 | 22 | select HAVE_EXIT_THREAD |
| 22 | 23 | select HAVE_IDE |
| @@ -14,6 +14,7 @@ config M68K · 13 unmodified lines | ||
| 14 | 14 | select DMA_DIRECT_REMAP if HAS_DMA && MMU && !COLDFIRE |
| 15 | 15 | select HAVE_IDE |
| 16 | 16 | select HAVE_AOUT if MMU |
| 17 | + select HAVE_ASM_MODVERSIONS | |
| 17 | 18 | select HAVE_DEBUG_BUGVERBOSE |
| 18 | 19 | select GENERIC_IRQ_SHOW |
| 19 | 20 | select GENERIC_ATOMIC64 |
| @@ -44,6 +44,7 @@ config MIPS · 43 unmodified lines | ||
| 44 | 44 | select HAVE_ARCH_SECCOMP_FILTER |
| 45 | 45 | select HAVE_ARCH_TRACEHOOK |
| 46 | 46 | select HAVE_ARCH_TRANSPARENT_HUGEPAGE if CPU_SUPPORTS_HUGEPAGES && 64BIT |
| 47 | + select HAVE_ASM_MODVERSIONS | |
| 47 | 48 | select HAVE_EBPF_JIT if (!CPU_MICROMIPS) |
| 48 | 49 | select HAVE_CONTEXT_TRACKING |
| 49 | 50 | select HAVE_COPY_THREAD_TLS |
| @@ -178,6 +178,7 @@ config PPC · 177 unmodified lines | ||
| 178 | 178 | select HAVE_ARCH_NVRAM_OPS |
| 179 | 179 | select HAVE_ARCH_SECCOMP_FILTER |
| 180 | 180 | select HAVE_ARCH_TRACEHOOK |
| 181 | + select HAVE_ASM_MODVERSIONS | |
| 181 | 182 | select HAVE_C_RECORDMCOUNT |
| 182 | 183 | select HAVE_CBPF_JIT if !PPC64 |
| 183 | 184 | select HAVE_STACKPROTECTOR if PPC64 && $(cc-option,-mstack-protector-guard=tls -mstack-protector-guard-reg=r13) |
| @@ -31,6 +31,7 @@ config RISCV · 30 unmodified lines | ||
| 31 | 31 | select GENERIC_SMP_IDLE_THREAD |
| 32 | 32 | select GENERIC_ATOMIC64 if !64BIT |
| 33 | 33 | select HAVE_ARCH_AUDITSYSCALL |
| 34 | + select HAVE_ASM_MODVERSIONS | |
| 34 | 35 | select HAVE_MEMBLOCK_NODE_MAP |
| 35 | 36 | select HAVE_DMA_CONTIGUOUS |
| 36 | 37 | select HAVE_FUTEX_CMPXCHG if FUTEX |
| @@ -131,6 +131,7 @@ config S390 · 130 unmodified lines | ||
| 131 | 131 | select HAVE_ARCH_TRACEHOOK |
| 132 | 132 | select HAVE_ARCH_TRANSPARENT_HUGEPAGE |
| 133 | 133 | select HAVE_ARCH_VMAP_STACK |
| 134 | + select HAVE_ASM_MODVERSIONS | |
| 134 | 135 | select HAVE_EBPF_JIT if PACK_STACK && HAVE_MARCH_Z196_FEATURES |
| 135 | 136 | select HAVE_CMPXCHG_DOUBLE |
| 136 | 137 | select HAVE_CMPXCHG_LOCAL |
| @@ -17,6 +17,7 @@ config SPARC · 16 unmodified lines | ||
| 17 | 17 | select ARCH_MIGHT_HAVE_PC_SERIO |
| 18 | 18 | select OF |
| 19 | 19 | select OF_PROMTREE |
| 20 | + select HAVE_ASM_MODVERSIONS | |
| 20 | 21 | select HAVE_IDE |
| 21 | 22 | select HAVE_OPROFILE |
| 22 | 23 | select HAVE_ARCH_KGDB if !SMP || SPARC64 |
| @@ -9,6 +9,7 @@ config UML · 8 unmodified lines | ||
| 9 | 9 | select ARCH_NO_PREEMPT |
| 10 | 10 | select HAVE_ARCH_AUDITSYSCALL |
| 11 | 11 | select HAVE_ARCH_SECCOMP_FILTER |
| 12 | + select HAVE_ASM_MODVERSIONS | |
| 12 | 13 | select HAVE_UID16 |
| 13 | 14 | select HAVE_FUTEX_CMPXCHG if FUTEX |
| 14 | 15 | select HAVE_DEBUG_KMEMLEAK |
| @@ -147,6 +147,7 @@ config X86 · 146 unmodified lines | ||
| 147 | 147 | select HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD if X86_64 |
| 148 | 148 | select HAVE_ARCH_VMAP_STACK if X86_64 |
| 149 | 149 | select HAVE_ARCH_WITHIN_STACK_FRAMES |
| 150 | + select HAVE_ASM_MODVERSIONS | |
| 150 | 151 | select HAVE_CMPXCHG_DOUBLE |
| 151 | 152 | select HAVE_CMPXCHG_LOCAL |
| 152 | 153 | select HAVE_CONTEXT_TRACKING if X86_64 |
| @@ -1989,6 +1989,14 @@ config MODVERSIONS · 1988 unmodified lines | ||
| 1989 | 1989 | make them incompatible with the kernel you are running. If |
| 1990 | 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 | 2000 | config MODULE_REL_CRCS |
| 1993 | 2001 | bool |
| 1994 | 2002 | depends on MODVERSIONS |
| @@ -349,11 +349,7 @@ $(obj)/%.s: $(src)/%.S FORCE · 348 unmodified lines | ||
| 349 | 349 | quiet_cmd_as_o_S = AS $(quiet_modtag) $@ |
| 350 | 350 | cmd_as_o_S = $(CC) $(a_flags) -c -o $@ $< |
| 351 | 351 | |
| 352 | −ifdef CONFIG_MODVERSIONS | |
| 353 | − | |
| 354 | −ASM_PROTOTYPES := $(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/asm-prototypes.h) | |
| 355 | − | |
| 356 | −ifneq ($(ASM_PROTOTYPES),) | |
| 352 | +ifdef CONFIG_ASM_MODVERSIONS | |
| 357 | 353 | |
| 358 | 354 | # versioning matches the C process described above, with difference that |
| 359 | 355 | # we parse asm-prototypes.h C header to get function definitions. |
| @@ -369,7 +365,6 @@ cmd_modversions_S = \ · 9 unmodified lines | ||
| 369 | 365 | rm -f $(@D)/.tmp_$(@F:.o=.ver); \ |
| 370 | 366 | fi |
| 371 | 367 | endif |
| 372 | −endif | |
| 373 | 368 | |
| 374 | 369 | $(obj)/%.o: $(src)/%.S $(objtool_dep) FORCE |
| 375 | 370 | $(call if_changed_rule,as_o_S) |