arm64: compat: Fix flip/flop vdso building bug
diff mbox series

Message ID
State New
Headers show
  • arm64: compat: Fix flip/flop vdso building bug
Related show

Commit Message

Vincenzo Frascino July 12, 2019, 12:06 p.m. UTC
Running "make" on an already compiled kernel tree will rebuild the
vdso32 library even if this has not been modified.

$ make
  GEN     Makefile
  Using linux as source for kernel
  CALL    linux/scripts/atomic/
  CALL    linux/scripts/
  VDSOCHK arch/arm64/kernel/vdso32/
  VDSOSYM include/generated/vdso32-offsets.h
  CHK     include/generated/compile.h
  CC      arch/arm64/kernel/signal.o
  CC      arch/arm64/kernel/vdso.o
  CC      arch/arm64/kernel/signal32.o
  VDSOL   arch/arm64/kernel/vdso32/
  MUNGE   arch/arm64/kernel/vdso32/
  OBJCOPY arch/arm64/kernel/vdso32/
  AS      arch/arm64/kernel/vdso32/vdso.o
  AR      arch/arm64/kernel/vdso32/built-in.a
  AR      arch/arm64/kernel/built-in.a
  GEN     .version
  CHK     include/generated/compile.h
  UPD     include/generated/compile.h
  CC      init/version.o
  AR      init/built-in.a
  LD      vmlinux.o
  MODPOST vmlinux.o

The issue is generated by the fact that "if_changed" is called twice
in a single target.

Fix the build bug merging the two commands into a single function.

Cc: Catalin Marinas <>
Cc: Will Deacon <>
Fixes: a7f71a2c8903 ("arm64: compat: Add vDSO")
Signed-off-by: Vincenzo Frascino <>
 arch/arm64/kernel/vdso32/Makefile | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff mbox series

diff --git a/arch/arm64/kernel/vdso32/Makefile b/arch/arm64/kernel/vdso32/Makefile
index 288c14d30b45..fb572b6f1bf5 100644
--- a/arch/arm64/kernel/vdso32/Makefile
+++ b/arch/arm64/kernel/vdso32/Makefile
@@ -144,8 +144,7 @@  $(obj)/ $(obj)/ $(obj)/$(munge) FORCE
 # Link rule for the .so file, .lds has to be first
 $(obj)/ $(src)/ $(obj-vdso) FORCE
-	$(call if_changed,vdsold)
-	$(call if_changed,vdso_check)
+	$(call if_changed,vdsold_and_vdso_check)
 # Compilation rules for the vDSO sources
 $(c-obj-vdso): %.o: %.c FORCE
@@ -156,6 +155,9 @@  $(asm-obj-vdso): %.o: %.S FORCE
 	$(call if_changed_dep,vdsoas)
 # Actual build commands
+quiet_cmd_vdsold_and_vdso_check = LD   $@
+      cmd_vdsold_and_vdso_check = $(cmd_vdsold); $(cmd_vdso_check)
 quiet_cmd_vdsold = VDSOL   $@
       cmd_vdsold = $(COMPATCC) -Wp,-MD,$(depfile) $(VDSO_LDFLAGS) \
                    -Wl,-T $(filter,$^) $(filter %.o,$^) -o $@