From patchwork Mon Sep 16 17:39:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Beresford X-Patchwork-Id: 275260 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 160172C00B3 for ; Tue, 17 Sep 2013 03:39:06 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id A049332BD5; Mon, 16 Sep 2013 17:38:49 +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 54TgNvMKB1Y9; Mon, 16 Sep 2013 17:38:46 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id F292B32B68; Mon, 16 Sep 2013 17:38:45 +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 B0A581BFA59 for ; Mon, 16 Sep 2013 17:38:59 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id A6E688CB66 for ; Mon, 16 Sep 2013 17:38:59 +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 7UVnhMb4ihSr for ; Mon, 16 Sep 2013 17:38:58 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail1.bemta3.messagelabs.com (mail1.bemta3.messagelabs.com [195.245.230.168]) by whitealder.osuosl.org (Postfix) with ESMTPS id A07E58CACC for ; Mon, 16 Sep 2013 17:38:57 +0000 (UTC) Received: from [85.158.137.67:6296] by server-8.bemta-3.messagelabs.com id AB/C7-28652-F2247325; Mon, 16 Sep 2013 17:38:55 +0000 X-Env-Sender: greg.beresford@zbdsolutions.com X-Msg-Ref: server-6.tower-139.messagelabs.com!1379353134!22321744!3 X-Originating-IP: [217.28.130.38] X-StarScan-Received: X-StarScan-Version: 6.9.12; banners=zbdsolutions.com,-,- X-VirusChecked: Checked Received: (qmail 28730 invoked from network); 16 Sep 2013 17:38:55 -0000 Received: from hostedexchange.hostedservice.com (HELO outlook.hostedservice2.net) (217.28.130.38) by server-6.tower-139.messagelabs.com with RC4-SHA encrypted SMTP; 16 Sep 2013 17:38:55 -0000 thread-index: Ac6zA53hAQL3i1m8TluOewmZctwwsA== Content-Class: urn:content-classes:message Importance: normal Priority: normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4913 Received: from zbd-vm-linuxbld.ZBDDisplays.local (195.99.192.130) by smtp.hostedservice2.net (192.168.16.122) with Microsoft SMTP Server (TLS) id 8.3.298.1; Mon, 16 Sep 2013 18:38:55 +0100 From: Greg Beresford To: Date: Mon, 16 Sep 2013 18:39:15 +0100 Message-ID: <1379353155-26459-1-git-send-email-greg.beresford@zbdsolutions.com> X-Mailer: git-send-email 1.8.4 MIME-Version: 1.0 Cc: Henry Luis Subject: [Buildroot] [PATCH] Add support for eglibc-2.17 multiarch layout, from Linaro 2013.07+ 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 From: Henry Luis Arch-specific libraries, including libc.so.6, are expected to be in a subdirectory of /lib (e.g. /lib/arm-linux-gnueabihf). This patch changes copy_toolchain_lib_root() in helper.mk to preserve the toolchain sysroot's lib directory structure, except for SUPPORT_LIB_DIR which are still copied directly under DESTDIR. Signed-off-by: Greg Beresford --- I've copied and reformatted Henry Luis' patch from the attachment to https://bugs.busybox.net/show_bug.cgi?id=6452. I've given it a test with Linaro ARM 2013.08 and CodeSourcery ARM 2013.05 toolchains and it seems to work ok. It does result in a non-hf ld-linux.so being copied in addition to the correct one on the linaro toolchain, but the target still works. (I think that this is because buildroot checks for both versions, and copies everything it successfully finds.) Also, this is my first submission to anything using git. I've tried to follow the instructions in the manual, so I hope everything is in order! Regards Greg toolchain/helpers.mk | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk index 0e270ee..b2b1b2f 100644 --- a/toolchain/helpers.mk +++ b/toolchain/helpers.mk @@ -50,11 +50,12 @@ copy_toolchain_lib_root = \ LIB="$(strip $4)"; \ DESTDIR="$(strip $5)" ; \ \ + pushd $${ARCH_SYSROOT_DIR} > /dev/null; \ for dir in \ - $${ARCH_SYSROOT_DIR}/$${ARCH_LIB_DIR}/$(TOOLCHAIN_EXTERNAL_PREFIX) \ - $${ARCH_SYSROOT_DIR}/usr/$(TOOLCHAIN_EXTERNAL_PREFIX)/$${ARCH_LIB_DIR} \ - $${ARCH_SYSROOT_DIR}/$${ARCH_LIB_DIR} \ - $${ARCH_SYSROOT_DIR}/usr/$${ARCH_LIB_DIR} \ + ./$${ARCH_LIB_DIR}/$(TOOLCHAIN_EXTERNAL_PREFIX) \ + ./usr/$(TOOLCHAIN_EXTERNAL_PREFIX)/$${ARCH_LIB_DIR} \ + ./$${ARCH_LIB_DIR} \ + ./usr/$${ARCH_LIB_DIR} \ $${SUPPORT_LIB_DIR} ; do \ LIBSPATH=`find $${dir} -maxdepth 1 -name "$${LIB}.*" 2>/dev/null` ; \ if test -n "$${LIBSPATH}" ; then \ @@ -66,18 +67,25 @@ copy_toolchain_lib_root = \ LIBDIR=`dirname $${LIBPATH}` ; \ while test \! -z "$${LIBNAME}" ; do \ LIBPATH=$${LIBDIR}/$${LIBNAME} ; \ - rm -fr $(TARGET_DIR)/$${DESTDIR}/$${LIBNAME}; \ - mkdir -p $(TARGET_DIR)/$${DESTDIR}; \ + if [ "$${dir}" = "$${SUPPORT_LIB_DIR}" ]; then \ + DDIR=$${DESTDIR} ; \ + else \ + DDIR=$${LIBDIR} ; \ + fi; \ + rm -fr $(TARGET_DIR)/$${DDIR}/$${LIBNAME}; \ + mkdir -p $(TARGET_DIR)/$${DDIR}; \ if test -h $${LIBPATH} ; then \ - cp -d $${LIBPATH} $(TARGET_DIR)/$${DESTDIR}/; \ + cp -d $${LIBPATH} $(TARGET_DIR)/$${DDIR}/; \ elif test -f $${LIBPATH}; then \ - $(INSTALL) -D -m0755 $${LIBPATH} $(TARGET_DIR)/$${DESTDIR}/$${LIBNAME}; \ + $(INSTALL) -D -m0755 $${LIBPATH} $(TARGET_DIR)/$${DDIR}/$${LIBNAME}; \ else \ + popd > /dev/null; \ exit -1; \ fi; \ LIBNAME="`readlink $${LIBPATH}`"; \ done; \ done; \ + popd > /dev/null; \ \ echo -n