ghc 6.0.1 and Mac OS X 10.2.6 build
Alastair Reid
alastair at reid-consulting-uk.ltd.uk
Thu Sep 11 12:32:05 EDT 2003
> While your patch should work, I remember seeing C code that uses
> function names like "foo" and "_foo" in the same way that a Haskell
> programmer might use foo and foo', so I had a bad feeling about
> automatically trying both.
Could I recommend that you use or adapt the autoconf test HUGS_TRY_DYNLINK
(hugs98/src/unic/aclocal.m4 in the same cvs repository that has ghc).
This test generates a C object file to be loaded then tries to load the object
file using one of dlopen, LoadLibrary, NSCreateObjectFileImageFromFile and
shl_load then tries looking up both the symbol '_test' and 'test' in the
file. It sets the linker flags to use to build dynamically loadable object
files and whether or not to use an underscore when doing the lookup and it
works on HPUX, Mac, Win32 and most mainstream unix variants. (Bug reports and
improvements are, of course, welcome.)
--
Alastair Reid
More information about the Glasgow-haskell-bugs
mailing list