public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
From: Samuel Rowberry <sprowdev@gmail.com>
To: masahiroy@kernel.org
Cc: nathan@kernel.org, nicolas@fjasle.eu,
	linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
	Samuel Rowberry <sprowdev@gmail.com>
Subject: [PATCH] kbuild: add GCC stability warning
Date: Sun, 29 Mar 2026 12:02:26 -0600	[thread overview]
Message-ID: <20260329180226.443235-1-sprowdev@gmail.com> (raw)

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.)

Signed-off-by: Samuel Rowberry <sprowdev@gmail.com>
---
 Makefile | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/Makefile b/Makefile
index 02902bcae..361b5a509 100644
--- a/Makefile
+++ b/Makefile
@@ -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
-- 
2.53.0


                 reply	other threads:[~2026-03-29 18:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260329180226.443235-1-sprowdev@gmail.com \
    --to=sprowdev@gmail.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=nathan@kernel.org \
    --cc=nicolas@fjasle.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox