patches/binutils/2.19/130-check_ldrunpath_length.patch
author Remy Bohmer <linux@bohmer.net>
Sun Jul 11 22:23:34 2010 +0200 (2010-07-11)
changeset 2021 3e52a1510f87
permissions -rw-r--r--
debug/gdb: Fix compilation for Mingw hosts

GDB requires PDcurses instead of ncurses while running on Windows.
So, do not always compile ncurses in case GDB needs to build.

PDcurses is provided by an earlier build step and is not described in
this file.

Signed-off-by: Remy Bohmer <linux@bohmer.net>
[yann.morin.1998@anciense.nib.fr: we already have a way to detect ncurses usage]
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,