diff options
| author | Nathan Chancellor <nathan@kernel.org> | 2026-10-20 14:52:19 -0700 |
|---|---|---|
| committer | Nathan Chancellor <nathan@kernel.org> | 2026-10-20 14:55:40 -0700 |
| commit | e58096244338308dde3fa76982c8042981ddda52 (patch) | |
| tree | e9fc1562fddea1b18c17eeb594f0935d4c2ce1ec /tools/perf/scripts/python | |
| parent | 9a6882502d353b89fd2c82b03d9267c94684e4b2 (diff) | |
scripts/Kconfig.toolchain: Highlight cc-option differences between Kconfig and Kbuild
Performing cc-option checks in Kconfig instead of Kbuild can help speed
up incremental builds where the configuration does not change, as the
results of the probes can be easily cached. However, there are two
potential issues that folks need to consider when using cc-option in
Kconfig compared to Kbuild.
The first is that in Kbuild, cc-option additions are cumulative, so
KBUILD_CFLAGS += $(call cc-option,-mfoo)
KBUILD_CFLAGS += $(call cc-option,-mbar)
results in '-mbar' being tested with '-mfoo' if it was supported. In
Kconfig, '-mbar' would be tested without '-mfoo', which could change the
result if '-mbar' depends on '-mfoo' being present, so it would need to
test support with
$(cc-option,-mbar -mfoo)
The second is that the Kconfig stage is where questions like "is the
target architecture 32-bit or 64-bit" or "is the target architecture big
or little endian" are answered, which very much matters for testing
compiler options. Toolchains may be configured for either option, so the
kernel needs to pass compiler flags like '-m32', '-m64',
'-mlittle-endian', and '-mbig-endian' to properly match a user's
configuration choices. Without these flags, '-mfoo' is tested against a
toolchain's configured default, resulting in an inconsistent answer to
whether the flag is actually supported for the requested configuration.
This could manifest as a build breakage from an unexpectedly included
but unsupported flag or missing functionality from an unexpected omitted
flag.
Add a big comment summarizing these two issues to help future travelers.
Link: https://patch.msgid.link/20261020-kconfig-fix-mfentry-check-v1-2-428258bc0fc0@kernel.org
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
