How to see which flags -march=native will activate?
To see command-line flags, use:
gcc -march=native -E -v - </dev/null 2>&1 | grep cc1
If you want to see the compiler/precompiler defines set by certain parameters, do this:
echo | gcc -dM -E - -march=native
It should be (-###
is similar to -v
):
echo | gcc -### -E - -march=native
To show the "real" native flags for gcc.
You can make them appear more "clearly" with a command:
gcc -### -E - -march=native 2>&1 | sed -r '/cc1/!d;s/(")|(^.* - )//g'
and you can get rid of flags with -mno-* with:
gcc -### -E - -march=native 2>&1 | sed -r '/cc1/!d;s/(")|(^.* - )|( -mno-[^\ ]+)//g'
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.