patches/binutils/2.19/130-check_ldrunpath_length.patch
author Darcy Watkins <dwatkins@tranzeo.com>
Thu Aug 05 18:19:07 2010 +0200 (2010-08-05)
branch1.8
changeset 2073 a3b7a63dce01
permissions -rw-r--r--
cc/gcc: with static ppl, correctly link with libm

On some Fedora boxen (at least FC13), it is also required
to link with libm when static ppl is used.
(transplanted from bcd33fce4db9c18223b59ecdc96f10bf6dd574de)
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,