Re: [PATCH] x86/purgatory: Compile purgatory with -D__DISABLE_EXPORTS
From: Eric Biggers
Date: Fri Sep 25 2026 - 15:16:42 EST
On Fri, Sep 25, 2026 at 03:01:49PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@xxxxxxxx>
>
> A previous patch fixed compile-time issues by setting __NO_FORTIFY
> for all of the purgatory code, but this is insufficient and still
> leaves build failures that appeared recently in linux-next:
>
> ld.lld: error: undefined symbol: __memset
> >>> referenced by string.c
> >>> arch/x86/purgatory/purgatory.ro:(__UNIQUE_ID_addressable___memset_2)
>
> ld.lld: error: undefined symbol: __memmove
> >>> referenced by string.c
> >>> arch/x86/purgatory/purgatory.ro:(__UNIQUE_ID_addressable___memmove_3)
>
> Set __DISABLE_EXPORTS as well, to avoid pulling in a reference to the
> wrong string functions.
>
> Fixes: 65cbe410d312 ("x86/purgatory: Compile purgatory with -D__NO_FORTIFY")
> Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
> ---
> arch/x86/purgatory/Makefile | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
I dropped the patch this fixes already, as I mentioned at
https://lore.kernel.org/linux-crypto/20260924174911.GA1978@sol/ . It's
gone from linux-next now. I think Thomas Huth is planning to send a
fixed version, together with the two patches that depend on this.
But compiling all of purgatory (and not just sha256.o as is the status
quo) with -D__NO_FORTIFY -D__DISABLE_EXPORTS sounds good to me.
Alternatively it could be just sha256.o and purgatory.o specifically.
But it seems it might as well just be all files.
- Eric