patches/binutils/2.18.50.0.4/120-check-ldrunpath-length.patch
author Zoltan Devai <zdevai@gmail.com>
Wed Oct 28 12:03:38 2009 +0100 (2009-10-28)
changeset 1602 1ba79f2126df
parent 747 d3e603e7c17c
permissions -rw-r--r--
libc/uClibc: fix building on system with recent glibc

While trying to build a toolchain with ct-ng 1.5.0,
arm-unknown-linux-uclibcgnueabi target,
I get the following error:

[INFO ] Installing C library headers
[EXTRA] Copying sources to build dir
[EXTRA] Applying configuration
[EXTRA] Building headers
[EXTRA] Installing headers
[ERROR] extra/scripts/unifdef.c:209: error: conflicting types for 'getline'
[ERROR] make[2]: *** [extra/scripts/unifdef] Error 1
[ERROR] Build failed in step 'Installing C library headers'

The following patch solves the problem.
(It's a backport of this uClibc commit:
http://git.uclibc.org/uClibc/commit/?id=49e81cada73616864b9b31df0aeb6961c30f5a6e
)

[--SNIP from another mail--]
AFAIK this is a problem since glibc 2.10.
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,