From patchwork Fri Jul 21 17:06:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vicente Olivert Riera X-Patchwork-Id: 792224 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xDccp1jfkz9sNw for ; Sat, 22 Jul 2017 03:06:48 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 8C60F87B13; Fri, 21 Jul 2017 17:06:46 +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 yUWoLj7WqL6A; Fri, 21 Jul 2017 17:06:45 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 61AE087AAF; Fri, 21 Jul 2017 17:06:45 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 41EB61C0146 for ; Fri, 21 Jul 2017 17:06:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 28FEA886D8 for ; Fri, 21 Jul 2017 17:06:43 +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 GjIDrKFdIZYg for ; Fri, 21 Jul 2017 17:06:42 +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 whitealder.osuosl.org (Postfix) with ESMTP id 5FD5A885F8 for ; Fri, 21 Jul 2017 17:06:42 +0000 (UTC) Received: from HHMAIL01.hh.imgtec.org (unknown [10.100.10.19]) by Forcepoint Email with ESMTPS id 0F1C57266C533 for ; Fri, 21 Jul 2017 18:06:36 +0100 (IST) Received: from vriera-linux.le.imgtec.org (192.168.154.36) by HHMAIL01.hh.imgtec.org (10.100.10.21) with Microsoft SMTP Server (TLS) id 14.3.294.0; Fri, 21 Jul 2017 18:06:40 +0100 From: Vicente Olivert Riera To: Date: Fri, 21 Jul 2017 18:06:31 +0100 Message-ID: <20170721170635.41202-1-Vincent.Riera@imgtec.com> X-Mailer: git-send-email 2.13.0 MIME-Version: 1.0 X-Originating-IP: [192.168.154.36] Subject: [Buildroot] [PATCH 1/5] arch/mips: add option for toolchains supporting -mnan 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" -mnan option was added in gcc-4.9.0 so make sure that users cannot select the NaN mode when using toolchains that have a gcc older than 4.9.0, and also make sure that the -mnan option is not passed at all to the toolchain-wrapper and target cflags. Signed-off-by: Vicente Olivert Riera --- arch/Config.in.mips | 1 + toolchain/toolchain-common.in | 4 ++++ toolchain/toolchain-external/pkg-toolchain-external.mk | 2 ++ 3 files changed, 7 insertions(+) diff --git a/arch/Config.in.mips b/arch/Config.in.mips index de71110e08..3d2dfe3f49 100644 --- a/arch/Config.in.mips +++ b/arch/Config.in.mips @@ -169,6 +169,7 @@ config BR2_MIPS_NAN_2008 choice prompt "Target NaN" + depends on BR2_TOOLCHAIN_HAS_MNAN_OPTION depends on BR2_mips_32r5 || BR2_mips_64r5 default BR2_MIPS_ENABLE_NAN_2008 help diff --git a/toolchain/toolchain-common.in b/toolchain/toolchain-common.in index 932eecac9a..0002682e12 100644 --- a/toolchain/toolchain-common.in +++ b/toolchain/toolchain-common.in @@ -342,6 +342,10 @@ config BR2_TOOLCHAIN_GCC_AT_LEAST default "4.4" if BR2_TOOLCHAIN_GCC_AT_LEAST_4_4 default "4.3" if BR2_TOOLCHAIN_GCC_AT_LEAST_4_3 +config BR2_TOOLCHAIN_HAS_MNAN_OPTION + bool + default y if BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 + config BR2_TOOLCHAIN_HAS_SYNC_1 bool default y diff --git a/toolchain/toolchain-external/pkg-toolchain-external.mk b/toolchain/toolchain-external/pkg-toolchain-external.mk index 3263199642..23cdf30b9f 100644 --- a/toolchain/toolchain-external/pkg-toolchain-external.mk +++ b/toolchain/toolchain-external/pkg-toolchain-external.mk @@ -178,10 +178,12 @@ ifneq ($(CC_TARGET_ABI_),) TOOLCHAIN_EXTERNAL_CFLAGS += -mabi=$(CC_TARGET_ABI_) TOOLCHAIN_EXTERNAL_TOOLCHAIN_WRAPPER_ARGS += -DBR_ABI='"$(CC_TARGET_ABI_)"' endif +ifeq ($(BR2_TOOLCHAIN_HAS_MNAN_OPTION),y) ifneq ($(CC_TARGET_NAN_),) TOOLCHAIN_EXTERNAL_CFLAGS += -mnan=$(CC_TARGET_NAN_) TOOLCHAIN_EXTERNAL_TOOLCHAIN_WRAPPER_ARGS += -DBR_NAN='"$(CC_TARGET_NAN_)"' endif +endif ifneq ($(CC_TARGET_FP32_MODE_),) TOOLCHAIN_EXTERNAL_CFLAGS += -mfp$(CC_TARGET_FP32_MODE_) TOOLCHAIN_EXTERNAL_TOOLCHAIN_WRAPPER_ARGS += -DBR_FP32_MODE='"$(CC_TARGET_FP32_MODE_)"'