From patchwork Sat Mar 5 00:52:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sergio Prado X-Patchwork-Id: 592310 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id 45654140291 for ; Sat, 5 Mar 2016 11:53:33 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=e-labworks-com.20150623.gappssmtp.com header.i=@e-labworks-com.20150623.gappssmtp.com header.b=jelHQL74; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 731D8A6408; Sat, 5 Mar 2016 00:53:32 +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 NCAKiPDvBUd3; Sat, 5 Mar 2016 00:53:31 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 3462CA63E1; Sat, 5 Mar 2016 00:53:31 +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 5AC751C11BB for ; Sat, 5 Mar 2016 00:53:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 5590791212 for ; Sat, 5 Mar 2016 00:53:29 +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 1ZGCz9QgBArj for ; Sat, 5 Mar 2016 00:53:28 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qg0-f41.google.com (mail-qg0-f41.google.com [209.85.192.41]) by whitealder.osuosl.org (Postfix) with ESMTPS id 5679888E42 for ; Sat, 5 Mar 2016 00:53:28 +0000 (UTC) Received: by mail-qg0-f41.google.com with SMTP id w104so57434403qge.1 for ; Fri, 04 Mar 2016 16:53:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=e-labworks-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Rtxdpln4tFpFoyQPFTz1n7ljVUvD4g/PfFwt+/vIKDY=; b=jelHQL74sUvL6UZLR6mjvqujz9x6KV0BY1rrG8ezeVWOCWt6pToGDBUX0rG5M6VkyR aCaa7kBvago+vYwh2824xdlX0i+/hz3ZCU4pQFk+JW/b4+P4r4IzkDH0gPXPWlVS+gCR M7jFI5OgySIxFbYbXqA5lMyclBzSILobOqTDuNO1ygCAQ2veFz+C8xkDBBPXCCuJl1Jz EyRbpRXQv2E4oTb28mQ7d2/zz8ZEqgVcssI+psPArB6ULGuaxoNtRfc8Elc3naOdukww eu0U5PUgE+hdDvzYhoJKkdxF1ypBi1OYhDBaArm7do1hLwmffHM9uQpfW0piMIK+d9PB TovA== 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:mime-version :content-transfer-encoding; bh=Rtxdpln4tFpFoyQPFTz1n7ljVUvD4g/PfFwt+/vIKDY=; b=SZXzdBGqYwGdm2seSPGns4/+RtvlND9KroOjOhQiVQ/sjw9gx88rEXqefz9ROtAvwM tvmVcdv4a2wZowDDxCgdtFflhi/Lm9R+rSe2neNsL4swp4M/BUdyVYpYykFOLmMbmM8k dodxyUdicZcLqPwAS+k950zBVeCD4ShoOc9TYauwaesn44mck8ilo1bAgAyHdjJfY8P6 eAFbH3BwfragSeRWl/amqqyiI6YQ9ElVmTF6ZS6ZYGb88CkrmbJT3YJWF0ysJ9ejMkkY 9Iydmqd3RCOwco+vAIqtT+n5XvIPbwIDUY+AwdvbV5qfTYLtXCWMc8arEoFl7x+oP85r yxuA== X-Gm-Message-State: AD7BkJI4BcJhKinu+ZaYw3g7Vo6qxJkbKQ8vqD2IIBZwbazJ/iTsH2rRtywuwd9XhZKILQ== X-Received: by 10.140.175.136 with SMTP id v130mr14759397qhv.74.1457139207418; Fri, 04 Mar 2016 16:53:27 -0800 (PST) Received: from localhost.localdomain ([177.32.209.20]) by smtp.gmail.com with ESMTPSA id q69sm2837042qki.11.2016.03.04.16.53.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 04 Mar 2016 16:53:26 -0800 (PST) From: Sergio Prado To: buildroot@buildroot.org Date: Fri, 4 Mar 2016 21:52:53 -0300 Message-Id: <1457139173-9535-1-git-send-email-sergio.prado@e-labworks.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH] dt: fix binary operation errors 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" Some GCC toolchains does not define _BSD_SOURCE when passing -D_GNU_SOURCE, and that is causing the declaration of large_t as double. In that case, GCC is complaining in some binary operations like the code below: dtgen.c:1653:59: error: invalid operands to binary % (have ‘large_t’ and ‘u_int32’) (dip->di_data_limit != INFINITY) && (dip->di_data_limit % dip->di_dsize) ) { ^ This patch adds a statement in the include file to define large_t as "long long int" when __GNUC__ is defined. Fixes: http://autobuild.buildroot.net/results/e7b803bd007c125e23eeae351acfc08628333706 http://autobuild.buildroot.net/results/72ca2970db41463435765b90c069417b8bb8a3fd http://autobuild.buildroot.net/results/22d18f0ca19898be02118c64e615ffbbb23ee46d http://autobuild.buildroot.net/results/ab50d1d4af47b026da77a81224500a4627c718ac ... Signed-off-by: Sergio Prado --- package/dt/0002-Fix-binary-operations-errors.patch | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 package/dt/0002-Fix-binary-operations-errors.patch diff --git a/package/dt/0002-Fix-binary-operations-errors.patch b/package/dt/0002-Fix-binary-operations-errors.patch new file mode 100644 index 000000000000..ed938ec98e47 --- /dev/null +++ b/package/dt/0002-Fix-binary-operations-errors.patch @@ -0,0 +1,50 @@ +From 80bbf34b032bf11647d87ea07c1a0c5cf7f87957 Mon Sep 17 00:00:00 2001 +From: Sergio Prado +Date: Fri, 4 Mar 2016 21:25:02 -0300 +Subject: [PATCH] Fix binary operations errors +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Some GCC toolchains does not define _BSD_SOURCE when passing -D_GNU_SOURCE, and that is causing the declaration of large_t as double. + +In that case, GCC is complaining in some binary operations like the code below: + +dtgen.c:1653:59: error: invalid operands to binary % (have ‘large_t’ and ‘u_int32’) + (dip->di_data_limit != INFINITY) && (dip->di_data_limit % dip->di_dsize) ) { + ^ + +So we need to add a statement to force large_t as "long long int" when __GNUC__ is defined. + +Signed-off-by: Sergio Prado +--- + common.h | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/common.h b/common.h +index 0cf9dc2145ee..a702d2d8dcff 100644 +--- a/common.h ++++ b/common.h +@@ -170,11 +170,18 @@ typedef volatile slarge_t v_slarge; + #define FUF LUF + #define FXF LXF + +-#else /* !defined(MACHINE_64BITS) && !defined(__GNUC__) */ ++#else /* !defined(MACHINE_64BITS) */ + ++#if (defined(__GNUC__)) ++#define QuadIsLongLong ++typedef unsigned long long int large_t; ++typedef signed long long int slarge_t; ++#else + #define QuadIsDouble + typedef double large_t; + typedef double slarge_t; ++#endif ++ + typedef volatile large_t v_large; + typedef volatile slarge_t v_slarge; + +-- +1.9.1 +