获取 -march=native 的值
Jun 26, 2016
在 make.conf 里面的 CFLAGS 中可以指定 -march 和 -mtune,最简单的就是指定 native,自行适配.
结果最近我上了 distcc,发现这东西不能在用 native 了,必须要指定出来,那就要问问 gcc 了.
gcc -v -E -x c -march=native -mtune=native - < /dev/null 2>&1 | grep cc1 | perl -pe 's/ -mno-\S+//g; s/^.* - //g;'
然后你就得到了你的 CFLAGS.
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.