Skip to content

Commit 174ac65

Browse files
committed
modules/linux: Consolidate EXTRA_FLAGS, version-dependent -std=gnu11 for 6.1.8 only
Remove duplication of EXTRA_FLAGS definition across kernel versions. Define base flags once (-fdebug-prefix-map, -gno-record-gcc-switches), then conditionally add -std=gnu11 only for kernel 6.1.8 which requires GCC 15.1 C23 compatibility workaround. Other kernel versions (4.14.62, 4.19.139, 5.4.69, 5.10.214, 6.6.16-openpower) compile without workaround flags. Ref: GCC 15.1.0 upgrade (PR #1991) Signed-off-by: Thierry Laurion <insurgo@riseup.net>
1 parent c8047fc commit 174ac65

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

modules/linux

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ else
3838
$(error "$(BOARD): does not specify linux kernel version under CONFIG_LINUX_VERSION")
3939
endif
4040

41+
# Base EXTRA_FLAGS for all Linux versions
42+
EXTRA_FLAGS := -fdebug-prefix-map=$(pwd)=heads -gno-record-gcc-switches
43+
44+
# TODO(GCC15-LINUX): 6.1.8 requires -std=gnu11 for C23 compatibility (bool/false keyword conflicts)
45+
ifeq "$(CONFIG_LINUX_VERSION)" "6.1.8"
46+
EXTRA_FLAGS += -std=gnu11
47+
endif
48+
4149
linux_base_dir := linux-$(linux_version)
4250

4351
# input file in the heads config/ dir
@@ -138,9 +146,6 @@ linux_modules-$(CONFIG_LINUX_NVME) += drivers/nvme/host/nvme-core.ko
138146
linux_modules-$(CONFIG_LINUX_MEI) += drivers/misc/mei/mei.ko
139147
linux_modules-$(CONFIG_LINUX_MEI) += drivers/misc/mei/mei-me.ko
140148

141-
#TODO: remove -std=gnu11 when bumping linux version (current 6.1.8 has C23 compatibility issues with GCC 15.1.0 bool/false conflicts)
142-
EXTRA_FLAGS := -fdebug-prefix-map=$(pwd)=heads -gno-record-gcc-switches -std=gnu11
143-
144149
ifeq "$(CONFIG_LINUX_VERSION)" "4.14.62"
145150
EXTRA_FLAGS += -Wno-cast-function-type
146151
endif

0 commit comments

Comments
 (0)