[m-rev.] [m-dev.] Mercury, Emscripten, and WebAssembly

Patrick Henning path at fea.st
Tue Mar 31 11:07:58 AEDT 2020


So hypothetically it should be fine with the hlc.gc grade to use a simple ’stub’ for `signal` or `sigaction` to placate the linker. Unfortunately the Boehm GC test function `GC_is_visible`, used during the mercury run time init process, is not succeeding. Is it safe to assume that this problem has nothing to do with signals then?

Thanks,
Patrick
On Mar 30, 2020, 4:53 PM -0700, Peter Wang <novalazy at gmail.com>, wrote:
> On Mon, 30 Mar 2020 00:42:09 -0700, Patrick Henning <path at fea.st> wrote:
> > Does Mercury need `signal` in the absence of `sigaction`? If so, the porting may not be possible currently since neither of these are implemented for emscripten unfortunately.
>
> The runtime will use signal if sigaction is not available;
> see MR_set_signal_action.
>
> The runtime does set up signal handlers for SIGSEGV/SIGBUS to display an
> error message in case of a crash, but is not really required.
>
> Time profiling grades (.prof) need to set a signal handler for a timer
> signal (see MR_init_time_profile_method), so you could not use those
> grades.
>
> Parallel grades (.par) will need to set signal handlers which are used
> in the stop-the-world implementation for GC, so you could not those
> grades.
>
> Debugging grades set a couple of signal handlers.
>
> Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20200330/ae68cc05/attachment-0001.html>


More information about the reviews mailing list