summary refs log tree commit diff
diff options
context:
space:
mode:
authorSamuel Dionne-Riel <samuel@dionne-riel.com>2020-11-09 17:47:50 -0500
committerSamuel Dionne-Riel <samuel@dionne-riel.com>2020-11-09 22:32:12 -0500
commitdbe556af9cb9d00c6c50d76a1c1abade5455ab2f (patch)
tree11181507c0b17e6004c46c8e05cebf34a3f50661
parent46db711cdadc1408da6dfe4d9b473bb444b1a563 (diff)
downloadnixpkgs-dbe556af9cb9d00c6c50d76a1c1abade5455ab2f.tar
nixpkgs-dbe556af9cb9d00c6c50d76a1c1abade5455ab2f.tar.gz
nixpkgs-dbe556af9cb9d00c6c50d76a1c1abade5455ab2f.tar.bz2
nixpkgs-dbe556af9cb9d00c6c50d76a1c1abade5455ab2f.tar.lz
nixpkgs-dbe556af9cb9d00c6c50d76a1c1abade5455ab2f.tar.xz
nixpkgs-dbe556af9cb9d00c6c50d76a1c1abade5455ab2f.tar.zst
nixpkgs-dbe556af9cb9d00c6c50d76a1c1abade5455ab2f.zip
binutils: Move patches in versioned dir
We'll have multiple binutils to contend with.
-rw-r--r--pkgs/development/libraries/libbfd/default.nix2
-rw-r--r--pkgs/development/libraries/libopcodes/default.nix2
-rw-r--r--pkgs/development/tools/misc/binutils/default.nix29
-rw-r--r--pkgs/development/tools/misc/binutils/patches/2.31/0001-x86-Add-a-GNU_PROPERTY_X86_ISA_1_USED-note-if-needed.patch (renamed from pkgs/development/tools/misc/binutils/0001-x86-Add-a-GNU_PROPERTY_X86_ISA_1_USED-note-if-needed.patch)0
-rw-r--r--pkgs/development/tools/misc/binutils/patches/2.31/0001-x86-Properly-add-X86_ISA_1_NEEDED-property.patch (renamed from pkgs/development/tools/misc/binutils/0001-x86-Properly-add-X86_ISA_1_NEEDED-property.patch)0
-rw-r--r--pkgs/development/tools/misc/binutils/patches/2.31/0001-x86-Properly-merge-GNU_PROPERTY_X86_ISA_1_USED.patch (renamed from pkgs/development/tools/misc/binutils/0001-x86-Properly-merge-GNU_PROPERTY_X86_ISA_1_USED.patch)0
-rw-r--r--pkgs/development/tools/misc/binutils/patches/2.31/always-search-rpath.patch (renamed from pkgs/development/tools/misc/binutils/always-search-rpath.patch)0
-rw-r--r--pkgs/development/tools/misc/binutils/patches/2.31/build-components-separately.patch (renamed from pkgs/development/tools/misc/binutils/build-components-separately.patch)0
-rw-r--r--pkgs/development/tools/misc/binutils/patches/2.31/deterministic.patch (renamed from pkgs/development/tools/misc/binutils/deterministic.patch)0
-rw-r--r--pkgs/development/tools/misc/binutils/patches/2.31/disambiguate-arm-targets.patch (renamed from pkgs/development/tools/misc/binutils/disambiguate-arm-targets.patch)0
-rw-r--r--pkgs/development/tools/misc/binutils/patches/2.31/gold-symbol-visibility.patch (renamed from pkgs/development/tools/misc/binutils/gold-symbol-visibility.patch)0
-rw-r--r--pkgs/development/tools/misc/binutils/patches/2.31/no-plugins.patch (renamed from pkgs/development/tools/misc/binutils/no-plugins.patch)0
12 files changed, 18 insertions, 15 deletions
diff --git a/pkgs/development/libraries/libbfd/default.nix b/pkgs/development/libraries/libbfd/default.nix
index 75db780b7bb..e622cc6be68 100644
--- a/pkgs/development/libraries/libbfd/default.nix
+++ b/pkgs/development/libraries/libbfd/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation {
   outputs = [ "out" "dev" ];
 
   patches = binutils-unwrapped.patches ++ [
-    ../../tools/misc/binutils/build-components-separately.patch
+    (binutils-unwrapped.patchesDir + "/build-components-separately.patch")
     (fetchpatch {
       url = "https://raw.githubusercontent.com/mxe/mxe/e1d4c144ee1994f70f86cf7fd8168fe69bd629c6/src/bfd-1-disable-subdir-doc.patch";
       sha256 = "0pzb3i74d1r7lhjan376h59a7kirw15j7swwm8pz3zy9lkdqkj6q";
diff --git a/pkgs/development/libraries/libopcodes/default.nix b/pkgs/development/libraries/libopcodes/default.nix
index 8db034683dc..f596ddfafc4 100644
--- a/pkgs/development/libraries/libopcodes/default.nix
+++ b/pkgs/development/libraries/libopcodes/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation {
   outputs = [ "out" "dev" ];
 
   patches = binutils-unwrapped.patches ++ [
-    ../../tools/misc/binutils/build-components-separately.patch
+    (binutils-unwrapped.patchesDir + "/build-components-separately.patch")
   ];
 
   # We just want to build libopcodes
diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix
index b352e63a27c..3807fd7a539 100644
--- a/pkgs/development/tools/misc/binutils/default.nix
+++ b/pkgs/development/tools/misc/binutils/default.nix
@@ -38,6 +38,7 @@ let
     url = "mirror://gnu/binutils/${basename}-${version}.tar.bz2";
     sha256 = "1l34hn1zkmhr1wcrgf0d4z7r3najxnw3cx2y2fk7v55zjlk3ik7z";
   });
+  patchesDir = ./patches + "/${minorVersion}";
 in
 
 stdenv.mkDerivation {
@@ -48,18 +49,18 @@ stdenv.mkDerivation {
 
   patches = [
     # Make binutils output deterministic by default.
-    ./deterministic.patch
+    "${patchesDir}/deterministic.patch"
 
     # Bfd looks in BINDIR/../lib for some plugins that don't
     # exist. This is pointless (since users can't install plugins
     # there) and causes a cycle between the lib and bin outputs, so
     # get rid of it.
-    ./no-plugins.patch
+    "${patchesDir}/no-plugins.patch"
 
     # Help bfd choose between elf32-littlearm, elf32-littlearm-symbian, and
     # elf32-littlearm-vxworks in favor of the first.
     # https://github.com/NixOS/nixpkgs/pull/30484#issuecomment-345472766
-    ./disambiguate-arm-targets.patch
+    "${patchesDir}/disambiguate-arm-targets.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
@@ -67,19 +68,21 @@ stdenv.mkDerivation {
     # shared objects when cross-compiling. Consequently, we are forced to
     # override this behavior, forcing ld to search DT_RPATH even when
     # cross-compiling.
-    ./always-search-rpath.patch
-
-  ] ++ lib.optionals (!stdenv.targetPlatform.isVc4)
-  [
+    "${patchesDir}/always-search-rpath.patch"
+  ]
+  # For version 2.31 exclusively
+  ++ lib.optionals (!stdenv.targetPlatform.isVc4 && minorVersion == "2.31") [
     # https://sourceware.org/bugzilla/show_bug.cgi?id=22868
-    ./gold-symbol-visibility.patch
+    ./patches/2.31/gold-symbol-visibility.patch
 
     # https://sourceware.org/bugzilla/show_bug.cgi?id=23428
     # un-break features so linking against musl doesn't produce crash-only binaries
-    ./0001-x86-Add-a-GNU_PROPERTY_X86_ISA_1_USED-note-if-needed.patch
-    ./0001-x86-Properly-merge-GNU_PROPERTY_X86_ISA_1_USED.patch
-    ./0001-x86-Properly-add-X86_ISA_1_NEEDED-property.patch
-  ] ++ lib.optional stdenv.targetPlatform.isiOS ./support-ios.patch;
+    ./patches/2.31/0001-x86-Add-a-GNU_PROPERTY_X86_ISA_1_USED-note-if-needed.patch
+    ./patches/2.31/0001-x86-Properly-merge-GNU_PROPERTY_X86_ISA_1_USED.patch
+    ./patches/2.31/0001-x86-Properly-add-X86_ISA_1_NEEDED-property.patch
+  ]
+  ++ lib.optional stdenv.targetPlatform.isiOS ./support-ios.patch
+  ;
 
   outputs = [ "out" "info" "man" ];
 
@@ -149,7 +152,7 @@ stdenv.mkDerivation {
   enableParallelBuilding = true;
 
   passthru = {
-    inherit targetPrefix;
+    inherit targetPrefix patchesDir;
   };
 
   meta = with lib; {
diff --git a/pkgs/development/tools/misc/binutils/0001-x86-Add-a-GNU_PROPERTY_X86_ISA_1_USED-note-if-needed.patch b/pkgs/development/tools/misc/binutils/patches/2.31/0001-x86-Add-a-GNU_PROPERTY_X86_ISA_1_USED-note-if-needed.patch
index 5a047b0f070..5a047b0f070 100644
--- a/pkgs/development/tools/misc/binutils/0001-x86-Add-a-GNU_PROPERTY_X86_ISA_1_USED-note-if-needed.patch
+++ b/pkgs/development/tools/misc/binutils/patches/2.31/0001-x86-Add-a-GNU_PROPERTY_X86_ISA_1_USED-note-if-needed.patch
diff --git a/pkgs/development/tools/misc/binutils/0001-x86-Properly-add-X86_ISA_1_NEEDED-property.patch b/pkgs/development/tools/misc/binutils/patches/2.31/0001-x86-Properly-add-X86_ISA_1_NEEDED-property.patch
index ca50d9a57cd..ca50d9a57cd 100644
--- a/pkgs/development/tools/misc/binutils/0001-x86-Properly-add-X86_ISA_1_NEEDED-property.patch
+++ b/pkgs/development/tools/misc/binutils/patches/2.31/0001-x86-Properly-add-X86_ISA_1_NEEDED-property.patch
diff --git a/pkgs/development/tools/misc/binutils/0001-x86-Properly-merge-GNU_PROPERTY_X86_ISA_1_USED.patch b/pkgs/development/tools/misc/binutils/patches/2.31/0001-x86-Properly-merge-GNU_PROPERTY_X86_ISA_1_USED.patch
index 866d6db8ce2..866d6db8ce2 100644
--- a/pkgs/development/tools/misc/binutils/0001-x86-Properly-merge-GNU_PROPERTY_X86_ISA_1_USED.patch
+++ b/pkgs/development/tools/misc/binutils/patches/2.31/0001-x86-Properly-merge-GNU_PROPERTY_X86_ISA_1_USED.patch
diff --git a/pkgs/development/tools/misc/binutils/always-search-rpath.patch b/pkgs/development/tools/misc/binutils/patches/2.31/always-search-rpath.patch
index 2e9956e6b6e..2e9956e6b6e 100644
--- a/pkgs/development/tools/misc/binutils/always-search-rpath.patch
+++ b/pkgs/development/tools/misc/binutils/patches/2.31/always-search-rpath.patch
diff --git a/pkgs/development/tools/misc/binutils/build-components-separately.patch b/pkgs/development/tools/misc/binutils/patches/2.31/build-components-separately.patch
index d3cd0d2131c..d3cd0d2131c 100644
--- a/pkgs/development/tools/misc/binutils/build-components-separately.patch
+++ b/pkgs/development/tools/misc/binutils/patches/2.31/build-components-separately.patch
diff --git a/pkgs/development/tools/misc/binutils/deterministic.patch b/pkgs/development/tools/misc/binutils/patches/2.31/deterministic.patch
index 736e0aca6ce..736e0aca6ce 100644
--- a/pkgs/development/tools/misc/binutils/deterministic.patch
+++ b/pkgs/development/tools/misc/binutils/patches/2.31/deterministic.patch
diff --git a/pkgs/development/tools/misc/binutils/disambiguate-arm-targets.patch b/pkgs/development/tools/misc/binutils/patches/2.31/disambiguate-arm-targets.patch
index abbfa73da05..abbfa73da05 100644
--- a/pkgs/development/tools/misc/binutils/disambiguate-arm-targets.patch
+++ b/pkgs/development/tools/misc/binutils/patches/2.31/disambiguate-arm-targets.patch
diff --git a/pkgs/development/tools/misc/binutils/gold-symbol-visibility.patch b/pkgs/development/tools/misc/binutils/patches/2.31/gold-symbol-visibility.patch
index 0fb05a482d1..0fb05a482d1 100644
--- a/pkgs/development/tools/misc/binutils/gold-symbol-visibility.patch
+++ b/pkgs/development/tools/misc/binutils/patches/2.31/gold-symbol-visibility.patch
diff --git a/pkgs/development/tools/misc/binutils/no-plugins.patch b/pkgs/development/tools/misc/binutils/patches/2.31/no-plugins.patch
index 9624b7976b7..9624b7976b7 100644
--- a/pkgs/development/tools/misc/binutils/no-plugins.patch
+++ b/pkgs/development/tools/misc/binutils/patches/2.31/no-plugins.patch