Re: [PATCH 4/5] kbuild: unify vdso_install rules

From: Masahiro Yamada
Date: Wed Oct 11 2023 - 08:53:26 EST


On Wed, Oct 11, 2023 at 11:24 AM Guo Ren <guoren@xxxxxxxxxx> wrote:
>
> On Mon, Oct 9, 2023 at 8:42 PM Masahiro Yamada <masahiroy@xxxxxxxxxx> wrote:

> > --- a/arch/riscv/Makefile
> > +++ b/arch/riscv/Makefile
> > @@ -131,12 +131,6 @@ endif
> > libs-y += arch/riscv/lib/
> > libs-$(CONFIG_EFI_STUB) += $(objtree)/drivers/firmware/efi/libstub/lib.a
> >
> > -PHONY += vdso_install
> > -vdso_install:
> > - $(Q)$(MAKE) $(build)=arch/riscv/kernel/vdso $@
> > - $(if $(CONFIG_COMPAT),$(Q)$(MAKE) \
> > - $(build)=arch/riscv/kernel/compat_vdso compat_$@)
> > -
> > ifeq ($(KBUILD_EXTMOD),)
> > ifeq ($(CONFIG_MMU),y)
> > prepare: vdso_prepare
> > @@ -148,6 +142,9 @@ vdso_prepare: prepare0
> > endif
> > endif
> >
> > +vdso-install-y += arch/riscv/kernel/vdso/vdso.so.dbg
> > +vdso-install-$(CONFIG_COMPAT) += arch/riscv/kernel/compat_vdso/compat_vdso.so.dbg:../compat_vdso/compat_vdso.so
> Why do we need ":../compat_vdso/compat_vdso.so" here?




All architectures except riscv install vdso files
to /lib/modules/$(uname -r)/vdso/.



See the following code in arch/riscv/kernel/compat_vdso/Makefile:


quiet_cmd_compat_vdso_install = INSTALL $@
cmd_compat_vdso_install = cp $(obj)/$@.dbg $(MODLIB)/compat_vdso/$@




Riscv copies the compat vdso to
/lib/modules/$(uname -r)/compat_vdso/.



This commit preserves the current installation path as-is.

If the riscv maintainers agree, we can change the
installation destination to /lib/modules/$(uname -r)/vdso/
for consistency.



--
Best Regards
Masahiro Yamada