From e8e92a84691772f64c1e057269e656dfb4eada97 Mon Sep 17 00:00:00 2001 From: Adam Sandberg Ericsson Date: Wed, 8 Apr 2020 19:03:44 +0100 Subject: [PATCH 1/2] ghc: don't use ld.gold with musl libc (fixes #84670) ld.gold doesn't play well with musl as is documented in #49071 and https://sourceware.org/bugzilla/show_bug.cgi?id=23856 (cherry picked from commit 4675649d9cd06d13f8f127855dda4993881dd81b) --- pkgs/development/compilers/ghc/8.10.1.nix | 2 +- pkgs/development/compilers/ghc/8.4.4.nix | 2 +- pkgs/development/compilers/ghc/8.6.5.nix | 2 +- pkgs/development/compilers/ghc/8.8.1.nix | 2 +- pkgs/development/compilers/ghc/8.8.2.nix | 2 +- pkgs/development/compilers/ghc/8.8.3.nix | 2 +- pkgs/development/compilers/ghc/head.nix | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pkgs/development/compilers/ghc/8.10.1.nix b/pkgs/development/compilers/ghc/8.10.1.nix index dba715285b1ea..38b6b93b804ed 100644 --- a/pkgs/development/compilers/ghc/8.10.1.nix +++ b/pkgs/development/compilers/ghc/8.10.1.nix @@ -84,7 +84,7 @@ let targetCC = builtins.head toolsForTarget; - useLdGold = targetPlatform.isLinux && !(targetPlatform.useLLVM or false); + useLdGold = targetPlatform.isLinux && !(targetPlatform.useLLVM or false) && !targetPlatform.isMusl; in stdenv.mkDerivation (rec { diff --git a/pkgs/development/compilers/ghc/8.4.4.nix b/pkgs/development/compilers/ghc/8.4.4.nix index a1b9d9013b367..15525aeea578c 100644 --- a/pkgs/development/compilers/ghc/8.4.4.nix +++ b/pkgs/development/compilers/ghc/8.4.4.nix @@ -79,7 +79,7 @@ let targetCC = builtins.head toolsForTarget; - useLdGold = targetPlatform.isLinux && !(targetPlatform.useLLVM or false); + useLdGold = targetPlatform.isLinux && !(targetPlatform.useLLVM or false) && !targetPlatform.isMusl; in stdenv.mkDerivation (rec { diff --git a/pkgs/development/compilers/ghc/8.6.5.nix b/pkgs/development/compilers/ghc/8.6.5.nix index ead28a3076a88..b7b12ed7eaee3 100644 --- a/pkgs/development/compilers/ghc/8.6.5.nix +++ b/pkgs/development/compilers/ghc/8.6.5.nix @@ -84,7 +84,7 @@ let targetCC = builtins.head toolsForTarget; - useLdGold = targetPlatform.isLinux && !(targetPlatform.useLLVM or false); + useLdGold = targetPlatform.isLinux && !(targetPlatform.useLLVM or false) && !targetPlatform.isMusl; in stdenv.mkDerivation (rec { diff --git a/pkgs/development/compilers/ghc/8.8.1.nix b/pkgs/development/compilers/ghc/8.8.1.nix index cc9dab51df739..c498d6c2bbe3c 100644 --- a/pkgs/development/compilers/ghc/8.8.1.nix +++ b/pkgs/development/compilers/ghc/8.8.1.nix @@ -84,7 +84,7 @@ let targetCC = builtins.head toolsForTarget; - useLdGold = targetPlatform.isLinux && !(targetPlatform.useLLVM or false); + useLdGold = targetPlatform.isLinux && !(targetPlatform.useLLVM or false) && !targetPlatform.isMusl; in stdenv.mkDerivation (rec { diff --git a/pkgs/development/compilers/ghc/8.8.2.nix b/pkgs/development/compilers/ghc/8.8.2.nix index 0f9fd7731d321..24650f366a836 100644 --- a/pkgs/development/compilers/ghc/8.8.2.nix +++ b/pkgs/development/compilers/ghc/8.8.2.nix @@ -84,7 +84,7 @@ let targetCC = builtins.head toolsForTarget; - useLdGold = targetPlatform.isLinux && !(targetPlatform.useLLVM or false); + useLdGold = targetPlatform.isLinux && !(targetPlatform.useLLVM or false) && !targetPlatform.isMusl; in stdenv.mkDerivation (rec { diff --git a/pkgs/development/compilers/ghc/8.8.3.nix b/pkgs/development/compilers/ghc/8.8.3.nix index e4ece9b8d8c16..a628489de7a6b 100644 --- a/pkgs/development/compilers/ghc/8.8.3.nix +++ b/pkgs/development/compilers/ghc/8.8.3.nix @@ -84,7 +84,7 @@ let targetCC = builtins.head toolsForTarget; - useLdGold = targetPlatform.isLinux && !(targetPlatform.useLLVM or false); + useLdGold = targetPlatform.isLinux && !(targetPlatform.useLLVM or false) && !targetPlatform.isMusl; in stdenv.mkDerivation (rec { diff --git a/pkgs/development/compilers/ghc/head.nix b/pkgs/development/compilers/ghc/head.nix index 2dd7d5f30c4d8..a4cbe277e65ee 100644 --- a/pkgs/development/compilers/ghc/head.nix +++ b/pkgs/development/compilers/ghc/head.nix @@ -85,7 +85,7 @@ let targetCC = builtins.head toolsForTarget; - useLdGold = targetPlatform.isLinux && !(targetPlatform.useLLVM or false); + useLdGold = targetPlatform.isLinux && !(targetPlatform.useLLVM or false) && !targetPlatform.isMusl; in stdenv.mkDerivation (rec { From aea667b17bc0817b326eaae04fc6196afffc6047 Mon Sep 17 00:00:00 2001 From: Adam Sandberg Ericsson Date: Thu, 9 Apr 2020 13:44:31 +0100 Subject: [PATCH 2/2] ghc: mention why ld.gold is disabled for musl libc (cherry picked from commit 08a9d51699f275c2e183e4e40879f28b05b19673) --- pkgs/development/compilers/ghc/8.10.1.nix | 2 ++ pkgs/development/compilers/ghc/8.4.4.nix | 2 ++ pkgs/development/compilers/ghc/8.6.5.nix | 2 ++ pkgs/development/compilers/ghc/8.8.1.nix | 2 ++ pkgs/development/compilers/ghc/8.8.2.nix | 2 ++ pkgs/development/compilers/ghc/8.8.3.nix | 2 ++ pkgs/development/compilers/ghc/head.nix | 2 ++ 7 files changed, 14 insertions(+) diff --git a/pkgs/development/compilers/ghc/8.10.1.nix b/pkgs/development/compilers/ghc/8.10.1.nix index 38b6b93b804ed..80fb801bd92a0 100644 --- a/pkgs/development/compilers/ghc/8.10.1.nix +++ b/pkgs/development/compilers/ghc/8.10.1.nix @@ -84,6 +84,8 @@ let targetCC = builtins.head toolsForTarget; + # ld.gold is disabled for musl libc due to https://sourceware.org/bugzilla/show_bug.cgi?id=23856 + # see #84670 and #49071 for more background. useLdGold = targetPlatform.isLinux && !(targetPlatform.useLLVM or false) && !targetPlatform.isMusl; in diff --git a/pkgs/development/compilers/ghc/8.4.4.nix b/pkgs/development/compilers/ghc/8.4.4.nix index 15525aeea578c..41499ba0970bc 100644 --- a/pkgs/development/compilers/ghc/8.4.4.nix +++ b/pkgs/development/compilers/ghc/8.4.4.nix @@ -79,6 +79,8 @@ let targetCC = builtins.head toolsForTarget; + # ld.gold is disabled for musl libc due to https://sourceware.org/bugzilla/show_bug.cgi?id=23856 + # see #84670 and #49071 for more background. useLdGold = targetPlatform.isLinux && !(targetPlatform.useLLVM or false) && !targetPlatform.isMusl; in diff --git a/pkgs/development/compilers/ghc/8.6.5.nix b/pkgs/development/compilers/ghc/8.6.5.nix index b7b12ed7eaee3..05545cdc9ab8e 100644 --- a/pkgs/development/compilers/ghc/8.6.5.nix +++ b/pkgs/development/compilers/ghc/8.6.5.nix @@ -84,6 +84,8 @@ let targetCC = builtins.head toolsForTarget; + # ld.gold is disabled for musl libc due to https://sourceware.org/bugzilla/show_bug.cgi?id=23856 + # see #84670 and #49071 for more background. useLdGold = targetPlatform.isLinux && !(targetPlatform.useLLVM or false) && !targetPlatform.isMusl; in diff --git a/pkgs/development/compilers/ghc/8.8.1.nix b/pkgs/development/compilers/ghc/8.8.1.nix index c498d6c2bbe3c..8a2062b5a6ea3 100644 --- a/pkgs/development/compilers/ghc/8.8.1.nix +++ b/pkgs/development/compilers/ghc/8.8.1.nix @@ -84,6 +84,8 @@ let targetCC = builtins.head toolsForTarget; + # ld.gold is disabled for musl libc due to https://sourceware.org/bugzilla/show_bug.cgi?id=23856 + # see #84670 and #49071 for more background. useLdGold = targetPlatform.isLinux && !(targetPlatform.useLLVM or false) && !targetPlatform.isMusl; in diff --git a/pkgs/development/compilers/ghc/8.8.2.nix b/pkgs/development/compilers/ghc/8.8.2.nix index 24650f366a836..cdf5f1e7a312e 100644 --- a/pkgs/development/compilers/ghc/8.8.2.nix +++ b/pkgs/development/compilers/ghc/8.8.2.nix @@ -84,6 +84,8 @@ let targetCC = builtins.head toolsForTarget; + # ld.gold is disabled for musl libc due to https://sourceware.org/bugzilla/show_bug.cgi?id=23856 + # see #84670 and #49071 for more background. useLdGold = targetPlatform.isLinux && !(targetPlatform.useLLVM or false) && !targetPlatform.isMusl; in diff --git a/pkgs/development/compilers/ghc/8.8.3.nix b/pkgs/development/compilers/ghc/8.8.3.nix index a628489de7a6b..ccb5f4e0502ff 100644 --- a/pkgs/development/compilers/ghc/8.8.3.nix +++ b/pkgs/development/compilers/ghc/8.8.3.nix @@ -84,6 +84,8 @@ let targetCC = builtins.head toolsForTarget; + # ld.gold is disabled for musl libc due to https://sourceware.org/bugzilla/show_bug.cgi?id=23856 + # see #84670 and #49071 for more background. useLdGold = targetPlatform.isLinux && !(targetPlatform.useLLVM or false) && !targetPlatform.isMusl; in diff --git a/pkgs/development/compilers/ghc/head.nix b/pkgs/development/compilers/ghc/head.nix index a4cbe277e65ee..a9f0f981db08b 100644 --- a/pkgs/development/compilers/ghc/head.nix +++ b/pkgs/development/compilers/ghc/head.nix @@ -85,6 +85,8 @@ let targetCC = builtins.head toolsForTarget; + # ld.gold is disabled for musl libc due to https://sourceware.org/bugzilla/show_bug.cgi?id=23856 + # see #84670 and #49071 for more background. useLdGold = targetPlatform.isLinux && !(targetPlatform.useLLVM or false) && !targetPlatform.isMusl; in