[GHC] #3345: Support reading .a files in GHCi to reclaim some disk
space
GHC
trac at galois.com
Fri Jul 3 08:01:50 EDT 2009
#3345: Support reading .a files in GHCi to reclaim some disk space
-----------------------------+----------------------------------------------
Reporter: batterseapower | Owner:
Type: feature request | Status: new
Priority: normal | Component: Compiler
Version: 6.10.2 | Severity: normal
Keywords: | Testcase:
Os: Unknown/Multiple | Architecture: Unknown/Multiple
-----------------------------+----------------------------------------------
Currently, Cabal builds two code files for every libary it installs:
{{{
mbolingbroke at mb566 ~/.cabal/lib/vector-space-0.5.6/ghc-6.10.1
$ ls
.
..
Data
HSvector-space-0.5.6.o
libHSvector-space-0.5.6.a
}}}
The .a is a straight concatenation of the .o files that got built. The .o
is the result of lding together all the .o files (and so has inter-object
references already resolved) but is actually only used by GHCi.
If GHCi could support loading .a files then Cabal wouldn't have to build
this extra .o file and we could cut the size of installed libraries almost
in half.
(Or perhaps GHC could link against the .o rather than the .a, and then
Cabal could stop building the .a, instead?)
{{{
[12:32] BSP_: does cabal build both .o and .a's for a library purely
because ghci isn't capable of reading the .a format and loading each .o
individually?
[12:33] BSP_: it seems a bit wasteful to have two copies of the code
installed for each library...
[12:35] dcoutts: BSP_: that's correct
[12:35] dcoutts: in theory it's not that hard
[12:35] dcoutts: there's no real need for ghci to read the .a index, just
link in everything
[12:36] arjanb left the chat room. ("bbl")
[12:36] dcoutts: the .a format is trivial
[12:36] • dcoutts has a parser
[12:36] dcoutts: and generator for that matter
}}}
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3345>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list