[patch 1/2] x86/vdso: Tweak CHECKFLAGS for 32-bit VDSO build
From: Thomas Gleixner
Date: Sat Jan 17 2026 - 16:58:27 EST
Sparse complains about a too large shift in the VDSO32 source file:
arch/x86/entry/vdso/vdso32/vclock_gettime.c: note: in included file (through /home/tglx/work/kernel/tip/tip/arch/x86/entry/vdso/vdso32/../vclock_gettime.c):
arch/x86/entry/vdso/vdso32/../../../../../lib/vdso/gettimeofday.c:454:26: warning: shift too big (40) for type unsigned long
That's because sparse is invoked with -D__x86_64__ -m64 on the command
line, which causes it to use __BITS_PER_LONG = 64. That causes __GENMASK()
to use a way too big shift value.
Give the CHECKFLAGS which are handed to sparse a similar treatment as
KBUILD_CFLAGS get for the 32-bit VDSO build.
Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxx>
---
arch/x86/entry/vdso/Makefile | 4 ++++
1 file changed, 4 insertions(+)
--- a/arch/x86/entry/vdso/Makefile
+++ b/arch/x86/entry/vdso/Makefile
@@ -144,6 +144,10 @@ endif
$(obj)/vdso32.so.dbg: KBUILD_CFLAGS = $(KBUILD_CFLAGS_32)
+CHECKFLAGS_32 := $(subst -m64,-m32,$(CHECKFLAGS))
+CHECKFLAGS_32 := $(subst -D__x86_64__,-D__i386__,$(CHECKFLAGS_32))
+$(obj)/vdso32.so.dbg: CHECKFLAGS = $(CHECKFLAGS_32)
+
$(obj)/vdso32.so.dbg: $(obj)/vdso32/vdso32.lds $(vobjs32) FORCE
$(call if_changed,vdso_and_check)