Linux kbuild/kconfig development
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Julian Braha <julianbraha@gmail.com>
Cc: Nicolas Schier <nsc@kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Bill Wendling <morbo@google.com>,
	Justin Stitt <justinstitt@google.com>,
	Arnd Bergmann <arnd@arndb.de>, Kees Cook <kees@kernel.org>,
	linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org,
	llvm@lists.linux.dev
Subject: Re: [PATCH 4/4] scripts/Kconfig.toolchain: Document minimum supported versions for dynamic checks
Date: Wed, 11 Nov 2026 17:59:03 -0700	[thread overview]
Message-ID: <20261112005903.GA2891174@ax162> (raw)
In-Reply-To: <6d7d25fa-69ef-42b0-b7f2-bb59ebf0eb2f@gmail.com>

On Wed, Nov 11, 2026 at 07:01:19PM +0000, Julian Braha wrote:
> Love, love, love this!
> 
> I tested the bounds and replicated nearly all of your results, but had a
> few notes:

Thanks a lot for double checking me! I adjusted the comment format in v2
to link the corresponding tool commit to make future audits easier to
validate.

> 'asm goto' failed for me with clang 10. Seems it was added with
> clang 11 [1]

Yes, good catch!

  https://github.com/llvm/llvm-project/commit/50cac248773c3a023e8f6ceb9938bdd5e9f15da2

I have adjusted this in v2.

> Clang 15 supports '-fstrict-flex-arrays' [1] so the check seemingly
> passed, but support for level 3 wasn't actually added until clang 16.

Yeah, I probably should have mentioned that it was only '3' that was
supported in clang-16. I added the direct link to the change in v2 that
makes that clearer.

> I think this needs a:
>     'depends on !CC_IS_CLANG || CLANG_VERSION >= 160000'
> so the option evaluates as empty string when these deps are unmet.

We don't need to add this dependency for two reasons though. The minimum
supported version of clang for building the kernel is 17.0.1, so that
dependency would be tautological. Even if it wasn't,
'-fstrict-flex-arrays=3' can be added to the command line without error
in clang-15, it just doesn't do anything.

  $ clang-15 -fstrict-flex-arrays=3 -c -o /dev/null -x c /dev/null
  $ clang-15 -fstrict-flex-arrays=4 -c -o /dev/null -x c /dev/null
  $ clang-16 -fstrict-flex-arrays=4 -c -o /dev/null -x c /dev/null
  error: invalid value '4' in '-fstrict-flex-arrays=4'

This has been a problem since the cc-option call was added to Makefile
in commit df8fc4e934c1 ("kbuild: Enable -fstrict-flex-arrays=3"), so I
did not do anything else about this in v2.

> '-mnop-mcount' worked for me on x86 with gcc 5 [3], but it seems s390
> support came later in v9 [4]

Thanks, I adjusted the comment to document the asymmetric architecture
and version matrix here. Turns out clang actually just recently added
support for this for x86:

  https://github.com/llvm/llvm-project/commit/f514b16972f785fdd3fad1d19195aad5c9324fb5
-- 
Cheers,
Nathan

  reply	other threads:[~2026-11-12  0:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-11  5:42 [PATCH 0/4] scripts/Kconfig.toolchain: Document minimum supported versions for dynamic checks Nathan Chancellor
2026-11-11  5:42 ` [PATCH 1/4] scripts/Kconfig.toolchain: Remove CONFIG_CC_HAS_NO_PROFILE_FN_ATTR Nathan Chancellor
2026-11-11 19:06   ` Nick Desaulniers
2026-11-11 19:10     ` Nathan Chancellor
2026-11-11 19:29       ` Nick Desaulniers
2026-11-11  5:42 ` [PATCH 2/4] scripts/Kconfig.toolchain: Do not dynamically probe '-fno-addrsig' Nathan Chancellor
2026-11-11 16:51   ` Nick Desaulniers
2026-11-11 18:36     ` Nathan Chancellor
2026-11-11 18:45       ` Nick Desaulniers
2026-11-11  5:42 ` [PATCH 3/4] scripts/Kconfig.toolchain: Clean up '-fno-allow-store-data-races' handling Nathan Chancellor
2026-11-11  5:42 ` [PATCH 4/4] scripts/Kconfig.toolchain: Document minimum supported versions for dynamic checks Nathan Chancellor
2026-11-11 19:01   ` Julian Braha
2026-11-12  0:59     ` Nathan Chancellor [this message]
2026-11-12 17:23 ` [PATCH 0/4] " Kees Cook

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=20261112005903.GA2891174@ax162 \
    --to=nathan@kernel.org \
    --cc=arnd@arndb.de \
    --cc=julianbraha@gmail.com \
    --cc=justinstitt@google.com \
    --cc=kees@kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=morbo@google.com \
    --cc=ndesaulniers@google.com \
    --cc=nsc@kernel.org \
    /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