From 6d54b2f918cf583ac7d909d6bf5ccd63d5be44b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Domen=20Ko=C5=BEar?= Date: Wed, 22 Jul 2020 11:31:48 +0200 Subject: [PATCH] ghc 8.8.4, 8.10.1: disable profiled builds on aarch64 to avoid 2GB output limit --- pkgs/development/compilers/ghc/8.10.1.nix | 5 +++++ pkgs/development/compilers/ghc/8.8.4.nix | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/pkgs/development/compilers/ghc/8.10.1.nix b/pkgs/development/compilers/ghc/8.10.1.nix index c70efe1fdef..bd7f17b53be 100644 --- a/pkgs/development/compilers/ghc/8.10.1.nix +++ b/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 +, enableProfiliedLibs ? !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 @@ -128,6 +131,8 @@ stdenv.mkDerivation (rec { export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}" '' + stdenv.lib.optionalString stdenv.isDarwin '' export NIX_LDFLAGS+=" -no_dtrace_dof" + '' + stdenv.lib.optionalString (!enableProfiliedLibs) '' + GhcLibWays = "v dyn" '' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt '' sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets '' + stdenv.lib.optionalString targetPlatform.isMusl '' diff --git a/pkgs/development/compilers/ghc/8.8.4.nix b/pkgs/development/compilers/ghc/8.8.4.nix index cf74fbdd741..02f1f85839b 100644 --- a/pkgs/development/compilers/ghc/8.8.4.nix +++ b/pkgs/development/compilers/ghc/8.8.4.nix @@ -23,6 +23,9 @@ , # If enabled, use -fPIC when compiling static libs. enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform + # aarch64 outputs otherwise exceed 2GB limit +, enableProfiliedLibs ? !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 @@ -128,6 +131,8 @@ stdenv.mkDerivation (rec { export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}" '' + stdenv.lib.optionalString stdenv.isDarwin '' export NIX_LDFLAGS+=" -no_dtrace_dof" + '' + stdenv.lib.optionalString (!enableProfiliedLibs) '' + GhcLibWays = "v dyn" '' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt '' sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets '' + stdenv.lib.optionalString targetPlatform.isMusl ''