Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 954704 - sys-kernel/gentoo-sources-6.1.135 failed to compile ./include/linux/stddef.h:11:9: error: cannot use keyword ‘false’ as enumeration constant
Summary: sys-kernel/gentoo-sources-6.1.135 failed to compile ./include/linux/stddef.h:...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: gcc-15
  Show dependency tree
 
Reported: 2025-04-26 08:40 UTC by email200202
Modified: 2025-06-01 10:16 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge -pqv '=sys-kernel/gentoo-sources-6.1.135:6.1.135::gentoo' (file_954704.txt,157 bytes, text/plain)
2025-04-26 08:43 UTC, email200202
Details
emerge --info '=sys-kernel/gentoo-sources-6.1.135:6.1.135::gentoo' (file_954704.txt,7.30 KB, text/plain)
2025-04-26 08:45 UTC, email200202
Details
6.14.4 compile error (file_954704.txt,25.82 KB, text/plain)
2025-04-26 17:12 UTC, John Croteau
Details

Note You need to log in before you can comment on or make changes to this bug.
Description email200202 2025-04-26 08:40:36 UTC
sys-kernel/gentoo-sources-6.1.135 failed to compile with the error messages:

  DESCEND objtool
  CALL    scripts/checksyscalls.sh
  CC      arch/x86/ia32/ia32_signal.o
  CC      arch/x86/ia32/audit.o
  CC      arch/x86/realmode/rm/wakemain.o
  AR      arch/x86/platform/atom/built-in.a
  CC      arch/x86/realmode/rm/video-mode.o
In file included from ./include/uapi/linux/posix_types.h:5,
                 from ./include/uapi/linux/types.h:14,
                 from ./include/linux/types.h:6,
                 from arch/x86/realmode/rm/wakeup.h:11,
                 from arch/x86/realmode/rm/wakemain.c:2:
./include/linux/stddef.h:11:9: error: cannot use keyword ‘false’ as enumeration constant
   11 |         false   = 0,
      |         ^~~~~
./include/linux/stddef.h:11:9: note: ‘false’ is a keyword with ‘-std=c23’ onwards
./include/linux/types.h:30:33: error: ‘bool’ cannot be defined via ‘typedef’
   30 | typedef _Bool                   bool;
      |                                 ^~~~
./include/linux/types.h:30:33: note: ‘bool’ is a keyword with ‘-std=c23’ onwards
./include/linux/types.h:30:1: warning: useless type name in empty declaration
   30 | typedef _Bool                   bool;
      | ^~~~~~~
  AR      arch/x86/platform/ce4100/built-in.a
In file included from ./include/uapi/linux/posix_types.h:5,
                 from ./include/uapi/linux/types.h:14,
                 from ./include/linux/types.h:6,
                 from arch/x86/realmode/rm/../../boot/boot.h:22,
                 from arch/x86/realmode/rm/../../boot/video-mode.c:16,
                 from arch/x86/realmode/rm/video-mode.c:1:
./include/linux/stddef.h:11:9: error: cannot use keyword ‘false’ as enumeration constant
   11 |         false   = 0,
      |         ^~~~~
./include/linux/stddef.h:11:9: note: ‘false’ is a keyword with ‘-std=c23’ onwards
./include/linux/types.h:30:33: error: ‘bool’ cannot be defined via ‘typedef’
   30 | typedef _Bool                   bool;
      |                                 ^~~~
./include/linux/types.h:30:33: note: ‘bool’ is a keyword with ‘-std=c23’ onwards
./include/linux/types.h:30:1: warning: useless type name in empty declaration
   30 | typedef _Bool                   bool;
      | ^~~~~~~
make[4]: *** [scripts/Makefile.build:250: arch/x86/realmode/rm/wakemain.o] Error 1
make[4]: *** Waiting for unfinished jobs....
make[4]: *** [scripts/Makefile.build:250: arch/x86/realmode/rm/video-mode.o] Error 1
make[3]: *** [arch/x86/realmode/Makefile:22: arch/x86/realmode/rm/realmode.bin] Error 2
make[2]: *** [scripts/Makefile.build:503: arch/x86/realmode] Error 2
make[2]: *** Waiting for unfinished jobs....
  CC      arch/x86/platform/efi/memmap.o
  AR      arch/x86/platform/geode/built-in.a
  CC      arch/x86/platform/efi/quirks.o


Reproducible: Always

Steps to Reproduce:
1. Sync and Update with emerge
2. Try to compile the new kernel

Actual Results:  
Failed to compile

Expected Results:  
Not to fail
Comment 1 email200202 2025-04-26 08:43:53 UTC
Created attachment 926206 [details]
emerge -pqv '=sys-kernel/gentoo-sources-6.1.135:6.1.135::gentoo'
Comment 2 email200202 2025-04-26 08:45:19 UTC
Created attachment 926207 [details]
emerge --info '=sys-kernel/gentoo-sources-6.1.135:6.1.135::gentoo'
Comment 3 John Croteau 2025-04-26 17:12:56 UTC
Created attachment 926224 [details]
6.14.4 compile error

Issues with 6.14.4 as well, not sure if I should file a separate bug report.  Since gcc-15 is treating all warnings as errors, it fails at multiple points with 16 jobs but I was unable to continue further once I reached this point in the compile:
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-04-26 17:16:23 UTC
(In reply to John Croteau from comment #3)
> Created attachment 926224 [details]
> 6.14.4 compile error
> 
> Issues with 6.14.4 as well, not sure if I should file a separate bug report.
> Since gcc-15 is treating all warnings as errors, i

That's not what is happening -- it's that the kernel defaults to CONFIG_WERROR in a bunch of places (or has in the past, and it gets carried on through people's configs) and this is a new *warning* that ends up promoted to an error because of that.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-04-26 17:16:53 UTC
(In reply to John Croteau from comment #3)
> Created attachment 926224 [details]
> 6.14.4 compile error
> 
> Issues with 6.14.4 as well, not sure if I should file a separate bug report.
> Since gcc-15 is treating all warnings as errors, it fails at multiple points
> with 16 jobs but I was unable to continue further once I reached this point
> in the compile:

But that issue is different from this one indeed. This particular bug is about C23. Your issue is bug 954669.
Comment 7 Holger Hoffstätte 2025-04-26 17:47:56 UTC
You probably want this: https://github.com/torvalds/linux/commit/ee2ab467bddfb2d7f68d996dbab94d7b88f8eaf7
Comment 8 Holger Hoffstätte 2025-04-28 12:45:55 UTC
Thread in -stable: https://lore.kernel.org/stable/fb4cce81-1e36-4887-a1e0-0cfd1a26693e@googlemail.com/
Comment 9 Matt Whitlock 2025-05-01 06:02:43 UTC
sys-kernel/gentoo-sources-6.6.88 has the same problem.

# make
  CALL    scripts/checksyscalls.sh
mkdir -p /usr/src/linux-6.6.88-gentoo/tools/objtool && make O=/usr/src/linux-6.6.88-gentoo subdir=tools/objtool --no-print-directory -C objtool 
make[4]: 'install_headers' is up to date.
  CC      arch/x86/realmode/rm/wakemain.o
In file included from ./include/uapi/linux/posix_types.h:5,
                 from ./include/uapi/linux/types.h:14,
                 from ./include/linux/types.h:6,
                 from arch/x86/realmode/rm/wakeup.h:11,
                 from arch/x86/realmode/rm/wakemain.c:2:
./include/linux/stddef.h:11:9: error: cannot use keyword 'false' as enumeration constant
   11 |         false   = 0,
      |         ^~~~~
./include/linux/stddef.h:11:9: note: 'false' is a keyword with '-std=c23' onwards
./include/linux/types.h:35:33: error: 'bool' cannot be defined via 'typedef'
   35 | typedef _Bool                   bool;
      |                                 ^~~~
./include/linux/types.h:35:33: note: 'bool' is a keyword with '-std=c23' onwards
./include/linux/types.h:35:1: warning: useless type name in empty declaration
   35 | typedef _Bool                   bool;
      | ^~~~~~~
make[5]: *** [scripts/Makefile.build:243: arch/x86/realmode/rm/wakemain.o] Error 1
make[4]: *** [arch/x86/realmode/Makefile:22: arch/x86/realmode/rm/realmode.bin] Error 2
make[3]: *** [scripts/Makefile.build:480: arch/x86/realmode] Error 2
make[2]: *** [scripts/Makefile.build:480: arch/x86] Error 2
make[1]: *** [/usr/src/linux-6.6.88-gentoo/Makefile:1932: .] Error 2
make: *** [Makefile:234: __sub-make] Error 2


(In reply to Holger Hoffstätte from comment #7)
> You probably want this:
> https://github.com/torvalds/linux/commit/ee2ab467bddfb2d7f68d996dbab94d7b88f8eaf7

I see that that patch has already been applied, but it's not enough.

A workaround is to run `make CC='gcc -std=gnu11'`.
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-05-01 06:17:51 UTC
We can do something like https://gitweb.gentoo.org/proj/linux-patches.git/commit/?h=6.12&id=353d9f32e0ba5f71b437ff4c970539e584a58e0b for older branches until it gets fixed properly upstream.
Comment 11 email200202 2025-05-03 03:17:52 UTC
linux-6.1.136-gentoo failed compilation at the same point:

In file included from ./include/uapi/linux/posix_types.h:5,
                 from ./include/uapi/linux/types.h:14,
                 from ./include/linux/types.h:6,
                 from arch/x86/realmode/rm/wakeup.h:11,
                 from arch/x86/realmode/rm/wakemain.c:2:
./include/linux/stddef.h:11:9: error: cannot use keyword ‘false’ as enumeration constant
   11 |         false   = 0,
      |         ^~~~~
./include/linux/stddef.h:11:9: note: ‘false’ is a keyword with ‘-std=c23’ onwards
./include/linux/types.h:30:33: error: ‘bool’ cannot be defined via ‘typedef’
   30 | typedef _Bool                   bool;
      |                                 ^~~~
./include/linux/types.h:30:33: note: ‘bool’ is a keyword with ‘-std=c23’ onwards
./include/linux/types.h:30:1: warning: useless type name in empty declaration
   30 | typedef _Bool                   bool;
      | ^~~~~~~
make[4]: *** [scripts/Makefile.build:250: arch/x86/realmode/rm/wakemain.o] Error 1
make[4]: *** Waiting for unfinished jobs....
  CC      fs/proc/loadavg.o
  CC      kernel/irq/dummychip.o
make[3]: *** [arch/x86/realmode/Makefile:22: arch/x86/realmode/rm/realmode.bin] Error 2
make[2]: *** [scripts/Makefile.build:503: arch/x86/realmode] Error 2
make[1]: *** [scripts/Makefile.build:503: arch/x86] Error 2
make[1]: *** Waiting for unfinished jobs....
Comment 12 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-05-03 03:20:40 UTC
(In reply to email200202 from comment #11)
> linux-6.1.136-gentoo failed compilation at the same point:

I'm not surprised, nothing's changed here. My earlier comment stands.
Comment 13 Larry the Git Cow gentoo-dev 2025-05-05 12:04:09 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=53b213bf12d856457f151af4e8dc3cce01da1051

commit 53b213bf12d856457f151af4e8dc3cce01da1051
Author:     Mike Pagano <mpagano@gentoo.org>
AuthorDate: 2025-05-05 12:02:57 +0000
Commit:     Mike Pagano <mpagano@gentoo.org>
CommitDate: 2025-05-05 12:02:57 +0000

    sys-kernel/gentoo-sources: add 6.1.137, GCC 15 fix
    
    GCC 15 defaults to -std=gnu23. Hack in CSTD_FLAG to
    pass -std=gnu11 everywhere
    
    Bug: https://bugs.gentoo.org/954704
    
    Signed-off-by: Mike Pagano <mpagano@gentoo.org>

 sys-kernel/gentoo-sources/Manifest                 |  3 +++
 .../gentoo-sources/gentoo-sources-6.1.137.ebuild   | 27 ++++++++++++++++++++++
 2 files changed, 30 insertions(+)
Comment 14 Larry the Git Cow gentoo-dev 2025-05-09 11:46:19 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6b077b6aae6250b4b527eb3c2b8dfb8855238fee

commit 6b077b6aae6250b4b527eb3c2b8dfb8855238fee
Author:     Mike Pagano <mpagano@gentoo.org>
AuthorDate: 2025-05-09 11:44:24 +0000
Commit:     Mike Pagano <mpagano@gentoo.org>
CommitDate: 2025-05-09 11:44:24 +0000

    sys-kernel/gentoo-sources: add 6.6.90, GCC 15 patch
    
    GCC 15 defaults to -std=gnu23. Hack in CSTD_FLAG to
    pass -std=gnu11 everywhere
    
    Bug: https://bugs.gentoo.org/954704
    
    Signed-off-by: Mike Pagano <mpagano@gentoo.org>

 sys-kernel/gentoo-sources/Manifest                 |  3 +++
 .../gentoo-sources/gentoo-sources-6.6.90.ebuild    | 27 ++++++++++++++++++++++
 2 files changed, 30 insertions(+)