eudoxos
eudoxos

Reputation: 19085

strange silent cc1plus error in cygwin

I have latest cygwin with g++ 4.5 installed, under windows xp. The compiler was working well, but got broken somehow in the meantime (resetting env vars by rebooting?). I have a short test program (called cxx.cpp)

#include<iostream>
int main(void){
    for(int i=0; i<3; i++) std::cerr<<i<<std::endl;
}

and I run

$ g++ cxx.cpp   # no output, jsut exits
$ echo $?
1

Then trying

$ strace -ff g++-4 cxx.cpp
... lots of output ...
   18  151816 [main] g++-4 2804 build_env: env count 4, bytes 275
   37  151853 [main] g++-4 2804 build_env: envp 0x61274708, envc 47
  428  152281 [main] g++-4 2804 child_info::child_info: subproc_ready 0x6CC
 1399  153680 [main] g++-4 2804 child_info_spawn::worker: pid 2804, prog_arg /usr/lib/gcc/i686-pc-cygwin/4.5.3/cc1plus.exe, cmd line C:\cygwin\lib\gcc\i686-pc-cygwin\4.5.3\cc1plus.exe -quiet -D__CYGWIN32__ -D__CYGWIN__ -Dunix -D__unix__ -D__unix -idirafter /usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api -idirafter /usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/lib/../../include/w32api cxx.cpp -quiet -dumpbase cxx.cpp -mtune=generic -march=i686 -auxbase cxx -o /tmp/ccr4l3sS.s)
   28  153708 [main] g++-4 2804! child_info_spawn::worker: new process name \\?\C:\cygwin\lib\gcc\i686-pc-cygwin\4.5.3\cc1plus.exe
   19  153727 [main] g++-4 2804! child_info_spawn::worker: spawned windows pid 2816
   17  153744 [main] g++-4 2804! child_info::sync: n 2, waiting for subproc_ready(0x6CC) and child process(0x670)
--- Process 2816, exception C0000139 at 7C96671E
--- Process 2816, exception C0000139 at 7C96671E
 6683  160427 [main] g++-4 2804! child_info::sync: pid 2816, WFMO returned 1, exit_code 0xC0000139, res 0
  461  160888 [main] g++-4 2804! child_info::proc_retry: exit_code 0xC0000139

I see cc1plus has a trouble. I use what child_info_spawn::worker reveals to call myself

$ /lib/gcc/i686-pc-cygwin/4.5.3/cc1plus.exe -quiet -D__CYGWIN32__ -D__CYGWIN__ -Dunix -D__unix__ -D__unix -idir./../../include/w32api -idirafter /usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/lib/../../includtune=generic -march=i686 -auxbase cxx -o /tmp/ccr4l3sS.s
$ echo $?
127

Any suggestion how to analyze what is going wrong? What should I check? I am fairly new to cygwin.

EDIT: Running cc1plus under strace as

strace -ff /lib/gcc/i686-pc-cygwin/4.5.3/cc1plus.exe -quiet -D__CYGWIN32__ -D__CYGWIN__ -Dunix -D__unix__ -D__unix -idir./../../include/w32api -idirafter /usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/lib/../../includtune=generic -march=i686 -auxbase cxx -o /tmp/ccr4l3sS.s

leads to a popup dialog saying "The procedure entry point __gxx_personality_v0 could not be located in the dynamic link library cygstdc++-6.dll":

error dialgue screenshot

Upvotes: 1

Views: 1414

Answers (1)

eudoxos
eudoxos

Reputation: 19085

The problem with cygstdc++-6.dll lead me to think that previous hand-installation of gcc-4.7 with --program-suffix=-4.7 was the problem. Sure enough, according to http://gcc.gnu.org/faq.html#multiple, two versions of gcc cannot be installed in parallel even with different --program-suffix, as it only applies to programs, not libs, and a different --prefix must be used as well.

According to http://cygwin.com/ml/cygwin/2010-03/msg00031.html, reinstalling a few base packages should fix the issue.

Upvotes: 1

Related Questions