Implement function-sections for Haskell code, #8405

Authored by olsner.

Description

Implement function-sections for Haskell code, Trac #8405

Summary:
This adds a flag -split-sections that does similar things to -split-objs, but
using sections in single object files instead of relying on the Satanic
Splitter and other abominations. This is very similar to the GCC flags
-ffunction-sections and -fdata-sections.

The --gc-sections linker flag, which allows unused sections to actually
be removed, is added to all link commands (if the linker supports it) so that
space savings from having base compiled with sections can be realized.

Supported both in LLVM and the native code-gen, in theory for all
architectures, but really tested on x86 only.

In the GHC build, a new SplitSections variable enables -split-sections for
relevant parts of the build.

Test Plan: validate with both settings of SplitSections

Reviewers: simonmar, austin, dterei, bgamari

Subscribers: erikd, kgardas, thomie

Differential Revision: https://phabricator.haskell.org/D1242

GHC Trac Issues: Trac #8405

Details

Committed
thomieSep 19 2015, 8:23 AM
Differential Revision
D1242: Implement function-sections for Haskell code, #8405
This commit no longer exists in the repository. It may have been part of a branch which was deleted.This commit has been deleted in the repository: it is no longer reachable from any branch, tag, or ref.

Commit No Longer Exists

This commit no longer exists in the repository.