The third expansion

gcc -static role of
static is to allow gcc to compile static, that is, all require libraries are integrated into the compiled program, this program can not rely on external libraries to run.
About three optimization
-O1: This is the most basic level of optimization. The compiler will try not to spend too much time at the same time generate compile faster, smaller code. These optimizations are very basic, but generally these tasks certainly be completed successfully.
-O2: -O1 advanced. This is the recommended level of optimization unless you have special needs. -O2 will enable some more marked than -O1. After setting the -O2, the compiler will attempt to increase code performance without increasing the volume and time-intensive compilation of.
-O3: This is the highest and most dangerous level of optimization. Extension of time to compile the code with this option, and should not be globally enabled in the system using gcc4.x's. Since the behavior of gcc 3.x version has been greatly changed. In 3.x, -O3 generated code is only just a little bit faster than -O2, and gcc4.x also not necessarily faster. With -O3 to compile all the packages will have a greater volume of consumption of more binary memory, greatly increasing the chance fail to compile the program behavior or unpredictable (including errors). Doing more harm than good to remember too far. -O3 is not recommended for use in gcc 4.x. in.

Published 10 original articles · won praise 0 · Views 269

Guess you like

Origin blog.csdn.net/m0_46451503/article/details/104918339
Recommended