- 论坛徽章:
- 0
|
http://gcc.gnu.org/ml/gcc-bugs/2008-07/msg01669.html
遇到一模一样的问题,但由于我那个是嵌入式编译的,命令可能稍复杂,我就直接贴网上这个例子了,也是搜到的唯一一个
Compiling PositionEstimator.cpp with g++ (for coverage)
which g++
/usr/bin/g++
g++ --version
g++ (GCC) 4.1.2 (Ubuntu 4.1.2-0ubuntu4)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
g++ -Wall -Wextra -g -O0 -I ../Astro -I
/home/sam/dnp/External/tools/boost_1_35_0 -I ../DNPStack -I
../External/TrackerLib -I ../External/TrackerLib/leastsquares -I
../External/quat -I includes -I ../ETracker -pg -fprofile-arcs -ftest-coverage
-D PSI_CYGWIN -fprofile-arcs -ftest-coverage -c PositionEstimator.cpp -MD -o
Linux_i686/PositionEstimator.o -save-temps
PositionEstimator.cpp: In function ?(static initializers for
PositionEstimator.cpp)?:
PositionEstimator.cpp:47: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
For Debian GNU/Linux specific bug reporting instructions,
see <URL:file:///usr/share/doc/gcc-4.1/README.Bugs>.
Preprocessed source stored into /tmp/ccWZm8Cl.out file, please attach this to
your bugreport.
里面加了profiling支持,也就是gcov工具选项.下面任一种改动都可以解决问题:
1. 去掉-g选项
2. 源文件里的匿名namespace改成有名的
3. 源文件里加上一些没什么用的代码,或是注释掉某些行
4. 去掉gcov相关选项.
5.换成本地x86的g++编译成本机版本
以上都不可行,因为gcov跟-g是一定要的,这样的文件有很多,暂时不想每个文件都改namespace.
BTW,用匿名namespace是在用UnitTest++写test case的时候避免名字冲突用的.
请问各位有见过这个问题吗?有何解决方案不? |
|