On 31/03/25 4:27 pm, 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 > --- > v2: Move the fix outside of ifdef to apply to all subarchitectures > v3: Change BOOTCFLAGS rather than BOOTTARGETFLAGS > --- > arch/powerpc/boot/Makefile | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile > index 184d0680e661..a7ab087d412c 100644 > --- a/arch/powerpc/boot/Makefile > +++ b/arch/powerpc/boot/Makefile > @@ -70,6 +70,7 @@ BOOTCPPFLAGS := -nostdinc $(LINUXINCLUDE) > BOOTCPPFLAGS += -isystem $(shell $(BOOTCC) -print-file-name=include) > > BOOTCFLAGS := $(BOOTTARGETFLAGS) \ > + -std=gnu11 \ > -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ > -fno-strict-aliasing -O2 \ > -msoft-float -mno-altivec -mno-vsx \ Tested this patch by applying on mainline kernel, on fed42 with head commit: 1a1d569a75f3ab2923cb62daf356d102e4df2b86 and kernel make is successful. Hence, Tested-by: Venkat Rao Bagalkote GCC: 15.0.1 20250228 (Red Hat 15.0.1-0) (GCC) Attached is the config file. With out this Patch:   BOOTCC  arch/powerpc/boot/devtree.o   BOOTAS  arch/powerpc/boot/div64.o   COPY    arch/powerpc/boot/fdt.h   BOOTCC  arch/powerpc/boot/elf_util.o In file included from arch/powerpc/boot/ops.h:13,                  from arch/powerpc/boot/cuboot.c:12: arch/powerpc/boot/types.h:43:13: error: ‘bool’ cannot be defined via ‘typedef’    43 | typedef int bool;       |             ^~~~ arch/powerpc/boot/types.h:43:13: note: ‘bool’ is a keyword with ‘-std=c23’ onwards arch/powerpc/boot/types.h:43:1: warning: useless type name in empty declaration    43 | typedef int bool;       | ^~~~~~~   COPY    arch/powerpc/boot/libfdt.h   COPY    arch/powerpc/boot/libfdt_internal.h   BOOTCC  arch/powerpc/boot/main.o make[2]: *** [arch/powerpc/boot/Makefile:233: arch/powerpc/boot/cuboot.o] Error 1 make[2]: *** Waiting for unfinished jobs....   BOOTCC  arch/powerpc/boot/ns16550.o   BOOTCC  arch/powerpc/boot/ofconsole.o   BOOTCC  arch/powerpc/boot/oflib.o In file included from arch/powerpc/boot/devtree.c:12: arch/powerpc/boot/types.h:43:13: error: ‘bool’ cannot be defined via ‘typedef’    43 | typedef int bool;       |             ^~~~ arch/powerpc/boot/types.h:43:13: note: ‘bool’ is a keyword with ‘-std=c23’ onwards arch/powerpc/boot/types.h:43:1: warning: useless type name in empty declaration    43 | typedef int bool;       | ^~~~~~~ In file included from arch/powerpc/boot/ofconsole.c:8: arch/powerpc/boot/types.h:43:13: error: ‘bool’ cannot be defined via ‘typedef’    43 | typedef int bool;       |             ^~~~ arch/powerpc/boot/types.h:43:13: note: ‘bool’ is a keyword with ‘-std=c23’ onwards arch/powerpc/boot/types.h:43:1: warning: useless type name in empty declaration    43 | typedef int bool;       | ^~~~~~~ In file included from arch/powerpc/boot/ops.h:13,                  from arch/powerpc/boot/main.c:13: arch/powerpc/boot/types.h:43:13: error: ‘bool’ cannot be defined via ‘typedef’    43 | typedef int bool;       |             ^~~~ arch/powerpc/boot/types.h:43:13: note: ‘bool’ is a keyword with ‘-std=c23’ onwards arch/powerpc/boot/types.h:43:1: warning: useless type name in empty declaration    43 | typedef int bool;       | ^~~~~~~ In file included from arch/powerpc/boot/oflib.c:6: arch/powerpc/boot/types.h:43:13: error: ‘bool’ cannot be defined via ‘typedef’    43 | typedef int bool;       |             ^~~~ arch/powerpc/boot/types.h:43:13: note: ‘bool’ is a keyword with ‘-std=c23’ onwards arch/powerpc/boot/types.h:43:1: warning: useless type name in empty declaration    43 | typedef int bool;       | ^~~~~~~ In file included from arch/powerpc/boot/ns16550.c:13: arch/powerpc/boot/types.h:43:13: error: ‘bool’ cannot be defined via ‘typedef’    43 | typedef int bool;       |             ^~~~ arch/powerpc/boot/types.h:43:13: note: ‘bool’ is a keyword with ‘-std=c23’ onwards arch/powerpc/boot/types.h:43:1: warning: useless type name in empty declaration    43 | typedef int bool;       | ^~~~~~~ make[2]: *** [arch/powerpc/boot/Makefile:234: arch/powerpc/boot/ofconsole.o] Error 1 make[2]: *** [arch/powerpc/boot/Makefile:234: arch/powerpc/boot/devtree.o] Error 1 make[2]: *** [arch/powerpc/boot/Makefile:234: arch/powerpc/boot/main.o] Error 1 make[2]: *** [arch/powerpc/boot/Makefile:234: arch/powerpc/boot/oflib.o] Error 1 make[2]: *** [arch/powerpc/boot/Makefile:234: arch/powerpc/boot/ns16550.o] Error 1 make[1]: *** [arch/powerpc/Makefile:236: zImage] Error 2 make: *** [Makefile:248: __sub-make] Error 2 With this Patch:  AS      .tmp_vmlinux1.kallsyms.o   LD      .tmp_vmlinux2   NM      .tmp_vmlinux2.syms   KSYMS   .tmp_vmlinux2.kallsyms.S   AS      .tmp_vmlinux2.kallsyms.o   LD      vmlinux   NM      System.map   SORTTAB vmlinux   BOOTAS  arch/powerpc/boot/crt0.o   BOOTAS  arch/powerpc/boot/crtsavres.o   COPY    arch/powerpc/boot/zlib.h   BOOTCC  arch/powerpc/boot/cuboot.o   COPY    arch/powerpc/boot/zconf.h   COPY    arch/powerpc/boot/zutil.h   COPY    arch/powerpc/boot/inffast.h   COPY    arch/powerpc/boot/inffixed.h   COPY    arch/powerpc/boot/inflate.h   COPY    arch/powerpc/boot/inftrees.h   COPY    arch/powerpc/boot/infutil.h   BOOTCC  arch/powerpc/boot/devtree.o   BOOTAS  arch/powerpc/boot/div64.o   COPY    arch/powerpc/boot/fdt.h   BOOTCC  arch/powerpc/boot/elf_util.o   COPY    arch/powerpc/boot/libfdt.h   COPY    arch/powerpc/boot/libfdt_internal.h   BOOTCC  arch/powerpc/boot/main.o   BOOTCC  arch/powerpc/boot/ofconsole.o   BOOTCC  arch/powerpc/boot/ns16550.o   BOOTCC  arch/powerpc/boot/oflib.o   BOOTCC  arch/powerpc/boot/serial.o   BOOTCC  arch/powerpc/boot/simple_alloc.o   BOOTCC  arch/powerpc/boot/stdio.o   BOOTCC  arch/powerpc/boot/stdlib.o   BOOTAS  arch/powerpc/boot/string.o   BOOTAS  arch/powerpc/boot/util.o   BOOTCC  arch/powerpc/boot/epapr.o   BOOTCC  arch/powerpc/boot/of.o   LDS     arch/powerpc/boot/zImage.lds   HOSTCC  arch/powerpc/boot/addnote   HOSTCC  arch/powerpc/boot/hack-coff   HOSTCC  arch/powerpc/boot/mktree   COPY    arch/powerpc/boot/inffast.c   COPY    arch/powerpc/boot/inflate.c   COPY    arch/powerpc/boot/inftrees.c   COPY    arch/powerpc/boot/fdt.c   COPY    arch/powerpc/boot/fdt_ro.c   COPY    arch/powerpc/boot/fdt_rw.c   COPY    arch/powerpc/boot/fdt_strerror.c   COPY    arch/powerpc/boot/fdt_sw.c   COPY    arch/powerpc/boot/fdt_wip.c   BOOTCC  arch/powerpc/boot/libfdt-wrapper.o   COPY    arch/powerpc/boot/decompress_inflate.c   BOOTCC  arch/powerpc/boot/empty.o   BOOTCC  arch/powerpc/boot/fdt.o   BOOTCC  arch/powerpc/boot/fdt_ro.o   BOOTCC  arch/powerpc/boot/fdt_rw.o   BOOTCC  arch/powerpc/boot/fdt_strerror.o   BOOTCC  arch/powerpc/boot/fdt_sw.o   BOOTCC  arch/powerpc/boot/fdt_wip.o   BOOTCC  arch/powerpc/boot/inffast.o   BOOTCC  arch/powerpc/boot/inflate.o   BOOTCC  arch/powerpc/boot/inftrees.o   BOOTCC  arch/powerpc/boot/decompress.o   BOOTAR  arch/powerpc/boot/wrapper.a   WRAP    arch/powerpc/boot/zImage.chrp   WRAP    arch/powerpc/boot/zImage.pmac   WRAP    arch/powerpc/boot/zImage.coff   WRAP    arch/powerpc/boot/zImage.miboot INFO: Uncompressed kernel (size 0x58c2c0) overlaps the address of the wrapper(0x400000) INFO: Fixing the link_address of wrapper to (0x600000) Note: Upon rebooting after exectuing make modules_install && make_install, OS didnt boot and observed call traces. Thats being debugged. make modules_install && make install   INSTALL /lib/modules/6.15.0-rc2-00043-ge586f952fbf5/modules.builtin   INSTALL /lib/modules/6.15.0-rc2-00043-ge586f952fbf5/modules.builtin.modinfo   INSTALL /boot dracut[W]: /lib/modules/6.15.0-rc2-00043-ge586f952fbf5//modules.dep is missing. Did you run depmod? depmod: WARNING: could not open modules.order at /var/tmp/dracut.XLH5xU/initramfs/lib/modules/6.15.0-rc2-00043-ge586f952fbf5: No such file or directory kdump: For kernel=/boot/vmlinuz-6.15.0-rc2-00043-ge586f952fbf5, crashkernel=2G-4G:384M,4G-16G:512M,16G-64G:1G,64G-128G:2G,128G-:4G now. Please reboot the system for the change to take effect. Note if you don't want kexec-tools to manage the crashkernel kernel parameter, please set auto_reset_crashkernel=no in /etc/kdump.conf. Traces: Call History ------------ throw  - c3f06c $call-method  - c4f1c4 (poplocals)  - c40a10 key-fillq  - c4f5dc ?xoff  - c4f6c4 (poplocals)  - c40a10 (stdout-write)  - c4fb74 (emit)  - c4fc4c space  - c4e0d8 quit  - c534c8 quit  - c53248 My Fix Pt Regs:  00 0008000000000000 0000000000000000 0000000000000001 0000000000c4f1c0  04 0000000008bfff80 00000000deadbeef 0000000000000004 0000000000c09010  08 0000000000000005 00000044cc9c8fd0 0000000008d0a5f8 000691f5755a7770  0c 0000000000000030 0000000000000000 0000000000000000 0000000008d17138  10 0000000000ea82e8 0000000000ea82e8 0000000000c4f1b8 0000000000c4f1c4  14 fffffffffffffff6 0000000008bfff80 78033de9500229e9 28003ff900003e89  18 0000000000c19000 0000000000c3e000 0000000000c1af00 0000000000c1cfc0  1c 0000000000c26000 0000000000c461e8 0000000000c17fa8 0000000000c16fe0 Special Regs:     %IV: 00000900     %CR: 22808408    %XER: 00040010  %DSISR: 00000000   %SRR0: 0000000000c41124   %SRR1: 800000000010b002     %LR: 0000000000c4111c    %CTR: 0000000000597248    %DAR: 0000000000000000 DEFAULT CATCH!, throw-code=fffffffffffffff6 Regards, Venkat.