From patchwork Tue Jul 30 16:32:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas De Schampheleire X-Patchwork-Id: 263444 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 BCB102C00C8 for ; Wed, 31 Jul 2013 02:32:41 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id A4EC48F4BB; Tue, 30 Jul 2013 16:32:40 +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 wAv6iAePmYSn; Tue, 30 Jul 2013 16:32:40 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id E52508F53C; Tue, 30 Jul 2013 16:32:39 +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 F265E1BFA2E for ; Tue, 30 Jul 2013 16:32:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 65BF28F53C for ; Tue, 30 Jul 2013 16:32:39 +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 g9dBaNSSF0KS for ; Tue, 30 Jul 2013 16:32:39 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ee0-f54.google.com (mail-ee0-f54.google.com [74.125.83.54]) by whitealder.osuosl.org (Postfix) with ESMTPS id AA7C78F4BB for ; Tue, 30 Jul 2013 16:32:38 +0000 (UTC) Received: by mail-ee0-f54.google.com with SMTP id e53so87663eek.27 for ; Tue, 30 Jul 2013 09:32:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:content-type:mime-version:content-transfer-encoding:subject :x-mercurial-node:message-id:user-agent:date:from:to; bh=Ssht8DgICj2dE5fO2MP6gpRt0cMHI0/b69Fkq4BAvJA=; b=gY38g6ZS53ZmxByaSwhuj96jgord39XQ1B+TNqUyKv7u14oytxRHJtMr//IQV9MVb3 7rI+7mqMF+oLBgI7shkFCYRY1+7Rxl5ia/JgFoWypjyniumu539P8skw1Taurl68LzVA autqm9Zlr38eezH0JUXTwuxugY7B0JcSj95Q4N9suvTqZio/F2Zefi5xkaA4QHNrZRFJ HqFBxIHx6WqAVbtqNTwBdJ7GJXt/F4xMJY+BrxER/WuPt4qsSOZU4qcAaaSE9tzMDUYf Njw8G4ao2omkHsLLp/3rrl8A33rePFYk/uxFpNH+F8h//7/qzll2Nlk5Q4B6HPnrU4dJ jvXg== X-Received: by 10.14.5.78 with SMTP id 54mr8126333eek.55.1375201956947; Tue, 30 Jul 2013 09:32:36 -0700 (PDT) Received: from [127.0.1.1] (d54C62EEB.access.telenet.be. [84.198.46.235]) by mx.google.com with ESMTPSA id n5sm111767676eed.9.2013.07.30.09.32.35 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 30 Jul 2013 09:32:36 -0700 (PDT) MIME-Version: 1.0 X-Mercurial-Node: f0fae6a2b5b0500a20ab9a5c533020a7697ee879 Message-Id: User-Agent: Mercurial-patchbomb/2.2.2 Date: Tue, 30 Jul 2013 18:32:30 +0200 From: Thomas De Schampheleire To: buildroot@busybox.net Subject: [Buildroot] [PATCH] toolchain-external: don't create gdb symlink when building host-gdb 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 The external-toolchain infrastructure creates symbolic links for all tools in the host directory. However, when buildroot builds its own version of a cross debugger (BR2_PACKAGE_HOST_GDB), and the toolchain also provides a cross debugger, there would be two symbolic links for gdb in the host directory, which is confusing. An example use case is where the external toolchain only provides a 64-bit gdbserver (e.g. Cavium Networks SDK) but the target is completely 32-bit (e.g. n32 ABI). In this case, using gdbserver on target requires copying a bunch of 64-bit libraries to the target as well, just for gdb. In this case, one can let buildroot build both gdbserver as cross-gdb (both in 32-bit). This patch modifies the symlink creation so that no gdb (or gdbtui) symlink is created if buildroot is going to build a cross-gdb. Signed-off-by: Thomas De Schampheleire --- toolchain/toolchain-external/ext-tool.mk | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/toolchain/toolchain-external/ext-tool.mk b/toolchain/toolchain-external/ext-tool.mk --- a/toolchain/toolchain-external/ext-tool.mk +++ b/toolchain/toolchain-external/ext-tool.mk @@ -531,8 +531,9 @@ ifeq ($(BR2_BFIN_INSTALL_FLAT_SHARED),y) TOOLCHAIN_EXTERNAL_INSTALL += $(STAMP_DIR)/ext-toolchain-bfin-shared-flat-installed endif -# Build toolchain wrapper for preprocessor, C and C++ compiler, and setup -# symlinks for everything else +# Build toolchain wrapper for preprocessor, C and C++ compiler and setup +# symlinks for everything else. Skip gdb symlink when we are building our +# own gdb to prevent two gdb's in output/host/usr/bin. $(HOST_DIR)/usr/bin/ext-toolchain-wrapper: $(TOOLCHAIN_EXTERNAL_INSTALL) $(Q)$(call MESSAGE,"Building ext-toolchain wrapper") mkdir -p $(HOST_DIR)/usr/bin; cd $(HOST_DIR)/usr/bin; \ @@ -542,6 +543,11 @@ endif *cc|*cc-*|*++|*++-*|*cpp) \ ln -sf $(@F) $$base; \ ;; \ + *gdb|*gdbtui) \ + if test "$(BR2_PACKAGE_HOST_GDB)" != "y"; then \ + ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%../..%') .; \ + fi \ + ;; \ *) \ ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%../..%') .; \ ;; \