diff --git a/sysdeps/unix/sysv/linux/riscv/init-first.c b/sysdeps/unix/sysv/linux/riscv/init-first.c
index 8134c79695..98a8ce33ad 100644
--- a/sysdeps/unix/sysv/linux/riscv/init-first.c
+++ b/sysdeps/unix/sysv/linux/riscv/init-first.c
@@ -17,9 +17,8 @@
License along with the GNU C Library; if not, see
. */
-#ifdef SHARED
-# include
-# include
+#include
+#include
long int (*VDSO_SYMBOL (getcpu)) (unsigned int *, unsigned int *, void *)
attribute_hidden;
@@ -52,7 +51,6 @@ _libc_vdso_platform_setup (void)
VDSO_SYMBOL (clock_getres) = p;
}
-# define VDSO_SETUP _libc_vdso_platform_setup
-#endif
+#define VDSO_SETUP _libc_vdso_platform_setup
#include
diff --git a/sysdeps/unix/sysv/linux/riscv/libc-vdso.h b/sysdeps/unix/sysv/linux/riscv/libc-vdso.h
index b0c46f3cb7..2373292ab9 100644
--- a/sysdeps/unix/sysv/linux/riscv/libc-vdso.h
+++ b/sysdeps/unix/sysv/linux/riscv/libc-vdso.h
@@ -20,9 +20,7 @@
#ifndef _LIBC_VDSO_H
#define _LIBC_VDSO_H
-#ifdef SHARED
-
-# include
+#include
extern long int (*VDSO_SYMBOL (getcpu)) (unsigned int *, unsigned int *, void *)
attribute_hidden;
@@ -33,6 +31,4 @@ extern long int (*VDSO_SYMBOL (clock_gettime)) (clockid_t, struct timespec *)
extern long int (*VDSO_SYMBOL (clock_getres)) (clockid_t, struct timespec *)
attribute_hidden;
-#endif
-
#endif /* _LIBC_VDSO_H */
diff --git a/sysdeps/unix/sysv/linux/riscv/sysdep.h b/sysdeps/unix/sysv/linux/riscv/sysdep.h
index 5470ea3d2a..caf013a9a1 100644
--- a/sysdeps/unix/sysv/linux/riscv/sysdep.h
+++ b/sysdeps/unix/sysv/linux/riscv/sysdep.h
@@ -19,6 +19,9 @@
#ifndef _LINUX_RISCV_SYSDEP_H
#define _LINUX_RISCV_SYSDEP_H 1
+/* Always enable vsyscalls on riscv */
+#define ALWAYS_USE_VSYSCALL 1
+
#include
#include