- 論壇徽章:
- 0
|
http://gcc.gnu.org/ml/gcc-bugs/2008-07/msg01669.html
遇到一模一樣的問題,但由于我那個(gè)是嵌入式編譯的,命令可能稍復(fù)雜,我就直接貼網(wǎng)上這個(gè)例子了,也是搜到的唯一一個(gè)
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工具選項(xiàng).下面任一種改動(dòng)都可以解決問題:
1. 去掉-g選項(xiàng)
2. 源文件里的匿名namespace改成有名的
3. 源文件里加上一些沒什么用的代碼,或是注釋掉某些行
4. 去掉gcov相關(guān)選項(xiàng).
5.換成本地x86的g++編譯成本機(jī)版本
以上都不可行,因?yàn)間cov跟-g是一定要的,這樣的文件有很多,暫時(shí)不想每個(gè)文件都改namespace.
BTW,用匿名namespace是在用UnitTest++寫test case的時(shí)候避免名字沖突用的.
請(qǐng)問各位有見過這個(gè)問題嗎?有何解決方案不? |
|