From patchwork Sun Jun 10 16:33:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Naour X-Patchwork-Id: 927390 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="tBvsA94A"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 413hXh0HVHz9s01 for ; Mon, 11 Jun 2018 02:33:23 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 2C89487AB6; Sun, 10 Jun 2018 16:33:22 +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 FEDL1IzDzqfE; Sun, 10 Jun 2018 16:33:21 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 882BE87ABE; Sun, 10 Jun 2018 16:33:21 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 3F84D1C0186 for ; Sun, 10 Jun 2018 16:33:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 3C05322791 for ; Sun, 10 Jun 2018 16:33:20 +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 VpUkGrEMJHLM for ; Sun, 10 Jun 2018 16:33:19 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by silver.osuosl.org (Postfix) with ESMTPS id 6552822694 for ; Sun, 10 Jun 2018 16:33:19 +0000 (UTC) Received: by mail-wm0-f68.google.com with SMTP id v131-v6so12043376wma.1 for ; Sun, 10 Jun 2018 09:33:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=5jiTOFfTFtSth5wk2mOrWokGW0O0CsnLAzN+xwd9UsE=; b=tBvsA94AG9WmMXlTiR7Y+2P+iV/1SZvKXmg6YtqB16Ma+fMW179IJ9g7+tbHSlKPBQ tUicMY+hURb5r53E9YJTa/jiF5V/6MVhmUReyQjGZSrc3elx25j43IKoGudiNck3zIaO 4OTsSH8lBYEfvajBEc/vHffGZed/05cyHGpzCgfOxhM5A6oT+NR7q5LIQJ4ndmDWZcuR lDX+Fb7st6AWOGfkjHaCfqKauvW60Ke8877now6vHF2WqAnlCf9pt3MAAFpaOU7EPRxJ 1EMpFVJi/8Y2nSZ1/kvtB6SvSViNnQzZbQPvDQU0reUpQDRe+QHuCG1fP2iMvNft58kc 3esw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=5jiTOFfTFtSth5wk2mOrWokGW0O0CsnLAzN+xwd9UsE=; b=Dun0Gev8W/TynZplrPu+dJeGLwJtCmRsxIIabXF8LUFGeJMJ1AgWh4DtdGhVAhYkrp tg1x+wUO6p7tKTpu3NDEFsKafZKbqILqw9yPp/LAewUPH7ZwkKioPbB9BobMuENj4qEn EiwKGDivsWX+BO5HsRbtlakrW2rxAL2Xu8qiQkRPIPlmgeWsm3h72HS0pJeMtztTpnAV bRcTcFy6l52jviEv6RrzTMtpsIVR2XEA60McGTqHJ+FdkT7wptj7NjuuU1pvYgctLZ7f 3TX5oV8J35xnXfKNCuHm7otaUua24K2MhgFQBsUmXRbVARVeB6aDDoEJXv6ulU0Q9yVx 576A== X-Gm-Message-State: APt69E3XH3gu8L7NvLwq7acjt+FW1EUtbAERRHm8J+MeBr3wqKfhvPD0 VgOwD66gmS1ZNJ3Zua0H+ECoZ7HD X-Google-Smtp-Source: ADUXVKKSXIRa7SB3l/1gtoVSRwaxTmcuofGmmbGaPMUXYl9RBjewTinCWa96ZZ3aXxVXR673NAQWfw== X-Received: by 2002:a1c:4252:: with SMTP id p79-v6mr5933831wma.119.1528648397603; Sun, 10 Jun 2018 09:33:17 -0700 (PDT) Received: from adeos.home (2a01cb00054978001a46adb371a118d7.ipv6.abo.wanadoo.fr. [2a01:cb00:549:7800:1a46:adb3:71a1:18d7]) by smtp.gmail.com with ESMTPSA id 12-v6sm9677226wmt.19.2018.06.10.09.33.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 10 Jun 2018 09:33:17 -0700 (PDT) From: Romain Naour To: buildroot@buildroot.org Date: Sun, 10 Jun 2018 18:33:15 +0200 Message-Id: <20180610163315.6511-1-romain.naour@gmail.com> X-Mailer: git-send-email 2.14.4 Subject: [Buildroot] [PATCH RFC] toolchain-buildroot: add sanity checks X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Romain Naour , Thomas Petazzoni MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" When a Buildroot toolchain is build by the internal toolchain infrastructure, we curently don't check for toolchain features like it's done for external toolchains. As an example: On microblaze, the SSP support was unconditionally requested from the Buildroot configuration even if it was not supported by the toolchain components. See https://gitlab.com/free-electrons/toolchains-builder/issues/1 Copy all external toolchain checks to the internal toolchain using TOOLCHAIN_BUILDROOT_CONFIGURE_CMDS. Signed-off-by: Romain Naour Cc: Thomas Petazzoni --- Until now helpers.mk was only used for external toolchains. All error messages must be updated in order to remove all BR2_TOOLCHAIN_EXTERNAL_ --- .../toolchain-buildroot/toolchain-buildroot.mk | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/toolchain/toolchain-buildroot/toolchain-buildroot.mk b/toolchain/toolchain-buildroot/toolchain-buildroot.mk index b30cc332d2..3fc4f37e39 100644 --- a/toolchain/toolchain-buildroot/toolchain-buildroot.mk +++ b/toolchain/toolchain-buildroot/toolchain-buildroot.mk @@ -14,4 +14,35 @@ TOOLCHAIN_BUILDROOT_DEPENDENCIES = host-gcc-final TOOLCHAIN_BUILDROOT_ADD_TOOLCHAIN_DEPENDENCY = NO +define TOOLCHAIN_BUILDROOT_CONFIGURE_CMDS + $(Q)$(call check_cross_compiler_exists,$(TARGET_CC)) + $(Q)$(call check_unusable_toolchain,$(TARGET_CC)) + $(Q)SYSROOT_DIR="$(call toolchain_find_sysroot,$(TARGET_CC))" ; \ + $(call check_kernel_headers_version,\ + $(call toolchain_find_sysroot,$(TARGET_CC)),\ + $(call qstrip,$(BR2_TOOLCHAIN_HEADERS_AT_LEAST))); \ + $(call check_gcc_version,$(TARGET_CC),\ + $(call qstrip,$(BR2_TOOLCHAIN_GCC_AT_LEAST))); \ + if test "$(BR2_arm)" = "y" ; then \ + $(call check_arm_abi,\ + "$(TARGET_CC) $(TARGET_CFLAGS)") ; \ + fi ; \ + if test "$(BR2_INSTALL_LIBSTDCPP)" = "y" ; then \ + $(call check_cplusplus,$(TARGET_CXX)) ; \ + fi ; \ + if test "$(BR2_TOOLCHAIN_HAS_FORTRAN)" = "y" ; then \ + $(call check_fortran,$(TARGET_FC)) ; \ + fi ; \ + if test "$(BR2_TOOLCHAIN_BUILDROOT_UCLIBC)" = "y" ; then \ + $(call check_uclibc,$${SYSROOT_DIR}) ; \ + elif test "$(BR2_TOOLCHAIN_BUILDROOT_MUSL)" = "y" ; then \ + $(call check_musl,\ + "$(TARGET_CC) $(TARGET_CFLAGS)",\ + $(TARGET_READELF)) ; \ + else \ + $(call check_glibc,$${SYSROOT_DIR}) ; \ + fi + $(Q)$(call check_toolchain_ssp,$(TARGET_CC)) +endef + $(eval $(virtual-package))