Binary bloat in 7.10

Thomas Miedema thomasmiedema at gmail.com
Mon Apr 6 10:04:56 UTC 2015


It was all due to a missing -split-objs in Jeremy's 7.8 build.

I updated the user's guide. The section on -split-objs now reads, with the
part that is new in italic:

-split-objs

Tell the linker to split the single object file that would normally be
generated into multiple object files, one per top-level Haskell function or
type in the module. This only makes sense for libraries, where it means
that executables linked against the library are smaller as they only link
against the object files that they need. However, assembling all the
sections separately is expensive, so this is slower than compiling
normally. *Additionally, the size of the library itself **(the .a file) can
be a factor of 2 to 2.5 **larger. *We use this feature for building GHC's
libraries.



On Mon, Apr 6, 2015 at 11:49 AM, Simon Peyton Jones <simonpj at microsoft.com>
wrote:

> Just to check, can someone summarise the conclusion of this thread?  Was
> it all due to -fsplit-objs?  If so, should we add some notes to the user
> manual to explain what may happen if you use -fsplit-objs? What was the
> business about Cabal?
>
> Simon
>
> |  -----Original Message-----
> |  From: Glasgow-haskell-users [mailto:glasgow-haskell-users-
> |  bounces at haskell.org] On Behalf Of Jeremy
> |  Sent: 05 April 2015 20:30
> |  To: glasgow-haskell-users at haskell.org
> |  Subject: Re: Binary bloat in 7.10
> |
> |  Thomas Miedema wrote
> |  > That suggestion was completely misguided. Compiling with `-split-objs`
> |  > makes a library _grow_ in size, but makes executables that link
> |  > against it _smaller_.
> |  >
> |  > All these numbers are not far off from the ones you were getting. I
> |  > think you have been comparing a 7.8.4 build of Cabal without split
> |  > objects, with a 7.10.1 build of Cabal with split objects.
> |  >
> |  > I don't think there is a bug here.
> |
> |  My GHC build is now back to the 7.8-era size. Thank you!
> |
> |  I was wondering why programs compiled with my GHC 7.8 build were bigger
> |  than if I used an official build. Perhaps a bug in the 7.8 build system
> |  had turned off SplitObjs.
> |
> |
> |
> |  --
> |  View this message in context:
> |  http://haskell.1045720.n5.nabble.com/Binary-bloat-in-7-10-
> |  tp5768067p5768274.html
> |  Sent from the Haskell - Glasgow-haskell-users mailing list archive at
> |  Nabble.com.
> |  _______________________________________________
> |  Glasgow-haskell-users mailing list
> |  Glasgow-haskell-users at haskell.org
> |  http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users
> _______________________________________________
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/glasgow-haskell-users/attachments/20150406/bb033962/attachment-0001.html>


More information about the Glasgow-haskell-users mailing list