From patchwork Wed Nov 9 09:25:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 692645 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tDLPc3QWPz9t5m for ; Wed, 9 Nov 2016 20:25:23 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 0E40931DA0; Wed, 9 Nov 2016 09:25:18 +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 hatLOVQpNcFS; Wed, 9 Nov 2016 09:25:12 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 101FF2EEDE; Wed, 9 Nov 2016 09:25:12 +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 EDB721C6845 for ; Wed, 9 Nov 2016 09:25:10 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id E956F914D4 for ; Wed, 9 Nov 2016 09:25:10 +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 q5Rgd9QLrCAd for ; Wed, 9 Nov 2016 09:25:09 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from lupi.sysmic.org (sysmic.org [62.210.89.17]) by whitealder.osuosl.org (Postfix) with ESMTPS id 676BC914E3 for ; Wed, 9 Nov 2016 09:25:09 +0000 (UTC) Received: from sagittea.ba_systemes.basystemes.fr (226.96.7.109.rev.sfr.net [109.7.96.226]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jezz) by lupi.sysmic.org (Postfix) with ESMTPSA id B231340D68; Wed, 9 Nov 2016 10:25:06 +0100 (CET) From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Pouiller?= To: buildroot@busybox.net Date: Wed, 9 Nov 2016 10:25:07 +0100 Message-Id: <20161109092508.4503-1-jezz@sysmic.org> X-Mailer: git-send-email 2.9.3 MIME-Version: 1.0 Cc: =?UTF-8?q?J=C3=A9r=C3=B4me=20Pouiller?= Subject: [Buildroot] [PATCH 1/2] python: fix double format detection 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" Python is not able to detect if compiler double representation is compliant with IEE754: checking whether C doubles are little-endian IEEE 754 binary64... no checking whether C doubles are big-endian IEEE 754 binary64... no checking whether C doubles are ARM mixed-endian IEEE 754 binary64... no Accordingly 'legacy' mode isused. It is possible to check this at runtime by check if 'sys.float_repr_style' contains 'short' or 'legacy'. Calculus correctness is not garanteed with 'legacy'. Problem is better described here: http://stackoverflow.com/questions/29920294/what-causes-pythons-float-repr-style-to-use-legacy https://bugs.python.org/issue7117 However, all gcc architecture use a representation compliant with IEE754. So, we can enable it unconditionnaly. Signed-off-by: Jérôme Pouiller --- package/python/python.mk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/package/python/python.mk b/package/python/python.mk index cc65376..0191d59 100644 --- a/package/python/python.mk +++ b/package/python/python.mk @@ -140,6 +140,13 @@ PYTHON_CONF_ENV += \ ac_cv_prog_HAS_HG=/bin/false \ ac_cv_prog_SVNVERSION=/bin/false +# GCC is always complient with IEEE754 +ifeq ($(call qstrip,$(BR2_ENDIAN)),LITTLE) +PYTHON_CONF_ENV += ac_cv_little_endian_double=yes +else +PYTHON_CONF_ENV += ac_cv_big_endian_double=yes +endif + PYTHON_CONF_OPTS += \ --without-cxx-main \ --without-doc-strings \