linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [Bug 220407] New: arch/powerpc/boot/types.h:43:13: error: 'bool' cannot be defined via 'typedef' when building with GCC 15
@ 2025-08-04 14:09 bugzilla-daemon
  2025-08-04 14:25 ` [Bug 220407] " bugzilla-daemon
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: bugzilla-daemon @ 2025-08-04 14:09 UTC (permalink / raw)
  To: linuxppc-dev

https://bugzilla.kernel.org/show_bug.cgi?id=220407

            Bug ID: 220407
           Summary: arch/powerpc/boot/types.h:43:13: error: 'bool' cannot
                    be defined via 'typedef' when building with GCC 15
           Product: Platform Specific/Hardware
           Version: 2.5
          Hardware: PPC-32
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P3
         Component: PPC-32
          Assignee: platform_ppc-32@kernel-bugs.osdl.org
          Reporter: anhollander516@gmail.com
        Regression: No

Created attachment 308441
  --> https://bugzilla.kernel.org/attachment.cgi?id=308441&action=edit
Gentoo default kernel config

I have been slowly bringing up a Gentoo PPC system in QEMU to host binary
packages for an iBook G3.

The kernel fails to compile with GCC 15 due to C23 issues:

  DESCEND objtool
  CALL    scripts/checksyscalls.sh
  INSTALL libsubcmd_headers
  COPY    arch/powerpc/boot/inflate.c
  COPY    arch/powerpc/boot/inffast.c
  COPY    arch/powerpc/boot/inftrees.c
  BOOTCC  arch/powerpc/boot/cuboot.o
  COPY    arch/powerpc/boot/fdt.c
  BOOTCC  arch/powerpc/boot/devtree.o
  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
  BOOTCC  arch/powerpc/boot/main.o
  BOOTCC  arch/powerpc/boot/ns16550.o
  BOOTCC  arch/powerpc/boot/ofconsole.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
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;
      | ^~~~~~~
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;
      |             ^~~~
In file included from arch/powerpc/boot/serial.c:14:
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
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: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;
      | ^~~~~~~
arch/powerpc/boot/types.h:43:1: warning: useless type name in empty declaration
   43 | typedef int bool;
      | ^~~~~~~
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;
      |             ^~~~
In file included from ./arch/powerpc/boot/libfdt_env.h:5,
                 from ./arch/powerpc/boot/libfdt.h:9,
                 from arch/powerpc/boot/libfdt-wrapper.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: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;
      | ^~~~~~~
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;
      |             ^~~~
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: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;
      | ^~~~~~~
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/cuboot.o] Error
1
make[2]: *** Waiting for unfinished jobs....
In file included from arch/powerpc/boot/simple_alloc.c:11:
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/stdio.c:9:
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/ns16550.o]
Error 1
make[2]: *** [arch/powerpc/boot/Makefile:234: arch/powerpc/boot/serial.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/ofconsole.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/simple_alloc.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/libfdt-wrapper.o] Error 1
make[2]: *** [arch/powerpc/boot/Makefile:234: arch/powerpc/boot/stdio.o] Error
1
make[1]: *** [arch/powerpc/Makefile:236: zImage] Error 2
make: *** [Makefile:248: __sub-make] Error 2

I tried adding KBUILD_CFLAGS += -std=gnu11 to arch/powerpc/boot/Makefile, but
that didn't fix the issue. I am building Linux 6.15.9 because that is the
latest that Gentoo has an official default config for, but
arch/powerpc/boot/types.h and arch/powerpc/boot/Makefile haven't changed from
there to master. 6.12 fails too, for that matter.



(Truncated) output from emerge --info (I am using a 64-bit kernel in the
emulator, and building a 32-bit userland + kernel for the target system):

Portage 3.0.68 (python 3.13.5-final-0, default/linux/ppc/23.0/desktop, gcc-15,
glibc-2.41-r4, 6.12.21-gentoo-ppc64-ppc ppc64)
=================================================================
System uname:
Linux-6.12.21-gentoo-ppc64-ppc-ppc64-POWER9_-architected-,_altivec_supported-with-glibc2.41
KiB Mem:    24096492 total,  10071272 free
KiB Swap:          0 total,         0 free
Head commit of repository gentoo: 5fbe5609e04996b5d2c6bed17f8bc55970d759bb

ld GNU ld (Gentoo 2.44 p4) 2.44.0
sys-devel/binutils:        2.44-r3::gentoo, 2.45::gentoo
sys-devel/gcc:             15.1.1_p20250705-r1::gentoo
sys-kernel/linux-headers:  6.16::gentoo (virtual/os-headers)
sys-libs/glibc:            2.41-r4::gentoo

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug 220407] arch/powerpc/boot/types.h:43:13: error: 'bool' cannot be defined via 'typedef' when building with GCC 15
  2025-08-04 14:09 [Bug 220407] New: arch/powerpc/boot/types.h:43:13: error: 'bool' cannot be defined via 'typedef' when building with GCC 15 bugzilla-daemon
@ 2025-08-04 14:25 ` bugzilla-daemon
  2025-08-04 18:54 ` bugzilla-daemon
  2025-08-04 19:05 ` bugzilla-daemon
  2 siblings, 0 replies; 4+ messages in thread
From: bugzilla-daemon @ 2025-08-04 14:25 UTC (permalink / raw)
  To: linuxppc-dev

https://bugzilla.kernel.org/show_bug.cgi?id=220407

Christophe Leroy (christophe.leroy@csgroup.eu) changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |christophe.leroy@csgroup.eu

--- Comment #1 from Christophe Leroy (christophe.leroy@csgroup.eu) ---
This is fixed with commit
https://github.com/torvalds/linux/commit/5a821e2d69e26b51b7f3740b6b0c3462b8cacaff

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug 220407] arch/powerpc/boot/types.h:43:13: error: 'bool' cannot be defined via 'typedef' when building with GCC 15
  2025-08-04 14:09 [Bug 220407] New: arch/powerpc/boot/types.h:43:13: error: 'bool' cannot be defined via 'typedef' when building with GCC 15 bugzilla-daemon
  2025-08-04 14:25 ` [Bug 220407] " bugzilla-daemon
@ 2025-08-04 18:54 ` bugzilla-daemon
  2025-08-04 19:05 ` bugzilla-daemon
  2 siblings, 0 replies; 4+ messages in thread
From: bugzilla-daemon @ 2025-08-04 18:54 UTC (permalink / raw)
  To: linuxppc-dev

https://bugzilla.kernel.org/show_bug.cgi?id=220407

Artem S. Tashkinov (aros@gmx.com) changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |PATCH_ALREADY_AVAILABLE

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug 220407] arch/powerpc/boot/types.h:43:13: error: 'bool' cannot be defined via 'typedef' when building with GCC 15
  2025-08-04 14:09 [Bug 220407] New: arch/powerpc/boot/types.h:43:13: error: 'bool' cannot be defined via 'typedef' when building with GCC 15 bugzilla-daemon
  2025-08-04 14:25 ` [Bug 220407] " bugzilla-daemon
  2025-08-04 18:54 ` bugzilla-daemon
@ 2025-08-04 19:05 ` bugzilla-daemon
  2 siblings, 0 replies; 4+ messages in thread
From: bugzilla-daemon @ 2025-08-04 19:05 UTC (permalink / raw)
  To: linuxppc-dev

https://bugzilla.kernel.org/show_bug.cgi?id=220407

--- Comment #2 from Avraham Hollander (anhollander516@gmail.com) ---
(In reply to Christophe Leroy from comment #1)
> This is fixed with commit
> https://github.com/torvalds/linux/commit/
> 5a821e2d69e26b51b7f3740b6b0c3462b8cacaff

Oh now I see that that commit is already present in Linux 6.16 but not 6.15.x.
Not sure how I missed that. It should probably be backported at some point but
for now I can just patch it myself.

So -std=gnu11 goes to BOOTCFLAGS, not KBUILD_CFLAGS. Makes sense. Thanks for
pointing me to the patch.

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-08-04 19:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-04 14:09 [Bug 220407] New: arch/powerpc/boot/types.h:43:13: error: 'bool' cannot be defined via 'typedef' when building with GCC 15 bugzilla-daemon
2025-08-04 14:25 ` [Bug 220407] " bugzilla-daemon
2025-08-04 18:54 ` bugzilla-daemon
2025-08-04 19:05 ` bugzilla-daemon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).