From 7717cc6675076ed2acbd0fb84aa5c8d6d9635d0a Mon Sep 17 00:00:00 2001 From: pho Date: Sat, 26 Feb 2022 03:55:37 +0000 Subject: 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! --- mk/haskell.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3