[mercury-users] Set linker command for 'mmc --make'?

Julien Fischer juliensf at csse.unimelb.edu.au
Tue Nov 28 03:13:10 AEDT 2006

On Mon, 27 Nov 2006, Ondrej Bojar wrote:

> Hi,
> Is there a way to set the linker command for 'mmc --make'? The default linker 
> is gcc but this is not sufficient for linking with C++ objects (depending on 
> libstdc++).

Yes.  There are a number of undocumented options that the compiler uses 
to control how mmc --make invokes the linker.  Probably the one you want


 	mmc --link-executable-command=g++ --make ...

The complete set is listed in the Mercury.config file.  These values are
usually set by the configure script.  (If you're building a library note
that there is a separate --link-shared-lib-command option.)

> I failed with adding -lstdc++ or other options via --ld-flags, because my 
> libstdc++ is shared only.

Are you trying to create a mercury executable or shared library?
In the later case you can tell mmc --make to only build the shared version
of the library via:

 	mmc --library-linkage=shared --make libfoo


> In short, a '--ld' option for mmc is probably missing.

Essentially it's already there - just not documented.

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