1、-march
不同架构的平台对应的-march不同,具体参考:https://gcc.gnu.org/onlinedocs/gcc 中“3.18 Machine-Dependent Options“”小节。查看机器对应的-march的方法:
gcc -c -Q -march=native --help=target
or
2、-arch
附:-arch的其他介绍
-arch arch
Compile for the specified target architecture arch. The allowable values are ‘i386’, ‘x86_64’, ‘ppc’ and ‘ppc64’. Multiple options work, and direct the compiler to produce “universal” binaries including object code for each architecture specified with -arch. This option only works if assembler and libraries are available for each architecture specified. (APPLE ONLY)
具体参考网址:https://stackoverflow.com/questions/1754460/apples-gcc-whats-the-difference-between-arch-i386-and-m32