[PATCH] riscv: vdso: Don't use && to chain compound cmd definitions

Thomas Weißschuh thomas.weissschuh at linutronix.de
Tue Oct 13 23:02:01 PDT 2026


The vDSO linking consists of multiple commands executed as part of a
single kbuild 'cmd'. Currently these commands are chained with shell
'&&' operators to make sure that the later commands are only executed
when the earlier ones succeeded. However kbuild already provides this
early abort by using 'set -e' before each command invocation.
Furthermore the '&&' chaining prevents the 'set -e' from promoting the
failure of a single command to a failure of the overall command.

If one of the subcommand fails, kbuild will not notice and continue the
build, potentially leading to confusing follow-up errors.

Switch to plain ';' based sequences over '&&' ones.

Reported-by: kernel test robot <lkp at intel.com>
Link: https://lore.kernel.org/oe-kbuild-all/202610131613.BpOi6VPp-lkp@intel.com/
Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
Best viewed with 'git show --word-diff --word-diff-regex=.'
---
 arch/riscv/kernel/compat_vdso/Makefile | 4 ++--
 arch/riscv/kernel/vdso/Makefile        | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/riscv/kernel/compat_vdso/Makefile b/arch/riscv/kernel/compat_vdso/Makefile
index 24e37d1ef7ec..c4ed74dfe998 100644
--- a/arch/riscv/kernel/compat_vdso/Makefile
+++ b/arch/riscv/kernel/compat_vdso/Makefile
@@ -63,8 +63,8 @@ include/generated/compat_vdso-offsets.h: $(obj)/compat_vdso.so.dbg FORCE
 # The DSO images are built using a special linker script
 # Make sure only to export the intended __compat_vdso_xxx symbol offsets.
 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 $@ && \
+      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
diff --git a/arch/riscv/kernel/vdso/Makefile b/arch/riscv/kernel/vdso/Makefile
index c023046a3fd7..d2ebdc048efb 100644
--- a/arch/riscv/kernel/vdso/Makefile
+++ b/arch/riscv/kernel/vdso/Makefile
@@ -97,7 +97,7 @@ include/generated/$(vdso_offsets): $(obj)/$(vdso_so_dbg) FORCE
 # The DSO images are built using a special linker script
 # Make sure only to export the intended __vdso_xxx symbol offsets.
 quiet_cmd_vdsold_and_check = VDSOLD  $@
-      cmd_vdsold_and_check = $(LD) $(CFI_FULL) $(ld_flags) -T $(filter-out FORCE,$^) -o $@.tmp && \
-                   $(OBJCOPY) $(patsubst %, -G __vdso_%, $(vdso-syms)) $@.tmp $@ && \
-                   rm $@.tmp && \
+      cmd_vdsold_and_check = $(LD) $(CFI_FULL) $(ld_flags) -T $(filter-out FORCE,$^) -o $@.tmp; \
+                   $(OBJCOPY) $(patsubst %, -G __vdso_%, $(vdso-syms)) $@.tmp $@; \
+                   rm $@.tmp; \
                    $(cmd_vdso_check)

---
base-commit: 4056b3c9d3c92ea45955641dbafeb9b960e146ef
change-id: 20261014-riscv-vdsold-errors-fd6a7d7fdea5

Best regards,
--  
Thomas Weißschuh <thomas.weissschuh at linutronix.de>




More information about the linux-riscv mailing list