[PATCH 6/9] MIPS: VDSO: Directly include the generic vDSO implementations

Thomas Weißschuh thomas.weissschuh at linutronix.de
Thu Dec 3 23:30:33 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/mips/vdso/Makefile        | 10 +++-------
 arch/mips/vdso/vgettimeofday.c |  2 ++
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/arch/mips/vdso/Makefile b/arch/mips/vdso/Makefile
index 00d3ba2c482a..fd07eaedc2d5 100644
--- a/arch/mips/vdso/Makefile
+++ b/arch/mips/vdso/Makefile
@@ -35,16 +35,12 @@ cflags-vdso := $(ccflags-vdso) \
 aflags-vdso := $(ccflags-vdso) \
 	-D__ASSEMBLY__ -Wa,-gdwarf-2
 
-ifneq ($(c-gettimeofday-y),)
-obj-vdso-y += vgettimeofday.o
-CFLAGS_vgettimeofday.o = -include $(c-gettimeofday-y)
+obj-vdso-$(CONFIG_MIPS_GENERIC_GETTIMEOFDAY) += vgettimeofday.o
 
 # config-n32-o32-env.c prepares the environment to build a 32bit vDSO
 # library on a 64bit kernel.
-# Note: Needs to be included before than the generic library.
-CFLAGS_vgettimeofday-o32.o = -include $(src)/config-n32-o32-env.c -include $(c-gettimeofday-y)
-CFLAGS_vgettimeofday-n32.o = -include $(src)/config-n32-o32-env.c -include $(c-gettimeofday-y)
-endif
+CFLAGS_vgettimeofday-o32.o = -include $(src)/config-n32-o32-env.c
+CFLAGS_vgettimeofday-n32.o = -include $(src)/config-n32-o32-env.c
 
 CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE)
 
diff --git a/arch/mips/vdso/vgettimeofday.c b/arch/mips/vdso/vgettimeofday.c
index a1fb06b8973e..60831451ba3e 100644
--- a/arch/mips/vdso/vgettimeofday.c
+++ b/arch/mips/vdso/vgettimeofday.c
@@ -11,6 +11,8 @@
 #include <linux/types.h>
 #include <vdso/gettime.h>
 
+#include "../../../lib/vdso/gettimeofday.c"
+
 #if _MIPS_SIM != _MIPS_SIM_ABI64
 
 #ifdef CONFIG_COMPAT_32BIT_TIME

-- 
2.56.1




More information about the linux-arm-kernel mailing list