LLVM Clang Now Supports -mcpu=native On 64-bit ARM
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.
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.
Add A Comment