linux/arch/arm64
Masahiro Yamada 56769ba4b2 kbuild: unify vdso_install rules
Currently, there is no standard implementation for vdso_install,
leading to various issues:

 1. Code duplication

    Many architectures duplicate similar code just for copying files
    to the install destination.

    Some architectures (arm, sparc, x86) create build-id symlinks,
    introducing more code duplication.

 2. Unintended updates of in-tree build artifacts

    The vdso_install rule depends on the vdso files to install.
    It may update in-tree build artifacts. This can be problematic,
    as explained in commit 19514fc665 ("arm, kbuild: make
    "make install" not depend on vmlinux").

 3. Broken code in some architectures

    Makefile code is often copied from one architecture to another
    without proper adaptation.

    'make vdso_install' for parisc does not work.

    'make vdso_install' for s390 installs vdso64, but not vdso32.

To address these problems, this commit introduces a generic vdso_install
rule.

Architectures that support vdso_install need to define vdso-install-y
in arch/*/Makefile. vdso-install-y lists the files to install.

For example, arch/x86/Makefile looks like this:

  vdso-install-$(CONFIG_X86_64)           += arch/x86/entry/vdso/vdso64.so.dbg
  vdso-install-$(CONFIG_X86_X32_ABI)      += arch/x86/entry/vdso/vdsox32.so.dbg
  vdso-install-$(CONFIG_X86_32)           += arch/x86/entry/vdso/vdso32.so.dbg
  vdso-install-$(CONFIG_IA32_EMULATION)   += arch/x86/entry/vdso/vdso32.so.dbg

These files will be installed to $(MODLIB)/vdso/ with the .dbg suffix,
if exists, stripped away.

vdso-install-y can optionally take the second field after the colon
separator. This is needed because some architectures install a vdso
file as a different base name.

The following is a snippet from arch/arm64/Makefile.

  vdso-install-$(CONFIG_COMPAT_VDSO)      += arch/arm64/kernel/vdso32/vdso.so.dbg:vdso32.so

This will rename vdso.so.dbg to vdso32.so during installation. If such
architectures change their implementation so that the base names match,
this workaround will go away.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Acked-by: Sven Schnelle <svens@linux.ibm.com> # s390
Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
Reviewed-by: Guo Ren <guoren@kernel.org>
Acked-by: Helge Deller <deller@gmx.de>  # parisc
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2023-10-28 21:09:02 +09:00
..
boot i.MX fixes for 6.6: 2023-09-27 11:02:51 +02:00
configs arm64: defconfig: enable syscon-poweroff driver 2023-09-28 09:17:05 +02:00
crypto crypto: arm64/aes - remove Makefile hack 2023-08-11 19:19:27 +08:00
hyperv arm64/hyperv: Use CPUHP_AP_HYPERV_ONLINE state to fix CPU online sequencing 2023-06-17 23:09:47 +00:00
include Fourteen hotfixes, eleven of which are cc:stable. The remainder pertain 2023-10-01 13:33:25 -07:00
kernel kbuild: unify vdso_install rules 2023-10-28 21:09:02 +09:00
kvm KVM: arm64: nvhe: Ignore SVE hint in SMCCC function ID 2023-09-12 13:07:37 +01:00
lib arm64 fixes for -rc1 2023-09-08 12:48:37 -07:00
mm arm64: hugetlb: fix set_huge_pte_at() to work with all swap entries 2023-09-29 17:20:47 -07:00
net bpf, arm64: Support signed div/mod instructions 2023-08-18 15:46:35 +02:00
tools arm64: cpufeature: Fix CLRBHB and BC detection 2023-09-18 10:45:11 +01:00
xen
Kbuild
Kconfig - An extensive rework of kexec and crash Kconfig from Eric DeVolder 2023-08-29 14:53:51 -07:00
Kconfig.debug
Kconfig.platforms STM32 STM32MP25 for v6.5, round 1 2023-06-20 22:28:44 +02:00
Makefile kbuild: unify vdso_install rules 2023-10-28 21:09:02 +09:00