[PATCH v3] powerpc: Add gpr1 and fpu save/restore functions

Timothy Pearson tpearson at raptorengineering.com
Sun Feb 18 08:23:57 AEDT 2024



----- Original Message -----
> From: "christophe leroy" <christophe.leroy at csgroup.eu>
> To: "Timothy Pearson" <tpearson at raptorengineering.com>
> Cc: "linuxppc-dev" <linuxppc-dev at lists.ozlabs.org>
> Sent: Saturday, February 17, 2024 10:39:06 AM
> Subject: Re: [PATCH v3] powerpc: Add gpr1 and fpu save/restore functions

> Le 16/02/2024 à 18:24, Timothy Pearson a écrit :
>> When building the kernel in size optimized mode with the amdgpu module enabled,
>> gcc will begin referencing external gpr1 and fpu save/restore functions.  This
>> will then cause a linker failure as we do not link against libgcc which
>> normally contains those builtin functions.
> 
> Right, but modules are linked with --save-restore-funcs when using gcc
> so crtsavres.o is not used and only your change to scripts/mod/modpost.c
> seems to be required to be able to build amdgpu module with GCC.
> 
> Maybe that's different with clang, but maybe worth a test and then a
> second patch ?

It looks to be gated on ld, specifically if we're CONFIG_PPC64 && CONFIG_LD_IS_BFD.  I can update the patch to match that gate if desired.

> Nevertheless, see comments below, you can do even shorter and more
> readable using GAS macros.

That's true, but my goal was to get this working, not refactor the entire file. :)  Any chance we can merge and do a fine polish later, especially if there's a distinct possibility of the entire file going away in the near future?


More information about the Linuxppc-dev mailing list