On 02/05/2009 01:14, Duncan Coutts wrote:
On Fri, 2009-05-01 at 12:05 +0100, Duncan Coutts wrote:
So the specific dyn way failures are:

[ ... ]

Turns out all but two are instances of the same problem which is fixed
by this patch:

Fri May  1 13:14:45 BST 2009  Duncan Coutts<[email protected]>
   * Make ghc -dynamic imply -fPIC for C code
   As is already the case for ghc -fPIC. This is needed because ghc -dynamic
   means to generate code that is capable of being linked to Haskell shared
   libs and for C code the equivalent is -fPIC. Normally C code does not need
   -fPIC merely to link to shared libs however Haskell shared libs do not
   follow common conventions. In particular the static data cannot be
   referenced statically because it cannot be copied by the static linker.
   The linker cannot copy them because we do not specify a .size for the
   _closure entries (in the .data section) though in principle we could.

ffi002 still fails because of the issue with Main. The length001 test
fails in other "ways" too (most ways except "normal") so I assume it's
not my fault :-)

Another patch as well:

Sat May  2 00:58:24 BST 2009  Duncan Coutts<[email protected]>
   * Link the rts shared libs against gmp and the other C libs
   When using shared libs we should link each lib against its deps. This allows
   the dynamic linker to chase dependencies and means we do not have to specify
   all indirect dependencies (as we must do for static libs).

This gets us part way to being able to make a Haskell .so lib and then
use it just like any other .so lib as part of a larger project (ie
linking using just gcc, not ghc).

Note, these patches are not yet validated though are suitable to include
into anyone's next validate run.

Thanks Duncan, I'm validating now.

Cheers,
        Simon

_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to