-
Notifications
You must be signed in to change notification settings - Fork 847
Description
Feature request
(Apparently) there is a cabal configure
option --enable-split-objs
that passes --split-objs
to ghc
for project sources and dependencies. This creates one object file per function and therefore can reduce the size of resulting binaries as the linker only includes necessary objects files (functions).
The cabal configure --enable-split-objs
is cited as a solution to the "large binary" problem (http://stackoverflow.com/questions/9198112/haskell-unnecessary-binary-growth-with-module-imports/9198223#9198223, http://stackoverflow.com/questions/6115459/small-haskell-program-compiled-with-ghc-into-huge-binary/6115703#6115703, http://stackoverflow.com/questions/12019072/compilation-dependencies-and-executable-size-with-ghc-in-linux/12019307#12019307) and there are deployments where a reduced size, statically linked binary is preferred.