about summary refs log tree commit diff
path: root/pkgs/development/tools/misc/binutils/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/tools/misc/binutils/default.nix')
-rw-r--r--pkgs/development/tools/misc/binutils/default.nix26
1 files changed, 10 insertions, 16 deletions
diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix
index a60457e73591e..491bfc19ae0fc 100644
--- a/pkgs/development/tools/misc/binutils/default.nix
+++ b/pkgs/development/tools/misc/binutils/default.nix
@@ -14,8 +14,8 @@ in
 , lib
 , noSysDirs
 , perl
-, substitute
 , zlib
+, CoreServices
 
 , enableGold ? withGold stdenv.targetPlatform
 , enableGoldDefault ? false
@@ -33,12 +33,12 @@ assert enableGoldDefault -> enableGold;
 let
   inherit (stdenv) buildPlatform hostPlatform targetPlatform;
 
-  version = "2.41";
+  version = "2.42";
 
   srcs = {
     normal = fetchurl {
       url = "mirror://gnu/binutils/binutils-${version}.tar.bz2";
-      hash = "sha256-pMS+wFL3uDcAJOYDieGUN38/SLVmGEGOpRBn9nqqsws=";
+      hash = "sha256-qlSFDr2lBkxyzU7C2bBWwpQlKZFIY1DZqXqypt/frxI=";
     };
     vc4-none = fetchFromGitHub {
       owner = "itszor";
@@ -57,20 +57,12 @@ stdenv.mkDerivation (finalAttrs: {
   pname = targetPrefix + "binutils";
   inherit version;
 
-  # HACK: Ensure that we preserve source from bootstrap binutils to not rebuild LLVM
-  src = stdenv.__bootPackages.binutils-unwrapped.src
-    or srcs.${targetPlatform.system}
-    or srcs.normal;
+  src = srcs.${targetPlatform.system} or srcs.normal;
 
   # WARN: this package is used for bootstrapping fetchurl, and thus cannot use
   # fetchpatch! All mutable patches (generated by GitHub or cgit) that are
   # needed here should be included directly in Nixpkgs as files.
   patches = [
-    # Upstream patch to fix llvm testsuite failure when loading powerpc
-    # objects:
-    #   https://sourceware.org/PR30794
-    ./gold-powerpc-for-llvm.patch
-
     # Make binutils output deterministic by default.
     ./deterministic.patch
 
@@ -80,9 +72,6 @@ stdenv.mkDerivation (finalAttrs: {
     ./0001-Revert-libtool.m4-fix-the-NM-nm-over-here-B-option-w.patch
     ./0001-Revert-libtool.m4-fix-nm-BSD-flag-detection.patch
 
-    # Required for newer macos versions
-    ./0001-libtool.m4-update-macos-version-detection-block.patch
-
     # For some reason bfd ld doesn't search DT_RPATH when cross-compiling. It's
     # not clear why this behavior was decided upon but it has the unfortunate
     # consequence that the linker will fail to find transitive dependencies of
@@ -95,6 +84,11 @@ stdenv.mkDerivation (finalAttrs: {
     # not need to know binutils' BINDIR at all. It's an absolute path
     # where libraries are stored.
     ./plugins-no-BINDIR.patch
+  ] ++ lib.optionals buildPlatform.isDarwin [
+    # Note: Conditional to avoid Linux rebuilds on staging-next. Remove the conditional with the next update.
+    # ld64 needs `-undefined dynamic_lookup` to link `libctf-nobfd.dylib`, but the Darwin
+    # version detection in `libtool.m4` fails to detect the Darwin version correctly.
+    ./0001-libtool.m4-update-macos-version-detection-block.patch
   ]
   ++ lib.optional targetPlatform.isiOS ./support-ios.patch
   # Adds AVR-specific options to "size" for compatibility with Atmel's downstream distribution
@@ -128,7 +122,7 @@ stdenv.mkDerivation (finalAttrs: {
   ++ lib.optionals targetPlatform.isVc4 [ flex ]
   ;
 
-  buildInputs = [ zlib gettext ];
+  buildInputs = [ zlib gettext ] ++ lib.optionals buildPlatform.isDarwin [ CoreServices ];
 
   inherit noSysDirs;