Creating Loadable Dynamic Libraries in OSX

Alfonso Acosta alfonso.acosta at gmail.com
Tue Nov 21 21:34:59 EST 2006


Hi,

I succesfully created dynamic loadable libraries (.so) with GHC6.6
under LinuxX86 using some C glue code and linking with -optl -shared.

Now I would like to port my code to OSX but linking with "-optl
-bunde" fails giving a "local relocation entries in non-writable
section" error.

I think that is becase under OSX, GHC calls gcc with -mdynamic-no-pic
preventing my FFI stub object files to be linked.


Does anyone know why is -mdynamic-no-pic used or a workaround?


Thanks in advance,

Alfonso Acosta


More information about the Glasgow-haskell-users mailing list