From patchwork Sun Apr 12 13:39:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Naour X-Patchwork-Id: 460494 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id E3028140134 for ; Sun, 12 Apr 2015 23:40:03 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 8EA07A19CB; Sun, 12 Apr 2015 13:40:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Iywf_uW63u-m; Sun, 12 Apr 2015 13:40:01 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id B9143A1943; Sun, 12 Apr 2015 13:40:01 +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 657561C22A7 for ; Sun, 12 Apr 2015 13:40:00 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 5F4018C7F4 for ; Sun, 12 Apr 2015 13:40:00 +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 GM1kUWBTsKAd for ; Sun, 12 Apr 2015 13:39:59 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from smtp1-g21.free.fr (smtp1-g21.free.fr [212.27.42.1]) by whitealder.osuosl.org (Postfix) with ESMTPS id E36BB8C7F0 for ; Sun, 12 Apr 2015 13:39:58 +0000 (UTC) Received: from localhost.localdomain (unknown [81.57.22.125]) by smtp1-g21.free.fr (Postfix) with ESMTP id 138DA940008; Sun, 12 Apr 2015 15:37:57 +0200 (CEST) From: Romain Naour To: buildroot@buildroot.org Date: Sun, 12 Apr 2015 15:39:48 +0200 Message-Id: <1428845988-9846-1-git-send-email-romain.naour@openwide.fr> X-Mailer: git-send-email 1.9.3 Subject: [Buildroot] [PATCH] package/gdb: force libiberty path X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 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" When shared libraries are enabled, gdb will try to link a shared libbfd.so against non-PIC libiberty.a found in $(HOST_DIR). This non-PIC libiberty.a come from the Buildroot's internal toolchain. But gdb build it's own version with PIC enabled which is linked to libbfd.so. Help gdb to find the right libiberty.a by setting the path in LDFLAGS. Fixes: http://autobuild.buildroot.net/results/204/2043888410baaf9d22338b48b4caab4a4363f777/ Signed-off-by: Romain Naour --- This is an alternative to the path: https://patchwork.ozlabs.org/patch/449686/ --- package/gdb/gdb.mk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/package/gdb/gdb.mk b/package/gdb/gdb.mk index 9818320..7b2dcfa 100644 --- a/package/gdb/gdb.mk +++ b/package/gdb/gdb.mk @@ -124,6 +124,9 @@ endif # * --target, because we're doing a cross build rather than a real # host build. # * --enable-static because gdb really wants to use libbfd.a +# * Force libiberty library path to use the one builded internally by +# gdb (libiberty/pic), and avoid a conflict with the one builded by +# the Buildroot's integral toolchain which is installed in $(HOST_DIR). HOST_GDB_CONF_OPTS = \ --target=$(GNU_TARGET_NAME) \ --enable-static \ @@ -134,7 +137,8 @@ HOST_GDB_CONF_OPTS = \ --disable-werror \ --without-included-gettext \ $(GDB_DISABLE_BINUTILS_CONF_OPTS) \ - --disable-sim + --disable-sim \ + LDFLAGS="-L$(@D)/libiberty/pic $(HOST_LDFLAGS)" ifeq ($(BR2_PACKAGE_HOST_GDB_TUI),y) HOST_GDB_CONF_OPTS += --enable-tui