Skip to contentSkip to conversation

kbuild: add GCC stability warning

PATCH Superseded Samuel Rowberry 1 participant 1 message Mar 29 Kbuild

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kbuild: add GCC stability warning

Newer GCC versions are not fully compatible with the code. Adding a warning lets users know without getting in the way of setups where it is okay to use GCC 15 (or is needed.)

---
 Makefile | 13 +++++++++++++
 1 file changed, 13 insertions(+)
Makefile +13 -0
index 02902bcae..361b5a509 100644
@@ -720,6 +720,19 @@ endif
 
 export KBUILD_MODULES KBUILD_BUILTIN
 
+# Version check on demand because configs can get stale
+# This check is GCC-only because that is standard
+# and if someone is using a custom setup, then it is
+# assumed that their setup works.
+ifeq ($(KBUILD_BUILTIN)$(KBUILD_MODULES),11)
+ifneq ($(findstring GCC,$(CC_VERSION_TEXT)),)
+CURRENT_CC_VERSION := $(shell $(CC) -dumpversion | cut -d. -f1)
+ifeq ($(shell expr $(CURRENT_CC_VERSION) \>= 15),1)
+$(warning "GCC $(CURRENT_CC_VERSION) detected. Please use GCC 11, 12, or 13 for stability.")
+endif
+endif
+endif
+
 ifdef need-config
 include include/config/auto.conf
 endif
Signature · 1 line
2.53.0