[MLton] cvs commit: Loading dynamic libraries works on Darwin

Matthew Fluet fluet@cs.cornell.edu
Tue, 28 Sep 2004 18:46:04 -0400 (EDT)


> Fair enough.  Although we should certainly provide a library at some
> point after the release.

Agreed.  Anything that doesn't need to be implemented in the Basis (or
need direct compiler support) should be in its own library.

> I see -ldl on two platforms, Linux and Solaris.

O.k.  I thought it was being used on more; but it's just that ldl is
available through the standard lib on Cygwin, Darwin, and *BSD.

> It's been on Solaris since the first port over two years ago.  I
> suspect it's there because linking failed otherwise.

I don't see why.  ldl only seems to provide the dl* functions, which
shouldn't be necessary for normal MLton compiles.

> I do want to point out that proper use of -ldl requires
> -target-link-opt (which is undocumented) rather than -link-opt (which
> is documented).  I know we're trying to keep the option count down,
> but exposing -ldl pushes towards exposing and documenting
> -target-{cc,link}-opt.

Well, proper use of any linker option requires -target-link-opt, if you
want to account for what may or may not be in the standard lib on
different machines.