From patchwork Tue Dec 29 00:55:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Romain Naour X-Patchwork-Id: 561413 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id 2163C140CD1 for ; Tue, 29 Dec 2015 12:16:42 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=IsEbNeDV; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 56FF9263E1; Tue, 29 Dec 2015 01:16:41 +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 Edqpk4uoiEog; Tue, 29 Dec 2015 01:16:37 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id E3B573393C; Tue, 29 Dec 2015 00:55:13 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id F3E2D1C0F91 for ; Tue, 29 Dec 2015 00:55:11 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id EEC328BE40 for ; Tue, 29 Dec 2015 00:55:11 +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 Vf5MxGe7pCUc for ; Tue, 29 Dec 2015 00:55:11 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f44.google.com (mail-wm0-f44.google.com [74.125.82.44]) by whitealder.osuosl.org (Postfix) with ESMTPS id E830788431 for ; Tue, 29 Dec 2015 00:55:10 +0000 (UTC) Received: by mail-wm0-f44.google.com with SMTP id f206so23726591wmf.0 for ; Mon, 28 Dec 2015 16:55:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=FNjT0CRXnY9odEv2TBSa/SU+rNHjlb+tsfY8IQsiWuU=; b=IsEbNeDVNbvLKtqVUiQ0ITv6pyIze5TPcNGaMoF7+RFmJblSy1MB1oDncVKg0X7mIT OkbH/NbsSKi705175Egg2qsa+Iym9Fiua6UnXCBYRFXHdbe1OEJA894XEkSroprO+IRX 3nE11hxJWdwcenUikY/d5FPShW55jYaXO4Rh+XtrYdXZcpvCiMsXBlWtqubJCA7UBQvT 7TQh3McuIPShVk1RfKZi6jNf6XrxdGsAApRyvvrttsJTsON52ldfJO1R8rY49rD/I/ZG ly+543dN1X2V1W59vReXPOnoccmSSp7rQvPUw1DbNStBHgps0XADo1JlfxW9m5TRwUxH uVqg== X-Received: by 10.28.7.138 with SMTP id 132mr65188650wmh.100.1451350509409; Mon, 28 Dec 2015 16:55:09 -0800 (PST) Received: from ?IPv6:2a01:e35:8b8d:cc60:caf7:33ff:fe77:d120? ([2a01:e35:8b8d:cc60:caf7:33ff:fe77:d120]) by smtp.gmail.com with ESMTPSA id cs4sm59106757wjc.10.2015.12.28.16.55.08 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 28 Dec 2015 16:55:08 -0800 (PST) To: Thomas Petazzoni References: <1448123780-30067-1-git-send-email-romain.naour@openwide.fr> <20151219135757.30f09e4d@free-electrons.com> From: Romain Naour Message-ID: <5681D9E8.70308@gmail.com> Date: Tue, 29 Dec 2015 01:55:04 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151219135757.30f09e4d@free-electrons.com> Cc: buildroot@buildroot.org Subject: Re: [Buildroot] [PATCH 1/7] toolchain-external: CodeSourcery AMD64: support only one version 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: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Hi Thomas, Le 19/12/2015 13:57, Thomas Petazzoni a écrit : > Romain, > > On Sat, 21 Nov 2015 17:36:14 +0100, Romain Naour wrote: >> See the conclusion about external toolchains during the Buildroot >> meeting [1]: >> "In the future, we stick to a single external toolchain version. The >> Kconfig symbol should not encode the version (avoid legacy handling)" >> >> [1] http://elinux.org/index.php?title=Buildroot:DeveloperDaysELCE2015#Report >> >> Signed-off-by: Romain Naour > > I have applied patches 1, 2, 3, 4, 6 and 7 of this patch series. Could > you send patches doing the same (reducing to one version only) for > other CodeSourcery toolchains as well ? > > Regarding patch 5, I don't really like the hacks needed with the > dynamic loader, and would like to see if there is a way to avoid having > those hacks. Well, this CS toolchain defeat (once again) the Buildroot toolchain-external Makefile code... I removed the hack from TOOLCHAIN_EXTERNAL_CODESOURCERY_AARCH64_STAGING_FIXUP but I had to do something in copy_toolchain_sysroot() to handle the special case. if we use a 64 bits toolchain we also look at "lib" directory to see if there are some symlink to libraries belonging to "lib64". If yes, we create the corresponding symlink in STAGING_DIR. I don't think it's better than TOOLCHAIN_EXTERNAL_CODESOURCERY_AARCH64_STAGING_FIXUP. The same kind of change should be done in copy_toolchain_lib_root() to copy the dynamic loader. In the common case, we expect that it match this pattern: ld*.so.* But it's not the case here because the symlink to the dynamic loader is in another directory (lib) and we are looking for it in (lib64). So the LIB_EXTERNAL_LIBS += ld*.so.* doesn't match any library during the copy to TARGET_DIR. That's why the system doesn't boot at runtime. Thoughts ? Best regards, Romain > > Thomas > diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk index 1452ec6..f6f769b 100644 --- a/toolchain/helpers.mk +++ b/toolchain/helpers.mk @@ -142,6 +142,18 @@ copy_toolchain_sysroot = \ $${ARCH_SYSROOT_DIR}/$$i/ $(STAGING_DIR)/$$i/ ; \ fi ; \ done ; \ + if [ $${ARCH_LIB_DIR} = "lib64" ] ; then \ + if [ -d $${ARCH_SYSROOT_DIR}/lib ] ; then \ + mkdir -p `dirname $(STAGING_DIR)/lib` ; \ + SYMLINKS=`find $${ARCH_SYSROOT_DIR}/lib -maxdepth 1 -type l 2>/dev/null` ; \ + for i in $${SYMLINKS} ; do \ + relpath=`readlink -f $${i}` ; \ + if [ "`dirname $${relpath}`" = "$${ARCH_SYSROOT_DIR}lib64" ] ; then \ + ln -sf `basename $${relpath}` $(STAGING_DIR)/lib/`basename $${i}` ; \ + fi ; \ + done ; \ + fi ; \ + fi ; \ if [ `readlink -f $${SYSROOT_DIR}` != `readlink -f $${ARCH_SYSROOT_DIR}` ] ; then \ if [ ! -d $${ARCH_SYSROOT_DIR}/usr/include ] ; then \ cp -a $${SYSROOT_DIR}/usr/include $(STAGING_DIR)/usr ; \