Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue #1284 enable-split-objs
This PR adds an
enable-split-objs
option toconfig
which takes aboolean
value (defaulting tofalse
).When set
true
,stack
builds new libraries passing the--enable-split-objs
option tocabal
.The result is that these libraries are built with multiple object files per module which results in unused functions not being linked into final executables. It's been reported that this can result in significantly reduced size binaries which can be advantageous in some deployments.
The correctness of the change can be confirmed by running
ar -t
on the resulting new library builds with the option settrue
, setfalse
, or removed fromconfig.yaml
.Use:
~/.stack/
(previously built libraries need to be removed and rebuilt)enable-split-objs: true
to a newly created~/.stack/config.yaml
stack clean
,stack build