#!/bin/sh -e # --- SDE-COPYRIGHT-NOTE-BEGIN --- # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # # Filename: package/.../uclibc/pkg_patch/binutils/300-012_check_ldrunpath_length.patch # Copyright (C) 2006 - 2009 The OpenSDE Project # Copyright (C) 2004 - 2006 The T2 SDE Project # # More information can be found in the files COPYING and README. # # This patch file is dual-licensed. It is available under the license the # patched project is licensed under, as long as it is an OpenSource license # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms # of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or (at your option) any later # version. # --- SDE-COPYRIGHT-NOTE-END --- Description: Only generate an RPATH entry if LD_RUN_PATH is not empty, for cases where -rpath isn't specified. (see Debian Bug #151024) Original Author: Chris Chimelis diff -ruN binutils-2.20.51.0.3-orig/ld/emultempl/elf32.em binutils-2.20.51.0.3/ld/emultempl/elf32.em --- binutils-2.20.51.0.3-orig/ld/emultempl/elf32.em 2009-11-11 17:53:30.000000000 +0100 +++ binutils-2.20.51.0.3/ld/emultempl/elf32.em 2009-12-09 11:38:11.000000000 +0100 @@ -1250,6 +1250,8 @@ && command_line.rpath == NULL) { lib_path = (const char *) getenv ("LD_RUN_PATH"); + if ((lib_path) && (strlen (lib_path) == 0)) + lib_path = NULL; if (gld${EMULATION_NAME}_search_needed (lib_path, &n, force)) break; @@ -1476,6 +1478,8 @@ rpath = command_line.rpath; if (rpath == NULL) rpath = (const char *) getenv ("LD_RUN_PATH"); + if ((rpath) && (strlen (rpath) == 0)) + rpath = NULL; for (abfd = link_info.input_bfds; abfd; abfd = abfd->link_next) {