patches/binutils/2.17.50.0.8/300-012_check_ldrunpath_length.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue May 08 17:48:32 2007 +0000 (2007-05-08)
changeset 78 c3868084d81a
permissions -rw-r--r--
Huge fixes to glibc build, so that we can build at least (and at last):
- use ports addon even when installing headers,
- use optimisation (-O) when installing headers, to avoid unnecessary warnings (thanks Robert P. J. DAY for pointing this out!),
- lowest kernel version to use is only X.Y.Z, not X.Y.Z.T,
- a bit of preparations for NPTL (RSN I hope),
- fix fixing the linker scripts (changing the backup file is kind of useless and stupid);

Shut uClibc finish step: there really is nothing to do;

Add a patch for glibc-2.3.6 weak aliases handling on some archs (ARM and ALPHA at least);

Did not catch the make errors: fixed the pattern matching in scripts/functions;

Introduce a new log level, ALL:
- send components' build messages there,
- DEBUG log level is destined only for crosstool-NG debug messages,
- migrate sub-actions to use appropriate log levels;

Update the armeb-unknown-linux-gnu sample:
- it builds!
- uses gcc-4.0.4 and glibc-2.3.6,
- updated to latest config options set.
yann@1
     1
#!/bin/sh -e
yann@1
     2
## 012_check_ldrunpath_length.dpatch by Chris Chimelis <chris@debian.org>
yann@1
     3
##
yann@1
     4
## All lines beginning with `## DP:' are a description of the patch.
yann@1
     5
## DP: Only generate an RPATH entry if LD_RUN_PATH is not empty, for
yann@1
     6
## DP: cases where -rpath isn't specified. (#151024)
yann@1
     7
yann@1
     8
if [ $# -ne 1 ]; then
yann@1
     9
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
yann@1
    10
    exit 1
yann@1
    11
fi
yann@1
    12
yann@1
    13
[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
yann@1
    14
patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
yann@1
    15
yann@1
    16
case "$1" in
yann@1
    17
       -patch) patch $patch_opts -p1 < $0;;
yann@1
    18
       -unpatch) patch $patch_opts -p1 -R < $0;;
yann@1
    19
        *)
yann@1
    20
                echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
yann@1
    21
                exit 1;;
yann@1
    22
esac
yann@1
    23
yann@1
    24
exit 0
yann@1
    25
yann@1
    26
@DPATCH@
yann@1
    27
diff -urNad /home/james/debian/packages/binutils/new/binutils-2.15/ld/emultempl/elf32.em binutils-2.15/ld/emultempl/elf32.em
yann@1
    28
--- /home/james/debian/packages/binutils/new/binutils-2.15/ld/emultempl/elf32.em	2004-05-21 23:12:58.000000000 +0100
yann@1
    29
+++ binutils-2.15/ld/emultempl/elf32.em	2004-05-21 23:12:59.000000000 +0100
yann@1
    30
@@ -692,6 +692,8 @@
yann@1
    31
 	      && command_line.rpath == NULL)
yann@1
    32
 	    {
yann@1
    33
 	      lib_path = (const char *) getenv ("LD_RUN_PATH");
yann@1
    34
+	      if ((lib_path) && (strlen (lib_path) == 0))
yann@1
    35
+		  lib_path = NULL;
yann@1
    36
 	      if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
yann@1
    37
 						      force))
yann@1
    38
 		break;
yann@1
    39
@@ -871,6 +873,8 @@
yann@1
    40
   rpath = command_line.rpath;
yann@1
    41
   if (rpath == NULL)
yann@1
    42
     rpath = (const char *) getenv ("LD_RUN_PATH");
yann@1
    43
+  if ((rpath) && (strlen (rpath) == 0))
yann@1
    44
+      rpath = NULL;
yann@1
    45
   if (! (bfd_elf_size_dynamic_sections
yann@1
    46
 	 (output_bfd, command_line.soname, rpath,
yann@1
    47
 	  command_line.filter_shlib,