summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpho <pho@pkgsrc.org>2022-02-26 03:55:37 +0000
committerpho <pho@pkgsrc.org>2022-02-26 03:55:37 +0000
commit7717cc6675076ed2acbd0fb84aa5c8d6d9635d0a (patch)
tree6de4851e2593d908484d01981501d62060a532d4
parent3c9f16624e28f4eb7c9bdb210b163eb17eb57b1f (diff)
downloadpkgsrc-7717cc6675076ed2acbd0fb84aa5c8d6d9635d0a.tar.gz
mk/haskell.mk: Enable --enable-split-sections
Ask GHC to put each compiled function in a separate section and ld(1) to perform GC. This greatly reduces the size of executables linked with static Haskell libraries. For example, lang/purescript shrinks down from 104 MiB to 57 MiB! Reduced storage use means reduced I/O cost!
-rw-r--r--mk/haskell.mk3
1 files changed, 2 insertions, 1 deletions
diff --git a/mk/haskell.mk b/mk/haskell.mk
index 4beb6f1eb65..feceffc2448 100644
--- a/mk/haskell.mk
+++ b/mk/haskell.mk
@@ -1,4 +1,4 @@
-# $NetBSD: haskell.mk,v 1.42 2022/02/23 16:03:00 pho Exp $
+# $NetBSD: haskell.mk,v 1.43 2022/02/26 03:55:37 pho Exp $
#
# This Makefile fragment handles Haskell Cabal packages. Package
# configuration, building, installation, registration and unregistration
@@ -182,6 +182,7 @@ CONFIGURE_ARGS+= --with-haddock=${BUILDLINK_PREFIX.ghc:Q}/bin/haddock
.endif
CONFIGURE_ARGS+= -O${HASKELL_OPTIMIZATION_LEVEL}
+CONFIGURE_ARGS+= --enable-split-sections
# Support RELRO. When PKGSRC_USE_RELRO isn't set to "no",
# mk/compiler/{ghc,clang}.mk add "-Wl,-z,relro" and optionally