[mercury-users] Debian package stuff

Tyson Dowd trd at cs.mu.OZ.AU
Tue Jan 25 13:31:15 AEDT 2000


On 22-Jan-2000, William Lee Irwin III <wli at cs.purdue.edu> wrote:
> It looks like the shared runtime system libraries were built using
> gcc --shared foobar.a in the Debian package, which failed to make
> anything of use, at least in the Debian package. I could be off on
> this, but on the other hand, I built my own versions of the runtime
> system libraries using
> 	gcc --shared *.o -o libfoobar.so # with *.o taken from libfoobar.a
> and managed to successfully link an executable which also worked.

> Also of note is that there is a library sitting somewhere in /lib
> or /usr/lib called libgc.so, so an
> -Xlinker -rpath /usr/lib/mercury/lib/i686-pc-linux-gnu flag might be
> in order to make sure that the right version of libgc.so is linked in.

I'm not entirely sure what you mean.  The runtime system libraries in
the Debian version (as with all versions) work fine as either shared
libraries or static libraries.  The default is static linking on the x86
because it creates significantly faster executables (-fPIC has a
significant overhead for Mercury) (actually it's static on all sorts of
Linux, but that's just an oversight, it should probably be just x86
Linux).

We link with the libgc.so we supply.  The mmake script is configured to
take care of all this automatically.  It uses -rpath.  

$ mmc --pic-reg --link-flags --shared hello.m
	(some warning messages because of some incorrect code in glibc)   
$ ldd hello
        libmer_std.so => /usr/lib/mercury/lib/asm_fast.gc/i686-pc-linux-gnu/libmer_std.so (0x40014000)
        libmer_rt.so => /usr/lib/mercury/lib/asm_fast.gc/i686-pc-linux-gnu/libmer_rt.so (0x40134000)
        libgc.so => /usr/lib/mercury/lib/i686-pc-linux-gnu/libgc.so (0x40148000)
        libm.so.6 => /lib/libm.so.6 (0x40169000)
        libc.so.6 => /lib/libc.so.6 (0x40186000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

$ ./hello
Hello, world

You may want to look around in the scripts directory to see how this all
works.  One outstanding work item is actually getting all this stuff to
work *without* using -rpath (use ldconfig instead).  Because of all the
grades we make available, this is a little non-trivial. 

-- 
       Tyson Dowd           # 
                            #  Surreal humour isn't eveyone's cup of fur.
     trd at cs.mu.oz.au        # 
http://www.cs.mu.oz.au/~trd #
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list