[PATCH v3 1/5] riscv: compat_vdso: switch to standard kbuild rule

Thomas Weißschuh thomas.weissschuh at linutronix.de
Fri Jul 17 05:17:39 PDT 2026


On Fri, Jul 17, 2026 at 10:06:34AM +0200, Nam Cao wrote:
> The compat_vdso Makefile has a custom build rule for *.S files. This
> is unnecessary, and makes it hard to extend this Makefile to support
> building *.c files.
> 
> Switch to standard kbuild rule instead.
> 
> Signed-off-by: Nam Cao <namcao at linutronix.de>

Reviewed-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>

> ---
>  arch/riscv/kernel/compat_vdso/Makefile | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/arch/riscv/kernel/compat_vdso/Makefile b/arch/riscv/kernel/compat_vdso/Makefile
> index 24e37d1ef7ec..8a395b5dd037 100644
> --- a/arch/riscv/kernel/compat_vdso/Makefile
> +++ b/arch/riscv/kernel/compat_vdso/Makefile
> @@ -8,7 +8,6 @@ compat_vdso-syms  = rt_sigreturn
>  compat_vdso-syms += getcpu
>  compat_vdso-syms += flush_icache
>  
> -COMPAT_CC := $(CC)
>  COMPAT_LD := $(LD)
>  
>  # binutils 2.35 does not support the zifencei extension, but in the ISA
> @@ -43,8 +42,7 @@ $(obj)/compat_vdso.so.dbg: $(obj)/compat_vdso.lds $(obj-compat_vdso) FORCE
>  LDFLAGS_compat_vdso.so.dbg = -shared -S -soname=linux-compat_vdso.so.1 \
>  	--build-id=sha1 --hash-style=both --eh-frame-hdr
>  
> -$(obj-compat_vdso): %.o: %.S FORCE
> -	$(call if_changed_dep,compat_vdsoas)
> +$(obj-compat_vdso) : KBUILD_AFLAGS += $(COMPAT_CC_FLAGS)

Spurious space before ":".

>  # strip rule for the .so file
>  $(obj)/%.so: OBJCOPYFLAGS := -S
> @@ -66,7 +64,3 @@ quiet_cmd_compat_vdsold = VDSOLD  $@
>        cmd_compat_vdsold = $(COMPAT_LD) $(ld_flags) $(COMPAT_LD_FLAGS) -T $(filter-out FORCE,$^) -o $@.tmp && \
>                     $(OBJCOPY) $(patsubst %, -G __compat_vdso_%, $(compat_vdso-syms)) $@.tmp $@ && \
>                     rm $@.tmp
> -
> -# actual build commands
> -quiet_cmd_compat_vdsoas = VDSOAS  $@
> -      cmd_compat_vdsoas = $(COMPAT_CC) $(a_flags) $(COMPAT_CC_FLAGS) -c -o $@ $<



More information about the linux-riscv mailing list