diff options
Diffstat (limited to 'nixpkgs/pkgs/development/compilers/ghc/8.10.1.nix')
-rw-r--r-- | nixpkgs/pkgs/development/compilers/ghc/8.10.1.nix | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/nixpkgs/pkgs/development/compilers/ghc/8.10.1.nix b/nixpkgs/pkgs/development/compilers/ghc/8.10.1.nix index c70efe1fdef3..d3835d01e5a2 100644 --- a/nixpkgs/pkgs/development/compilers/ghc/8.10.1.nix +++ b/nixpkgs/pkgs/development/compilers/ghc/8.10.1.nix @@ -23,6 +23,9 @@ , # If enabled, use -fPIC when compiling static libs. enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform + # aarch64 outputs otherwise exceed 2GB limit +, enableProfiledLibs ? !stdenv.targetPlatform.isAarch64 + , # Whether to build dynamic libs for the standard library (on the target # platform). Static libs are always built. enableShared ? !stdenv.targetPlatform.isWindows && !stdenv.targetPlatform.useiOSPrebuilt @@ -52,19 +55,30 @@ let (targetPlatform != hostPlatform) "${targetPlatform.config}-"; - buildMK = '' + buildMK = dontStrip: '' BuildFlavour = ${ghcFlavour} ifneq \"\$(BuildFlavour)\" \"\" include mk/flavours/\$(BuildFlavour).mk 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) '' - Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"} + '' + # 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 BUILD_SPHINX_HTML = NO BUILD_SPHINX_PDF = NO + '' + stdenv.lib.optionalString dontStrip '' + STRIP_CMD = : + '' + stdenv.lib.optionalString (!enableProfiledLibs) '' + GhcLibWays = "v dyn" '' + stdenv.lib.optionalString enableRelocatedStaticLibs '' GhcLibHcOpts += -fPIC GhcRtsHcOpts += -fPIC @@ -94,7 +108,7 @@ stdenv.mkDerivation (rec { name = "${targetPrefix}ghc-${version}"; src = fetchurl { - url = "https://downloads.haskell.org/ghc/8.10.1/ghc-${version}-src.tar.xz"; + url = "https://downloads.haskell.org/ghc/${version}/ghc-${version}-src.tar.xz"; sha256 = "1xgdl6ig5jzli3bg054vfryfkg0y6wggf68g66c32sr67bw0ffsf"; }; @@ -122,7 +136,7 @@ stdenv.mkDerivation (rec { export READELF="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}readelf" export STRIP="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}strip" - echo -n "${buildMK}" > mk/build.mk + echo -n "${buildMK dontStrip}" > mk/build.mk sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure '' + stdenv.lib.optionalString (!stdenv.isDarwin) '' export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}" @@ -235,8 +249,9 @@ stdenv.mkDerivation (rec { inherit (ghc.meta) license platforms; }; -} // stdenv.lib.optionalAttrs targetPlatform.useAndroidPrebuilt { - dontStrip = true; + dontStrip = (targetPlatform.useAndroidPrebuilt || targetPlatform.isWasm); + +} // stdenv.lib.optionalAttrs targetPlatform.useAndroidPrebuilt{ dontPatchELF = true; noAuditTmpdir = true; }) |