diff --git a/pkgs/development/compilers/ghc/8.10.1.nix b/pkgs/development/compilers/ghc/8.10.1.nix index c0bcdaa6bee3..6325e2187c03 100644 --- a/pkgs/development/compilers/ghc/8.10.1.nix +++ b/pkgs/development/compilers/ghc/8.10.1.nix @@ -62,7 +62,14 @@ let endif DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"} INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"} - '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' + '' + # We only need to build stage1 on most cross-compilation because + # we will be running the compiler on the native system. In some + # situations, like native Musl compilation, we need the compiler + # to actually link to our new Libc. The iOS simulator is a special + # exception because we can’t actually run simulators binaries + # ourselves. + + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"} CrossCompilePrefix = ${targetPrefix} HADDOCK_DOCS = NO diff --git a/pkgs/development/compilers/ghc/8.6.5.nix b/pkgs/development/compilers/ghc/8.6.5.nix index 863fc74c037b..a5d2bb5c88d6 100644 --- a/pkgs/development/compilers/ghc/8.6.5.nix +++ b/pkgs/development/compilers/ghc/8.6.5.nix @@ -59,7 +59,14 @@ let endif DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"} INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"} - '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' + '' + # We only need to build stage1 on most cross-compilation because + # we will be running the compiler on the native system. In some + # situations, like native Musl compilation, we need the compiler + # to actually link to our new Libc. The iOS simulator is a special + # exception because we can’t actually run simulators binaries + # ourselves. + + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"} CrossCompilePrefix = ${targetPrefix} HADDOCK_DOCS = NO diff --git a/pkgs/development/compilers/ghc/8.8.2.nix b/pkgs/development/compilers/ghc/8.8.2.nix index af5c5433f1bc..bd1f09709dcf 100644 --- a/pkgs/development/compilers/ghc/8.8.2.nix +++ b/pkgs/development/compilers/ghc/8.8.2.nix @@ -59,7 +59,14 @@ let endif DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"} INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"} - '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' + '' + # We only need to build stage1 on most cross-compilation because + # we will be running the compiler on the native system. In some + # situations, like native Musl compilation, we need the compiler + # to actually link to our new Libc. The iOS simulator is a special + # exception because we can’t actually run simulators binaries + # ourselves. + + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"} CrossCompilePrefix = ${targetPrefix} HADDOCK_DOCS = NO diff --git a/pkgs/development/compilers/ghc/8.8.3.nix b/pkgs/development/compilers/ghc/8.8.3.nix index f6b0a8efdf22..1f1a23ee2c24 100644 --- a/pkgs/development/compilers/ghc/8.8.3.nix +++ b/pkgs/development/compilers/ghc/8.8.3.nix @@ -62,7 +62,14 @@ let endif DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"} INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"} - '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' + '' + # We only need to build stage1 on most cross-compilation because + # we will be running the compiler on the native system. In some + # situations, like native Musl compilation, we need the compiler + # to actually link to our new Libc. The iOS simulator is a special + # exception because we can’t actually run simulators binaries + # ourselves. + + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"} CrossCompilePrefix = ${targetPrefix} HADDOCK_DOCS = NO diff --git a/pkgs/development/compilers/ghc/8.8.4.nix b/pkgs/development/compilers/ghc/8.8.4.nix index 6efbef45bac2..448995f66ba2 100644 --- a/pkgs/development/compilers/ghc/8.8.4.nix +++ b/pkgs/development/compilers/ghc/8.8.4.nix @@ -62,7 +62,14 @@ let endif DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"} INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"} - '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' + '' + # We only need to build stage1 on most cross-compilation because + # we will be running the compiler on the native system. In some + # situations, like native Musl compilation, we need the compiler + # to actually link to our new Libc. The iOS simulator is a special + # exception because we can’t actually run simulators binaries + # ourselves. + + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"} CrossCompilePrefix = ${targetPrefix} HADDOCK_DOCS = NO