[mercury-users] dynamic linking, Guile
pbone at csse.unimelb.edu.au
Tue Feb 9 11:04:16 AEDT 2010
On Tue, Feb 09, 2010 at 10:50:01AM +1100, Peter Wang wrote:
> 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.
If we want to link two different Boehms into one program we would probably have
to name appart all the exported symbols to prevent the librarys getting their
data structures and inter-module calls confused.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 489 bytes
Desc: Digital signature
More information about the users