[PATCH v3 0/2] x86: Avoid CONFIG_X86_NATIVE_CPU=y when cross compiling
From: Nathan Chancellor
Date: Wed Nov 25 2026 - 01:43:33 EST
This series addresses an massive spew of warnings that I see when cross
compiling x86 allmodconfig on certain ARM machines. To resolve these
warnings, introduce a Kconfig symbol for when cross compiling and avoid
allowing CONFIG_X86_NATIVE_CPU to be enabled when it is set.
This could go through either the kbuild or -tip tree, I don't have a
strong preference.
---
Changes in v3:
- Introduce CONFIG_CROSS_COMPILING to perform the host == target check
from v1 in a generic way and make CONFIG_X86_NATIVE_CPU depend on it
not being set (Linus)
- Add bug link to second patch (Nick)
- Link to v2: https://patch.msgid.link/20261115-x86-no-march-native-on-non-x86_64-v2-1-fb3f9634b1bc@xxxxxxxxxx
Changes in v2:
- Rather than checking if host == target, just make X86_NATIVE_CPU
depend on !COMPILE_TEST, which makes sense anyways (Borislav)
- Link to v1: https://patch.msgid.link/20261113-x86-no-march-native-on-non-x86_64-v1-1-cbc8b096d1c4@xxxxxxxxxx
---
Nathan Chancellor (2):
kbuild: Introduce CONFIG_CROSS_COMPILING
x86/build: Do not allow X86_NATIVE_CPU to be enabled when cross compiling
MAINTAINERS | 1 +
arch/x86/Kconfig.cpu | 1 +
scripts/Kconfig.toolchain | 3 +++
scripts/check-cross-compiling.sh | 26 ++++++++++++++++++++++++++
4 files changed, 31 insertions(+)
---
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
base-tree: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
change-id: 20261113-x86-no-march-native-on-non-x86_64-88233b48a7d7
Best regards,
--
Cheers,
Nathan