From patchwork Mon May 14 11:22:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Zacarias X-Patchwork-Id: 158967 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id 79B58B703B for ; Mon, 14 May 2012 21:23:03 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 7BAF520661; Mon, 14 May 2012 11:23:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xm6s7+V-w6KF; Mon, 14 May 2012 11:22:59 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id A10E12EDF8; Mon, 14 May 2012 11:22:59 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 40F678F753 for ; Mon, 14 May 2012 11:22:58 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 362B18C13D for ; Mon, 14 May 2012 11:22:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XLIkWStn+WIz for ; Mon, 14 May 2012 11:22:56 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from loknar.toptech.com.ar (loknar.toptech.com.ar [74.118.36.95]) by whitealder.osuosl.org (Postfix) with ESMTPS id 3D4C08C134 for ; Mon, 14 May 2012 11:22:55 +0000 (UTC) Received: from asgard (host101.190-231-11.telecom.net.ar [190.231.11.101]) (authenticated bits=0) by loknar.toptech.com.ar (8.14.4/8.14.4) with ESMTP id q4EBMoEA029651 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 14 May 2012 08:22:52 -0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=zacarias.com.ar; s=dkey; t=1336994574; bh=3y5C2Fv52MLGS0gSRhuFel0K9qZlIcgyQ2XE51dmGmY=; h=From:To:Cc:Subject:Date:Message-Id; b=dSDePfeBU85QP9CZ3nbe5/1B7j7qoXUr7/MN9itnPwR3fiYZslZ1kxe7bKwAXjFa0 5Me6ZINvhEV/m1h8UmzwcpNUYGnlw4w7QJH+1uMyKD7rr6Xlx25IGhuh8wSNhRvAIt Hho9j2bGdnOuPoaByy9NUvV0LF1aWbygzTv7+7/8= Received: by asgard (sSMTP sendmail emulation); Mon, 14 May 2012 08:22:49 -0300 From: Gustavo Zacarias To: buildroot@busybox.net Date: Mon, 14 May 2012 08:22:48 -0300 Message-Id: <1336994568-29695-1-git-send-email-gustavo@zacarias.com.ar> X-Mailer: git-send-email 1.7.3.4 X-Virus-Scanned: clamav-milter 0.97.3 at loknar X-Virus-Status: Clean Subject: [Buildroot] [PATCH] binutils: add sysroot fix from bug #3049 X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net Add binutils ld sysroot bug fix. See http://sourceware.org/bugzilla/show_bug.cgi?id=10340 Signed-off-by: Gustavo Zacarias --- package/binutils/binutils-2.20.1/500-sysroot.patch | 36 ++++++++++++++++++++ package/binutils/binutils-2.20/500-sysroot.patch | 36 ++++++++++++++++++++ package/binutils/binutils-2.21.1/500-sysroot.patch | 36 ++++++++++++++++++++ package/binutils/binutils-2.21/500-sysroot.patch | 36 ++++++++++++++++++++ package/binutils/binutils-2.22/500-sysroot.patch | 36 ++++++++++++++++++++ 5 files changed, 180 insertions(+), 0 deletions(-) create mode 100644 package/binutils/binutils-2.20.1/500-sysroot.patch create mode 100644 package/binutils/binutils-2.20/500-sysroot.patch create mode 100644 package/binutils/binutils-2.21.1/500-sysroot.patch create mode 100644 package/binutils/binutils-2.21/500-sysroot.patch create mode 100644 package/binutils/binutils-2.22/500-sysroot.patch diff --git a/package/binutils/binutils-2.20.1/500-sysroot.patch b/package/binutils/binutils-2.20.1/500-sysroot.patch new file mode 100644 index 0000000..d21e4cb --- /dev/null +++ b/package/binutils/binutils-2.20.1/500-sysroot.patch @@ -0,0 +1,36 @@ +Signed-off-by: Sven Rebhan + +Always try to prepend the sysroot prefix to absolute filenames first. + +http://bugs.gentoo.org/275666 +http://sourceware.org/bugzilla/show_bug.cgi?id=10340 + +--- a/ld/ldfile.c ++++ b/ld/ldfile.c +@@ -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/package/binutils/binutils-2.20/500-sysroot.patch b/package/binutils/binutils-2.20/500-sysroot.patch new file mode 100644 index 0000000..d21e4cb --- /dev/null +++ b/package/binutils/binutils-2.20/500-sysroot.patch @@ -0,0 +1,36 @@ +Signed-off-by: Sven Rebhan + +Always try to prepend the sysroot prefix to absolute filenames first. + +http://bugs.gentoo.org/275666 +http://sourceware.org/bugzilla/show_bug.cgi?id=10340 + +--- a/ld/ldfile.c ++++ b/ld/ldfile.c +@@ -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/package/binutils/binutils-2.21.1/500-sysroot.patch b/package/binutils/binutils-2.21.1/500-sysroot.patch new file mode 100644 index 0000000..d21e4cb --- /dev/null +++ b/package/binutils/binutils-2.21.1/500-sysroot.patch @@ -0,0 +1,36 @@ +Signed-off-by: Sven Rebhan + +Always try to prepend the sysroot prefix to absolute filenames first. + +http://bugs.gentoo.org/275666 +http://sourceware.org/bugzilla/show_bug.cgi?id=10340 + +--- a/ld/ldfile.c ++++ b/ld/ldfile.c +@@ -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/package/binutils/binutils-2.21/500-sysroot.patch b/package/binutils/binutils-2.21/500-sysroot.patch new file mode 100644 index 0000000..d21e4cb --- /dev/null +++ b/package/binutils/binutils-2.21/500-sysroot.patch @@ -0,0 +1,36 @@ +Signed-off-by: Sven Rebhan + +Always try to prepend the sysroot prefix to absolute filenames first. + +http://bugs.gentoo.org/275666 +http://sourceware.org/bugzilla/show_bug.cgi?id=10340 + +--- a/ld/ldfile.c ++++ b/ld/ldfile.c +@@ -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/package/binutils/binutils-2.22/500-sysroot.patch b/package/binutils/binutils-2.22/500-sysroot.patch new file mode 100644 index 0000000..d21e4cb --- /dev/null +++ b/package/binutils/binutils-2.22/500-sysroot.patch @@ -0,0 +1,36 @@ +Signed-off-by: Sven Rebhan + +Always try to prepend the sysroot prefix to absolute filenames first. + +http://bugs.gentoo.org/275666 +http://sourceware.org/bugzilla/show_bug.cgi?id=10340 + +--- a/ld/ldfile.c ++++ b/ld/ldfile.c +@@ -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);