-march=native portability limits between build hosts
0 reputation · 24 Apr 2020, 17:00 UTC
A build policy is being defined for Clang/LLVM projects that compile with host-specific CPU targeting. The goal is to understand the documented limits of -march=native for reproducible artifacts across different build environments.
The documented behavior resolves -march=native to the CPU features present on the build host at compile time, with no runtime CPU detection emitted by the compiler. This creates a portability constraint when build hosts have newer ISA extensions than deployment targets, and builds are not hermetic across machines.
What CPU name and enabled extensions does Clang document as the resolution for -march=native? How is portability characterized in the documented behavior of -march=native? Is there documented support for constraining the native target to a portable baseline without changing the flag?