Re: [PATCH v1 0/3] efi/libstub: Build the x86 stub from KBUILD_CFLAGS
From: Ard Biesheuvel
Date: Thu Oct 08 2026 - 10:43:46 EST
On Tue, 6 Oct 2026, at 22:42, Kees Cook wrote:
> Hi!
>
> The x86 EFI stub builds from its own short list of compiler flags instead
> of KBUILD_CFLAGS, so options added kernel-wide reach it only when someone
> remembers to add them there too (e.g. for -fms-extensions). Swap it
> around to remove unwanted options instead, as we do for all the other
> architectures.
>
> This will let Clang's -fexperimental-late-parse-attributes reach the
> stub build so that __counted_by() will get parsed without error[1].
>
> Thanks!
>
> -Kees
>
> Link: https://lore.kernel.org/all/202610060642.7C4125F@keescook [1]
>
> Kees Cook (3):
> efi/libstub: Declare the x86 stub's assembly entry points
> efi/libstub: Build the x86 stub from KBUILD_CFLAGS
> efi/libstub: Disable kernel stack erasing in the common flags
>
Thanks. I've queued this up but with a tweak applied to patch #1,
as it broke the GCC i386 build due to the fact that 'asmlinkage'
evaluates to __attribute__((regparm(0))), and apparently, GCC
still thinks that differs from a function without the attribute,
even when it is the default. (Clang built fine)