Referring to your last question: gcc 4.6.1 ( gcc/gcc.c) sources contain the following comment in %>:
%>S Similar to "%<S", but keep it in the GCC command line.
For completeness, following the comment for %<, create the same file:
%<S remove all occurrences of -S from the command line.
Note - this command is position dependent. % commands in the
spec string before this one will see -S, % commands in the
spec string after this one will not.
To answer the first question in short: yes, but ....
... The only general solution that I found has a significant flaw that will be ignored in the option -march, so each assembly is performed as if it were indicated -march=native. In any case, there is a workaround to this.
1 Solution (no workaround)
specs let say specs.nativealways, :
*cc1_cpu:
%<march=* -march=native %>march=native %:local_cpu_detect(arch) %{!mtune=*:%>mtune=native %:local_cpu_detect(tune)} %{mtune=native:%>mtune=native %:local_cpu_detect(tune)}
specs (, gcc -specs=specs.nativealways) , -march=native ( , -march=<arch> ).
2
, , -myarch , -march ( -myarch=native, , , native ).
specs :
*cc1_cpu:
%<march=* %{myarch=*:%<myarch* -march=%* ; :-march=native %>march=native %:local_cpu_detect(arch) %{!mtune=*:%>mtune=native %:local_cpu_detect(tune)}} %{mtune=native:%>mtune=native %:local_cpu_detect(tune)}
PS: gcc 4.6.2 Linux, MinGW.