[oe] [PATCH] binutils_2.20.1.bb: Add patch to fix ld sysroot

Khem Raj raj.khem at gmail.com
Wed Sep 22 06:13:29 UTC 2010


Fixes the issue seen on builds where libc.so is not being found

Signed-off-by: Khem Raj <raj.khem at gmail.com>
---
 .../binutils-2.19.1-ld-sysroot.patch               |   36 ++++++++++++++++++++
 recipes/binutils/binutils_2.20.1.bb                |    3 +-
 2 files changed, 38 insertions(+), 1 deletions(-)
 create mode 100644 recipes/binutils/binutils-2.20.1/binutils-2.19.1-ld-sysroot.patch

diff --git a/recipes/binutils/binutils-2.20.1/binutils-2.19.1-ld-sysroot.patch b/recipes/binutils/binutils-2.20.1/binutils-2.19.1-ld-sysroot.patch
new file mode 100644
index 0000000..b252196
--- /dev/null
+++ b/recipes/binutils/binutils-2.20.1/binutils-2.19.1-ld-sysroot.patch
@@ -0,0 +1,36 @@
+http://sourceware.org/bugzilla/show_bug.cgi?id=10340
+
+Signed-off-by: Sven Rebhan <odinshorse at googlemail.com>
+
+Always try to prepend the sysroot prefix to absolute filenames first.
+
+--- a/ld/ldfile.c	2009-06-14 12:46:19.000000000 +0200
++++ b/ld/ldfile.c.new	2009-06-14 12:46:04.000000000 +0200
+@@ -308,18 +308,24 @@
+      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);
+
diff --git a/recipes/binutils/binutils_2.20.1.bb b/recipes/binutils/binutils_2.20.1.bb
index d75dbb2..c2a5dab 100644
--- a/recipes/binutils/binutils_2.20.1.bb
+++ b/recipes/binutils/binutils_2.20.1.bb
@@ -1,7 +1,7 @@
 require binutils.inc
 LICENSE = "GPLv3"
 
-PR = "${INC_PR}.1"
+PR = "${INC_PR}.2"
 
 #COMPATIBLE_TARGET_SYS = "."
 
@@ -15,6 +15,7 @@ SRC_URI = "\
      file://binutils-uclibc-gas-needs-libm.patch \
      file://binutils-x86_64_i386_biarch.patch \
      file://libtool-update.patch \
+     file://binutils-2.19.1-ld-sysroot.patch \
      "
 
 SRC_URI_append_nios2 =" \
-- 
1.7.1





More information about the Openembedded-devel mailing list