Re: [PATCH v2] x86/build/64: Prevent native builds from generating APX instructions

Miguel Ojeda <[email protected]>
Newsgroups gmane.linux.kernel,gmane.linux.kernel.rust,gmane.linux.kernel.stable
Message-ID <CANiq72=bEB5-GvvroXigiCVtHjGtkhs1ARkk+mDbvjNAR4XKVQ@mail.gmail.com>
On Fri, Aug 7, 2026 at 5:43 PM Chang S. Bae <[email protected]> wrote:
>
> Omar reported this broad concern to me, when resolving a separate issue
> with his custom module. CONFIG_X86_NATIVE_CPU=y allows builds to
> opportunistically emit APX instructions when the build host supports APX
> since the commit.

I think this sentence may be cut? I guess this refers to the commit in
the Fixes tag.

> For Rust, APX must be explicitly disabled because any backend supporting
> APX may otherwise emit APX instructions with target-cpu=native. Pass
> features=-apxf through the generated JSON to avoid unstable-feature
> warnings.

So, just to confirm: is Rust 1.88 (with a new enough LLVM) enough to
avoid the warnings? Maybe a link to the tracking issue would be nice:

  https://github.com/rust-lang/rust/issues/139284

> Support for this gating also depends on the Rust/LLVM combination. Rust
> 1.88 introduced the `apxf` feature option, but versions prior to 1.93 may
> emit an `apxf` attribute which LLVM 23 or later can interpret. Restrict
> native Rust builds accordingly.
>
> Fixes: ea1dcca1de12 ("x86/kbuild/64: Add the CONFIG_X86_NATIVE_CPU option to locally optimize the kernel with '-march=native'")

This looks like it exists in 6.18.y+, so I assume this should have:

Cc: [email protected]

Thanks!

Cheers,
Miguel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.