Bug 2338348
| Summary: | kernel failed to build with GCC 15: C23 bool/true/false keywords | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Dave Malcolm <dmalcolm> |
| Component: | kernel | Assignee: | Kernel Maintainer List <kernel-maint> |
| Status: | NEW --- | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | rawhide | CC: | acaringi, adscvr, airlied, alciregi, bskeggs, fedora, hdegoede, hpa, jakub, jforbes, josef, kernel-maint, linville, masami256, mchehab, ptalbert, steved, suraj.ghimire7 |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | Type: | --- | |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 2333037 | ||
|
Description
Dave Malcolm
2025-01-15 21:11:35 UTC
aarch64 build: https://download.copr.fedorainfracloud.org/results/dmalcolm/gcc-15-smoketest-3.failed/fedora-rawhide-aarch64/08476572-kernel/builder-live.log.gz failed with: drivers/gpu/drm/panthor/panthor_fw.c: In function ‘panthor_fw_read_build_info’: drivers/gpu/drm/panthor/panthor_fw.c:651:53: error: initializer-string for array of ‘char’ is too long [-Werror=unterminated-string-initialization] 651 | const char git_sha_header[sizeof(header)] = "git_sha: "; | ^~~~~~~~~~~ Build on ppc64le succeeded: https://download.copr.fedorainfracloud.org/results/dmalcolm/gcc-15-smoketest-3.failed/fedora-rawhide-ppc64le/08476572-kernel/builder-live.log.gz Builds on x86_64 and s390x failed with "bool" keyword issues; x86_64 as per comment #0; s390x failing with: 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 ./include/linux/kasan-checks.h:5, from ./include/asm-generic/rwonce.h:26, from ./arch/s390/include/asm/rwonce.h:29, from ./include/linux/compiler.h:324, from ./include/linux/export.h:5, from ./include/linux/linkage.h:7, from ./include/linux/vmcore_info.h:5, from ./include/linux/kexec.h:18, from arch/s390/purgatory/purgatory.c:10: ./include/linux/stddef.h:11:9: error: expected identifier before ‘false’ 11 | false = 0, | ^~~~~ ./include/linux/types.h:35:33: error: two or more data types in declaration specifiers 35 | typedef _Bool bool; | ^~~~ ./include/linux/types.h:35:1: warning: useless type name in empty declaration 35 | typedef _Bool bool; | ^~~~~~~ https://download.copr.fedorainfracloud.org/results/dmalcolm/gcc-15-smoketest-3.failed/fedora-rawhide-s390x/08476572-kernel/builder-live.log.gz FWIW I've updated the error message in more recent builds of GCC; see: https://gcc.gnu.org/gcc-15/porting_to.html#c23-new-keywords Looks like this was addressed in https://src.fedoraproject.org/rpms/kernel/c/39f6da9eabe9fa880a8b720231eb3010e99e4f51 which has: +KBUILD_CFLAGS += -std=gnu11 in arch/x86/boot/compressed/Makefile and a bunch of other changes that seem to be C23 related. If so, presumably this can be closed out. That part is hopefully fixed, I've seen flying tons of patches about that.
But your comment has also
drivers/gpu/drm/panthor/panthor_fw.c: In function ‘panthor_fw_read_build_info’:
drivers/gpu/drm/panthor/panthor_fw.c:651:53: error: initializer-string for array of ‘char’ is too long [-Werror=unterminated-string-initialization]
651 | const char git_sha_header[sizeof(header)] = "git_sha: ";
| ^~~~~~~~~~~
part, that is a semi-new warning and dunno if kernel has been tweaked for that.
There is a possibility the warning will change, see e.g.
https://gcc.gnu.org/pipermail/gcc-patches/2024-December/thread.html#671714
https://gcc.gnu.org/pipermail/gcc-patches/2025-January/672738.html
https://gcc.gnu.org/pipermail/gcc-patches/2025-February/thread.html#675137
but it hasn't happened yet.
We are building now, and have been for a bit. Of the 8 patches that were required to build after the toolchain update, 6 are now upstream. https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3611/diffs?commit_id=da91c927eb1d424bd82d8023d4ce13ddae83289b Is the patch which deals with disabling -Werror=unterminated-string-initialization and I don't know if it will and upstream or not. |