Search code examples
clangcompiler-optimizationcompiler-flags

What flags does -march=native activate with Clang?


With GCC one is able to print out the specific flags that -march=native triggers. Is it possible to have Clang print similar information?


Solution

  • Instead of using the (non-existent in clang) -help=target flag, you can use echo | clang -E - -march=native -### to print out the compilation command. While this doesn't list the non-triggered flags and it's not pretty, it does list all the enabled flags.