selftests: vDSO: don't hard-code location of vDSO sources
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Thu, 22 Aug 2024 07:13:21 +0000 (09:13 +0200)
committerJason A. Donenfeld <Jason@zx2c4.com>
Fri, 30 Aug 2024 13:44:33 +0000 (15:44 +0200)
Architectures use different location for vDSO sources:

arch/mips/vdso
arch/sparc/vdso
arch/arm64/kernel/vdso
arch/riscv/kernel/vdso
arch/csky/kernel/vdso
arch/x86/um/vdso
arch/x86/entry/vdso
arch/powerpc/kernel/vdso
arch/arm/vdso
arch/loongarch/vdso

Don't hard-code vdso sources location in selftest Makefile. Instead
create a vdso/ symbolic link in tools/arch/$arch/ and update Makefile
accordingly.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
tools/arch/x86/vdso [new symlink]
tools/testing/selftests/vDSO/Makefile

diff --git a/tools/arch/x86/vdso b/tools/arch/x86/vdso
new file mode 120000 (symlink)
index 0000000..7eb962f
--- /dev/null
@@ -0,0 +1 @@
+../../../arch/x86/entry/vdso/
\ No newline at end of file
index 3de8e7e..c9a819c 100644 (file)
@@ -40,7 +40,7 @@ $(OUTPUT)/vdso_test_getrandom: parse_vdso.c
 $(OUTPUT)/vdso_test_getrandom: CFLAGS += -isystem $(top_srcdir)/tools/include \
                                          -isystem $(top_srcdir)/include/uapi
 
-$(OUTPUT)/vdso_test_chacha: $(top_srcdir)/arch/$(ARCH)/entry/vdso/vgetrandom-chacha.S
+$(OUTPUT)/vdso_test_chacha: $(top_srcdir)/tools/arch/$(ARCH)/vdso/vgetrandom-chacha.S
 $(OUTPUT)/vdso_test_chacha: CFLAGS += -idirafter $(top_srcdir)/tools/include \
                                       -isystem $(top_srcdir)/arch/$(ARCH)/include \
                                       -isystem $(top_srcdir)/include \