[mercury-users] dynamic linking, Guile

Peter Wang novalazy at gmail.com
Tue Feb 9 10:50:01 AEDT 2010


On 2010-02-07, Julien Fischer <juliensf at csse.unimelb.edu.au> wrote:
> 
> Hi,
> 
> On Sat, 6 Feb 2010, Tomas By wrote:
> 
> >I am trying to write a Guile module in Mercury. Have created a dynamic
> >library using the Mercury compiler, but when I try to load it in Guile,
> >with "dynamic link", I get errors. Apparently Guile, like Mercury, uses
> >the Boehm GC, and the problem seems related to this. In my first try,
> >my Mercury .so was linked with the libgc.so in the Mercury distribution,
> >and then I tried linking it with the one that Guile uses instead (by
> >the crude method of renaming the Mercury libgc.so). It seems to me that
> >the problems are the same in both cases. What the "mmap2", "mprotect",
> >and "munmap" calls are about I do not know.
> >
> >Has anybody done this before? Could somebody explain how to tell the
> >Mercury compiler to use the system wide libgc using polite language?
> 
> The version of libgc that Mercury uses contains Mercury specific
> modifications; I would be surprised if linking against the system
> wide one worked.

The changes are not extensive and are not crucial; search for "mercury"
(case insensitive) in the boehm_gc directory.  Assuming you replace the
Mercury-specific version of the library with the unmodified one, you
should only need to comment out parts of the files in the `runtime'
directory which refer to undefined symbols; search for "GC_mercury".

Perhaps we should rename our copy of the Boehm GC library.

Peter
--------------------------------------------------------------------------
mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the users mailing list