Re: [PATCH 4/4] scripts/Kconfig.toolchain: Document minimum supported versions for dynamic checks
From: Nathan Chancellor
Date: Wed Nov 11 2026 - 19:59:20 EST
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