Skip to content

Commit 3b8b80e

Browse files
nathanchanceAlexander Gordeev
authored andcommitted
s390: Add '-std=gnu11' to decompressor and purgatory CFLAGS
GCC changed the default C standard dialect from gnu17 to gnu23, which should not have impacted the kernel because it explicitly requests the gnu11 standard in the main Makefile. However, there are certain places in the s390 code that use their own CFLAGS without a '-std=' value, which break with this dialect change because of the kernel's own definitions of bool, false, and true conflicting with the C23 reserved keywords. 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 Add '-std=gnu11' to the decompressor and purgatory CFLAGS to eliminate these errors and make the C standard version of these areas match the rest of the kernel. Cc: stable@vger.kernel.org Signed-off-by: Nathan Chancellor <nathan@kernel.org> Tested-by: Heiko Carstens <hca@linux.ibm.com> Link: https://lore.kernel.org/r/20250122-s390-fix-std-for-gcc-15-v1-1-8b00cadee083@kernel.org Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
1 parent 0a89123 commit 3b8b80e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

arch/s390/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ KBUILD_AFLAGS_DECOMPRESSOR := $(CLANG_FLAGS) -m64 -D__ASSEMBLY__
2222
ifndef CONFIG_AS_IS_LLVM
2323
KBUILD_AFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO),$(aflags_dwarf))
2424
endif
25-
KBUILD_CFLAGS_DECOMPRESSOR := $(CLANG_FLAGS) -m64 -O2 -mpacked-stack
25+
KBUILD_CFLAGS_DECOMPRESSOR := $(CLANG_FLAGS) -m64 -O2 -mpacked-stack -std=gnu11
2626
KBUILD_CFLAGS_DECOMPRESSOR += -DDISABLE_BRANCH_PROFILING -D__NO_FORTIFY
2727
KBUILD_CFLAGS_DECOMPRESSOR += -D__DECOMPRESSOR
2828
KBUILD_CFLAGS_DECOMPRESSOR += -fno-delete-null-pointer-checks -msoft-float -mbackchain

arch/s390/purgatory/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ CFLAGS_sha256.o := -D__DISABLE_EXPORTS -D__NO_FORTIFY
1313
$(obj)/mem.o: $(srctree)/arch/s390/lib/mem.S FORCE
1414
$(call if_changed_rule,as_o_S)
1515

16-
KBUILD_CFLAGS := -fno-strict-aliasing -Wall -Wstrict-prototypes
16+
KBUILD_CFLAGS := -std=gnu11 -fno-strict-aliasing -Wall -Wstrict-prototypes
1717
KBUILD_CFLAGS += -Wno-pointer-sign -Wno-sign-compare
1818
KBUILD_CFLAGS += -fno-zero-initialized-in-bss -fno-builtin -ffreestanding
1919
KBUILD_CFLAGS += -Os -m64 -msoft-float -fno-common

0 commit comments

Comments
 (0)