From: David Laight <david.laight.linux@gmail.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Nathan Chancellor <nathan@kernel.org>,
Ingo Molnar <mingo@kernel.org>,
linux-kernel@vger.kernel.org, linux-tip-commits@vger.kernel.org,
"Borislav Petkov (AMD)" <bp@alien8.de>,
stable@vger.kernel.org, x86@kernel.org
Subject: Re: [tip: x86/urgent] x86/build: Do not allow X86_NATIVE_CPU to be enabled when compile testing
Date: Mon, 16 Nov 2026 22:36:28 +0000 [thread overview]
Message-ID: <20261116223628.5a6139a7@pumpkin> (raw)
In-Reply-To: <CAHk-=wgmkoWHWwaQ6nsGoCiBp0hrpJuiwmoVbQ=Efun8JyUNKw@mail.gmail.com>
On Mon, 16 Nov 2026 07:48:34 -0800
Linus Torvalds <torvalds@linux-foundation.org> wrote:
> On Mon, 16 Nov 2026 at 05:02, Nathan Chancellor <nathan@kernel.org> wrote:
> >
> > On Mon, Nov 16, 2026 at 10:40:01AM +0100, Ingo Molnar wrote:
> > > Can we just limit the feature to when host == target, ie. to not
> > > work it around in such a crude fashion?
> >
> > That was my v1 but Boris didn't like it:
> >
> > https://lore.kernel.org/20261113-x86-no-march-native-on-non-x86_64-v1-1-cbc8b096d1c4@kernel.org
>
> Well, that is admittedly very crude and hacky.
>
> Maybe we should have some config variables that depend on HOSTCC, and
> detect it *that* way. It does appear that we don't have any model for
> cross-compiling in the Kconfig setup, but maybe we should..
>
> I'd actually love to have support for making the compiler itself part
> of Kconfig, so that the gcc-vs-clang could be *in* the .config file
> rather than being an external thing to it.
>
> I've mentioned that before, and the problem has typically been that we
> end up depending on 'CC' outside of the Kconfig scripts and
> independently of the current config.
I don't even remember a check that the compiler is right for the architecture.
I'm sure I've got strange errors when I've forgotten I need to specify the
compiler for a cross build - and then forgotten where I'd put the compiler,
Oh and forgotten all the things you need to set to get clang to do a
cross compile.
David
>
> The recent work to move the compiler flags into Kconfig itself may
> have lessened some of those dependencies, but there's probably still
> lots of small details.
>
> But for the whole "cross-compile", maybe we can just say that
> X86_NATIVE_CPU depends on '$CC' being the same as '$HOSTCC'.
>
> Or even do '$(CC) -v" and '$(HOSTCC) -v' and check for 'Target' being
> the same, and having a CONFIG_CROSSCOMPILE thing for that?
>
> Linus
>
prev parent reply other threads:[~2026-11-16 22:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 6:05 [tip: x86/urgent] x86/build: Do not allow X86_NATIVE_CPU to be enabled when compile testing tip-bot2 for Nathan Chancellor
2026-11-16 9:40 ` Ingo Molnar
2026-11-16 13:01 ` Nathan Chancellor
2026-11-16 15:48 ` Linus Torvalds
2026-11-16 15:53 ` Linus Torvalds
2026-11-16 20:45 ` Nathan Chancellor
2026-11-16 22:36 ` David Laight [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261116223628.5a6139a7@pumpkin \
--to=david.laight.linux@gmail.com \
--cc=bp@alien8.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=nathan@kernel.org \
--cc=stable@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox