How to see which flags -march=native will activate?

vartec picture vartec · Mar 29, 2011 · Viewed 97.2k times · Source

I'm compiling my C++ app using GCC 4.3. Instead of manually selecting the optimization flags I'm using -march=native, which in theory should add all optimization flags applicable to the hardware I'm compiling on. But how can I check which flags is it actually using?

Answer

thkala picture thkala · Mar 29, 2011

You can use the -Q --help=target options:

gcc -march=native -Q --help=target ...

The -v option may also be of use.

You can see the documentation on the --help option here.