patches/binutils/2.19/130-check_ldrunpath_length.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue Aug 02 18:28:10 2011 +0200 (2011-08-02)
changeset 2590 b64cfb67944e
permissions -rw-r--r--
scripts/functions: svn retrieval first tries the mirror for tarballs

The svn download helper looks for the local tarballs dir to see if it
can find a pre-downloaded tarball, and if it does not find it, does
the actual fetch to upstream via svn.

In the process, it does not even try to get a tarball from the local
mirror, which can be useful if the mirror has been pre-populated
manually (or with a previously downloaded tree).

Fake a tarball get with the standard tarball-download helper, but
without specifying any upstream URL, which makes the helper directly
try the LAN mirror.

Of course, if no mirror is specified, no URL wil be available, and
the standard svn retrieval will kick in.

Reported-by: ANDY KENNEDY <ANDY.KENNEDY@adtran.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
yann@1069
     1
Original patch from Gentoo:
yann@1069
     2
gentoo/src/patchsets/binutils/2.19/42_all_012_check_ldrunpath_length.patch
yann@1069
     3
yann@1069
     4
Originaly from Debian:
yann@1069
     5
## 012_check_ldrunpath_length.dpatch by Chris Chimelis <chris@debian.org>
yann@1069
     6
##
yann@1069
     7
## All lines beginning with `## DP:' are a description of the patch.
yann@1069
     8
## DP: Only generate an RPATH entry if LD_RUN_PATH is not empty, for
yann@1069
     9
## DP: cases where -rpath isn't specified. (#151024)
yann@1069
    10
yann@1069
    11
diff -durN binutils-2.19.orig/ld/emultempl/elf32.em binutils-2.19/ld/emultempl/elf32.em
yann@1069
    12
--- binutils-2.19.orig/ld/emultempl/elf32.em	2008-09-07 06:02:31.000000000 +0200
yann@1069
    13
+++ binutils-2.19/ld/emultempl/elf32.em	2008-11-23 16:25:51.000000000 +0100
yann@1069
    14
@@ -1219,6 +1219,8 @@
yann@1069
    15
 	      && command_line.rpath == NULL)
yann@1069
    16
 	    {
yann@1069
    17
 	      lib_path = (const char *) getenv ("LD_RUN_PATH");
yann@1069
    18
+	      if ((lib_path) && (strlen (lib_path) == 0))
yann@1069
    19
+		  lib_path = NULL;
yann@1069
    20
 	      if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
yann@1069
    21
 						      force))
yann@1069
    22
 		break;
yann@1069
    23
@@ -1404,6 +1406,8 @@
yann@1069
    24
   rpath = command_line.rpath;
yann@1069
    25
   if (rpath == NULL)
yann@1069
    26
     rpath = (const char *) getenv ("LD_RUN_PATH");
yann@1069
    27
+  if ((rpath) && (strlen (rpath) == 0))
yann@1069
    28
+      rpath = NULL;
yann@1069
    29
   if (! (bfd_elf_size_dynamic_sections
yann@1069
    30
 	 (link_info.output_bfd, command_line.soname, rpath,
yann@1069
    31
 	  command_line.filter_shlib,