Re: [PATCH v2] x86: Use correct CHECKFLAGS for realmode code

From: Thomas Weißschuh

Date: Tue Jun 02 2026 - 01:09:43 EST


On Mon, Jun 01, 2026 at 08:44:48AM +0200, Thomas Weißschuh wrote:
> Currently the CHECKFLAGS from the normal build are also used for the
> realmode code. This leads to inconsistent flags confusing sparse and
> the logic in the kernel headers. Since recently this inconsistent state
> is detected by asm-generic/bitsperlong.h, triggering a warning.
>
> Fix the CHECKFLAGS to let sparse properly check this code and
> also avoid the warning.
>
> At this point -m32/-m64 and -D__i386__/-D__x86_64__ are not yet added to
> CHECKFLAGS, so no replacement is necessary.
>
> Reported-by: Mark Bloch <mbloch@xxxxxxxxxx>
> Closes: https://lore.kernel.org/lkml/3bbcf456-322c-46f9-b238-88fb8ad227b2@xxxxxxxxxx/
> Fixes: 62357a5888ea ("asm-generic/bitsperlong.h: Add sanity checks for __BITS_PER_LONG")
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@xxxxxxxxxxxxx>

Please ignore thispatch . It doesn't work correctly for the peculiar build
setup of arch/x86/boot/compressed/.

I'll try to come up with something better.


Thomas