LLVM Clang Adds "-march=native" Support For The Apple M1

Written by Michael Larabel in LLVM on 28 March 2022 at 06:00 AM EDT. 1 Comment
LLVM
A subtle but notable change worth mentioning last week for LLVM Clang 15.0 is "-march=native" now working for this compiler when running on Apple M1 SoCs.

While "-march=native" is popular and widely used on x86/x86_64 processors for targeting the native/in-use processor's capabilities, the -march=native support on non-x86 CPUs has been spotty and not always supported for other architectures.

With this commit (it was reverted and then re-landed shortly afterwards last week) to LLVM Clang Git, -march=native now works (and correctly) for Apple M1 SoCs.


Asahi Linux on the Apple M1 Mac Mini.


So whether you are running Clang on macOS with an Apple M1 SoC or the likes of running Linux rather well on the Apple M1 hardware, you can now use "-march=native" if so desired for more optimized code generation.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week