[MLton-user] SVN r6941 MLton/MinGW32 and FFI
Wesley W. Terpstra
wesley at terpstra.ca
Tue Nov 11 16:41:40 PST 2008
On Wed, Nov 12, 2008 at 1:14 AM, Matthew Fluet <fluet at tti-c.org> wrote:
> As I understand it, if the symbol is coming from an
> archive, then 'public' or 'private' is the correct scope (but, I don't
> understand the rules for using one or the other); if the symbol is coming
> from a shared object, then 'external' is the correct scope.
Within a DSO symbols exported as private should be imported as
private. Public as public. Imports and exports need to agree within
the DSO, that's all.
I suppose you could have an archive of private symbols (in fact,
libmlton.a is such an archive), then _import private would be
appropriate. This is not the common case, though. Your typical
scenario for mlnlffi -linkage archive as I understand it is a library
that's packaged as an archive. It's public interface (in the header)
is almost surely public in the symbol table too.
> So, the '-linkage' option should probably be refined to
> {dynamic|archive|shared} to distinguish between using the dynamic linking
> loader (with dynamic), using 'public' (with archive), and using 'external'
> (with shared).
Sounds convenient.
More information about the MLton-user
mailing list