LLVM Clang Now Supports -mcpu=native On 64-bit ARM

Written by Michael Larabel in LLVM on 7 July 2018 at 09:22 AM EDT. Add A Comment
LLVM
For those compiling code on AArch64 (64-bit ARM) systems with LLVM Clang and tuning for your particular SoC, the Clang compiler now supports -mcpu=native.

The -mcpu option is used by compilers for determining the micro-architecture / processor type to be used for performance tuning. While this option has worked on AArch64 when specifying the CPU name, it hasn't worked with a value of "native" like it does with other architectures. But now with the latest LLVM Clang SVN/Git, -mcpu=native will work on AArch64 for making it easier than having to remember the actual CPU name or if wishing to maintain generic build scripts that work across different ARM64 systems while still tuning for each CPU.

The -mcpu=native support for AArch64 in Clang landed on Friday with this commit. The change will be present in the LLVM/Clang 7.0 release due out in September.
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