Re: [PATCH 2/3] kconfig: Replace "cc-option-bit" with "cc-option-str"

From: Julian Braha

Date: Mon Sep 21 2026 - 09:10:30 EST


On 9/19/26 01:59, Kees Cook wrote:
> $(cc-option-bit) returns the flag it was given when the compiler accepts
> it, and an empty string otherwise. It was originally only used
> internally for machine bit flags, but it is generally useful[1].
>
> Rename it to $(cc-option-str), which says what it returns rather than
> what it was first used for, and extract the probe logic from the existing
> $(cc-option) macro to reuse it. Additionally add support for an optional
> fallback, much like the Kbuild cc-option macro. This can be used as:
>
> config CC_OPT_FOO
> def_string "$(cc-option-str,-fnew-option,-fold-option)"
>
> If the fallback is omitted, it is just an empty string.
>
> Build tested ARCH=x86_64 defconfig with GCC 16.2.0.
>
> Assisted-by: LLM
> Signed-off-by: Kees Cook <kees@xxxxxxxxxx>

Tested-by: Julian Braha <julianbraha@xxxxxxxxx>
Reviewed-by: Julian Braha <julianbraha@xxxxxxxxx>