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