static linking (was Re: [mercury-users] ICFP 2002)

Fergus Henderson fjh at
Mon Aug 12 15:54:13 AEST 2002

On 12-Aug-2002, Michael Day <mikeday at> wrote:
> > mmc --make --link-flags "--mercury-libs static"
> In fact, I seem to be getting static binaries no matter how I build them.
> When I hide the Mercury libraries the binaries still run without errors,
> and they're rather large (smallest is 1.5mb).
> Are static binaries the default on Linux?

Yes.  See the README.Linux file in the distribution.

As it says there, to use the shared libraries, you must compile
your program with `mmc --pic-reg' and link with `ml --shared' or add
`MGNUCFLAGS=--pic-reg' and `MLFLAGS=--shared' to your Mmakefile.

If you're using `mmc --make', that means either using
`mmc --make --pic-reg --link-flags "--shared"'
or putting the above settings of MGNUCFLAGS and MLFLAGS in the
Mercury.options file.

Fergus Henderson <fjh at>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <>  |     -- the last words of T. S. Garp.
mercury-users mailing list
post:  mercury-users at
administrative address: owner-mercury-users at
unsubscribe: Address: mercury-users-request at Message: unsubscribe
subscribe:   Address: mercury-users-request at Message: subscribe

More information about the users mailing list