WAROQUIERS Philippe <[email protected]> writes:

> c_main : this one contains calls to adainit + a call to an Ada
> procedure exported to C. This procedure handles all exceptions and
> calls another Ada procedure that raises an exception.

On Windows, with GNAT gpl 2014, this runs fine.

> dl_open_main: this one does not contain any references to an Ada call.
> However, it dynamically loads the Ada shared lib, acquires the needed
> symbols, and then do the same sequence as c_main.

First I changed dl_open_main to use ltdl instead of dl, since ltdl works
on Windows.

Then I compiled the dll with GNAT gpl 2014, and the C main with
mingw32 gcc; this is the Emacs build environment.

This gives a crash at the point of the raise.

Recompiling libadashlib.dll with --RTS=sjlj eliminates the crash.

On the other hand, recompiling libadashlib.dll with mingw32 gcc, without
--RTS=sjlj, also eliminates the crash.

So it appears the problem is mixing gcc versions, although I don't
understand why using sjlj is a workaround. Unless mingw32 gcc always
uses sjlj.

Thanks for the simple example; it makes things quite clear.

This does fix my original problem, which was how to compile the .so on
Linux; the answer is I don't need sjlj on Linux (or Mac).

I'll try compiling my full dll with mingw32 gcc. But that doesn't have
gprbuild, which makes things much more difficult. Sigh. 

-- 
-- Stephe

_______________________________________________
Emacs-ada-mode mailing list
[email protected]
http://host114.hostmonster.com/mailman/listinfo/emacs-ada-mode_stephe-leake.org

Reply via email to