diff --git a/pkgs/development/compilers/ghc/8.10.4.nix b/pkgs/development/compilers/ghc/8.10.4.nix index da957f93520..9c514efc282 100644 --- a/pkgs/development/compilers/ghc/8.10.4.nix +++ b/pkgs/development/compilers/ghc/8.10.4.nix @@ -93,6 +93,15 @@ let # see #84670 and #49071 for more background. useLdGold = targetPlatform.isLinux && !(targetPlatform.useLLVM or false) && !targetPlatform.isMusl; + runtimeDeps = [ + targetPackages.stdenv.cc.bintools + coreutils + ] + # On darwin, we need unwrapped bintools as well (for otool) + ++ lib.optionals (stdenv.targetPlatform.linker == "cctools") [ + targetPackages.stdenv.cc.bintools.bintools + ]; + in stdenv.mkDerivation (rec { version = "8.10.4"; @@ -235,7 +244,7 @@ stdenv.mkDerivation (rec { for i in "$out/bin/"*; do test ! -h $i || continue egrep --quiet '^#!' <(head -n 1 $i) || continue - sed -i -e '2i export PATH="$PATH:${lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i + sed -i -e '2i export PATH="$PATH:${lib.makeBinPath runtimeDeps}"' $i done ''; diff --git a/pkgs/development/compilers/ghc/8.8.4.nix b/pkgs/development/compilers/ghc/8.8.4.nix index b0336ad3992..fcb7db617d0 100644 --- a/pkgs/development/compilers/ghc/8.8.4.nix +++ b/pkgs/development/compilers/ghc/8.8.4.nix @@ -102,6 +102,15 @@ let # see #84670 and #49071 for more background. useLdGold = targetPlatform.isLinux && !(targetPlatform.useLLVM or false) && !targetPlatform.isMusl; + runtimeDeps = [ + targetPackages.stdenv.cc.bintools + coreutils + ] + # On darwin, we need unwrapped bintools as well (for otool) + ++ lib.optionals (stdenv.targetPlatform.linker == "cctools") [ + targetPackages.stdenv.cc.bintools.bintools + ]; + in stdenv.mkDerivation (rec { version = "8.8.4"; @@ -242,7 +251,7 @@ stdenv.mkDerivation (rec { for i in "$out/bin/"*; do test ! -h $i || continue egrep --quiet '^#!' <(head -n 1 $i) || continue - sed -i -e '2i export PATH="$PATH:${lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i + sed -i -e '2i export PATH="$PATH:${lib.makeBinPath runtimeDeps}"' $i done ''; diff --git a/pkgs/development/compilers/ghc/9.0.1.nix b/pkgs/development/compilers/ghc/9.0.1.nix index 58beef5d688..a110d587874 100644 --- a/pkgs/development/compilers/ghc/9.0.1.nix +++ b/pkgs/development/compilers/ghc/9.0.1.nix @@ -94,6 +94,15 @@ let # see #84670 and #49071 for more background. useLdGold = targetPlatform.isLinux && !(targetPlatform.useLLVM or false) && !targetPlatform.isMusl; + runtimeDeps = [ + targetPackages.stdenv.cc.bintools + coreutils + ] + # On darwin, we need unwrapped bintools as well (for otool) + ++ lib.optionals (stdenv.targetPlatform.linker == "cctools") [ + targetPackages.stdenv.cc.bintools.bintools + ]; + in stdenv.mkDerivation (rec { version = "9.0.1"; @@ -225,7 +234,7 @@ stdenv.mkDerivation (rec { for i in "$out/bin/"*; do test ! -h $i || continue egrep --quiet '^#!' <(head -n 1 $i) || continue - sed -i -e '2i export PATH="$PATH:${lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i + sed -i -e '2i export PATH="$PATH:${lib.makeBinPath runtimeDeps}"' $i done ''; diff --git a/pkgs/development/compilers/ghc/head.nix b/pkgs/development/compilers/ghc/head.nix index a0ca13270a2..e1c1cdf8dc5 100644 --- a/pkgs/development/compilers/ghc/head.nix +++ b/pkgs/development/compilers/ghc/head.nix @@ -104,6 +104,15 @@ let # see #84670 and #49071 for more background. useLdGold = targetPlatform.isLinux && !(targetPlatform.useLLVM or false) && !targetPlatform.isMusl; + runtimeDeps = [ + targetPackages.stdenv.cc.bintools + coreutils + ] + # On darwin, we need unwrapped bintools as well (for otool) + ++ lib.optionals (stdenv.targetPlatform.linker == "cctools") [ + targetPackages.stdenv.cc.bintools.bintools + ]; + in stdenv.mkDerivation (rec { inherit version; @@ -242,7 +251,7 @@ stdenv.mkDerivation (rec { for i in "$out/bin/"*; do test ! -h $i || continue egrep --quiet '^#!' <(head -n 1 $i) || continue - sed -i -e '2i export PATH="$PATH:${lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i + sed -i -e '2i export PATH="$PATH:${lib.makeBinPath runtimeDeps}"' $i done '';