GHCI and archive libraries.

Simon Peyton-Jones simonpj at microsoft.com
Mon Dec 5 04:15:47 EST 2005


I believe that it ought to be fairly straightforward to modify GHCi's
linker (which is written in C) to understand .a files.   Would someone
like to try?

Failing that, it'd be great if someone would feel able to write a few
paras to summarise this thread, for us to add to the documentation.

Simon

| -----Original Message-----
| From: glasgow-haskell-users-bounces at haskell.org
[mailto:glasgow-haskell-users-
| bounces at haskell.org] On Behalf Of Keean Schupke
| Sent: 04 December 2005 14:28
| To: Sven Panne
| Cc: Lennart Augustsson; glasgow-haskell-users at haskell.org
| Subject: Re: GHCI and archive libraries.
| 
| Thaks guys... I realise it is a simple matter of unpacking the object
| files, however when using ghci for prototyping, it can be more
| convenient to have all the '.o's packed into a '.a'. As it is a simple
| matter to extract the .o files from the .a, I would have thought a
| fairly small change to the ghci code would have enabled using archive
| libraries. I think this change would aid usability. I don't know the
| ghci code at all, so it would take me a long time to make this change,
| as I would first have to understand the existing code. I was wondering
| if anyone familier with the ghci code could add archive library
support?
| I suppose as a work around I could write a wrapper for ghci that
| extracts the .o files from the .a to a temp directory, and then calls
| ghci with the .o files on the command line.
| 
|     Regards,
|     Keean.
| 
| Sven Panne wrote:
| 
| >Am Samstag, 3. Dezember 2005 15:17 schrieb Lennart Augustsson:
| >
| >
| >>And on many platforms (well, at least a few years ago) a "shared"
| >>library doesn't have to be PIC.  The dynamic loader can do
relocation
| >>when it loads the file.  (Then it can't be shared.)
| >>
| >>But this was a few years ago on Solaris and BSDs, it could be
| >>different now.
| >>
| >>
| >
| >After a quick look this seems to be the case on current x86 Linux
systems,
| >too: "Real" shared libraries consist of PIC to enhance sharing code
at
| >runtime, but nevertheless the dynamic loader seems to be able to load
and
| >relocate non-PIC, at the cost of less sharing, but often slightly
better code
| >quality. So the mentioned repacking of a static library into a
partially
| >linked object file might work for most common platforms.
| >
| >Cheers,
| >   S.
| >_______________________________________________
| >Glasgow-haskell-users mailing list
| >Glasgow-haskell-users at haskell.org
| >http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
| >
| >
| 
| _______________________________________________
| Glasgow-haskell-users mailing list
| Glasgow-haskell-users at haskell.org
| http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


More information about the Glasgow-haskell-users mailing list