From: Thomas Gleixner <tglx@kernel.org>
To: LKML <linux-kernel@vger.kernel.org>
Cc: x86@kernel.org, "Thomas Weißschuh" <thomas.weissschuh@linutronix.de>
Subject: [patch 1/2] x86/vdso: Tweak CHECKFLAGS for 32-bit VDSO build
Date: Sat, 17 Jan 2026 22:58:25 +0100 [thread overview]
Message-ID: <20260117215542.342638347@kernel.org> (raw)
In-Reply-To: 20260117215257.601937692@kernel.org
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@kernel.org>
---
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)
next prev parent reply other threads:[~2026-01-17 21:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-17 21:58 [patch 0/2] x86/vdso: Address sparse warnings Thomas Gleixner
2026-01-17 21:58 ` Thomas Gleixner [this message]
2026-01-19 7:18 ` [patch 1/2] x86/vdso: Tweak CHECKFLAGS for 32-bit VDSO build Thomas Weißschuh
2026-01-22 14:06 ` Thomas Gleixner
2026-01-17 21:58 ` [patch 2/2] x86/vdso: Prevent empty switch case warning Thomas Gleixner
2026-01-19 7:16 ` Thomas Weißschuh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260117215542.342638347@kernel.org \
--to=tglx@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=thomas.weissschuh@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox