[PATCH] riscv: cfi: gitignore generated vdso files
Anirudh Srinivasan
asrinivasan at oss.tenstorrent.com
Sat May 16 10:48:04 PDT 2026
On Sat, Apr 18, 2026 at 12:31:08AM -0400, Charlie Jenkins wrote:
> During compilation, the standard VDSO files are copied into
> arch/riscv/kernel/vdso_cfi. Add a .gitignore to prevent these files from
> being tracked by git.
>
> Signed-off-by: Charlie Jenkins <thecharlesjenkins at gmail.com>
> ---
> arch/riscv/kernel/vdso_cfi/.gitignore | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/arch/riscv/kernel/vdso_cfi/.gitignore b/arch/riscv/kernel/vdso_cfi/.gitignore
> new file mode 100644
> index 000000000000..8bc6f31c8ee6
> --- /dev/null
> +++ b/arch/riscv/kernel/vdso_cfi/.gitignore
> @@ -0,0 +1,5 @@
> +# SPDX-License-Identifier: GPL-2.0-only
> +*.S
> +*.c
> +vdso.lds
> +!vdso-cfi.S
Thanks for this patch. I was seeing a bunch of files in gitignore like
this and this cleans this up.
Sashiko [1] seems to say that *.tmp should be added to this gitignore.
I think it's correct. I see some vdso-cfi.so.dbg.tmp files being
generated (and removed) in the build logs if I run make with --trace.
arch/riscv/kernel/vdso/Makefile:81: update target 'arch/riscv/kernel/vdso_cfi/vdso-cfi.so.dbg' due to: arch/riscv/kernel/vdso_cfi/vdso.lds arch/riscv/kernel/vdso_cfi/rt_sigreturn.o arch/riscv/kernel/vdso_cfi/vgettimeofday.o arch/riscv/kernel/vdso_cfi/getcpu.o arch/riscv/kernel/vdso_cfi/flush_icache.o arch/riscv/kernel/vdso_cfi/hwprobe.o arch/riscv/kernel/vdso_cfi/sys_hwprobe.o arch/riscv/kernel/vdso_cfi/getrandom.o arch/riscv/kernel/vdso_cfi/note.o arch/riscv/kernel/vdso_cfi/vgetrandom-chacha.o FORCE
set -e; echo ' VDSOLD arch/riscv/kernel/vdso_cfi/vdso-cfi.so.dbg'; trap 'rm -f arch/riscv/kernel/vdso_cfi/vdso-cfi.so.dbg; trap - HUP; kill -s HUP $$' HUP; trap 'rm -f arch/riscv/kernel/vdso_cfi/vdso-cfi.so.dbg; trap - INT; kill -s INT $$' INT; trap 'rm -f arch/riscv/kernel/vdso_cfi/vdso-cfi.so.dbg; trap - QUIT; kill -s QUIT $$' QUIT; trap 'rm -f arch/riscv/kernel/vdso_cfi/vdso-cfi.so.dbg; trap - TERM; kill -s TERM $$' TERM; trap 'rm -f arch/riscv/kernel/vdso_cfi/vdso-cfi.so.dbg; trap - PIPE; kill -s PIPE $$' PIPE; riscv64-unknown-linux-gnu-ld -fcf-protection=full -melf64lriscv -z noexecstack --no-warn-rwx-segments -shared -soname=linux-vdso.so.1 --build-id=sha1 --eh-frame-hdr -T arch/riscv/kernel/vdso_cfi/vdso.lds arch/riscv/kernel/vdso_cfi/rt_sigreturn.o arch/riscv/kernel/vdso_cfi/vgettimeofday.o arch/riscv/kernel/vdso_cfi/getcpu.o arch/riscv/kernel/vdso_cfi/flush_icache.o arch/riscv/kernel/vdso_cfi/hwprobe.o arch/riscv/kernel/vdso_cfi/sys_hwprobe.o arch/riscv/kernel/vdso_cfi/getrandom.o arch/riscv/kernel/vdso_cfi/note.o arch/riscv/kernel/vdso_cfi/vgetrandom-chacha.o -o arch/riscv/kernel/vdso_cfi/vdso-cfi.so.dbg.tmp && riscv64-unknown-linux-gnu-objcopy -G __vdso_rt_sigreturn -G __vdso_vgettimeofday -G __vdso_getcpu -G __vdso_flush_icache -G __vdso_hwprobe -G __vdso_sys_hwprobe -G __vdso_getrandom arch/riscv/kernel/vdso_cfi/vdso-cfi.so.dbg.tmp arch/riscv/kernel/vdso_cfi/vdso-cfi.so.dbg && rm arch/riscv/kernel/vdso_cfi/vdso-cfi.so.dbg.tmp && if riscv64-unknown-linux-gnu-readelf -rW arch/riscv/kernel/vdso_cfi/vdso-cfi.so.dbg | grep -v _NONE | grep -q " R_\w*_"; then (echo >&2 "arch/riscv/kernel/vdso_cfi/vdso-cfi.so.dbg: dynamic relocations are not supported"; rm -f arch/riscv/kernel/vdso_cfi/vdso-cfi.so.dbg; /bin/false); fi; printf '%s\n' 'savedcmd_arch/riscv/kernel/vdso_cfi/vdso-cfi.so.dbg := riscv64-unknown-linux-gnu-ld -fcf-protection=full -melf64lriscv -z noexecstack --no-warn-rwx-segments -shared -soname=linux-vdso.so.1 --build-id=sha1 --eh-frame-hdr -T arch/riscv/kernel/vdso_cfi/vdso.lds arch/riscv/kernel/vdso_cfi/rt_sigreturn.o arch/riscv/kernel/vdso_cfi/vgettimeofday.o arch/riscv/kernel/vdso_cfi/getcpu.o arch/riscv/kernel/vdso_cfi/flush_icache.o arch/riscv/kernel/vdso_cfi/hwprobe.o arch/riscv/kernel/vdso_cfi/sys_hwprobe.o arch/riscv/kernel/vdso_cfi/getrandom.o arch/riscv/kernel/vdso_cfi/note.o arch/riscv/kernel/vdso_cfi/vgetrandom-chacha.o -o arch/riscv/kernel/vdso_cfi/vdso-cfi.so.dbg.tmp && riscv64-unknown-linux-gnu-objcopy -G __vdso_rt_sigreturn -G __vdso_vgettimeofday -G __vdso_getcpu -G __vdso_flush_icache -G __vdso_hwprobe -G __vdso_sys_hwprobe -G __vdso_getrandom arch/riscv/kernel/vdso_cfi/vdso-cfi.so.dbg.tmp arch/riscv/kernel/vdso_cfi/vdso-cfi.so.dbg && rm arch/riscv/kernel/vdso_cfi/vdso-cfi.so.dbg.tmp && if riscv64-unknown-linux-gnu-readelf -rW arch/riscv/kernel/vdso_cfi/vdso-cfi.so.dbg | grep -v _NONE | grep -q " R_\w*_"; then (echo >&2 "arch/riscv/kernel/vdso_cfi/vdso-cfi.so.dbg: dynamic relocations are not supported"; rm -f arch/riscv/kernel/vdso_cfi/vdso-cfi.so.dbg; /bin/false); fi' > arch/riscv/kernel/vdso_cfi/.vdso-cfi.so.dbg.cmd
VDSOLD arch/riscv/kernel/vdso_cfi/vdso-cfi.so.dbg
Sort of related, but I noticed that make clean doesn't cleanup these
files in the vdso_cfi directory. I can send a patch to clean this up.
Something like this
diff --git a/arch/riscv/kernel/vdso_cfi/Makefile b/arch/riscv/kernel/vdso_cfi/Makefile
index 8ebd190782b08..5aa78b85bbed8 100644
--- a/arch/riscv/kernel/vdso_cfi/Makefile
+++ b/arch/riscv/kernel/vdso_cfi/Makefile
@@ -20,6 +20,8 @@ $(vdso_S_objects): $(obj)/%.S: $(src)/%.S
$(vdso_c_objects): $(obj)/%.c: $(src)/%.c
$(Q)cp $< $@
+clean-files := $(patsubst $(src)/%.c, %.c, $(vdso_c_sources)) $(patsubst $(src)/%.S, %.S, $(vdso_S_sources))
+
# Include the main VDSO Makefile which contains all the build rules and sources
# The VDSO_CFI_BUILD variable will be passed to it to enable CFI compilation
include $(src)/Makefile
[1] https://sashiko.dev/#/patchset/20260418-vdso_cfi_ignore-v1-1-f4b89f5b0d3b%40gmail.com
>
> ---
> base-commit: 08ee1559052be302f1d3752f48360b89517d9f8d
> change-id: ${change-id}
>
> - Charlie
>
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv
More information about the linux-riscv
mailing list