about summary refs log tree commit diff
path: root/pkgs/development/tools/misc
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/tools/misc')
-rw-r--r--pkgs/development/tools/misc/astyle/default.nix2
-rw-r--r--pkgs/development/tools/misc/automake/automake-1.13.x.nix2
-rw-r--r--pkgs/development/tools/misc/automake/automake-1.14.x.nix2
-rw-r--r--pkgs/development/tools/misc/automake/automake-1.15.x.nix2
-rw-r--r--pkgs/development/tools/misc/binutils/default.nix13
-rw-r--r--pkgs/development/tools/misc/binutils/elf-check-orphan-input.patch99
-rw-r--r--pkgs/development/tools/misc/binutils/elf-check-orphan-placement.patch161
-rw-r--r--pkgs/development/tools/misc/ccache/default.nix12
-rw-r--r--pkgs/development/tools/misc/creduce/default.nix2
-rw-r--r--pkgs/development/tools/misc/csmith/default.nix5
-rw-r--r--pkgs/development/tools/misc/distcc/default.nix2
-rw-r--r--pkgs/development/tools/misc/elfkickers/default.nix2
-rw-r--r--pkgs/development/tools/misc/elfutils/debug-info-from-env.patch27
-rw-r--r--pkgs/development/tools/misc/elfutils/default.nix10
-rw-r--r--pkgs/development/tools/misc/gdb/debug-info-from-env.patch81
-rw-r--r--pkgs/development/tools/misc/gdb/default.nix15
-rw-r--r--pkgs/development/tools/misc/gede/default.nix2
-rw-r--r--pkgs/development/tools/misc/gnum4/default.nix4
-rw-r--r--pkgs/development/tools/misc/hydra/default.nix6
-rw-r--r--pkgs/development/tools/misc/intltool/default.nix2
-rw-r--r--pkgs/development/tools/misc/lit/default.nix2
-rw-r--r--pkgs/development/tools/misc/ninka/default.nix2
-rw-r--r--pkgs/development/tools/misc/rolespec/default.nix2
-rw-r--r--pkgs/development/tools/misc/srecord/default.nix2
-rw-r--r--pkgs/development/tools/misc/swig/3.x.nix4
-rw-r--r--pkgs/development/tools/misc/texinfo/5.2.nix2
-rw-r--r--pkgs/development/tools/misc/texinfo/6.3.nix2
-rw-r--r--pkgs/development/tools/misc/unifdef/default.nix2
-rw-r--r--pkgs/development/tools/misc/universal-ctags/default.nix2
29 files changed, 432 insertions, 39 deletions
diff --git a/pkgs/development/tools/misc/astyle/default.nix b/pkgs/development/tools/misc/astyle/default.nix
index fb1e4a8ca4b5..9aea35104320 100644
--- a/pkgs/development/tools/misc/astyle/default.nix
+++ b/pkgs/development/tools/misc/astyle/default.nix
@@ -24,7 +24,7 @@ stdenv.mkDerivation {
   installFlags = "INSTALL=install prefix=$$out";
 
   meta = {
-    homepage = "http://astyle.sourceforge.net/";
+    homepage = http://astyle.sourceforge.net/;
     description = "Source code indenter, formatter, and beautifier for C, C++, C# and Java";
     license = stdenv.lib.licenses.lgpl3;
     platforms = stdenv.lib.platforms.unix;
diff --git a/pkgs/development/tools/misc/automake/automake-1.13.x.nix b/pkgs/development/tools/misc/automake/automake-1.13.x.nix
index 77fe2b7b92c2..54e697656d2c 100644
--- a/pkgs/development/tools/misc/automake/automake-1.13.x.nix
+++ b/pkgs/development/tools/misc/automake/automake-1.13.x.nix
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     branch = "1.13";
-    homepage = "http://www.gnu.org/software/automake/";
+    homepage = http://www.gnu.org/software/automake/;
     description = "GNU standard-compliant makefile generator";
     license = stdenv.lib.licenses.gpl2Plus;
 
diff --git a/pkgs/development/tools/misc/automake/automake-1.14.x.nix b/pkgs/development/tools/misc/automake/automake-1.14.x.nix
index fd074e6b96c8..c797042885a0 100644
--- a/pkgs/development/tools/misc/automake/automake-1.14.x.nix
+++ b/pkgs/development/tools/misc/automake/automake-1.14.x.nix
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     branch = "1.14";
-    homepage = "http://www.gnu.org/software/automake/";
+    homepage = http://www.gnu.org/software/automake/;
     description = "GNU standard-compliant makefile generator";
     license = stdenv.lib.licenses.gpl2Plus;
 
diff --git a/pkgs/development/tools/misc/automake/automake-1.15.x.nix b/pkgs/development/tools/misc/automake/automake-1.15.x.nix
index 3c4a8d1189e4..49978e9739dc 100644
--- a/pkgs/development/tools/misc/automake/automake-1.15.x.nix
+++ b/pkgs/development/tools/misc/automake/automake-1.15.x.nix
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     branch = "1.15";
-    homepage = "http://www.gnu.org/software/automake/";
+    homepage = http://www.gnu.org/software/automake/;
     description = "GNU standard-compliant makefile generator";
     license = stdenv.lib.licenses.gpl2Plus;
 
diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix
index d13ea9390da9..dda2a78097a6 100644
--- a/pkgs/development/tools/misc/binutils/default.nix
+++ b/pkgs/development/tools/misc/binutils/default.nix
@@ -5,7 +5,7 @@
 }:
 
 let
-  version = "2.28";
+  version = "2.29";
   basename = "binutils-${version}";
   inherit (stdenv.lib) optional optionals optionalString;
   # The prefix prepended to binary names to allow multiple binuntils on the
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "mirror://gnu/binutils/${basename}.tar.bz2";
-    sha256 = "0wiasgns7i8km8nrxas265sh2dfpsw93b3qw195ipc90w4z475v2";
+    sha256 = "1gqfyksdnj3iir5gzyvlp785mnk60g1pll6zbzbslfchhr4rb8i9";
   };
 
   patches = [
@@ -45,6 +45,15 @@ stdenv.mkDerivation rec {
     # there) and causes a cycle between the lib and bin outputs, so
     # get rid of it.
     ./no-plugins.patch
+
+    # remove after 2.29.1/2.30
+    (fetchurl {
+      url = "https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=patch;h=c6b78c965a96fb152fbd58926edccb5dee2707a5";
+      sha256 = "0rkbq5pf7ffgcggfk4czkxin1091bqjj92an9wxnqkgqwq6cx5yr";
+      name = "readelf-empty-sections.patch";
+    })
+    ./elf-check-orphan-input.patch
+    ./elf-check-orphan-placement.patch
   ];
 
   outputs = [ "out" ]
diff --git a/pkgs/development/tools/misc/binutils/elf-check-orphan-input.patch b/pkgs/development/tools/misc/binutils/elf-check-orphan-input.patch
new file mode 100644
index 000000000000..2ec90128347e
--- /dev/null
+++ b/pkgs/development/tools/misc/binutils/elf-check-orphan-input.patch
@@ -0,0 +1,99 @@
+From a388b7afeffad6411686d39dc1c62294da48a814 Mon Sep 17 00:00:00 2001
+From: "H.J. Lu" <hjl.tools@gmail.com>
+Date: Wed, 2 Aug 2017 05:10:29 -0700
+Subject: [PATCH] Check ELF section header only for ELF output
+
+When placing an orphan input section, check ELF section header only for
+ELF output.
+
+	PR ld/21884
+	* emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Check
+	ELF section header only for ELF output.
+	* testsuite/ld-elf/pr21884.d: New test.
+	* testsuite/ld-elf/pr21884.t: Likewise.
+	* testsuite/ld-elf/pr21884a.s: Likewise.
+	* testsuite/ld-elf/pr21884b.s: Likewise.
+
+(cherry picked from commit db99ecc08f5b66fbe9cb72e90352c7f77ec71a6e)
+---
+ ld/ChangeLog                   | 10 ++++++++++
+ ld/emultempl/elf32.em          |  3 ++-
+ ld/testsuite/ld-elf/pr21884.d  | 11 +++++++++++
+ ld/testsuite/ld-elf/pr21884.t  |  7 +++++++
+ ld/testsuite/ld-elf/pr21884a.s |  5 +++++
+ ld/testsuite/ld-elf/pr21884b.s |  5 +++++
+ 6 files changed, 40 insertions(+), 1 deletion(-)
+ create mode 100644 ld/testsuite/ld-elf/pr21884.d
+ create mode 100644 ld/testsuite/ld-elf/pr21884.t
+ create mode 100644 ld/testsuite/ld-elf/pr21884a.s
+ create mode 100644 ld/testsuite/ld-elf/pr21884b.s
+
+diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
+index d2551b6..75ded12 100644
+--- a/ld/emultempl/elf32.em
++++ b/ld/emultempl/elf32.em
+@@ -2136,7 +2136,8 @@ gld${EMULATION_NAME}_place_orphan (asection *s,
+     }
+ 
+   /* Look through the script to see where to place this section.  */
+-  if (constraint == 0)
++  if (constraint == 0
++      && link_info.output_bfd->xvec->flavour == bfd_target_elf_flavour)
+     for (os = lang_output_section_find (secname);
+ 	 os != NULL;
+ 	 os = next_matching_output_section_statement (os, 0))
+diff --git a/ld/testsuite/ld-elf/pr21884.d b/ld/testsuite/ld-elf/pr21884.d
+new file mode 100644
+index 0000000..52cd2c1
+--- /dev/null
++++ b/ld/testsuite/ld-elf/pr21884.d
+@@ -0,0 +1,11 @@
++#source: pr21884a.s
++#source: pr21884b.s
++#ld: -T pr21884.t
++#objdump: -b binary -s
++#notarget: aarch64*-*-* arm*-*-* nds32*-*-*
++# Skip targets which can't change output format to binary.
++
++.*:     file format binary
++
++Contents of section .data:
++#pass
+diff --git a/ld/testsuite/ld-elf/pr21884.t b/ld/testsuite/ld-elf/pr21884.t
+new file mode 100644
+index 0000000..d483911
+--- /dev/null
++++ b/ld/testsuite/ld-elf/pr21884.t
+@@ -0,0 +1,7 @@
++OUTPUT_FORMAT("binary")
++
++ENTRY(_main);
++SECTIONS {
++	. = 0;
++	.setup : { *(.setup) }
++}
+diff --git a/ld/testsuite/ld-elf/pr21884a.s b/ld/testsuite/ld-elf/pr21884a.s
+new file mode 100644
+index 0000000..a3361b2
+--- /dev/null
++++ b/ld/testsuite/ld-elf/pr21884a.s
+@@ -0,0 +1,5 @@
++	.text
++	.globl	_main
++	.type _main,%function
++_main:
++	.dc.a bar
+diff --git a/ld/testsuite/ld-elf/pr21884b.s b/ld/testsuite/ld-elf/pr21884b.s
+new file mode 100644
+index 0000000..e533837
+--- /dev/null
++++ b/ld/testsuite/ld-elf/pr21884b.s
+@@ -0,0 +1,5 @@
++	.text
++	.globl	bar
++	.type bar,%function
++bar:
++	.byte 0
+-- 
+2.9.3
+
diff --git a/pkgs/development/tools/misc/binutils/elf-check-orphan-placement.patch b/pkgs/development/tools/misc/binutils/elf-check-orphan-placement.patch
new file mode 100644
index 000000000000..7e7566aec43d
--- /dev/null
+++ b/pkgs/development/tools/misc/binutils/elf-check-orphan-placement.patch
@@ -0,0 +1,161 @@
+From 36088682f447540fd8666a2c437fa232064044a7 Mon Sep 17 00:00:00 2001
+From: Alan Modra <amodra@gmail.com>
+Date: Thu, 3 Aug 2017 14:01:34 +0930
+Subject: [PATCH] ELF checks for orphan placement
+
+The loop checking for previous orphan placement should run even when
+the output is non-ELF.
+
+	PR ld/21884
+	* emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Revert
+	last change.  Rename iself to elfinput.  Expand comments.  Condition
+	ELF checks on having both input and output ELF files.  Extract..
+	(elf_orphan_compatible): ..this new function.
+---
+ ld/ChangeLog          |  8 ++++++
+ ld/emultempl/elf32.em | 76 +++++++++++++++++++++++++++++++--------------------
+ 2 files changed, 55 insertions(+), 29 deletions(-)
+
+diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
+index 75ded12..9ac1840 100644
+--- a/ld/emultempl/elf32.em
++++ b/ld/emultempl/elf32.em
+@@ -2008,6 +2008,29 @@ output_rel_find (asection *sec, int isdyn)
+   return last;
+ }
+ 
++/* Return whether IN is suitable to be part of OUT.  */
++
++static bfd_boolean
++elf_orphan_compatible (asection *in, asection *out)
++{
++  /* Non-zero sh_info implies a section with SHF_INFO_LINK with
++     unknown semantics for the generic linker, or a SHT_REL/SHT_RELA
++     section where sh_info specifies a symbol table.  (We won't see
++     SHT_GROUP, SHT_SYMTAB or SHT_DYNSYM sections here.)  We clearly
++     can't merge SHT_REL/SHT_RELA using differing symbol tables, and
++     shouldn't merge sections with differing unknown semantics.  */
++  if (elf_section_data (out)->this_hdr.sh_info
++      != elf_section_data (in)->this_hdr.sh_info)
++    return FALSE;
++  /* We can't merge two sections with differing SHF_EXCLUDE when doing
++     a relocatable link.  */
++  if (bfd_link_relocatable (&link_info)
++      && ((elf_section_flags (out) ^ elf_section_flags (in)) & SHF_EXCLUDE) != 0)
++    return FALSE;
++  return _bfd_elf_match_sections_by_type (link_info.output_bfd, out,
++					  in->owner, in);
++}
++
+ /* Place an orphan section.  We use this to put random SHF_ALLOC
+    sections in the right segment.  */
+ 
+@@ -2064,8 +2087,9 @@ gld${EMULATION_NAME}_place_orphan (asection *s,
+   lang_output_section_statement_type *os;
+   lang_output_section_statement_type *match_by_name = NULL;
+   int isdyn = 0;
+-  int iself = s->owner->xvec->flavour == bfd_target_elf_flavour;
+-  unsigned int sh_type = iself ? elf_section_type (s) : SHT_NULL;
++  int elfinput = s->owner->xvec->flavour == bfd_target_elf_flavour;
++  int elfoutput = link_info.output_bfd->xvec->flavour == bfd_target_elf_flavour;
++  unsigned int sh_type = elfinput ? elf_section_type (s) : SHT_NULL;
+   flagword flags;
+   asection *nexts;
+ 
+@@ -2073,7 +2097,7 @@ gld${EMULATION_NAME}_place_orphan (asection *s,
+       && link_info.combreloc
+       && (s->flags & SEC_ALLOC))
+     {
+-      if (iself)
++      if (elfinput)
+ 	switch (sh_type)
+ 	  {
+ 	  case SHT_RELA:
+@@ -2095,6 +2119,8 @@ gld${EMULATION_NAME}_place_orphan (asection *s,
+     }
+ 
+   if (!bfd_link_relocatable (&link_info)
++      && elfinput
++      && elfoutput
+       && (s->flags & SEC_ALLOC) != 0
+       && (elf_section_flags (s) & SHF_GNU_MBIND) != 0)
+     {
+@@ -2135,9 +2161,11 @@ gld${EMULATION_NAME}_place_orphan (asection *s,
+ 	secname = ".mbind.text";
+     }
+ 
+-  /* Look through the script to see where to place this section.  */
+-  if (constraint == 0
+-      && link_info.output_bfd->xvec->flavour == bfd_target_elf_flavour)
++  /* Look through the script to see where to place this section.  The
++     script includes entries added by previous lang_insert_orphan
++     calls, so this loop puts multiple compatible orphans of the same
++     name into a single output section.  */
++  if (constraint == 0)
+     for (os = lang_output_section_find (secname);
+ 	 os != NULL;
+ 	 os = next_matching_output_section_statement (os, 0))
+@@ -2146,29 +2174,19 @@ gld${EMULATION_NAME}_place_orphan (asection *s,
+ 	   lang_insert_orphan to create a new output section.  */
+ 	constraint = SPECIAL;
+ 
+-	/* SEC_EXCLUDE is cleared when doing a relocatable link.  But
+-	   we can't merge 2 input sections with the same name when only
+-	   one of them has SHF_EXCLUDE.  Don't merge 2 sections with
+-	   different sh_info.  */
++	/* Check to see if we already have an output section statement
++	   with this name, and its bfd section has compatible flags.
++	   If the section already exists but does not have any flags
++	   set, then it has been created by the linker, possibly as a
++	   result of a --section-start command line switch.  */
+ 	if (os->bfd_section != NULL
+-	    && (elf_section_data (os->bfd_section)->this_hdr.sh_info
+-		== elf_section_data (s)->this_hdr.sh_info)
+ 	    && (os->bfd_section->flags == 0
+-		|| ((!bfd_link_relocatable (&link_info)
+-		     || (iself && (((elf_section_flags (s)
+-				     ^ elf_section_flags (os->bfd_section))
+-				    & SHF_EXCLUDE) == 0)))
+-		    && ((s->flags ^ os->bfd_section->flags)
++		|| (((s->flags ^ os->bfd_section->flags)
+ 		     & (SEC_LOAD | SEC_ALLOC)) == 0
+-		    && _bfd_elf_match_sections_by_type (link_info.output_bfd,
+-							os->bfd_section,
+-							s->owner, s))))
++		    && (!elfinput
++			|| !elfoutput
++			|| elf_orphan_compatible (s, os->bfd_section)))))
+ 	  {
+-	    /* We already have an output section statement with this
+-	       name, and its bfd section has compatible flags.
+-	       If the section already exists but does not have any flags
+-	       set, then it has been created by the linker, probably as a
+-	       result of a --section-start command line switch.  */
+ 	    lang_add_section (&os->children, s, NULL, os);
+ 	    return os;
+ 	  }
+@@ -2244,8 +2262,8 @@ gld${EMULATION_NAME}_place_orphan (asection *s,
+   else if ((flags & SEC_ALLOC) == 0)
+     ;
+   else if ((flags & SEC_LOAD) != 0
+-	   && ((iself && sh_type == SHT_NOTE)
+-	       || (!iself && CONST_STRNEQ (secname, ".note"))))
++	   && ((elfinput && sh_type == SHT_NOTE)
++	       || (!elfinput && CONST_STRNEQ (secname, ".note"))))
+     place = &hold[orphan_interp];
+   else if ((flags & (SEC_LOAD | SEC_HAS_CONTENTS | SEC_THREAD_LOCAL)) == 0)
+     place = &hold[orphan_bss];
+@@ -2255,8 +2273,8 @@ gld${EMULATION_NAME}_place_orphan (asection *s,
+     place = &hold[orphan_tdata];
+   else if ((flags & SEC_READONLY) == 0)
+     place = &hold[orphan_data];
+-  else if (((iself && (sh_type == SHT_RELA || sh_type == SHT_REL))
+-	    || (!iself && CONST_STRNEQ (secname, ".rel")))
++  else if (((elfinput && (sh_type == SHT_RELA || sh_type == SHT_REL))
++	    || (!elfinput && CONST_STRNEQ (secname, ".rel")))
+ 	   && (flags & SEC_LOAD) != 0)
+     place = &hold[orphan_rel];
+   else if ((flags & SEC_CODE) == 0)
+-- 
+2.9.3
+
diff --git a/pkgs/development/tools/misc/ccache/default.nix b/pkgs/development/tools/misc/ccache/default.nix
index 765fdfb2ea45..65c7e633f8e2 100644
--- a/pkgs/development/tools/misc/ccache/default.nix
+++ b/pkgs/development/tools/misc/ccache/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch, runCommand, zlib }:
+{ stdenv, fetchurl, fetchpatch, runCommand, zlib, makeWrapper }:
 
 let ccache = stdenv.mkDerivation rec {
   name = "ccache-${version}";
@@ -32,18 +32,16 @@ let ccache = stdenv.mkDerivation rec {
         isGNU = unwrappedCC.isGNU or false;
       };
       inherit (unwrappedCC) lib;
+      nativeBuildInputs = [ makeWrapper ];
       buildCommand = ''
         mkdir -p $out/bin
 
         wrap() {
           local cname="$1"
           if [ -x "${unwrappedCC}/bin/$cname" ]; then
-            cat > $out/bin/$cname << EOF
-        #!/bin/sh
-        ${extraConfig}
-        exec ${ccache}/bin/ccache ${unwrappedCC}/bin/$cname "\$@"
-        EOF
-            chmod +x $out/bin/$cname
+            makeWrapper ${ccache}/bin/ccache $out/bin/$cname \
+              --run ${stdenv.lib.escapeShellArg extraConfig} \
+              --add-flags ${unwrappedCC}/bin/$cname
           fi
         }
 
diff --git a/pkgs/development/tools/misc/creduce/default.nix b/pkgs/development/tools/misc/creduce/default.nix
index c8378e06df6d..37ec63627b15 100644
--- a/pkgs/development/tools/misc/creduce/default.nix
+++ b/pkgs/development/tools/misc/creduce/default.nix
@@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     description = "A C program reducer";
-    homepage = "https://embed.cs.utah.edu/creduce";
+    homepage = https://embed.cs.utah.edu/creduce;
     # Officially, the license is: https://github.com/csmith-project/creduce/blob/master/COPYING
     license = licenses.ncsa;
     longDescription = ''
diff --git a/pkgs/development/tools/misc/csmith/default.nix b/pkgs/development/tools/misc/csmith/default.nix
index 20d149f3efe0..9a8c24fa1685 100644
--- a/pkgs/development/tools/misc/csmith/default.nix
+++ b/pkgs/development/tools/misc/csmith/default.nix
@@ -22,7 +22,8 @@ stdenv.mkDerivation rec {
       --replace '../compiler_test.pl' $out/bin/compiler_test.pl \
       --replace '../$CONFIG_FILE' '$CONFIG_FILE'
 
-    wrapProgram $out/bin/launchn.pl --prefix PERL5LIB : "$PERL5LIB" $out/bin/launchn.pl
+    wrapProgram $out/bin/launchn.pl \
+      --prefix PERL5LIB : "$PERL5LIB"
 
     mkdir -p $out/share/csmith
     mv $out/bin/compiler_test.in $out/share/csmith/
@@ -32,7 +33,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     description = "A random generator of C programs";
-    homepage = "https://embed.cs.utah.edu/csmith";
+    homepage = https://embed.cs.utah.edu/csmith;
     # Officially, the license is this: https://github.com/csmith-project/csmith/blob/master/COPYING
     license = licenses.bsd2;
     longDescription = ''
diff --git a/pkgs/development/tools/misc/distcc/default.nix b/pkgs/development/tools/misc/distcc/default.nix
index 32e212a09214..17ef66470505 100644
--- a/pkgs/development/tools/misc/distcc/default.nix
+++ b/pkgs/development/tools/misc/distcc/default.nix
@@ -71,7 +71,7 @@ let
 
     meta = {
       description = "A fast, free distributed C/C++ compiler";
-      homepage = "http://distcc.org";
+      homepage = http://distcc.org;
       license = "GPL";
 
       platforms = stdenv.lib.platforms.linux;
diff --git a/pkgs/development/tools/misc/elfkickers/default.nix b/pkgs/development/tools/misc/elfkickers/default.nix
index 603f8c0bef60..905fa0d40935 100644
--- a/pkgs/development/tools/misc/elfkickers/default.nix
+++ b/pkgs/development/tools/misc/elfkickers/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   enableParallelBuilding = true;
 
   meta = with stdenv.lib; {
-    homepage = "http://www.muppetlabs.com/~breadbox/software/elfkickers.html";
+    homepage = http://www.muppetlabs.com/~breadbox/software/elfkickers.html;
     description = "A collection of programs that access and manipulate ELF files";
     platforms = platforms.linux;
     license = licenses.gpl2;
diff --git a/pkgs/development/tools/misc/elfutils/debug-info-from-env.patch b/pkgs/development/tools/misc/elfutils/debug-info-from-env.patch
new file mode 100644
index 000000000000..409f1311c315
--- /dev/null
+++ b/pkgs/development/tools/misc/elfutils/debug-info-from-env.patch
@@ -0,0 +1,27 @@
+Look up .build-id files relative to the directories in the
+colon-separated environment variable NIX_DEBUG_INFO_DIRS, unless
+overriden by --debuginfo-path.
+
+diff -ru elfutils-0.169-orig/libdwfl/argp-std.c elfutils-0.169/libdwfl/argp-std.c
+--- elfutils-0.169-orig/libdwfl/argp-std.c	2017-05-02 23:05:52.000000000 +0200
++++ elfutils-0.169/libdwfl/argp-std.c	2017-07-28 16:08:06.739558106 +0200
+@@ -376,5 +376,7 @@
+ const struct argp *
+ dwfl_standard_argp (void)
+ {
++  debuginfo_path = getenv("NIX_DEBUG_INFO_DIRS");
++
+   return &libdwfl_argp;
+ }
+diff -ru elfutils-0.169-orig/src/stack.c elfutils-0.169/src/stack.c
+--- elfutils-0.169-orig/src/stack.c	2017-02-24 11:55:28.000000000 +0100
++++ elfutils-0.169/src/stack.c	2017-07-28 15:50:06.743196696 +0200
+@@ -631,6 +631,8 @@
+   /* Set locale.  */
+   (void) setlocale (LC_ALL, "");
+ 
++  debuginfo_path = getenv("NIX_DEBUG_INFO_DIRS");
++
+   const struct argp_option options[] =
+     {
+       { NULL, 0, NULL, 0, N_("Input selection options:"), 0 },
diff --git a/pkgs/development/tools/misc/elfutils/default.nix b/pkgs/development/tools/misc/elfutils/default.nix
index 6e80f0907bc6..591e263205c8 100644
--- a/pkgs/development/tools/misc/elfutils/default.nix
+++ b/pkgs/development/tools/misc/elfutils/default.nix
@@ -1,15 +1,17 @@
-{ lib, stdenv, fetchurl, m4, zlib, bzip2, bison, flex, gettext, xz }:
+{ lib, stdenv, fetchurl, m4, zlib, bzip2, bison, flex, gettext, xz, setupDebugInfoDirs }:
 
 # TODO: Look at the hardcoded paths to kernel, modules etc.
 stdenv.mkDerivation rec {
   name = "elfutils-${version}";
-  version = "0.168";
+  version = "0.169";
 
   src = fetchurl {
     url = "https://sourceware.org/elfutils/ftp/${version}/${name}.tar.bz2";
-    sha256 = "0xn2fbgda1i703csfs35frvm7l068ybmay4ssrykqdx17f4hg3dq";
+    sha256 = "1hiv1yqig3292dwqhrwsxwk3qjalxp5fpl8yphwbfwh8ng3zl4ll";
   };
 
+  patches = ./debug-info-from-env.patch;
+
   hardeningDisable = [ "format" ];
 
   # We need bzip2 in NativeInputs because otherwise we can't unpack the src,
@@ -17,6 +19,8 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ m4 bison flex gettext bzip2 ];
   buildInputs = [ zlib bzip2 xz ];
 
+  propagatedNativeBuildInputs = [ setupDebugInfoDirs ];
+
   configureFlags =
     [ "--program-prefix=eu-" # prevent collisions with binutils
       "--enable-deterministic-archives"
diff --git a/pkgs/development/tools/misc/gdb/debug-info-from-env.patch b/pkgs/development/tools/misc/gdb/debug-info-from-env.patch
new file mode 100644
index 000000000000..ad6dca6749e4
--- /dev/null
+++ b/pkgs/development/tools/misc/gdb/debug-info-from-env.patch
@@ -0,0 +1,81 @@
+Look up .build-id files relative to the directories in the
+colon-separated environment variable NIX_DEBUG_INFO_DIRS, in addition
+to the existing debug-file-directory setting.
+
+diff -ru --exclude '*gcore' --exclude '*pdtrace' gdb-8.0-orig/gdb/build-id.c gdb-8.0/gdb/build-id.c
+--- gdb-8.0-orig/gdb/build-id.c	2017-06-04 17:51:26.000000000 +0200
++++ gdb-8.0/gdb/build-id.c	2017-07-28 13:18:10.797375927 +0200
+@@ -67,8 +67,8 @@
+ 
+ /* See build-id.h.  */
+ 
+-gdb_bfd_ref_ptr
+-build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id)
++static gdb_bfd_ref_ptr
++build_id_to_debug_bfd_in (const char *directories, size_t build_id_len, const bfd_byte *build_id)
+ {
+   char *link, *debugdir;
+   VEC (char_ptr) *debugdir_vec;
+@@ -78,7 +78,7 @@
+   int alloc_len;
+ 
+   /* DEBUG_FILE_DIRECTORY/.build-id/ab/cdef */
+-  alloc_len = (strlen (debug_file_directory)
++  alloc_len = (strlen (directories)
+ 	       + (sizeof "/.build-id/" - 1) + 1
+ 	       + 2 * build_id_len + (sizeof ".debug" - 1) + 1);
+   link = (char *) alloca (alloc_len);
+@@ -86,7 +86,7 @@
+   /* Keep backward compatibility so that DEBUG_FILE_DIRECTORY being "" will
+      cause "/.build-id/..." lookups.  */
+ 
+-  debugdir_vec = dirnames_to_char_ptr_vec (debug_file_directory);
++  debugdir_vec = dirnames_to_char_ptr_vec (directories);
+   back_to = make_cleanup_free_char_ptr_vec (debugdir_vec);
+ 
+   for (ix = 0; VEC_iterate (char_ptr, debugdir_vec, ix, debugdir); ++ix)
+@@ -137,6 +137,30 @@
+   return abfd;
+ }
+ 
++gdb_bfd_ref_ptr
++build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id)
++{
++  gdb_bfd_ref_ptr abfd = build_id_to_debug_bfd_in(debug_file_directory, build_id_len, build_id);
++
++  if (abfd != NULL)
++    return abfd;
++
++  static int init = 0;
++  static char *env_var;
++  if (!init)
++    {
++      env_var = getenv("NIX_DEBUG_INFO_DIRS");
++      init = 1;
++    }
++
++  if (env_var)
++    {
++      abfd = build_id_to_debug_bfd_in(env_var, build_id_len, build_id);
++    }
++
++  return abfd;
++}
++
+ /* See build-id.h.  */
+ 
+ char *
+diff -ru --exclude '*gcore' --exclude '*pdtrace' gdb-8.0-orig/gdb/symfile.c gdb-8.0/gdb/symfile.c
+--- gdb-8.0-orig/gdb/symfile.c	2017-06-04 17:51:27.000000000 +0200
++++ gdb-8.0/gdb/symfile.c	2017-07-28 12:54:05.401586174 +0200
+@@ -1415,8 +1415,8 @@
+ 			   struct cmd_list_element *c, const char *value)
+ {
+   fprintf_filtered (file,
+-		    _("The directory where separate debug "
+-		      "symbols are searched for is \"%s\".\n"),
++		    _("The directories where separate debug "
++		      "symbols are searched for are \"%s\".\n"),
+ 		    value);
+ }
+ 
diff --git a/pkgs/development/tools/misc/gdb/default.nix b/pkgs/development/tools/misc/gdb/default.nix
index 78dd4a1e3f55..410fd36ef252 100644
--- a/pkgs/development/tools/misc/gdb/default.nix
+++ b/pkgs/development/tools/misc/gdb/default.nix
@@ -11,6 +11,8 @@
 
 # Additional dependencies for GNU/Hurd.
 , mig ? null, hurd ? null
+
+, setupDebugInfoDirs
 }:
 
 let
@@ -32,7 +34,9 @@ stdenv.mkDerivation rec {
     sha256 = "1vplyf8v70yn0rdqjx6awl9nmfbwaj5ynwwjxwa71rhp97z4z8pn";
   };
 
-  nativeBuildInputs = [ pkgconfig texinfo perl ]
+  patches = [ ./debug-info-from-env.patch ];
+
+  nativeBuildInputs = [ pkgconfig texinfo perl setupDebugInfoDirs ]
     # TODO(@Ericson2314) not sure if should be host or target
     ++ stdenv.lib.optional targetPlatform.isHurd mig;
 
@@ -41,6 +45,8 @@ stdenv.mkDerivation rec {
     ++ stdenv.lib.optional targetPlatform.isHurd hurd
     ++ stdenv.lib.optional doCheck dejagnu;
 
+  propagatedNativeBuildInputs = [ setupDebugInfoDirs ];
+
   enableParallelBuilding = true;
 
   # darwin build fails with format hardening since v7.12
@@ -60,6 +66,13 @@ stdenv.mkDerivation rec {
     ++ stdenv.lib.optional (!pythonSupport) "--without-python"
     ++ stdenv.lib.optional multitarget "--enable-targets=all";
 
+  preConfigure =
+    # Not sure why this is causing problems, now that the stdenv
+    # exports CPP=cpp the build fails with strange errors on darwin.
+    stdenv.lib.optionalString stdenv.cc.isClang ''
+      unset CPP
+    '';
+
   postInstall =
     '' # Remove Info files already provided by Binutils and other packages.
        rm -v $out/share/info/bfd.info
diff --git a/pkgs/development/tools/misc/gede/default.nix b/pkgs/development/tools/misc/gede/default.nix
index 24f099a15337..9e2f35875583 100644
--- a/pkgs/development/tools/misc/gede/default.nix
+++ b/pkgs/development/tools/misc/gede/default.nix
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     description = "Graphical frontend (GUI) to GDB";
-    homepage = "http://gede.acidron.com";
+    homepage = http://gede.acidron.com;
     license = licenses.bsd2;
     platforms = platforms.unix;
     maintainers = with maintainers; [ juliendehos ];
diff --git a/pkgs/development/tools/misc/gnum4/default.nix b/pkgs/development/tools/misc/gnum4/default.nix
index fbbd6cc4d6f8..33ea78907468 100644
--- a/pkgs/development/tools/misc/gnum4/default.nix
+++ b/pkgs/development/tools/misc/gnum4/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ stdenv, hostPlatform, fetchurl }:
 
 stdenv.mkDerivation rec {
   name = "gnum4-1.4.18";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
   configureFlags = "--with-syscmd-shell=${stdenv.shell}";
 
   # Upstream is aware of it; it may be in the next release.
-  patches = [ ./s_isdir.patch ];
+  patches = [ ./s_isdir.patch ] ++ stdenv.lib.optional hostPlatform.isDarwin stdenv.secure-format-patch;
 
   # FIXME needs gcc 4.9 in bootstrap tools
   hardeningDisable = [ "stackprotector" ];
diff --git a/pkgs/development/tools/misc/hydra/default.nix b/pkgs/development/tools/misc/hydra/default.nix
index fe1bb771fcad..128ce6008fa8 100644
--- a/pkgs/development/tools/misc/hydra/default.nix
+++ b/pkgs/development/tools/misc/hydra/default.nix
@@ -62,15 +62,15 @@ let
   };
 in releaseTools.nixBuild rec {
   name = "hydra-${version}";
-  version = "2017-06-22";
+  version = "2017-07-27";
 
   inherit stdenv;
 
   src = fetchFromGitHub {
     owner = "NixOS";
     repo = "hydra";
-    rev = "803833aba77e1082c14857aa26933fc7fe5ae190";
-    sha256 = "1cnxpsan8l6fnbr73n0qxxq1szlda1n3qfkk9k9ic8ijk7md4pvs";
+    rev = "3fc320db320c9aa5180c54e77513f1bcb7407079";
+    sha256 = "0kml2rvy5pz8pzl23vfib5vrwxccff9j1jmyq926qv7f5kbzy61b";
   };
 
   buildInputs =
diff --git a/pkgs/development/tools/misc/intltool/default.nix b/pkgs/development/tools/misc/intltool/default.nix
index 3c5dacb6f65e..537541e37bb7 100644
--- a/pkgs/development/tools/misc/intltool/default.nix
+++ b/pkgs/development/tools/misc/intltool/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
   patches = [(fetchpatch {
     name = "perl-5.22.patch";
     url = "https://anonscm.debian.org/viewvc/pkg-gnome/desktop/unstable/intltool"
-      + "/debian/patches/perl5.22-regex-fixes.patch?revision=47258&view=co";
+      + "/debian/patches/perl5.22-regex-fixes?revision=47258&view=co&pathrev=47258";
     sha256 = "17clqczb9fky7hp8czxa0fy82b5478irvz4f3fnans3sqxl95hx3";
   })];
 
diff --git a/pkgs/development/tools/misc/lit/default.nix b/pkgs/development/tools/misc/lit/default.nix
index adc5ba967583..af792c0c6b96 100644
--- a/pkgs/development/tools/misc/lit/default.nix
+++ b/pkgs/development/tools/misc/lit/default.nix
@@ -15,7 +15,7 @@ python2.pkgs.buildPythonApplication rec {
 
   meta = {
     description = "Portable tool for executing LLVM and Clang style test suites";
-    homepage = "http://llvm.org/docs/CommandGuide/lit.html";
+    homepage = http://llvm.org/docs/CommandGuide/lit.html;
     license = lib.licenses.ncsa;
     maintainers = with lib.maintainers; [ dtzWill ];
   };
diff --git a/pkgs/development/tools/misc/ninka/default.nix b/pkgs/development/tools/misc/ninka/default.nix
index 08631fd0352b..9cd1a56e68fe 100644
--- a/pkgs/development/tools/misc/ninka/default.nix
+++ b/pkgs/development/tools/misc/ninka/default.nix
@@ -28,7 +28,7 @@ buildPerlPackage rec {
 
   meta = with stdenv.lib; {
     description = "A sentence based license detector";
-    homepage = "http://ninka.turingmachine.org/";
+    homepage = http://ninka.turingmachine.org/;
     license = licenses.gpl2;
     maintainers = [ maintainers.vrthra ];
     platforms = platforms.all;
diff --git a/pkgs/development/tools/misc/rolespec/default.nix b/pkgs/development/tools/misc/rolespec/default.nix
index 6eb13bb242da..1e85e87c5378 100644
--- a/pkgs/development/tools/misc/rolespec/default.nix
+++ b/pkgs/development/tools/misc/rolespec/default.nix
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
   dontStrip = true;
 
   meta = with stdenv.lib; {
-    homepage = "https://github.com/nickjj/rolespec";
+    homepage = https://github.com/nickjj/rolespec;
     description = "A test library for testing Ansible roles";
     longDescription = ''
       A shell based test library for Ansible that works both locally and over
diff --git a/pkgs/development/tools/misc/srecord/default.nix b/pkgs/development/tools/misc/srecord/default.nix
index 9d0e2d7430e8..94a452ce0836 100644
--- a/pkgs/development/tools/misc/srecord/default.nix
+++ b/pkgs/development/tools/misc/srecord/default.nix
@@ -18,6 +18,6 @@ stdenv.mkDerivation rec {
     homepage = http://srecord.sourceforge.net/;
     license = licenses.gpl3Plus;
     maintainers = [ maintainers.bjornfor ];
-    platforms = platforms.linux;
+    platforms = stdenv.lib.platforms.unix;
   };
 }
diff --git a/pkgs/development/tools/misc/swig/3.x.nix b/pkgs/development/tools/misc/swig/3.x.nix
index 2a6b6880183a..9b4fd05dc0a0 100644
--- a/pkgs/development/tools/misc/swig/3.x.nix
+++ b/pkgs/development/tools/misc/swig/3.x.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   name = "swig-${version}";
-  version = "3.0.10";
+  version = "3.0.12";
 
   src = fetchFromGitHub {
     owner = "swig";
     repo = "swig";
     rev = "rel-${version}";
-    sha256 = "049rj883r9mf2bgabj3b03p7cnmqgl5939lmh8v5nnia24zb51jg";
+    sha256 = "1wyffskbkzj5zyhjnnpip80xzsjcr3p0q5486z3wdwabnysnhn8n";
   };
 
   nativeBuildInputs = [ autoconf automake libtool bison ];
diff --git a/pkgs/development/tools/misc/texinfo/5.2.nix b/pkgs/development/tools/misc/texinfo/5.2.nix
index d01a2f9cdd06..571af764fcf7 100644
--- a/pkgs/development/tools/misc/texinfo/5.2.nix
+++ b/pkgs/development/tools/misc/texinfo/5.2.nix
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
   doCheck = !stdenv.isDarwin;
 
   meta = {
-    homepage = "http://www.gnu.org/software/texinfo/";
+    homepage = http://www.gnu.org/software/texinfo/;
     description = "The GNU documentation system";
     license = licenses.gpl3Plus;
     platforms = platforms.all;
diff --git a/pkgs/development/tools/misc/texinfo/6.3.nix b/pkgs/development/tools/misc/texinfo/6.3.nix
index b75878b8d332..704611e315a3 100644
--- a/pkgs/development/tools/misc/texinfo/6.3.nix
+++ b/pkgs/development/tools/misc/texinfo/6.3.nix
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
     && !stdenv.isDarwin && !stdenv.isSunOS/*flaky*/;
 
   meta = with stdenv.lib; {
-    homepage = "http://www.gnu.org/software/texinfo/";
+    homepage = http://www.gnu.org/software/texinfo/;
     description = "The GNU documentation system";
     license = licenses.gpl3Plus;
     platforms = platforms.all;
diff --git a/pkgs/development/tools/misc/unifdef/default.nix b/pkgs/development/tools/misc/unifdef/default.nix
index 19dd907b73b9..8fc268423505 100644
--- a/pkgs/development/tools/misc/unifdef/default.nix
+++ b/pkgs/development/tools/misc/unifdef/default.nix
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
   '';
 
   meta = with stdenv.lib; {
-    homepage = "http://dotat.at/prog/unifdef/";
+    homepage = http://dotat.at/prog/unifdef/;
     description = "Selectively remove C preprocessor conditionals";
     license = licenses.bsd2;
     platforms = platforms.unix;
diff --git a/pkgs/development/tools/misc/universal-ctags/default.nix b/pkgs/development/tools/misc/universal-ctags/default.nix
index 903359f5c762..b0d5bcd28f79 100644
--- a/pkgs/development/tools/misc/universal-ctags/default.nix
+++ b/pkgs/development/tools/misc/universal-ctags/default.nix
@@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     description = "A maintained ctags implementation";
-    homepage = "https://ctags.io/";
+    homepage = https://ctags.io/;
     license = licenses.gpl2Plus;
     platforms = platforms.unix;
     # universal-ctags is preferred over emacs's ctags