Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Romain Naour <romain.naour@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2 2/2] toolchain-external: move the sysroot toolchain support check to helper function
Date: Mon, 1 Feb 2016 14:43:45 +0100	[thread overview]
Message-ID: <56AF6111.8030201@gmail.com> (raw)
In-Reply-To: <1454334017-12326-2-git-send-email-romain.naour@gmail.com>

Hi All,

Le 01/02/2016 14:40, Romain Naour a ?crit :
> The sysroot toolchain support check is duplicated at tree location in the
> external toolchain infra. So move it inside the check_unusable_toolchain helper
> that is called when the sysroot is copied to staging directory.
> 
> Signed-off-by: Romain Naour <romain.naour@gmail.com>
> Cc: "Yann E. MORIN" <yann.morin.1998@free.fr>
> ---
> v2: new patch
> ---
>  toolchain/helpers.mk                               |  4 ++++
>  toolchain/toolchain-external/toolchain-external.mk | 14 +-------------
>  2 files changed, 5 insertions(+), 13 deletions(-)
> 
> diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk
> index fd99efe..add433a 100644
> --- a/toolchain/helpers.mk
> +++ b/toolchain/helpers.mk
> @@ -423,6 +423,10 @@ check_unusable_toolchain = \
>  	if test "$${non_existent_sysroot}" = "libc.a" ; then \
>  		echo "Unable to detect the toolchain sysroot, Buildroot cannot handle this toolchain." ; \
>  		exit 1 ; \
> +	fi ; \
> +	sysroot_dir="$(call toolchain_find_sysroot,$(__CROSS_CC))" ; \
> +	if test -z "$${sysroot_dir}" ; then \
> +		echo "External toolchain doesn't support --sysroot. Cannot use." ; \

oops, missing:

exit 1 ; \

Sorry.

Best regards,
Romain
>  	fi
>  
>  #
> diff --git a/toolchain/toolchain-external/toolchain-external.mk b/toolchain/toolchain-external/toolchain-external.mk
> index 518afd6..5ad6309 100644
> --- a/toolchain/toolchain-external/toolchain-external.mk
> +++ b/toolchain/toolchain-external/toolchain-external.mk
> @@ -467,17 +467,13 @@ $$(printf $(call toolchain_find_libc_a,$(1)) | sed -r -e 's:.*/(usr/)?(lib(32|64
>  endef
>  
>  # Checks for an already installed toolchain: check the toolchain
> -# location, check that it supports sysroot, and then verify that it
> +# location, check that it is usable, and then verify that it
>  # matches the configuration provided in Buildroot: ABI, C++ support,
>  # kernel headers version, type of C library and all C library features.
>  define TOOLCHAIN_EXTERNAL_CONFIGURE_CMDS
>  	$(Q)$(call check_cross_compiler_exists,$(TOOLCHAIN_EXTERNAL_CC))
>  	$(Q)$(call check_unusable_toolchain,$(TOOLCHAIN_EXTERNAL_CC))
>  	$(Q)SYSROOT_DIR="$(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC))" ; \
> -	if test -z "$${SYSROOT_DIR}" ; then \
> -		@echo "External toolchain doesn't support --sysroot. Cannot use." ; \
> -		exit 1 ; \
> -	fi ; \
>  	$(call check_kernel_headers_version,\
>  		$(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC)),\
>  		$(call qstrip,$(BR2_TOOLCHAIN_HEADERS_AT_LEAST))); \
> @@ -588,10 +584,6 @@ endef
>  
>  define TOOLCHAIN_EXTERNAL_INSTALL_TARGET_LIBS
>  	$(Q)SYSROOT_DIR="$(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC))" ; \
> -	if test -z "$${SYSROOT_DIR}" ; then \
> -		@echo "External toolchain doesn't support --sysroot. Cannot use." ; \
> -		exit 1 ; \
> -	fi ; \
>  	ARCH_SYSROOT_DIR="$(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC) $(TOOLCHAIN_EXTERNAL_CFLAGS))" ; \
>  	ARCH_LIB_DIR="$(call toolchain_find_libdir,$(TOOLCHAIN_EXTERNAL_CC) $(TOOLCHAIN_EXTERNAL_CFLAGS))" ; \
>  	SUPPORT_LIB_DIR="" ; \
> @@ -633,10 +625,6 @@ endef
>  
>  define TOOLCHAIN_EXTERNAL_INSTALL_SYSROOT_LIBS
>  	$(Q)SYSROOT_DIR="$(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC))" ; \
> -	if test -z "$${SYSROOT_DIR}" ; then \
> -		@echo "External toolchain doesn't support --sysroot. Cannot use." ; \
> -		exit 1 ; \
> -	fi ; \
>  	ARCH_SYSROOT_DIR="$(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC) $(TOOLCHAIN_EXTERNAL_CFLAGS))" ; \
>  	ARCH_LIB_DIR="$(call toolchain_find_libdir,$(TOOLCHAIN_EXTERNAL_CC) $(TOOLCHAIN_EXTERNAL_CFLAGS))" ; \
>  	SUPPORT_LIB_DIR="" ; \
> 

  reply	other threads:[~2016-02-01 13:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-01 13:40 [Buildroot] [PATCH v2 1/2] toolchain-external: add a check for unsupported toolchains Romain Naour
2016-02-01 13:40 ` [Buildroot] [PATCH v2 2/2] toolchain-external: move the sysroot toolchain support check to helper function Romain Naour
2016-02-01 13:43   ` Romain Naour [this message]
2016-02-01 14:35   ` Thomas Petazzoni
2016-02-01 14:38 ` [Buildroot] [PATCH v2 1/2] toolchain-external: add a check for unsupported toolchains Thomas Petazzoni
2016-02-01 14:57   ` Romain Naour
2016-02-01 15:47     ` Thomas Petazzoni

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=56AF6111.8030201@gmail.com \
    --to=romain.naour@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox