patches/binutils/2.18.50.0.4/120-check-ldrunpath-length.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Thu Jun 11 21:47:19 2009 +0000 (2009-06-11)
branch1.4
changeset 1451 25d050084e98
parent 747 d3e603e7c17c
permissions -rw-r--r--
populate: fix installing dynamic linker 'ld.so'

The dynamic linker, ld.so, needs the execute bit to be set.
Detect tht the library being installed is in fact ld.so and
install it with 0755 instead of 0644.

Fix detecting src == dst.

Use a simpler command to copy src -> dst.

Also change echo to printf, get rid of 'echo -n', which is
highly non-portable.


-------- diffstat follows --------
/trunk/scripts/populate.in | 76 43 33 0 +++++++++++++++++++++++++++++-----------------------
1 file changed, 43 insertions(+), 33 deletions(-)
(transplanted from d7ddcb75e0f703e2ba6d17169167356389224870)
yann@1241
     1
Original patch from: ../crosstool-NG/ct-ng.trunk/patches/binutils/2.18.50.0.4/120-check-ldrunpath-length.patch
yann@1241
     2
yann@1241
     3
-= BEGIN original header =-
yann@475
     4
Check LD_RUN_PATH length, copied from buildroot.
yann@475
     5
yann@475
     6
 binutils-2.18.50.0.6/ld/emultempl/elf32.em |    4     4     0     0 ++++
yann@475
     7
 1 file changed, 4 insertions(+)
yann@475
     8
yann@1241
     9
-= END original header =-
yann@1241
    10
yann@1241
    11
diff -durN binutils-2.18.50.0.4.orig/ld/emultempl/elf32.em binutils-2.18.50.0.4/ld/emultempl/elf32.em
yann@1241
    12
--- binutils-2.18.50.0.4.orig/ld/emultempl/elf32.em	2008-02-08 17:44:55.000000000 +0100
yann@1241
    13
+++ binutils-2.18.50.0.4/ld/emultempl/elf32.em	2009-03-07 12:17:31.000000000 +0100
yann@475
    14
@@ -1220,6 +1220,8 @@
yann@475
    15
 	      && command_line.rpath == NULL)
yann@475
    16
 	    {
yann@475
    17
 	      lib_path = (const char *) getenv ("LD_RUN_PATH");
yann@475
    18
+	      if ((lib_path) && (strlen (lib_path) == 0))
yann@475
    19
+		  lib_path = NULL;
yann@475
    20
 	      if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
yann@475
    21
 						      force))
yann@475
    22
 		break;
yann@1241
    23
@@ -1404,6 +1406,8 @@
yann@475
    24
   rpath = command_line.rpath;
yann@475
    25
   if (rpath == NULL)
yann@475
    26
     rpath = (const char *) getenv ("LD_RUN_PATH");
yann@475
    27
+  if ((rpath) && (strlen (rpath) == 0))
yann@475
    28
+      rpath = NULL;
yann@475
    29
   if (! (bfd_elf_size_dynamic_sections
yann@1241
    30
 	 (output_bfd, command_line.soname, rpath,
yann@475
    31
 	  command_line.filter_shlib,