From patchwork Tue Jan 16 18:50:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Schmitz X-Patchwork-Id: 861857 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="NbgWFi9o"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zLfSz6mPwz9t2l for ; Wed, 17 Jan 2018 05:51:31 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 8324A88E18; Tue, 16 Jan 2018 18:51:28 +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 FdutefFAIbTM; Tue, 16 Jan 2018 18:51:27 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id F1C0388D32; Tue, 16 Jan 2018 18:51:26 +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 2C9EF1C2648 for ; Tue, 16 Jan 2018 18:51:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 28DC1890E9 for ; Tue, 16 Jan 2018 18:51:26 +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 6uzLZe+cRavO for ; Tue, 16 Jan 2018 18:51:24 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr0-f194.google.com (mail-wr0-f194.google.com [209.85.128.194]) by hemlock.osuosl.org (Postfix) with ESMTPS id 1189A89114 for ; Tue, 16 Jan 2018 18:50:22 +0000 (UTC) Received: by mail-wr0-f194.google.com with SMTP id o7so16321890wro.8 for ; Tue, 16 Jan 2018 10:50:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=D9wAASCyfbkMdg7SsoAjHdIgnwJBq0wkNQPMUSe+1gI=; b=NbgWFi9oa5SgfRzdnfSUZeYJK5D9KpK3o4vLphF6UTg5tIUzZjuSvaAwGHKa7z9YN/ q4TSqFC10DbQs1hu/wTigNT5oZBBPNLCxaVdrdUxYChyqPui51OIjaU/ggLkF/53AtYC PB+M4GekPvAEgYcKtxN0OGe0yHDM/DnIfYoM3iWKiepG2Hp2KUYOicH/bA6ayfKA62gt AsBUyHWNCMLx/5pFghS2BBLwC+ebuy3Eiwj1/HgqL9RPvO6+t1xMa/fHlo0yKuFkbBMm oTSxJkL61mzIAuJGyAHgn/wUE1uorHnn1oaWXWGHXsiMTQne3GVMX2a7gxv8diqoQKrZ 4ZWg== 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=D9wAASCyfbkMdg7SsoAjHdIgnwJBq0wkNQPMUSe+1gI=; b=dwNCO87xIjGjVa3kgVJ0Wle44gQCaONLQBBVlk3v5HhA/EUqlhGzQ0b3oQO6IMVp5b WrO8IRSVcmEf5QhdH62NG121sw4N4l7N4ej4qV0Z9qH+tiE+9m00+NZkA3ML+qeLjXCA GrBpvez9Sdlg6J+9o2e3WkmLloWwxlRN78ySe18vC18TB0kvrFYg+yWuCubm4g89mEwY vYUpkRXwWNIlcp9zNx7DWEr1QRCdX+DpH8J7k6Xw/ci4U/urPaDvvQGPW/eJqSDHa4lf j4KGnFs1tgU8AlafHZmpyFfnLM7KK50HkcfVBGlE0SvR/qVpUfwK2HRdiXiCBzpUjG5c WsOQ== X-Gm-Message-State: AKwxytfAOcsisgM8RyHRiXzcW/T4X49PyJmr0tFEJN0MoB7YI5Oc8N0X I6FU5pZHS3oZ76Q350Ude6BUaIqe X-Google-Smtp-Source: ACJfBotnLvHQLmA/81BQtJ29AzzBOJxIq42g/A0F810pPbCvQNO+K3HOme9LdffwD8RS97tFXGoPGQ== X-Received: by 10.223.151.20 with SMTP id r20mr189752wrb.24.1516128620030; Tue, 16 Jan 2018 10:50:20 -0800 (PST) Received: from metis.ti.rwth-aachen.de (metis.ti.rwth-aachen.de. [134.130.35.68]) by smtp.gmail.com with ESMTPSA id a6sm2938668wma.7.2018.01.16.10.50.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 16 Jan 2018 10:50:19 -0800 (PST) From: Johannes Schmitz To: buildroot@buildroot.org Date: Tue, 16 Jan 2018 19:50:16 +0100 Message-Id: <1516128616-20127-1-git-send-email-johannes.schmitz1@gmail.com> X-Mailer: git-send-email 2.7.4 Subject: [Buildroot] [PATCH 1/1] toolchain: use -ffp-contract=off on MIPS in the wrapper when needed 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: thomas.petazzoni@free-electrons.com, Johannes Schmitz MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This fix is necessary for to build for MIPS, for example for the MIPS XBurst architecture used on ci20 boards. GCC has replaced (no)mfused-madd with ffp-contract. Find more details and a long discussion at https://gcc.gnu.org/ml/gcc-patches/2015-06/msg00876.html Signed-off-by: Johannes Schmitz Tested-by: Ezequiel Garcia --- toolchain/toolchain-wrapper.c | 10 ++++++++-- toolchain/toolchain-wrapper.mk | 6 +++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/toolchain/toolchain-wrapper.c b/toolchain/toolchain-wrapper.c index 2928ea4..dd3a25e 100644 --- a/toolchain/toolchain-wrapper.c +++ b/toolchain/toolchain-wrapper.c @@ -79,8 +79,14 @@ static char *predef_args[] = { #ifdef BR_OMIT_LOCK_PREFIX "-Wa,-momit-lock-prefix=yes", #endif -#ifdef BR_NO_FUSED_MADD - "-mno-fused-madd", +#ifdef BR2_TOOLCHAIN_GCC_AT_LEAST_4_6 + #ifdef BR_FP_CONTRACT_OFF + "-ffp-contract=off", + #endif +#else + #ifdef BR_NO_FUSED_MADD + "-mno-fused-madd", + #endif #endif #ifdef BR_BINFMT_FLAT "-Wl,-elf2flt", diff --git a/toolchain/toolchain-wrapper.mk b/toolchain/toolchain-wrapper.mk index 7f72a0c..b7a4b9b 100644 --- a/toolchain/toolchain-wrapper.mk +++ b/toolchain/toolchain-wrapper.mk @@ -28,7 +28,11 @@ endif # Avoid FPU bug on XBurst CPUs ifeq ($(BR2_mips_xburst),y) -TOOLCHAIN_WRAPPER_ARGS += -DBR_NO_FUSED_MADD + ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_4_6),y) + TOOLCHAIN_WRAPPER_ARGS += -DBR_FP_CONTRACT_OFF + else + TOOLCHAIN_WRAPPER_ARGS += -DBR_NO_FUSED_MADD + endif endif ifeq ($(BR2_CCACHE_USE_BASEDIR),y)