[project @ 2005-01-23 06:10:15 by wolfgang]
authorwolfgang <unknown>
Sun, 23 Jan 2005 06:10:24 +0000 (06:10 +0000)
committerwolfgang <unknown>
Sun, 23 Jan 2005 06:10:24 +0000 (06:10 +0000)
commit6f985ae88171fb52ca68d75f667669e139b6b8c2
treea4e670b53bfbe5b9f094690b697592b63f0ed3d1
parent585d87f1d621a386e4cfdd14f8a3ac1eed2413d4
[project @ 2005-01-23 06:10:15 by wolfgang]
Add support for the dead code stripping feature of recent Apple linkers.
If your code is compiled using the NCG, you can now specify
-optl-W,-dead_strip on the GHC command line when linking.
It will have basically the same effect as using split-objs to build the
libraries.

Advantages over split-objs:
    * No evil perl script involved
    * Requires no special handling when building libraries

Disadvantages:
    * The current version of Apple's linker is slow when given the
      -dead_strip flag. _REALLY_ slow.
    * Mac OS X only.

This works by making the NCG emit the .subsections_via_symbols directive.
Additionally, we have to add an extra label at the top of every info table,
and make sure that the entry code references it (otherwise the info table
will be considered part of the preceding entry code).
The mangler just removes the .subsections_via_symbols directive.
configure.ac
ghc/compiler/cmm/CLabel.hs
ghc/compiler/nativeGen/AsmCodeGen.lhs
ghc/compiler/nativeGen/PprMach.hs
ghc/driver/mangler/ghc-asm.lprl
ghc/rts/StgCRun.c