From c5617381bcfe0549c5848f07bcfb64cd40aa0204 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Thu, 13 Aug 2020 11:01:27 -0500 Subject: ghc: document Stage1Only setting --- pkgs/development/compilers/ghc/8.10.1.nix | 9 ++++++++- pkgs/development/compilers/ghc/8.6.5.nix | 9 ++++++++- pkgs/development/compilers/ghc/8.8.2.nix | 9 ++++++++- pkgs/development/compilers/ghc/8.8.3.nix | 9 ++++++++- pkgs/development/compilers/ghc/8.8.4.nix | 9 ++++++++- 5 files changed, 40 insertions(+), 5 deletions(-) diff --git a/pkgs/development/compilers/ghc/8.10.1.nix b/pkgs/development/compilers/ghc/8.10.1.nix index c0bcdaa6bee..6325e2187c0 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 863fc74c037..a5d2bb5c88d 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 af5c5433f1b..bd1f09709dc 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 f6b0a8efdf2..1f1a23ee2c2 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 6efbef45bac..448995f66ba 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 -- cgit 1.4.1