patches/binutils/2.17a/150-check_ldrunpath_length.patch
author Anthony Foiani <anthony.foiani@gmail.com>
Thu Apr 26 19:55:59 2012 -0600 (2012-04-26)
changeset 2939 58974be61289
parent 747 d3e603e7c17c
permissions -rw-r--r--
Allow multi-word "install" command.

Autoconf can determine that the correct install command includes flags,
e.g., "/usr/bin/install -c". When using this as a command, we can't
enclose the value in double-quotes, as that makes some shells use the
whole expression as a filename:

# this is the value returned by autoconf and stored in CT_install
$ ins="/usr/bin/install -c"

# if we call it with quotes, the command is not found
$ "${ins}"
bash: /usr/bin/install -c: No such file or directory

# removing the quotes lets it work as expected
$ ${ins}
/usr/bin/install: missing file operand
Try `/usr/bin/install --help' for more information.

Signed-Off-By: Anthony Foiani <anthony.foiani@gmail.com>
yann@55
     1
diff -dur binutils-2.17.old/ld/emultempl/elf32.em binutils-2.17/ld/emultempl/elf32.em
yann@55
     2
--- binutils-2.17.old/ld/emultempl/elf32.em	2006-06-12 15:05:04.000000000 +0200
yann@55
     3
+++ binutils-2.17/ld/emultempl/elf32.em	2007-05-01 18:26:13.000000000 +0200
yann@55
     4
@@ -970,6 +970,8 @@
yann@55
     5
 	      && command_line.rpath == NULL)
yann@55
     6
 	    {
yann@55
     7
 	      lib_path = (const char *) getenv ("LD_RUN_PATH");
yann@55
     8
+	      if ((lib_path) && (strlen (lib_path) == 0))
yann@55
     9
+		  lib_path = NULL;
yann@55
    10
 	      if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
yann@55
    11
 						      force))
yann@55
    12
 		break;
yann@55
    13
@@ -1154,6 +1156,8 @@
yann@55
    14
   rpath = command_line.rpath;
yann@55
    15
   if (rpath == NULL)
yann@55
    16
     rpath = (const char *) getenv ("LD_RUN_PATH");
yann@55
    17
+  if ((rpath) && (strlen (rpath) == 0))
yann@55
    18
+      rpath = NULL;
yann@55
    19
   if (! (bfd_elf_size_dynamic_sections
yann@55
    20
 	 (output_bfd, command_line.soname, rpath,
yann@55
    21
 	  command_line.filter_shlib,