【发布时间】:2012-04-01 06:55:26
【问题描述】:
我正在尝试在调试会话中获取ZBar。我可以这样做,但我无法关闭优化器,因此我的调试会话意外地跳来跳去,并且许多变量在 Eclipse Indigo 中被标记为optimized-out。我在 Ubuntu 中运行。
我尝试在 Makefile 中的任何 gcc 调用中尽可能添加 -O0,因为最后一个 -O 是代理。我使用 -Q --help=optimizers 来查找要查找的内容,但它的输出有点奇怪:
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I./include -I./zbar -I./include -O0 -O0 -Q --help=optimizers -Wall -Wno-parentheses -O0 -g -O0 -Q --help=optimizers -MT zbar/zbar_libzbar_la-config.lo -MD -MP -MF zbar/.deps/zbar_libzbar_la-config.Tpo -c zbar/config.c -fPIC -DPIC -o zbar/.libs/zbar_libzbar_la-config.o
The following options control optimizations:
make[1]: *** [zbar/zbar_libzbar_la-config.lo] Error 1
-O<number>
make: *** [all] Error 2
-Ofast
-Os
-falign-functions [disabled]
-falign-jumps [disabled]
-falign-labels [disabled]
-falign-loops [disabled]
-fasynchronous-unwind-tables [enabled]
-fbranch-count-reg [enabled]
-fbranch-probabilities [disabled]
-fbranch-target-load-optimize [disabled]
-fbranch-target-load-optimize2 [disabled]
-fbtr-bb-exclusive [disabled]
-fcaller-saves [disabled]
-fcombine-stack-adjustments [disabled]
-fcommon [enabled]
-fcompare-elim [disabled]
etc...
显然,我已经在几个地方放置了 -O0。我对 ZBar 使用的 automake 没有任何经验。我试图避免必须从头开始制作自己的 Makefile,是否有关于在哪里禁用优化器的建议?我已经在 Makefile 中搜索了所有与优化相关的 -O 和任何 -f;我没有找到。在进行 Makefile 修改尝试后,该项目已被清理。
【问题讨论】:
标签: gcc compiler-optimization automake zbar-sdk