From patchwork Thu Jul 23 23:10:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vicente Olivert Riera X-Patchwork-Id: 499563 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 A095C140B04 for ; Fri, 24 Jul 2015 09:12:40 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id E2A79336CB; Thu, 23 Jul 2015 23:12:39 +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 UWPq46qlB2xF; Thu, 23 Jul 2015 23:12:36 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id DBD86337C1; Thu, 23 Jul 2015 23:12:35 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 8107B1BFC0A for ; Thu, 23 Jul 2015 23:12:34 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 7BAA5A429A for ; Thu, 23 Jul 2015 23:12:34 +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 TAXdPhMwOE6D for ; Thu, 23 Jul 2015 23:12:33 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mailapp01.imgtec.com (mailapp01.imgtec.com [195.59.15.196]) by fraxinus.osuosl.org (Postfix) with ESMTP id 02389A4297 for ; Thu, 23 Jul 2015 23:12:32 +0000 (UTC) Received: from KLMAIL01.kl.imgtec.org (unknown [192.168.5.35]) by Websense Email Security Gateway with ESMTPS id 3311569A4C2EA; Fri, 24 Jul 2015 00:12:26 +0100 (IST) Received: from LEMAIL01.le.imgtec.org (192.168.152.62) by KLMAIL01.kl.imgtec.org (192.168.5.35) with Microsoft SMTP Server (TLS) id 14.3.195.1; Fri, 24 Jul 2015 00:12:30 +0100 Received: from quad.carrosses.com (192.168.159.77) by LEMAIL01.le.imgtec.org (192.168.152.62) with Microsoft SMTP Server (TLS) id 14.3.210.2; Fri, 24 Jul 2015 00:12:29 +0100 From: Vicente Olivert Riera To: Date: Fri, 24 Jul 2015 01:10:07 +0200 Message-ID: <1437693007-13320-2-git-send-email-Vincent.Riera@imgtec.com> X-Mailer: git-send-email 2.3.6 In-Reply-To: <1437693007-13320-1-git-send-email-Vincent.Riera@imgtec.com> References: <1437693007-13320-1-git-send-email-Vincent.Riera@imgtec.com> MIME-Version: 1.0 X-Originating-IP: [192.168.159.77] Cc: thomas.petazzoni@free-electrons.com, yann.morin.1998@free.fr Subject: [Buildroot] [PATCH v3 2/2] Add support for MIPS Codescape MTI GNU Linux toolchain 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" - Add support for MIPS Codescape MTI GNU Linux toolchain - Add a hash value - Add logic to 'toolchain/helpers.mk' to allow the SYSROOT_DIR and ARCH_SYSROOT_DIR sit side by side instead of nested. - Add logic for creating the side-by-side symlink as a post install hook. Signed-off-by: Vicente Olivert Riera --- toolchain/helpers.mk | 12 ++++- toolchain/toolchain-external/Config.in | 51 ++++++++++++++++++++++ .../toolchain-external/toolchain-external.hash | 6 +++ toolchain/toolchain-external/toolchain-external.mk | 17 ++++++++ 4 files changed, 85 insertions(+), 1 deletion(-) diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk index 895f3f1..71d2ec9 100644 --- a/toolchain/helpers.mk +++ b/toolchain/helpers.mk @@ -116,6 +116,13 @@ copy_toolchain_lib_root = \ # non-default architecture variant is used. Without this, the # compiler fails to find libraries and headers. # +# * Note: this guesses that the ARCH_SYSROOT_DIR is nested into +# the SYSROOT_DIR, but that's not true for all toolchains (i.e. +# Codescape toolchains), so a post-install-staging hook will be +# needed to create the symlink when the sysroot dirs are not nested +# because there is not enough information here to determine whether +# the sysroot layout is nested or side-by-side. +# # Some toolchains (i.e Linaro binary toolchains) store support # libraries (libstdc++, libgcc_s) outside of the sysroot, so we simply # copy all the libraries from the "support lib directory" into our @@ -144,7 +151,10 @@ copy_toolchain_sysroot = \ $${ARCH_SYSROOT_DIR}/$$i/ $(STAGING_DIR)/$$i/ ; \ fi ; \ done ; \ - if [ `readlink -f $${SYSROOT_DIR}` != `readlink -f $${ARCH_SYSROOT_DIR}` ] ; then \ + SYSROOT_DIR_CANON=`readlink -f $${SYSROOT_DIR}` ; \ + ARCH_SYSROOT_DIR_CANON=`readlink -f $${ARCH_SYSROOT_DIR}` ; \ + if [ $${SYSROOT_DIR_CANON} != $${ARCH_SYSROOT_DIR_CANON} \ + -a $${ARCH_SYSROOT_DIR_CANON:0:$${\#SYSROOT_DIR_CANON}} == $${SYSROOT_DIR_CANON} ] ; then \ if [ ! -d $${ARCH_SYSROOT_DIR}/usr/include ] ; then \ cp -a $${SYSROOT_DIR}/usr/include $(STAGING_DIR)/usr ; \ fi ; \ diff --git a/toolchain/toolchain-external/Config.in b/toolchain/toolchain-external/Config.in index e70989e..1fed720 100644 --- a/toolchain/toolchain-external/Config.in +++ b/toolchain/toolchain-external/Config.in @@ -188,6 +188,56 @@ config BR2_TOOLCHAIN_EXTERNAL_ARAGO_ARMV5TE_201109 This toolchain uses software-floating point. +config BR2_TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS201506 + bool "Codescape MTI GNU Linux Toolchain 2015.06" + depends on BR2_mips || BR2_mipsel || BR2_mips64 || BR2_mips64el + depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86" + depends on !BR2_MIPS_SOFT_FLOAT + depends on BR2_mips_32r2 || BR2_mips_64r2 + select BR2_TOOLCHAIN_EXTERNAL_GLIBC + select BR2_INSTALL_LIBSTDCPP + select BR2_HOSTARCH_NEEDS_IA32_LIBS + select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_0 + help + Codescape MTI GNU Linux Toolchain 2015.06 for the MIPS + architecture, from Imagination Technologies. It uses gcc + 4.9.2, binutils 2.24.90, glibc 2.20, gdb 7.9.1 and kernel + headers 4.0. It has support for the following variants: + - MIPS32r2 - Big-Endian, O32 + Select 'MIPS (big endian)' Target Architecture + Select 'mips 32r6' Target Architecture Variant + - MIPS32r2 - Little-Endian, O32 + Select 'MIPS (little endian)' Target Architecture + Select 'mips 32r6' Target Architecture Variant + - MIPS32r2 - Big-Endian, 2008 NaN, O32 + Select 'MIPS (big endian)' Target Architecture + Select 'mips 32r6' Target Architecture Variant + Set BR2_TARGET_OPTIMIZATION to '-mnan=2008' + - MIPS32r2 - Little-Endian, 2008 NaN, O32 + Select 'MIPS (little endian)' Target Architecture + Select 'mips 32r6' Target Architecture Variant + Set BR2_TARGET_OPTIMIZATION to '-mnan=2008' + - MIPS32r2 - Little-Endian, 2008 NaN, O32, microMIPS + Select 'MIPS (little endian)' Target Architecture + Select 'mips 32r6' Target Architecture Variant + Set BR2_TARGET_OPTIMIZATION to '-mnan=2008 -mmicromips' + - MIPS64r2 - Big-Endian, N32 + Select 'MIPS64 (big endian)' Target Architecture + Select 'mips 64r2' Target Architecture Variant + Select 'n32' Target ABI + - MIPS64r2 - Little-Endian, N32 + Select 'MIPS64 (little endian)' Target Architecture + Select 'mips 64r2' Target Architecture Variant + Select 'n32' Target ABI + - MIPS64r2 - Big-Endian, N64 + Select 'MIPS64 (big endian)' Target Architecture + Select 'mips 64r2' Target Architecture Variant + Select 'n64' Target ABI + - MIPS64r2 - Little-Endian, N64 + Select 'MIPS64 (little endian)' Target Architecture + Select 'mips 64r2' Target Architecture Variant + Select 'n64' Target ABI + config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS201505 bool "Sourcery CodeBench MIPS 2015.05" depends on BR2_mips || BR2_mipsel || BR2_mips64 || BR2_mips64el @@ -914,6 +964,7 @@ config BR2_TOOLCHAIN_EXTERNAL_PREFIX default "arm-arago-linux-gnueabi" if BR2_TOOLCHAIN_EXTERNAL_ARAGO_ARMV5TE_201109 default "aarch64-linux-gnu" if BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64 default "aarch64-linux-gnu" if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_AARCH64 + default "mips-mti-linux-gnu" if BR2_TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS201506 default "mips-linux-gnu" if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS201405 default "mips-linux-gnu" if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS201411 default "mips-linux-gnu" if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS201505 diff --git a/toolchain/toolchain-external/toolchain-external.hash b/toolchain/toolchain-external/toolchain-external.hash index 3980c62..2361f0e 100644 --- a/toolchain/toolchain-external/toolchain-external.hash +++ b/toolchain/toolchain-external/toolchain-external.hash @@ -55,6 +55,12 @@ sha256 0cffac0caea0eb3c8bdddfa14be011ce366680f40aeddbefc7cf23cb6d4f1891 gcc-lin sha256 4bc9d86390f8fa67a693ba4768ba5b12faaf7dd37c706c05ccd9321e765226e4 gcc-linaro-armeb-linux-gnueabihf-4.9-2014.09_linux.tar.xz sha256 3954f496ab01de67241109e82abfaa9b7625fdab4f05e79e7902e9814a07b832 gcc-linaro-aarch64-linux-gnu-4.9-2014.09_linux.tar.xz +# Codescape toolchains from Imagination Technologies +# From: http://codescape-mips-sdk.imgtec.com/components/toolchain/2015.06-03/ +md5 80e98c7425e4c9f7df255f5098bf7a10 Codescape.GNU.Tools.Package.2015.06-03.for.MIPS.MTI.Linux.CentOS-5.x86.tar.gz +# Locally calculated +sha256 c44857522fa80b99e6918cfe8ffa70100b78a124e97b0749e86c2b71a101e2fd Codescape.GNU.Tools.Package.2015.06-03.for.MIPS.MTI.Linux.CentOS-5.x86.tar.gz + # Synopsys DesignWare ARC toolchains sha256 1fa4ea2c8616623205f1c7beca02ea31b019099528a7433e5b020b0876b93bf3 arc_gnu_2014.12_prebuilt_uclibc_le_arc700_linux_install.tar.gz sha256 1080f07fcae2bfc176a3ea8d30b9ed8eaecab70fb786639d6ec70cae8322df10 arc_gnu_2014.12_prebuilt_uclibc_be_arc700_linux_install.tar.gz diff --git a/toolchain/toolchain-external/toolchain-external.mk b/toolchain/toolchain-external/toolchain-external.mk index 2254248..f2c1bc0 100644 --- a/toolchain/toolchain-external/toolchain-external.mk +++ b/toolchain/toolchain-external/toolchain-external.mk @@ -253,6 +253,18 @@ define TOOLCHAIN_EXTERNAL_LINARO_AARCH64_SYMLINK ln -snf . $(TARGET_DIR)/usr/lib/aarch64-linux-gnu endef +# The Codescape toolchain uses a sysroot layout that places them +# side-by-side instead of nested like multilibs. A symlink is needed +# much like for the nested sysroots which are handled in +# copy_toolchain_sysroot but there is not enough information in there +# to determine whether the sysroot layout was nested or side-by-side. +# Add the symlink here for now. +define TOOLCHAIN_EXTERNAL_CODESCAPE_MIPS_SYMLINK + $(Q)ARCH_SYSROOT_DIR="$(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC) $(TOOLCHAIN_EXTERNAL_CFLAGS))"; \ + ARCH_SUBDIR=`basename $${ARCH_SYSROOT_DIR}`; \ + ln -snf . $(STAGING_DIR)/$${ARCH_SUBDIR} +endef + ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM201305),y) TOOLCHAIN_EXTERNAL_SITE = http://sourcery.mentor.com/public/gnu_toolchain/arm-none-linux-gnueabi TOOLCHAIN_EXTERNAL_SOURCE = arm-2013.05-24-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2 @@ -284,6 +296,11 @@ else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_LINARO_ARMEB),y) TOOLCHAIN_EXTERNAL_SITE = http://releases.linaro.org/14.09/components/toolchain/binaries TOOLCHAIN_EXTERNAL_SOURCE = gcc-linaro-armeb-linux-gnueabihf-4.9-2014.09_linux.tar.xz TOOLCHAIN_EXTERNAL_POST_INSTALL_STAGING_HOOKS += TOOLCHAIN_EXTERNAL_LINARO_ARMEBHF_SYMLINK +else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS201506),y) +TOOLCHAIN_EXTERNAL_SITE = http://codescape-mips-sdk.imgtec.com/components/toolchain/2015.06-03 +TOOLCHAIN_EXTERNAL_SOURCE = Codescape.GNU.Tools.Package.2015.06-03.for.MIPS.MTI.Linux.CentOS-5.x86.tar.gz +TOOLCHAIN_EXTERNAL_STRIP_COMPONENTS = 2 +TOOLCHAIN_EXTERNAL_POST_INSTALL_STAGING_HOOKS += TOOLCHAIN_EXTERNAL_CODESCAPE_MIPS_SYMLINK else ifeq ($(BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS201405),y) TOOLCHAIN_EXTERNAL_SITE = http://sourcery.mentor.com/public/gnu_toolchain/mips-linux-gnu TOOLCHAIN_EXTERNAL_SOURCE = mips-2014.05-27-mips-linux-gnu-i686-pc-linux-gnu.tar.bz2