All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 6/6 RFC] Add support for MIPS Codescape MTI GNU Linux toolchain
Date: Thu, 3 Sep 2015 15:06:25 +0100	[thread overview]
Message-ID: <55E853E1.8060006@imgtec.com> (raw)
In-Reply-To: <8ea8baf0059c895f8df15fca5d3b9b70d41f7b53.1441233378.git.yann.morin.1998@free.fr>

Dear Yann E. MORIN,
On 09/02/2015 11:52 PM, Yann E. MORIN wrote:
> From: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
> 
> - 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 <Vincent.Riera@imgtec.com>
> [yann.morin.1998 at free.fr: no need to specify TOOLCHAIN_EXTERNAL_BIN
>  now that we use the generic extract commands]
> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> 
> ---
> Chamges v4 -> v5:
>   - Use 2015.06-05 version instead of 2015.06-04
> 
> Changes v3 -> v4:
>   - Use 2015.06-04 version instead of 2015.06-03.
>   - Add BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
> 
> Changes v2 -> v3:
>   - Use the generic extract-commands, only define the strip level (Yann)
> ---
>  toolchain/helpers.mk                               | 12 ++++-
>  toolchain/toolchain-external/Config.in             | 52 ++++++++++++++++++++++
>  .../toolchain-external/toolchain-external.hash     |  4 ++
>  toolchain/toolchain-external/toolchain-external.mk | 17 +++++++
>  4 files changed, 84 insertions(+), 1 deletion(-)
> 
> diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk
> index 85a9407..9fa831d 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 e7aed2e..56ae84a 100644
> --- a/toolchain/toolchain-external/Config.in
> +++ b/toolchain/toolchain-external/Config.in
> @@ -195,6 +195,57 @@ 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
> +	select BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
> +	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
> @@ -943,6 +994,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..247833c 100644
> --- a/toolchain/toolchain-external/toolchain-external.hash
> +++ b/toolchain/toolchain-external/toolchain-external.hash
> @@ -55,6 +55,10 @@ 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-04/
> +sha256 f2d12dde626b750987d37ba6c73c6e11839850add94b0d4e4cf77917c1b0944f  Codescape.GNU.Tools.Package.2015.06-05.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 6bc2fdc..bd45cbb 100644
> --- a/toolchain/toolchain-external/toolchain-external.mk
> +++ b/toolchain/toolchain-external/toolchain-external.mk
> @@ -263,6 +263,18 @@ define TOOLCHAIN_EXTERNAL_BLACKFIN_UCLIBC_EXTRA_EXTRACT
>  		$(TAR) --strip-components=3 --hard-dereference -C $(@D) $(TAR_OPTIONS) -
>  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
> @@ -294,6 +306,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-05
> +TOOLCHAIN_EXTERNAL_SOURCE = Codescape.GNU.Tools.Package.2015.06-05.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
> 

Reviewed-by: Vicente Olivert Riera <Vincent.Riera@imgtec.org>
Tested-by: Vicente Olivert Riera <Vincent.Riera@imgtec.org>

I have applied the complete series and then built a rootfs using this
toolchain, and everything went fine. I don't know if I have to add my
"reviewed" and "tested" tags to every patch in the series...

Regards,

Vincent.

  reply	other threads:[~2015-09-03 14:06 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-02 22:51 [Buildroot] [PATCH 0/6 RFC] toolchain/external: use generic extract commands (branch yem/extract-cmds) Yann E. MORIN
2015-09-02 22:51 ` [Buildroot] [PATCH 1/6 RFC] core/pkg-generic: allow packages to exclude files when extracting Yann E. MORIN
2015-10-03 14:46   ` Romain Naour
2015-09-02 22:51 ` [Buildroot] [PATCH 2/6 RFC] core/pkg-generic: always dereference hardlinks from archives Yann E. MORIN
2015-09-02 22:51 ` [Buildroot] [PATCH 3/6 RFC] package/gcc: use generic extract commands Yann E. MORIN
2015-10-03 14:49   ` Romain Naour
2015-09-02 22:51 ` [Buildroot] [PATCH 4/6 RFC] toolchain/external: use generic extract commands (!blackfin case) Yann E. MORIN
2015-10-03 14:55   ` Romain Naour
2015-09-02 22:51 ` [Buildroot] [PATCH 5/6 RFC] toolchain/external: use generic extract commands (blackfin case) Yann E. MORIN
2015-10-03 14:55   ` Romain Naour
2015-09-02 22:52 ` [Buildroot] [PATCH 6/6 RFC] Add support for MIPS Codescape MTI GNU Linux toolchain Yann E. MORIN
2015-09-03 14:06   ` Vicente Olivert Riera [this message]
2015-10-03 14:58   ` Romain Naour
2015-10-03 13:31 ` [Buildroot] [PATCH 0/6 RFC] toolchain/external: use generic extract commands (branch yem/extract-cmds) Romain Naour
2015-10-03 14:06   ` Arnout Vandecappelle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55E853E1.8060006@imgtec.com \
    --to=vincent.riera@imgtec.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.