on iko/ghcjs-patch-master help sign in
Minor adjustments
ed1dbc0Moritz Angermann
builder/comp-builder.nix+9−6
@@ -20,6 +20,9 @@
20, doCrossCheck ? component.doCrossCheck || false
20, doCrossCheck ? component.doCrossCheck || false
21, dontPatchELF ? true
21, dontPatchELF ? true
22, dontStrip ? true
22, dontStrip ? true
23+
24+, static ? stdenv.hostPlatform.isMusl
25+, deadCodeElimination ? true
23}:
26}:
24
27
25let
28let
@@ -131,14 +134,14 @@ let
131 "--with-ar=${stdenv.cc.bintools.targetPrefix}ar"
134 "--with-ar=${stdenv.cc.bintools.targetPrefix}ar"
132 "--with-strip=${stdenv.cc.bintools.targetPrefix}strip"
135 "--with-strip=${stdenv.cc.bintools.targetPrefix}strip"
133 # other flags
136 # other flags
134− "--enable-static"
135− "--enable-split-sections"
136 "--enable-executable-stripping"
137 "--enable-executable-stripping"
137 "--enable-library-stripping"
138 "--enable-library-stripping"
139+ ] ++ lib.optional (deadCodeElimination && stdenv.hostPlatform.isLinux) "--enable-split-sections"
140+ ++ lib.optional (static) "--enable-static"
138− ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) (
141+ ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) (
139− map (arg: "--hsc2hs-option=" + arg) ["--cross-compile" "--via-asm"]
142+ map (arg: "--hsc2hs-option=" + arg) ["--cross-compile" "--via-asm"]
140− ++ lib.optional (package.buildType == "Configure") "--configure-option=--host=${stdenv.hostPlatform.config}"
143+ ++ lib.optional (package.buildType == "Configure") "--configure-option=--host=${stdenv.hostPlatform.config}" )
141− ) ++ component.configureFlags
144+ ++ component.configureFlags
142 );
145 );
143
146
144in stdenv.mkDerivation ({
147in stdenv.mkDerivation ({