@@ -7,7 +7,7 @@
77
88, libffi, libiconv ? null, ncurses
99
10−, useLLVM ? !targetPlatform.isx86
10+, useLLVM ? !targetPlatform.isx86 || targetPlatform.isMusl
1111, # LLVM is conceptually a run-time-only depedendency, but for
1212 # non-x86, we need LLVM to bootstrap later stages, so it becomes a
1313 # build-time dependency too.
@@ -50,7 +50,8 @@ let
5050 '' + stdenv.lib.optionalString enableIntegerSimple ''
5151 INTEGER_LIBRARY = integer-simple
5252 '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
53− Stage1Only = YES
53+ Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"}
54+ CrossCompilePrefix = ${targetPrefix}
5455 HADDOCK_DOCS = NO
5556 BUILD_SPHINX_HTML = NO
5657 BUILD_SPHINX_PDF = NO
@@ -166,10 +167,10 @@ stdenv.mkDerivation rec {
166167 # that in turn causes GHCi to abort
167168 stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
168169
169− hardeningDisable = [ "format" ];
170−
171170 checkTarget = "test";
172171
172+ hardeningDisable = [ "format" ];
173+
173174 postInstall = ''
174175 for bin in "$out"/lib/${name}/bin/*; do
175176 isELF "$bin" || continue