binutils 2.20.1: merge in yocto fixes for 2.21.0

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
This commit is contained in:
Koen Kooi 2011-01-22 17:00:23 +01:00
parent 68bf9ac203
commit e4c4b805c4
5 changed files with 31254 additions and 77 deletions

View File

@ -0,0 +1,37 @@
http://sourceware.org/bugzilla/show_bug.cgi?id=10340
Signed-off-by: Sven Rebhan <odinshorse@googlemail.com>
Always try to prepend the sysroot prefix to absolute filenames first.
Index: binutils-2.21/ld/ldfile.c
===================================================================
--- binutils-2.21.orig/ld/ldfile.c
+++ binutils-2.21/ld/ldfile.c
@@ -372,18 +372,24 @@ ldfile_open_file_search (const char *arc
directory first. */
if (! entry->is_archive)
{
- if (entry->sysrooted && IS_ABSOLUTE_PATH (entry->filename))
+ /* For absolute pathnames, try to always open the file in the
+ sysroot first. If this fails, try to open the file at the
+ given location. */
+ entry->sysrooted = is_sysrooted_pathname(entry->filename, FALSE);
+ if (IS_ABSOLUTE_PATH (entry->filename) && ld_sysroot && ! entry->sysrooted)
{
char *name = concat (ld_sysroot, entry->filename,
(const char *) NULL);
if (ldfile_try_open_bfd (name, entry))
{
entry->filename = name;
+ entry->sysrooted = TRUE;
return TRUE;
}
free (name);
}
- else if (ldfile_try_open_bfd (entry->filename, entry))
+
+ if (ldfile_try_open_bfd (entry->filename, entry))
{
entry->sysrooted = IS_ABSOLUTE_PATH (entry->filename)
&& is_sysrooted_pathname (entry->filename, TRUE);

View File

@ -1,67 +0,0 @@
This is because libdir has a trailing slash which breaks the comparision.
RP 2/1/10
Index: binutils-2.20.1/ltmain.sh
===================================================================
--- binutils-2.20.1.orig/ltmain.sh 2009-09-01 00:59:32.000000000 +0800
+++ binutils-2.20.1/ltmain.sh 2010-07-29 09:41:14.000000000 +0800
@@ -2156,8 +2156,12 @@
dir="$dir$objdir"
if test -n "$relink_command"; then
+ # Strip any trailing slash from the destination.
+ func_stripname '' '/' "$libdir"
+ destlibdir=$func_stripname_result
+
# Determine the prefix the user has applied to our future dir.
- inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"`
+ inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$destlibdir\$%%"`
# Don't allow the user to place us outside of our expected
# location b/c this prevents finding dependent libraries that
@@ -5570,8 +5574,14 @@
absdir="$abs_ladir"
libdir="$abs_ladir"
else
- dir="$libdir"
- absdir="$libdir"
+ # Adding 'libdir' from the .la file to our library search paths
+ # breaks crosscompilation horribly. We cheat here and don't add
+ # it, instead adding the path where we found the .la. -CL
+ dir="$abs_ladir"
+ absdir="$abs_ladir"
+ libdir="$abs_ladir"
+ #dir="$libdir"
+ #absdir="$libdir"
fi
test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
else
@@ -5942,8 +5952,6 @@
add="$libdir/$linklib"
fi
else
- # We cannot seem to hardcode it, guess we'll fake it.
- add_dir="-L$libdir"
# Try looking first in the location we're being installed to.
if test -n "$inst_prefix_dir"; then
case $libdir in
@@ -6089,7 +6097,17 @@
fi
;;
*)
- path="-L$absdir/$objdir"
+ # OE sets installed=no in staging. We need to look in $objdir and $absdir,
+ # preferring $objdir. RP 31/04/2008
+ if test -f "$absdir/$objdir/$depdepl" ; then
+ depdepl="$absdir/$objdir/$depdepl"
+ path="-L$absdir/$objdir"
+ elif test -f "$absdir/$depdepl" ; then
+ depdepl="$absdir/$depdepl"
+ path="-L$absdir"
+ else
+ path="-L$absdir/$objdir"
+ fi
;;
esac
else

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,36 @@
Enabling sysroot support in libtool exposed a bug where the final
library had an RPATH encoded into it which still pointed to the
sysroot. This works around the issue until it gets sorted out
upstream.
Fix suggested by Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Scott Garman <scott.a.garman@intel.com>
diff -urN binutils-2.21.orig//ltmain.sh binutils-2.21/ltmain.sh
--- binutils-2.21.orig//ltmain.sh 2011-01-18 11:50:40.821710085 -0800
+++ binutils-2.21/ltmain.sh 2011-01-18 11:51:38.774952785 -0800
@@ -8035,9 +8035,11 @@
test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
for libdir in $rpath; do
if test -n "$hardcode_libdir_flag_spec"; then
+ func_replace_sysroot "$libdir"
+ libdir=$func_replace_sysroot_result
+ func_stripname '=' '' "$libdir"
+ libdir=$func_stripname_result
if test -n "$hardcode_libdir_separator"; then
- func_replace_sysroot "$libdir"
- libdir=$func_replace_sysroot_result
if test -z "$hardcode_libdirs"; then
hardcode_libdirs="$libdir"
else
@@ -8770,6 +8772,10 @@
hardcode_libdirs=
for libdir in $compile_rpath $finalize_rpath; do
if test -n "$hardcode_libdir_flag_spec"; then
+ func_replace_sysroot "$libdir"
+ libdir=$func_replace_sysroot_result
+ func_stripname '=' '' "$libdir"
+ libdir=$func_stripname_result
if test -n "$hardcode_libdir_separator"; then
if test -z "$hardcode_libdirs"; then
hardcode_libdirs="$libdir"

View File

@ -1,6 +1,6 @@
require binutils.inc
PR = "r4"
PR = "r5"
LIC_FILES_CHKSUM="\
file://src-release;endline=17;md5=4830a9ef968f3b18dd5e9f2c00db2d35\
@ -16,7 +16,7 @@ LIC_FILES_CHKSUM="\
"
SRC_URI = "\
${GNU_MIRROR}/binutils/binutils-${PV}.tar.bz2;name=tarball \
${GNU_MIRROR}/binutils/binutils-${PV}.tar.bz2 \
file://binutils-uclibc-100-uclibc-conf.patch \
file://110-arm-eabi-conf.patch \
file://binutils-uclibc-300-001_ld_makefile_patch.patch \
@ -25,17 +25,14 @@ SRC_URI = "\
file://binutils-uclibc-gas-needs-libm.patch \
file://binutils-x86_64_i386_biarch.patch \
file://binutils-mips-pie.patch \
file://binutils-libtool.patch \
file://libtool-2.4-update.patch \
file://binutils-2.19.1-ld-sysroot.patch \
file://libiberty_path_fix.patch \
file://binutils-poison.patch \
file://libtool-rpath-fix.patch \
"
SRC_URI[tarball.md5sum] = "9cdfb9d6ec0578c166d3beae5e15c4e5"
SRC_URI[tarball.sha256sum] = "228b84722d87e88e7fdd36869e590e649ab523a0800a7d53df906498afe6f6f8"
# powerpc patches
SRC_URI += "\
file://binutils-2.16.1-e300c2c3.patch \
"
SRC_URI[md5sum] = "c84c5acc9d266f1a7044b51c85a823f5"
SRC_URI[sha256sum] = "60abec5bf448eb930a5a15acb8712612377dc8bcfb13dfd5131228f70561d0c7"
BBCLASSEXTEND = "native"