Skip to contentSkip to conversation

s390: Add '-std=gnu11' to decompressor and purgatory CFLAGS

PATCH In review Heiko Carstens 2 participants 2 messages Jun 23, 2025 – Jun 25, 2025 Stable branch

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 s390: Add '-std=gnu11' to decompressor and purgatory CFLAGS

From: Nathan Chancellor <[email protected]>

commit 3b8b80e993766dc96d1a1c01c62f5d15fafc79b9 upstream.

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.

---
 arch/s390/Makefile           | 2 +-
 arch/s390/purgatory/Makefile | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
arch/s390/Makefile +1 -1
index 71e3d7c0b870..22dc393b5a83 100644
@@ -23,7 +23,7 @@ endif
 aflags_dwarf	:= -Wa,-gdwarf-2
 KBUILD_AFLAGS_DECOMPRESSOR := $(CLANG_FLAGS) -m64 -D__ASSEMBLY__
 KBUILD_AFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO),$(aflags_dwarf))
-KBUILD_CFLAGS_DECOMPRESSOR := $(CLANG_FLAGS) -m64 -O2
+KBUILD_CFLAGS_DECOMPRESSOR := $(CLANG_FLAGS) -m64 -O2 -std=gnu11
 KBUILD_CFLAGS_DECOMPRESSOR += -DDISABLE_BRANCH_PROFILING -D__NO_FORTIFY
 KBUILD_CFLAGS_DECOMPRESSOR += -fno-delete-null-pointer-checks -msoft-float
 KBUILD_CFLAGS_DECOMPRESSOR += -fno-asynchronous-unwind-tables
arch/s390/purgatory/Makefile +1 -1
index 9de56065f28c..2f4d8422bdfb 100644
@@ -20,7 +20,7 @@ GCOV_PROFILE := n
 UBSAN_SANITIZE := n
 KASAN_SANITIZE := n
 
-KBUILD_CFLAGS := -fno-strict-aliasing -Wall -Wstrict-prototypes
+KBUILD_CFLAGS := -std=gnu11 -fno-strict-aliasing -Wall -Wstrict-prototypes
 KBUILD_CFLAGS += -Wno-pointer-sign -Wno-sign-compare
 KBUILD_CFLAGS += -fno-zero-initialized-in-bss -fno-builtin -ffreestanding
 KBUILD_CFLAGS += -c -MD -Os -m64 -msoft-float -fno-common
Signature · 1 line
2.48.1
maintainer
#1 lore raw

[ Sasha's backport helper bot ]

Hi,

✅ All tests passed successfully. No issues detected. No action required from the submitter.

The upstream commit SHA1 provided is correct: 3b8b80e993766dc96d1a1c01c62f5d15fafc79b9

WARNING: Author mismatch between patch and upstream commit:
Backport author: Heiko Carstens<[email protected]> Commit author: Nathan Chancellor<[email protected]>

Status in newer kernel trees:
6.15.y | Present (exact SHA1)
6.12.y | Present (different SHA1: 593d852f7fe2) 6.6.y | Present (different SHA1: cefbf9f892ce) 6.1.y | Present (different SHA1: 62d33b9e68bd) 5.15.y | Not found
5.10.y | Not found

Note: The patch differs from the upstream commit:
---

1:  3b8b80e993766 < -:  ------------- s390: Add '-std=gnu11' to decompressor and purgatory CFLAGS
-:  ------------- > 1:  81f0ce117f8c7 s390: Add '-std=gnu11' to decompressor and purgatory CFLAGS

---

Results of testing on various branches:

| Branch                    | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-5.4.y        |  Success    |  Success   |