mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3 0/2] x86: Avoid CONFIG_X86_NATIVE_CPU=y when cross compiling
@ 2026-11-25  6:43 Nathan Chancellor
  2026-11-25  6:43 ` [PATCH v3 1/2] kbuild: Introduce CONFIG_CROSS_COMPILING Nathan Chancellor
  2026-11-25  6:43 ` [PATCH v3 2/2] x86/build: Do not allow X86_NATIVE_CPU to be enabled when cross compiling Nathan Chancellor
  0 siblings, 2 replies; 4+ messages in thread
From: Nathan Chancellor @ 2026-11-25  6:43 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen,
	Nathan Chancellor, Nicolas Schier
  Cc: x86, H. Peter Anvin, Nick Desaulniers, Bill Wendling,
	Justin Stitt, Julian Braha, linux-kernel, llvm, linux-kbuild,
	stable, Linus Torvalds

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@kernel.org

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@kernel.org

---
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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-25 10:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-25  6:43 [PATCH v3 0/2] x86: Avoid CONFIG_X86_NATIVE_CPU=y when cross compiling Nathan Chancellor
2026-11-25  6:43 ` [PATCH v3 1/2] kbuild: Introduce CONFIG_CROSS_COMPILING Nathan Chancellor
2026-11-25 10:27   ` Thomas Weißschuh
2026-11-25  6:43 ` [PATCH v3 2/2] x86/build: Do not allow X86_NATIVE_CPU to be enabled when cross compiling Nathan Chancellor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®