Linking in Dead Code

Daniel Fischer at
Sat May 14 21:18:23 CEST 2011

On Saturday 14 May 2011 21:06:50, Guy wrote:
> On 14/05/2011 21:12, Don Stewart wrote:
> > When compiled with "split objs" GHC makes it possible for the linker
> > to do dead code stripping. Make sure your GHC has split-objs on.
> Thank you, I hadn't realised that the imported library could be built
> like this. How is this configured with cabal?

In your ~/.cabal/config file (translate the path to Windows, I've no idea 
where the config goes there), there's a field for that, set

split-objs: True

And from then on cabal (install) passes the -split-objs flag (or was that 
--split-objs?) to GHC when installing packages. You'd have to rebuild the 
packages you already have.

> (And do any packages actually do so?)

It's something the user decides, not the package author.

More information about the Glasgow-haskell-users mailing list