comp.lang.ada
 help / color / mirror / Atom feed
* snag in building Ada mode Emacs module on Linux
@ 2015-05-21 13:23 Stephen Leake
  2015-05-21 13:39 ` Simon Wright
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Leake @ 2015-05-21 13:23 UTC (permalink / raw)


I've got an Emacs module (which is a dynamic library with a defined
interface) that implements an OpenToken parser for Ada mode.

It works on Windows, where it is marginally faster than the elisp
parser. I have already identified some significant speedups to implement
in the parser; that will break compatibility with OpenToken, so I'll be
renaming it FastToken :).

But the point of this post is to ask for help/advice for Linux (and
possibly Mac).

The module doesn't compile on Linux, because GNAT GPL 2014 doesn't
provide a (static or dynamic) libgnat for the sjlj runtime that is
compiled with -fPIC. I need -fPIC on all code in order to include it in
the dynamic library that is the Emacs module. I need the sjlj runtime to
support raising exceptions in the module; since Emacs is not an Ada
main, it uses the sjlj exception method.

I haven't tested yet, but I'm assuming Debian Ada doesn't provide -fPIC
with sjlj either.

So it looks like I have to compile the GNAT runtime on Linux (Debian in
particular, for my test machine).

Anyone have any other suggestions?

Is there a similar problem on the Mac?

-- 
-- Stephe


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: snag in building Ada mode Emacs module on Linux
  2015-05-21 13:23 snag in building Ada mode Emacs module on Linux Stephen Leake
@ 2015-05-21 13:39 ` Simon Wright
  2015-05-28  4:14   ` Stephen Leake
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Wright @ 2015-05-21 13:39 UTC (permalink / raw)


Stephen Leake <stephen_leake@stephe-leake.org> writes:

> The module doesn't compile on Linux, because GNAT GPL 2014 doesn't
> provide a (static or dynamic) libgnat for the sjlj runtime that is
> compiled with -fPIC. I need -fPIC on all code in order to include it
> in the dynamic library that is the Emacs module. I need the sjlj
> runtime to support raising exceptions in the module; since Emacs is
> not an Ada main, it uses the sjlj exception method.

What will you do with the exceptions once they propagate out of Ada? Or
is it that exceptions won't work at all, even if caught at the boundary
and converted to a status return/out parameter?

> Is there a similar problem on the Mac?

Yes.

Will it be easy to recompile the runtime with a different exception
method? I don't even know what the switches would be! At least GNAT GPL
2014 comes with an adalib/Makefile.adalib; the FSF GCCs don't (but the
GPL 2014 one might well work with minimal change).

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: snag in building Ada mode Emacs module on Linux
  2015-05-21 13:39 ` Simon Wright
@ 2015-05-28  4:14   ` Stephen Leake
  0 siblings, 0 replies; 3+ messages in thread
From: Stephen Leake @ 2015-05-28  4:14 UTC (permalink / raw)


Simon Wright <simon@pushface.org> writes:

> Stephen Leake <stephen_leake@stephe-leake.org> writes:
>
>> The module doesn't compile on Linux, because GNAT GPL 2014 doesn't
>> provide a (static or dynamic) libgnat for the sjlj runtime that is
>> compiled with -fPIC. I need -fPIC on all code in order to include it
>> in the dynamic library that is the Emacs module. I need the sjlj
>> runtime to support raising exceptions in the module; since Emacs is
>> not an Ada main, it uses the sjlj exception method.
>
> What will you do with the exceptions once they propagate out of Ada? 

There's a top-level exception handler at the Ada/C boundary.

> Or
> is it that exceptions won't work at all, even if caught at the boundary
> and converted to a status return/out parameter?

They don't work at all; they generate SEGV.

>> Is there a similar problem on the Mac?
>
> Yes.
>
> Will it be easy to recompile the runtime with a different exception
> method? I don't even know what the switches would be! At least GNAT GPL
> 2014 comes with an adalib/Makefile.adalib; 

For GNAT GPL, apparently we can do:

cd /usr/gnat/lib/gcc/x86_64-pc-linux-gnu/4.7.4/rts-sjlj
chmod +w *
make -f Makefile.adalib ROOT=/usr/gnat CFLAGS='-fPIC'
chmod -w *

but I haven't tried it yet.

> the FSF GCCs don't (but the
> GPL 2014 one might well work with minimal change).

Hmph. I'll just dump that issue on the Linux packagers.

-- 
-- Stephe

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-05-28  4:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-21 13:23 snag in building Ada mode Emacs module on Linux Stephen Leake
2015-05-21 13:39 ` Simon Wright
2015-05-28  4:14   ` Stephen Leake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox