./configure \
--enable-debug=3 \
--disable-optimizations \
--disable-asm \
--disable-stripping \
... ... (其它设置)
configure以后再看看生成的config.mak中-g前面的设置,如果是-O3,可以修改成-O1 或直接去掉(记得以前去掉-O选项编译不通过,不知怎么回事,可能什么地方设置不正确,反正现在是可以了)
看看gcc手册中是怎么说的
优化选项
-
Optimize. Optimizing compilation takes somewhat more time, and a lot more memory for a large function.
With -O, the compiler tries to reduce code size and execution time, without performing any optimizations that take a great deal of compilation time.
-O turns on the following optimization flags: (打开优化开关)
-fauto-inc-dec -fcompare-elim -fcprop-registers -fdce -fdefer-pop -fdelayed-branch -fdse -fguess-branch-probability -fif-conversion2 -fif-conversion -fipa-pure-const -fipa-pro
-O
-O1