CFLAGS
. CXXFLAGS
should be equal to CXXFLAGS="${CFLAGS}"
, and MAKEOPTS
only indicates the number of parallelly run compilation processes (usually the total number of processor cores is + 1)."-O2 -pipe"
. The -O
parameter indicates the level of optimization used. The second level is considered the highest safe, with the third level is often manifested instability of work. The -pipe
parameter instructs gcc to use in-memory channels instead of temporary files to exchange data between different stages of compilation. With the default value, binary files are built under the generic architecture, they work on different processor models, but do not take advantage of one or another model.-march=native
flag has appeared. With this flag, gcc automatically detects the type of processor, supported features, and uses them.cat /proc/cpuinfo
, pay attention to the flags row, in particular mmx * , 3dnow * , sse * , cx * ;gcc -march=native -O2 -Q --help=target -fverbose-asm
;-march=native
and, possibly, some more -m*
that are not automatically included;-mfpmath=
flag -mfpmath=
not specify any value, then write in make.conf -mfpmath=sse
;gcc -march=native -O2 -Q --help=optimizers -fverbose-asm
;-fomit-frame-pointer
, its inclusion is safe if you are not going to debug.gcc <your_options> -Q --help = target -fverbose-asm
gcc <your_options> -Q --help = optimizers -fverbose-asm
Without the -fverbose-asm
flag, gcc shows incorrect data. This is discussed here: http://www.gentoo.ru/node/14818 .
gcc <your_options> -E -v - </dev/null 2>&1 | sed -n 's/.* -v - //p'
gcc <your_options> -E -v - </dev/null 2>&1 | sed -n 's/.* -v - //p'
. Interest is, perhaps, only for developers.Source: https://habr.com/ru/post/108311/
All Articles