[PATCH 5/9] powerpc/vdso: Directly include the generic vDSO implementations
Thomas Weißschuh
thomas.weissschuh at linutronix.de
Thu Dec 3 23:30:32 PST 2026
The inclusion of the generic vDSO implementation through compiler
arguments is complicated and non-obvious.
Directly include the .c files instead.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
arch/powerpc/kernel/vdso/Makefile | 10 +---------
arch/powerpc/kernel/vdso/vgetrandom.c | 2 ++
arch/powerpc/kernel/vdso/vgettimeofday.c | 2 ++
3 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/arch/powerpc/kernel/vdso/Makefile b/arch/powerpc/kernel/vdso/Makefile
index 0d1a49529885..386eb3778934 100644
--- a/arch/powerpc/kernel/vdso/Makefile
+++ b/arch/powerpc/kernel/vdso/Makefile
@@ -11,19 +11,11 @@ obj-vdso64 = sigtramp64-64.o gettimeofday-64.o datapage-64.o cacheflush-64.o not
obj-vdso32 += getrandom-32.o vgetrandom-chacha-32.o
obj-vdso64 += getrandom-64.o vgetrandom-chacha-64.o
-ifneq ($(c-gettimeofday-y),)
- CFLAGS_vgettimeofday-32.o += -include $(c-gettimeofday-y)
# Go prior to 1.16.x assumes r30 is not clobbered by any VDSO code. That used to be true
# by accident when the VDSO was hand-written asm code, but may not be now that the VDSO is
# compiler generated. To avoid breaking Go tell GCC not to use r30. Impact on code
# generation is minimal, it will just use r29 instead.
- CFLAGS_vgettimeofday-64.o += -include $(c-gettimeofday-y) $(call cc-option, -ffixed-r30)
-endif
-
-ifneq ($(c-getrandom-y),)
- CFLAGS_vgetrandom-32.o += -include $(c-getrandom-y)
- CFLAGS_vgetrandom-64.o += -include $(c-getrandom-y)
-endif
+CFLAGS_vgettimeofday-64.o += $(call cc-option, -ffixed-r30)
# Build rules
diff --git a/arch/powerpc/kernel/vdso/vgetrandom.c b/arch/powerpc/kernel/vdso/vgetrandom.c
index cc79b960a541..e164e2052615 100644
--- a/arch/powerpc/kernel/vdso/vgetrandom.c
+++ b/arch/powerpc/kernel/vdso/vgetrandom.c
@@ -7,6 +7,8 @@
#include <linux/time.h>
#include <linux/types.h>
+#include "../../../../lib/vdso/getrandom.c"
+
ssize_t __c_kernel_getrandom(void *buffer, size_t len, unsigned int flags, void *opaque_state,
size_t opaque_len)
{
diff --git a/arch/powerpc/kernel/vdso/vgettimeofday.c b/arch/powerpc/kernel/vdso/vgettimeofday.c
index 4b712fb01a3f..11a69411e04a 100644
--- a/arch/powerpc/kernel/vdso/vgettimeofday.c
+++ b/arch/powerpc/kernel/vdso/vgettimeofday.c
@@ -5,6 +5,8 @@
#include <linux/time.h>
#include <linux/types.h>
+#include "../../../../lib/vdso/gettimeofday.c"
+
#ifdef __powerpc64__
int __c_kernel_clock_gettime(clockid_t clock, struct __kernel_timespec *ts,
const struct vdso_time_data *vd)
--
2.56.1
More information about the linux-arm-kernel
mailing list