From patchwork Wed Apr 27 20:15:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Naour X-Patchwork-Id: 615804 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id 3qwB6340RTz9t6M for ; Thu, 28 Apr 2016 06:15:23 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=jj7S51gI; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id BD6338C386; Wed, 27 Apr 2016 20:15:22 +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 NGQKA3vQDeju; Wed, 27 Apr 2016 20:15:16 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 40D008C493; Wed, 27 Apr 2016 20:15:15 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id D582D1C0F9E for ; Wed, 27 Apr 2016 20:15:12 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id D1F188A9DB for ; Wed, 27 Apr 2016 20:15:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LwpQZVoQK5g1 for ; Wed, 27 Apr 2016 20:15:11 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by hemlock.osuosl.org (Postfix) with ESMTPS id 84D1E8A9DA for ; Wed, 27 Apr 2016 20:15:11 +0000 (UTC) Received: by mail-wm0-f66.google.com with SMTP id w143so16353403wmw.3 for ; Wed, 27 Apr 2016 13:15:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=WOweeaMs/IG0c3XShqNozQb5yw9CGkzI/TvJAkBqHjw=; b=jj7S51gI/03UpkIV/KhrruUootJdbOP68lUIYBPXc0K967EikTwfjQ61BOU6sdZsaM 5LnmaIIC+L0ap9qZu0o0xswa/Lk6QpES1aCPg6VmfIwm7FI6d6bC5Jl1z4sktfMCyMx0 LCp0nGcY84V2tonvK2o+8my4xLUf3iRnJ1WjjqFJnzTMNK9jhfev/FdpJ9/VFLObmykz /jYxmFnMh9BSPnbtALGIPJnfQZ709Wzw6V5w1nw/chneeD+EsUzmAeNNj+W37cAlkCVB tEoweVWbdkliRccRRru1yrEepZFa+QUcpXEiZK6/cXJBq2viLvcYPQyxWZZ8671k+nbu e8wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=WOweeaMs/IG0c3XShqNozQb5yw9CGkzI/TvJAkBqHjw=; b=KMG4Lbe0HLEluru7hlLaprNq5UCCfEhv/FKBYxe1pF3Hng1yYt54/jKjTTd157FnVD 4NVDrPsCGBbag1m5iGARLEUI4rR/nZ2X9ZQSNunWowi1xhFntoyiUu/R9Gj04Kg07LBe VkawCPPhPTiOvvRNl8P0vLZW+M6t1TCvoRHvHwFt6YTrcUQ7j+usxM909dP7WbVjOGTk qt63HCIhgbDLfPYc9UXbLfNvHugvfAhk1duktKuXvksbWht8tXAp5ttzG9hWsTr/Ze/V UBje9ttlTdx0oZt/AJYDT9rCtl1orhYgxCo5HarVuM3T7NVUnRdWXH/M7n7B1igmVGEc V8cw== X-Gm-Message-State: AOPr4FWGbCrPErRUfT2MVs/4nATrLUjmwdz+caVg2v2RB8nP/jR0GzA2X508gmsu5HrG7A== X-Received: by 10.28.128.143 with SMTP id b137mr25985668wmd.57.1461788110111; Wed, 27 Apr 2016 13:15:10 -0700 (PDT) Received: from adeos.localdomain (bgl93-4-82-235-219-60.fbx.proxad.net. [82.235.219.60]) by smtp.gmail.com with ESMTPSA id kz1sm5743668wjc.46.2016.04.27.13.15.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Apr 2016 13:15:09 -0700 (PDT) From: Romain Naour To: buildroot@buildroot.org Date: Wed, 27 Apr 2016 22:15:02 +0200 Message-Id: <1461788103-12163-2-git-send-email-romain.naour@gmail.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1461788103-12163-1-git-send-email-romain.naour@gmail.com> References: <1461788103-12163-1-git-send-email-romain.naour@gmail.com> Cc: Romain Naour , "Yann E. MORIN" , Thomas De Schampheleire Subject: [Buildroot] [PATCH v4 2/3] toolchain-external: move the sysroot toolchain support check to helper function 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: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" The sysroot toolchain support check is duplicated at two locations in the external toolchain infra. So move it inside the check_unusable_toolchain helper that is called when the toolchain package is configured (TOOLCHAIN_EXTERNAL_CONFIGURE_CMDS). The check in TOOLCHAIN_EXTERNAL_INSTALL_SYSROOT_LIBS can be safely removed since it's already done in check_unusable_toolchain helper. The check in TOOLCHAIN_EXTERNAL_INSTALL_TARGET_LIBS was removed by 2a87b64f8e8a832a351f8552eb032e4b18431949. Signed-off-by: Romain Naour Cc: "Yann E. MORIN" Cc: Arnout Vandecappelle (Essensium/Mind) Cc: Thomas De Schampheleire --- v4: rebase on master v3: add missing exit 1 s/$(__CROSS_CC)/$${__CROSS_CC}/ Improve commit log (ThomasP) v2: new patch --- toolchain/helpers.mk | 5 +++++ toolchain/toolchain-external/toolchain-external.mk | 10 +--------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk index 8aaad67..4548ede 100644 --- a/toolchain/helpers.mk +++ b/toolchain/helpers.mk @@ -376,6 +376,11 @@ check_unusable_toolchain = \ if test "$${libc_a_path}" = "libc.a" ; then \ echo "Unable to detect the toolchain sysroot, Buildroot cannot use 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." ; \ + exit 1 ; \ fi # diff --git a/toolchain/toolchain-external/toolchain-external.mk b/toolchain/toolchain-external/toolchain-external.mk index 2620fb8..2422b6d 100644 --- a/toolchain/toolchain-external/toolchain-external.mk +++ b/toolchain/toolchain-external/toolchain-external.mk @@ -493,17 +493,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))); \ @@ -654,10 +650,6 @@ endif 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="" ; \