From db896154d1fae2476be750bdcee5f4f889518479 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Mon, 30 Jan 2017 14:08:54 +0100 Subject: [PATCH] binutils: minimize rebuilds after parent revert Only revert the addition of the output and only on Darwin. --- .../tools/misc/binutils/default.nix | 11 ++++++++++- .../tools/misc/binutils/no-plugins.patch | 19 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/tools/misc/binutils/no-plugins.patch diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix index 4c32255e8755..e61acd598cf6 100644 --- a/pkgs/development/tools/misc/binutils/default.nix +++ b/pkgs/development/tools/misc/binutils/default.nix @@ -32,9 +32,18 @@ stdenv.mkDerivation rec { # This is needed, for instance, so that running "ldd" on a binary that is # PaX-marked to disable mprotect doesn't fail with permission denied. ./pt-pax-flags.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 ]; - outputs = [ "out" "info" ] ++ (optional (cross == null) "dev"); + outputs = [ "out" ] + ++ optional (!stdenv.isDarwin) "lib" # problems in Darwin stdenv + ++ [ "info" ] + ++ optional (cross == null) "dev"; nativeBuildInputs = [ bison ]; buildInputs = [ zlib ]; diff --git a/pkgs/development/tools/misc/binutils/no-plugins.patch b/pkgs/development/tools/misc/binutils/no-plugins.patch new file mode 100644 index 000000000000..9624b7976b70 --- /dev/null +++ b/pkgs/development/tools/misc/binutils/no-plugins.patch @@ -0,0 +1,19 @@ +diff -ru binutils-2.27-orig/bfd/plugin.c binutils-2.27/bfd/plugin.c +--- binutils-2.27-orig/bfd/plugin.c 2016-10-14 17:46:30.791315555 +0200 ++++ binutils-2.27/bfd/plugin.c 2016-10-14 17:46:38.583298765 +0200 +@@ -333,6 +333,7 @@ + if (plugin_program_name == NULL) + return found; + ++#if 0 + plugin_dir = concat (BINDIR, "/../lib/bfd-plugins", NULL); + p = make_relative_prefix (plugin_program_name, + BINDIR, +@@ -364,6 +365,7 @@ + free (p); + if (d) + closedir (d); ++#endif + + return found; + }