ghc image size

Simon Marlow simonmar@microsoft.com
Mon, 17 Dec 2001 11:36:20 -0000


> if you are using GNU tools there is some magic to make them
> garbage-collect all the symbols in your executable before=20
> outputting the
> final code. you have to do some tricks with the segment=20
> headers so that
> it can GC individual functions but this should fix many of the image
> size problems at least in some cases. I agree that the GHC image sizes
> are a problem.=20

This is something we'd like to do, but haven't got around to.  It's not
just a case of adding the correct flags to gcc/ld unfortunately: GHC's
assembly mangler needs to be taught how to generate the unique section
names for each function.  But then it's possible that we could remove
the grotty -split-objs stuff that we use to split the libraries into
small pieces.=20

Cheers,
	Simon

> 	John
>=20
> On Fri, Dec 14, 2001 at 01:28:20PM +0100, Jan de Wit wrote:
> > Hi,
> >=20
> > > I just recently starting to use the ghc compiler and am=20
> astonished by the
> > > size of the executables. Out of interest, why are they so=20
> large? Is there
> > > any work in progress to make the resulting=20
> executable/object somewhat more
> > > "normal" in size?
> > >
> > > I read in the Haskell mailing list archives discussions=20
> relating to
> > reducing
> > > the barriers to broader acceptance of functional=20
> programming by the
> > general
> > > programming community (in particular Haskell) - I would=20
> regard this as one
> > > of these barriers.
> >=20
> > When I want to send compiled Haskell programs by email or=20
> put them on the
> > web for distribution, I run 'strip' on them and, if I'm on=20
> Linux or Win32, I
> > run UPX on it as well. UPX is an executable packer, see
> > http://upx.sourceforge.net/ for details. This routinely=20
> brings programs down
> > from over 2 MB to around 250Kb which is small enough for me.
> >=20
> > Hope this helps,
> >=20
> > Jan de Wit
> >=20
> >=20
> >=20
> > _______________________________________________
> > Glasgow-haskell-users mailing list
> > Glasgow-haskell-users@haskell.org
> > http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
> >=20
>=20
> --=20
> --------------------------------------------------------------
> -------------
> John Meacham - California Institute of Technology, Alum. -=20
> john@repetae.net
> --------------------------------------------------------------
> -------------
>=20
> _______________________________________________
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users@haskell.org
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
>=20