GHCI and archive libraries.

Sven Panne Sven.Panne at aedion.de
Sat Dec 3 09:10:22 EST 2005


Am Samstag, 3. Dezember 2005 14:48 schrieb Lennart Augustsson:
> Can't you unpack the ar library and then link the object files
> into a shared library?

On most platforms the code in a *.a library is not shared library code, e.g. 
it is not PIC or something like that. Nevertheless, I think that the *.o 
files GHCi loads are not exactly shared libraries, they are incrementally 
linked relocatable object code (correct me if I'm wrong here, the details of 
shared libraries are still a kind of black art...). So you might have luck 
with unpacking and re-linking like that:

   ar x libblah.a
   ld -r -x -o /my/new/blah.o *.o

The linker flags for doing this vary, depending on the platform, you can have 
a look at GHC's autoconf magic for hints if it doesn't work like mentioned 
above.

Cheers,
   S.


More information about the Glasgow-haskell-users mailing list