diff mbox series

powerpc/boot: Fix build with gcc 15

Message ID 20250307092055.21986-1-msuchanek@suse.de (mailing list archive)
State Superseded
Headers show
Series powerpc/boot: Fix build with gcc 15 | expand

Commit Message

Michal Suchánek March 7, 2025, 9:20 a.m. UTC
Similar to x86 the ppc boot code does not build with GCC 15.

Copy the fix from
commit ee2ab467bddf ("x86/boot: Use '-std=gnu11' to fix build with GCC 15")

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
---
 arch/powerpc/boot/Makefile | 1 +
 1 file changed, 1 insertion(+)

Comments

Nysal Jan K.A. March 8, 2025, 10:09 a.m. UTC | #1
On Fri, Mar 07, 2025 at 10:20:52AM +0100, Michal Suchanek wrote:
> Similar to x86 the ppc boot code does not build with GCC 15.
> 
> Copy the fix from
> commit ee2ab467bddf ("x86/boot: Use '-std=gnu11' to fix build with GCC 15")
> 
> Signed-off-by: Michal Suchanek <msuchanek@suse.de>
> ---
>  arch/powerpc/boot/Makefile | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
> index 1ff6ad4f6cd2..e6b35699c049 100644
> --- a/arch/powerpc/boot/Makefile
> +++ b/arch/powerpc/boot/Makefile
> @@ -33,6 +33,7 @@ else
>  endif
>  
>  ifdef CONFIG_PPC64_BOOT_WRAPPER
> +BOOTTARGETFLAGS	+= -std=gnu11
>  BOOTTARGETFLAGS	+= -m64
>  BOOTTARGETFLAGS	+= -mabi=elfv2
>  ifdef CONFIG_PPC64_ELF_ABI_V2
> -- 
> 2.47.1
> 
> 

Reviewed-by: Nysal Jan K.A. <nysal@linux.ibm.com>
Michal Suchánek March 10, 2025, 8:40 a.m. UTC | #2
On Fri, Mar 07, 2025 at 10:20:52AM +0100, Michal Suchanek wrote:
> Similar to x86 the ppc boot code does not build with GCC 15.
> 
> Copy the fix from
> commit ee2ab467bddf ("x86/boot: Use '-std=gnu11' to fix build with GCC 15")
> 
> Signed-off-by: Michal Suchanek <msuchanek@suse.de>
> ---
>  arch/powerpc/boot/Makefile | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
> index 1ff6ad4f6cd2..e6b35699c049 100644
> --- a/arch/powerpc/boot/Makefile
> +++ b/arch/powerpc/boot/Makefile
> @@ -33,6 +33,7 @@ else
>  endif
>  
>  ifdef CONFIG_PPC64_BOOT_WRAPPER
> +BOOTTARGETFLAGS	+= -std=gnu11

I suppose this should be above the ifdef, not below. I build only 64S
but I expect any other platforms that build boot code will be equally
affected.

Thanks

Michal

>  BOOTTARGETFLAGS	+= -m64
>  BOOTTARGETFLAGS	+= -mabi=elfv2
>  ifdef CONFIG_PPC64_ELF_ABI_V2
> -- 
> 2.47.1
>
Mukesh Kumar Chaurasiya April 17, 2025, 6:07 a.m. UTC | #3
On Fri, Mar 07, 2025 at 10:20:52AM +0100, Michal Suchanek wrote:
> Similar to x86 the ppc boot code does not build with GCC 15.
> 
> Copy the fix from
> commit ee2ab467bddf ("x86/boot: Use '-std=gnu11' to fix build with GCC 15")
> 
> Signed-off-by: Michal Suchanek <msuchanek@suse.de>
> ---
>  arch/powerpc/boot/Makefile | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
> index 1ff6ad4f6cd2..e6b35699c049 100644
> --- a/arch/powerpc/boot/Makefile
> +++ b/arch/powerpc/boot/Makefile
> @@ -33,6 +33,7 @@ else
>  endif
>  
>  ifdef CONFIG_PPC64_BOOT_WRAPPER
> +BOOTTARGETFLAGS	+= -std=gnu11
>  BOOTTARGETFLAGS	+= -m64
>  BOOTTARGETFLAGS	+= -mabi=elfv2
>  ifdef CONFIG_PPC64_ELF_ABI_V2
> -- 
> 2.47.1
> 
There's another patch which fixes this problem by version comparison.
https://lore.kernel.org/all/20250323163607.537270-2-misanjum@linux.ibm.com/

In my opinion this is a better solution as it will use the features of latest
compiler.
Michal Suchánek April 17, 2025, 11:02 a.m. UTC | #4
On Thu, Apr 17, 2025 at 11:37:09AM +0530, Mukesh Kumar Chaurasiya wrote:
> On Fri, Mar 07, 2025 at 10:20:52AM +0100, Michal Suchanek wrote:
> > Similar to x86 the ppc boot code does not build with GCC 15.
> > 
> > Copy the fix from
> > commit ee2ab467bddf ("x86/boot: Use '-std=gnu11' to fix build with GCC 15")
> > 
> > Signed-off-by: Michal Suchanek <msuchanek@suse.de>
> > ---
> >  arch/powerpc/boot/Makefile | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
> > index 1ff6ad4f6cd2..e6b35699c049 100644
> > --- a/arch/powerpc/boot/Makefile
> > +++ b/arch/powerpc/boot/Makefile
> > @@ -33,6 +33,7 @@ else
> >  endif
> >  
> >  ifdef CONFIG_PPC64_BOOT_WRAPPER
> > +BOOTTARGETFLAGS	+= -std=gnu11
> >  BOOTTARGETFLAGS	+= -m64
> >  BOOTTARGETFLAGS	+= -mabi=elfv2
> >  ifdef CONFIG_PPC64_ELF_ABI_V2
> > -- 
> > 2.47.1
> > 
> There's another patch which fixes this problem by version comparison.
> https://lore.kernel.org/all/20250323163607.537270-2-misanjum@linux.ibm.com/
> 
> In my opinion this is a better solution as it will use the features of latest
> compiler.

No it's not a better solution. It's documented that the kernel is built
with the GNU dialect of ISO C11. When a file is not compiled with the
documented C dialect that's a bug.

If newer C dialect features are desirable then they should be enabled
consistently across the tree, not individually for a few files used in
boot code.

Thanks

Michal
Mukesh Kumar Chaurasiya April 21, 2025, 8:26 a.m. UTC | #5
On Thu, Apr 17, 2025 at 01:02:05PM +0200, Michal Suchánek wrote:
> On Thu, Apr 17, 2025 at 11:37:09AM +0530, Mukesh Kumar Chaurasiya wrote:
> > On Fri, Mar 07, 2025 at 10:20:52AM +0100, Michal Suchanek wrote:
> > > Similar to x86 the ppc boot code does not build with GCC 15.
> > > 
> > > Copy the fix from
> > > commit ee2ab467bddf ("x86/boot: Use '-std=gnu11' to fix build with GCC 15")
> > > 
> > > Signed-off-by: Michal Suchanek <msuchanek@suse.de>
> > > ---
> > >  arch/powerpc/boot/Makefile | 1 +
> > >  1 file changed, 1 insertion(+)
> > > 
> > > diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
> > > index 1ff6ad4f6cd2..e6b35699c049 100644
> > > --- a/arch/powerpc/boot/Makefile
> > > +++ b/arch/powerpc/boot/Makefile
> > > @@ -33,6 +33,7 @@ else
> > >  endif
> > >  
> > >  ifdef CONFIG_PPC64_BOOT_WRAPPER
> > > +BOOTTARGETFLAGS	+= -std=gnu11
> > >  BOOTTARGETFLAGS	+= -m64
> > >  BOOTTARGETFLAGS	+= -mabi=elfv2
> > >  ifdef CONFIG_PPC64_ELF_ABI_V2
> > > -- 
> > > 2.47.1
> > > 
> > There's another patch which fixes this problem by version comparison.
> > https://lore.kernel.org/all/20250323163607.537270-2-misanjum@linux.ibm.com/
> > 
> > In my opinion this is a better solution as it will use the features of latest
> > compiler.
> 
> No it's not a better solution. It's documented that the kernel is built
> with the GNU dialect of ISO C11. When a file is not compiled with the
> documented C dialect that's a bug.
> 
> If newer C dialect features are desirable then they should be enabled
> consistently across the tree, not individually for a few files used in
> boot code.
> 
> Thanks
> 
> Michal
Oh cool.

Thanks
diff mbox series

Patch

diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 1ff6ad4f6cd2..e6b35699c049 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -33,6 +33,7 @@  else
 endif
 
 ifdef CONFIG_PPC64_BOOT_WRAPPER
+BOOTTARGETFLAGS	+= -std=gnu11
 BOOTTARGETFLAGS	+= -m64
 BOOTTARGETFLAGS	+= -mabi=elfv2
 ifdef CONFIG_PPC64_ELF_ABI_V2