Skip to content

Commit 772d789

Browse files
xhackerustcpalmer-dabbelt
authored andcommitted
riscv: vdso: fix and clean-up Makefile
Running "make" on an already compiled kernel tree will rebuild the kernel even without any modifications: CALL linux/scripts/checksyscalls.sh CALL linux/scripts/atomic/check-atomics.sh CHK include/generated/compile.h SO2S arch/riscv/kernel/vdso/vdso-syms.S AS arch/riscv/kernel/vdso/vdso-syms.o AR arch/riscv/kernel/vdso/built-in.a AR arch/riscv/kernel/built-in.a AR arch/riscv/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 The reason is "Any target that utilizes if_changed must be listed in $(targets), otherwise the command line check will fail, and the target will always be built" as explained by Documentation/kbuild/makefiles.rst Fix this build bug by adding vdso-syms.S to $(targets) At the same time, there are two trivial clean up modifications: - the vdso-dummy.o is not needed any more after so remove it. - vdso.lds is a generated file, so it should be prefixed with $(obj)/ instead of $(src)/ Fixes: c2c81bb ("RISC-V: Fix the VDSO symbol generaton for binutils-2.35+") Cc: [email protected] Signed-off-by: Jisheng Zhang <[email protected]> Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent e75e6bf commit 772d789

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/riscv/kernel/vdso/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ ifneq ($(c-gettimeofday-y),)
2323
endif
2424

2525
# Build rules
26-
targets := $(obj-vdso) vdso.so vdso.so.dbg vdso.lds vdso-dummy.o
26+
targets := $(obj-vdso) vdso.so vdso.so.dbg vdso.lds vdso-syms.S
2727
obj-vdso := $(addprefix $(obj)/, $(obj-vdso))
2828

2929
obj-y += vdso.o vdso-syms.o
@@ -41,7 +41,7 @@ KASAN_SANITIZE := n
4141
$(obj)/vdso.o: $(obj)/vdso.so
4242

4343
# link rule for the .so file, .lds has to be first
44-
$(obj)/vdso.so.dbg: $(src)/vdso.lds $(obj-vdso) FORCE
44+
$(obj)/vdso.so.dbg: $(obj)/vdso.lds $(obj-vdso) FORCE
4545
$(call if_changed,vdsold)
4646
LDFLAGS_vdso.so.dbg = -shared -s -soname=linux-vdso.so.1 \
4747
--build-id=sha1 --hash-style=both --eh-frame-hdr

0 commit comments

Comments
 (0)