www.digitalmars.com         C & C++   DMDScript  

D.gnu - completely unable to cross-build gdc for mingw32

reply downs <default_357-line yahoo.de> writes:
I have in the last few days made about a dozen of attempts to cross-build GDC's
SVN version on GCC 4.1.2, targetting mingw32.

I have been completely unable to get a working compiler out of this. All the
compilers I tested were completely unable to handle exceptions (instead of
traversing the stack, the test program, a simple "try throw new Exception("");
catch (Exception ex) { }", takes the easy way out and simply exits).

Did anybody here have the same problem, and can help me out? What's the secret
ingredient required to make GDC cross-compiling work?

Any hints greatly appreciated,

 --downs (desperate)
Feb 05 2008
parent downs <default_357-line yahoo.de> writes:
downs wrote:
 I have in the last few days made about a dozen of attempts to cross-build
GDC's SVN version on GCC 4.1.2, targetting mingw32.
 
 I have been completely unable to get a working compiler out of this. All the
compilers I tested were completely unable to handle exceptions (instead of
traversing the stack, the test program, a simple "try throw new Exception("");
catch (Exception ex) { }", takes the easy way out and simply exits).
 
 Did anybody here have the same problem, and can help me out? What's the secret
ingredient required to make GDC cross-compiling work?
 
 Any hints greatly appreciated,
 
  --downs (desperate)
I have reproduced the problem on native Linux. It's definitely the SjLj exceptions' fault - somehow GCC's unwinding code is unable to see the handlers that GDC generated. I'm a complete noob in this regard, but I went ahead and added some debugging code that seems to indicate the stack traversal code completely ignores all present exception handlers and terminates with "bottom of stack found". I can see two options. One, make SjLj exceptions work reliably, or two, try to get dwarf2 exceptions to work under win32. Either way, I have no idea how to proceed. Help urgently needed. --downs
Feb 05 2008