From patchwork Sun Apr 29 21:13:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Nilsson X-Patchwork-Id: 155767 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 48B81B701A for ; Mon, 30 Apr 2012 07:20:31 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 571D410113F; Sun, 29 Apr 2012 21:20:30 +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 IrMOT9U+lGcD; Sun, 29 Apr 2012 21:20:28 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id D2B3F10148B; Sun, 29 Apr 2012 21:20:27 +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 EDAEB8F753 for ; Sun, 29 Apr 2012 21:20:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id DC5D08192C for ; Sun, 29 Apr 2012 21:20:25 +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 Ndi9BqJn8mGc for ; Sun, 29 Apr 2012 21:20:20 +0000 (UTC) X-Greylist: delayed 00:06:22 by SQLgrey-1.7.6 Received: from smtp-gw21.han.skanova.net (smtp-gw21.han.skanova.net [81.236.55.21]) by whitealder.osuosl.org (Postfix) with ESMTP id BD5EA8D0C3 for ; Sun, 29 Apr 2012 21:20:19 +0000 (UTC) Received: from oden.home.dnil.se (90.230.170.31) by smtp-gw21.han.skanova.net (8.5.133) id 4EDE1D1703DFF6E4; Sun, 29 Apr 2012 23:13:54 +0200 Received: from localhost (localhost [127.0.0.1]) by oden.home.dnil.se (Postfix) with ESMTP id 1A6152404E4; Sun, 29 Apr 2012 23:13:53 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at dnil.se Received: from oden.home.dnil.se ([127.0.0.1]) by localhost (oden.home.dnil.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OPG8CU1ymg3x; Sun, 29 Apr 2012 23:13:49 +0200 (CEST) Received: from [192.168.1.3] (laptop.home.dnil.se [192.168.1.3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by oden.home.dnil.se (Postfix) with ESMTPSA id 5BD7B240351; Sun, 29 Apr 2012 23:13:49 +0200 (CEST) Message-ID: <4F9DAF0C.8060900@dnil.se> Date: Sun, 29 Apr 2012 23:13:48 +0200 From: Daniel Nilsson User-Agent: Mozilla/5.0 (X11; Linux i686; rv:9.0) Gecko/20111220 Thunderbird/9.0 MIME-Version: 1.0 To: Thomas Petazzoni References: <87obrxr04x.fsf@macbook.be.48ers.dk> In-Reply-To: <87obrxr04x.fsf@macbook.be.48ers.dk> Cc: buildroot@busybox.net Subject: Re: [Buildroot] [PATCH 2/3] debug: provide an option to copy the gdbserver to the target 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 On 03/15/2012 11:05 PM, Peter Korsgaard wrote: >>>>>> "Thomas" == Thomas Petazzoni writes: > > Thomas> When an external toolchain is used, it is very likely that it contains > Thomas> a pre-built version of a gdbserver that has the same version as the > Thomas> cross-gdb included in the external toolchain. So, we now provide an > Thomas> option that allows to copy this pre-built gdbserver to the target. > > Committed, thanks. > Hi Thomas, I have attempted to build a root filesystem for QEMU/x86 based on the current version of buildroot in git (0242ae4c6b7d1daf85a5f0c191394b0a15f95c54). The RFS is built using an external toolchain (Code Sourcery 2011.09). All seems fine except that copying the gdbserver to the target fails, this is since the toolchain does not keep the gdbserver where the ext-tool.mk expect to find it, it is present in these two locations: host/usr/i686-unknown-linux-gnu/sysroot/usr/lib64/bin/gdbserver host/usr/i686-unknown-linux-gnu/sysroot/usr/lib/bin/gdbserver The below patch works around this issue in my case, however I'm not so sure this is a proper "fix" since it will not work when the 64-bit version is requested. I'm not sure how the framework is setup to determine 32/64bit versions in this case so I didn't attempt to fix it. I have attached my config file below for reference, maybe there is a config option I need to set? Regards Daniel Nilsson toolchain/toolchain-external/ext-tool.mk | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) egrep -v '^#|^$' .config BR2_HAVE_DOT_CONFIG=y BR2_i386=y BR2_x86_pentiumpro=y BR2_ARCH="i686" BR2_ENDIAN="LITTLE" BR2_GCC_TARGET_TUNE="pentiumpro" BR2_GCC_TARGET_ARCH="pentiumpro" BR2_WGET="wget --passive-ftp -nd -t 3" BR2_SVN="svn" BR2_BZR="bzr" BR2_GIT="git" BR2_LOCALFILES="cp" BR2_SCP="scp" BR2_SSH="ssh" BR2_HG="hg" BR2_ZCAT="gzip -d -c" BR2_BZCAT="bzcat" BR2_XZCAT="xzcat" BR2_TAR_OPTIONS="" BR2_DL_DIR="$(TOPDIR)/dl" BR2_HOST_DIR="$(BASE_DIR)/host" BR2_PRIMARY_SITE="" BR2_BACKUP_SITE="http://sources.buildroot.net/" BR2_SOURCEFORGE_MIRROR="kent" BR2_KERNEL_MIRROR="http://www.kernel.org/pub/" BR2_GNU_MIRROR="http://ftp.gnu.org/pub/gnu" BR2_DEBIAN_MIRROR="http://ftp.debian.org" BR2_JLEVEL=4 BR2_STRIP_strip=y BR2_OPTIMIZE_S=y BR2_PACKAGE_OVERRIDE_FILE="$(TOPDIR)/local.mk" BR2_TOOLCHAIN_EXTERNAL=y BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_X86_201109=y BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y BR2_TOOLCHAIN_EXTERNAL_PREFIX="i686-pc-linux-gnu" BR2_TOOLCHAIN_EXTERNAL_GLIBC=y BR2_TOOLCHAIN_EXTERNAL_GDB_SERVER_COPY=y BR2_LARGEFILE=y BR2_INET_IPV6=y BR2_INET_RPC=y BR2_USE_WCHAR=y BR2_ENABLE_LOCALE=y BR2_INSTALL_LIBSTDCPP=y BR2_TOOLCHAIN_HAS_THREADS=y BR2_TOOLCHAIN_HAS_THREADS_DEBUG=y BR2_TOOLCHAIN_HAS_THREADS_DEBUG_IF_NEEDED=y BR2_TOOLCHAIN_HAS_SHADOW_PASSWORDS=y BR2_ENABLE_LOCALE_PURGE=y BR2_ENABLE_LOCALE_WHITELIST="C en_US" BR2_USE_MMU=y BR2_TARGET_OPTIMIZATION="-pipe" BR2_TARGET_LDFLAGS="" BR2_TARGET_GENERIC_HOSTNAME="br-x86-glibc" BR2_TARGET_GENERIC_ISSUE="Welcome to Buildroot" BR2_ROOTFS_DEVICE_CREATION_STATIC=y BR2_ROOTFS_DEVICE_TABLE="target/generic/device_table.txt" BR2_ROOTFS_STATIC_DEVICE_TABLE="target/generic/device_table_dev.txt" BR2_ROOTFS_SKELETON_DEFAULT=y BR2_TARGET_GENERIC_GETTY_PORT="ttyS0" BR2_TARGET_GENERIC_GETTY_BAUDRATE_115200=y BR2_TARGET_GENERIC_GETTY_BAUDRATE="115200" BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW=y BR2_ROOTFS_POST_BUILD_SCRIPT="" BR2_PACKAGE_BUSYBOX=y BR2_BUSYBOX_VERSION_1_19_X=y BR2_BUSYBOX_VERSION="1.19.4" BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-1.19.x.config" BR2_TARGET_ROOTFS_EXT2=y BR2_TARGET_ROOTFS_EXT2_BLOCKS=0 BR2_TARGET_ROOTFS_EXT2_INODES=0 BR2_TARGET_ROOTFS_EXT2_RESBLKS=0 BR2_TARGET_ROOTFS_EXT2_NONE=y BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_VERSION=y BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="3.3" BR2_LINUX_KERNEL_VERSION="3.3" BR2_LINUX_KERNEL_PATCH="" BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/x86/linux-3.3.config" BR2_LINUX_KERNEL_BZIMAGE=y diff --git a/toolchain/toolchain-external/ext-tool.mk b/toolchain/toolchain-external/ext-tool.mk index a45603a..7101e1f 100644 --- a/toolchain/toolchain-external/ext-tool.mk +++ b/toolchain/toolchain-external/ext-tool.mk @@ -388,9 +388,9 @@ $(STAMP_DIR)/ext-toolchain-installed: $(STAMP_DIR)/ext-toolchain-checked fi ; \ if test x"$(BR2_TOOLCHAIN_EXTERNAL_GDB_SERVER_COPY)" == x"y"; then \ gdbserver_found=0 ; \ - for d in $${ARCH_SYSROOT_DIR} $${ARCH_SYSROOT_DIR}/../debug-root/ ; do \ - if test -f $${d}/usr/bin/gdbserver ; then \ - install -m 0755 -D $${d}/usr/bin/gdbserver $(TARGET_DIR)/usr/bin/gdbserver ; \ + for d in $${ARCH_SYSROOT_DIR}/usr $${ARCH_SYSROOT_DIR}/../debug-root/usr $${ARCH_SYSROOT_DIR}/usr/lib ; do \ + if test -f $${d}/bin/gdbserver ; then \ + install -m 0755 -D $${d}/bin/gdbserver $(TARGET_DIR)/usr/bin/gdbserver ; \ gdbserver_found=1 ; \ break ; \ fi ; \