From patchwork Wed Mar 20 17:25:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Worth, Kevin" X-Patchwork-Id: 229438 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id 3B1462C00B6 for ; Thu, 21 Mar 2013 04:27:17 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 5141D8D193; Wed, 20 Mar 2013 17:27:14 +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 3jdSxGMj5E9D; Wed, 20 Mar 2013 17:27:11 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id CACA38D16B; Wed, 20 Mar 2013 17:27:10 +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 87FC98F753 for ; Wed, 20 Mar 2013 17:27:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id C67FF8D116 for ; Wed, 20 Mar 2013 17:27:09 +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 sBqezEttuuMo for ; Wed, 20 Mar 2013 17:27:03 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from g4t0015.houston.hp.com (g4t0015.houston.hp.com [15.201.24.18]) by whitealder.osuosl.org (Postfix) with ESMTPS id D90388D188 for ; Wed, 20 Mar 2013 17:26:52 +0000 (UTC) Received: from G4W6310.americas.hpqcorp.net (g4w6310.houston.hp.com [16.210.26.217]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by g4t0015.houston.hp.com (Postfix) with ESMTPS id 1FCA087EB for ; Wed, 20 Mar 2013 17:26:51 +0000 (UTC) Received: from G9W3611.americas.hpqcorp.net (16.216.186.46) by G4W6310.americas.hpqcorp.net (16.210.26.217) with Microsoft SMTP Server (TLS) id 14.2.328.9; Wed, 20 Mar 2013 17:25:47 +0000 Received: from G9W0753.americas.hpqcorp.net ([169.254.1.85]) by G9W3611.americas.hpqcorp.net ([16.216.186.46]) with mapi id 14.02.0328.009; Wed, 20 Mar 2013 17:25:47 +0000 From: "Worth, Kevin" To: "buildroot@busybox.net" Thread-Topic: [PATCH] Fix external toolchain gdbserver copy path for using buildroot-generated toolchain Thread-Index: Ac4ljLAuCOd+xieoRHGo9/y+vnWgOw== Date: Wed, 20 Mar 2013 17:25:46 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [16.210.48.14] MIME-Version: 1.0 Subject: [Buildroot] [PATCH] Fix external toolchain gdbserver copy path for using buildroot-generated toolchain 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: , Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net I have a few different toolchains and boards, and I'm using buildroot to generate toolchains and system images for them. I'm building my toolchain using O=board1.toolchain, then my system using O=board1. I simply set my system defconfig to use an external toolchain, which points to the matching toolchain directory at $(TOPDIR)/board1.toolchain/host/usr. This works quite nicely so far (I can do a clean system build in about 10 minutes without the 20 minute toolchain build), except that the gdbserver generated by buildroot goes to output/target/usr/bin/gdbserver (appropriately so, since it runs on the target, not the host). However, toolchain/toolchain-external/ext-tool.mk only looks in sysroot and sysroot/../debug-root; neither of which is the right spot for buildroot's generated toolchain, and it dies as follows: >>> Checking external toolchain settings >>> Copying external toolchain libraries to target... >>> Copying external toolchain sysroot to staging... >>> Copying gdbserver Could not find gdbserver in external toolchain make: *** [/.../stamps/ext-toolchain-installed] This patch is a simple fix to add buildroot's generated gdbserver path list of searched directories. Perhaps I should be configuring my system to point somewhere besides board1.toolchain/host/usr, but I've been unable to find anything around the web. Another alternative could be to create a debug-root symlink (a path already searched by ext-tool.mk) in the buildroot toolchain generation of gdb that points to the host directory, but I'm not sure if that is the intended purpose of the debug-root path. Looking at toolchain/gdb/gdb.mk, there is a conditional check for a (possibly stale, I can't find it elsewhere) configuration option- BR2_CROSS_TOOLCHAIN_TARGET_UTILS: $(TARGET_DIR)/usr/bin/gdbserver: $(GDB_SERVER_DIR)/gdbserver ifeq ($(BR2_CROSS_TOOLCHAIN_TARGET_UTILS),y) mkdir -p $(STAGING_DIR)/usr/$(GNU_TARGET_NAME)/target_utils install -c $(GDB_SERVER_DIR)/gdbserver \ $(STAGING_DIR)/usr/$(GNU_TARGET_NAME)/target_utils/gdbserver endif install -c -D $(GDB_SERVER_DIR)/gdbserver $(TARGET_DIR)/usr/bin/gdbserver Perhaps this would be a candidate for putting gdbserver in a place that ext-tool.mk will know to pick it up? Signed-off-by: Kevin Worth --- toolchain/toolchain-external/ext-tool.mk | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/toolchain/toolchain-external/ext-tool.mk b/toolchain/toolchain-external/ext-tool.mk index b477bc0..84ded7b 100644 --- a/toolchain/toolchain-external/ext-tool.mk +++ b/toolchain/toolchain-external/ext-tool.mk @@ -438,7 +438,7 @@ $(STAMP_DIR)/ext-toolchain-installed: $(STAMP_DIR)/ext-toolchain-checked if test x"$(BR2_TOOLCHAIN_EXTERNAL_GDB_SERVER_COPY)" == x"y"; then \ $(call MESSAGE,"Copying gdbserver") ; \ gdbserver_found=0 ; \ - for d in $${ARCH_SYSROOT_DIR} $${ARCH_SYSROOT_DIR}/../debug-root/ ; do \ + for d in $${ARCH_SYSROOT_DIR} $${ARCH_SYSROOT_DIR}/../debug-root/ $${ARCH_SYSROOT_DIR}/../../../../target/; do \ if test -f $${d}/usr/bin/gdbserver ; then \ install -m 0755 -D $${d}/usr/bin/gdbserver $(TARGET_DIR)/usr/bin/gdbserver ; \ gdbserver_found=1 ; \