From da402892dc747ea2051c1de2c16004f11bc2a3bc Mon Sep 17 00:00:00 2001 From: Luis Pedro Coelho Date: Fri, 29 Mar 2019 16:02:08 +0100 Subject: ghc: make disableLargeAddressSpace configurable Even on Linux/NixOS, it can be useful to have a compiler without the large address space as it creates issues in some contexts. --- pkgs/development/compilers/ghc/8.6.4.nix | 7 +++++-- pkgs/development/compilers/ghc/head.nix | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'pkgs/development/compilers/ghc') diff --git a/pkgs/development/compilers/ghc/8.6.4.nix b/pkgs/development/compilers/ghc/8.6.4.nix index f970836fd696..d9c63edc9155 100644 --- a/pkgs/development/compilers/ghc/8.6.4.nix +++ b/pkgs/development/compilers/ghc/8.6.4.nix @@ -32,6 +32,10 @@ , # What flavour to build. An empty string indicates no # specific flavour and falls back to ghc default values. ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) "perf-cross" + +, # Whether to disable the large address space allocator + # necessary fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/ + disableLargeAddressSpace ? stdenv.targetPlatform.isDarwin && stdenv.targetPlatform.isAarch64 }: assert !enableIntegerSimple -> gmp != null; @@ -162,8 +166,7 @@ stdenv.mkDerivation (rec { "CFLAGS=-fuse-ld=gold" "CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold" "CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold" - ] ++ stdenv.lib.optionals (targetPlatform.isDarwin && targetPlatform.isAarch64) [ - # fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/ + ] ++ stdenv.lib.optionals (disableLargeAddressSpace) [ "--disable-large-address-space" ]; diff --git a/pkgs/development/compilers/ghc/head.nix b/pkgs/development/compilers/ghc/head.nix index 087d5a2c678d..88b273500dc0 100644 --- a/pkgs/development/compilers/ghc/head.nix +++ b/pkgs/development/compilers/ghc/head.nix @@ -30,6 +30,10 @@ , # What flavour to build. An empty string indicates no # specific flavour and falls back to ghc default values. ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) "perf-cross" + +, # Whether to disable the large address space allocator + # necessary fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/ + disableLargeAddressSpace ? stdenv.targetPlatform.isDarwin && stdenv.targetPlatform.isAarch64 }: assert !enableIntegerSimple -> gmp != null; @@ -157,8 +161,7 @@ stdenv.mkDerivation (rec { "CFLAGS=-fuse-ld=gold" "CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold" "CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold" - ] ++ stdenv.lib.optionals (targetPlatform.isDarwin && targetPlatform.isAarch64) [ - # fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/ + ] ++ stdenv.lib.optionals (disableLargeAddressSpace) [ "--disable-large-address-space" ]; -- cgit 1.4.1