From patchwork Sat Nov 21 16:24:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: dftxbs3e X-Patchwork-Id: 25250 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 6303A27BBF7; Sat, 21 Nov 2020 16:25:10 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 9709727BBF6 for ; Sat, 21 Nov 2020 16:25:09 +0000 (GMT) Received: from localhost ([::1]:51636 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kgVhE-000432-ND for patchwork@mira.cbaines.net; Sat, 21 Nov 2020 11:25:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41114) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kgVh8-00042w-IE for guix-patches@gnu.org; Sat, 21 Nov 2020 11:25:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:34438) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kgVh8-0001EE-9t for guix-patches@gnu.org; Sat, 21 Nov 2020 11:25:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kgVh8-00031b-5I for guix-patches@gnu.org; Sat, 21 Nov 2020 11:25:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#44778] [PATCH] gnu: libffi: Add unreleased patch to fix float128 on powerpc64le. Resent-From: dftxbs3e Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 21 Nov 2020 16:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 44778 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 44778@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.160597589211606 (code B ref -1); Sat, 21 Nov 2020 16:25:01 +0000 Received: (at submit) by debbugs.gnu.org; 21 Nov 2020 16:24:52 +0000 Received: from localhost ([127.0.0.1]:45984 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kgVgu-000314-LZ for submit@debbugs.gnu.org; Sat, 21 Nov 2020 11:24:52 -0500 Received: from lists.gnu.org ([209.51.188.17]:51032) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kgVgm-00030p-JT for submit@debbugs.gnu.org; Sat, 21 Nov 2020 11:24:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40946) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kgVgm-00041y-DV for guix-patches@gnu.org; Sat, 21 Nov 2020 11:24:40 -0500 Received: from smtp5-g21.free.fr ([2a01:e0c:1:1599::14]:36118) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kgVgh-0001A2-Od for guix-patches@gnu.org; Sat, 21 Nov 2020 11:24:40 -0500 Received: from 2a01cb08026ce9001b80128993b94ecf.ipv6.abo.wanadoo.fr (unknown [IPv6:2a01:cb08:26c:e900:1b80:1289:93b9:4ecf]) (Authenticated sender: dftxbs3e) by smtp5-g21.free.fr (Postfix) with ESMTPSA id 47C4F5FFC6 for ; Sat, 21 Nov 2020 17:24:31 +0100 (CET) Message-ID: From: dftxbs3e Date: Sat, 21 Nov 2020 17:24:30 +0100 User-Agent: Evolution 3.38.1 (3.38.1-1.fc33) MIME-Version: 1.0 Received-SPF: none client-ip=2a01:e0c:1:1599::14; envelope-from=dftxbs3e@free.fr; helo=smtp5-g21.free.fr X-Spam_score_int: 6 X-Spam_score: 0.6 X-Spam_bar: / X-Spam_report: (0.6 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FROM=0.001, HK_RANDOM_ENVFROM=0.001, HK_RANDOM_FROM=0.999, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, SPOOFED_FREEMAIL=1.492 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Hello, Merging this and https://issues.guix.gnu.org/38459 onto master allows to successfully build bootstrap-tarballs for powerpc64le-linux-gnu using the command: $ guix build --target=powerpc64le-linux-gnu bootstrap-tarballs This patch can be removed when libffi releases the next version (probably 3.4). Thank you From e195e9e9fe0409dd4b76cac87244cb2b5d7636e0 Mon Sep 17 00:00:00 2001 From: John Doe Date: Sat, 21 Nov 2020 17:06:07 +0100 Subject: [PATCH] gnu: libffi: Add unreleased patch to fix float128 on powerpc64le. Patch fetched from https://github.com/libffi/libffi/pull/561.patch --- gnu/local.mk | 3 +- gnu/packages/libffi.scm | 1 + .../patches/libffi-float128-powerpc64le.patch | 58 +++++++++++++++++++ 3 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/libffi-float128-powerpc64le.patch diff --git a/gnu/local.mk b/gnu/local.mk index 35369063f1..f4a43982cc 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1731,7 +1731,8 @@ dist_patch_DATA = \ %D%/packages/patches/xsane-support-ipv6.patch \ %D%/packages/patches/xsane-tighten-default-umask.patch \ %D%/packages/patches/yggdrasil-extra-config.patch \ - %D%/packages/patches/zziplib-CVE-2018-16548.patch + %D%/packages/patches/zziplib-CVE-2018-16548.patch \ + %D%/packages/patches/libffi-float128-powerpc64le.patch MISC_DISTRO_FILES = \ %D%/packages/ld-wrapper.in diff --git a/gnu/packages/libffi.scm b/gnu/packages/libffi.scm index d324892330..f6e2efabe0 100644 --- a/gnu/packages/libffi.scm +++ b/gnu/packages/libffi.scm @@ -48,6 +48,7 @@ (uri (string-append "ftp://sourceware.org/pub/libffi/" name "-" version ".tar.gz")) + (patches (search-patches "libffi-float128-powerpc64le.patch")) (sha256 (base32 "0mi0cpf8aa40ljjmzxb7im6dbj45bb0kllcd09xgmp834y9agyvj")))) diff --git a/gnu/packages/patches/libffi-float128-powerpc64le.patch b/gnu/packages/patches/libffi-float128-powerpc64le.patch new file mode 100644 index 0000000000..4fd32b0102 --- /dev/null +++ b/gnu/packages/patches/libffi-float128-powerpc64le.patch @@ -0,0 +1,58 @@ +From de93adfb6f48100946bba2c3abad2a77a0cfde0b Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Sun, 24 Nov 2019 09:52:01 +0100 +Subject: [PATCH] ffi_powerpc.h: fix build failure with powerpc7 + +This is a patch pulled down from the following: +https://github.com/buildroot/buildroot/blob/78926f610b1411b03464152472fd430012deb9ac/package/libffi/0004-ffi_powerpc.h-fix-build-failure-with-powerpc7.patch + +This issue is being hit on OpenBMC code when pulling the latest +libffi tag and building on a P8 ppc64le machine. I verified this +patch fixes the issue we are seeing. + +Below is the original commit message: + +Sicne commit 73dd43afc8a447ba98ea02e9aad4c6898dc77fb0, build on powerpc7 +fails on: + +In file included from ../src/powerpc/ffi.c:33:0: +../src/powerpc/ffi_powerpc.h:61:9: error: '_Float128' is not supported on this target + typedef _Float128 float128; + ^~~~~~~~~ + +Fix this build failure by checking for __HAVE_FLOAT128 before using +_Float128, as _Float128 is enabled only on specific conditions, see +output/host/powerpc64-buildroot-linux-gnu/sysroot/usr/include/bits/floatn.h: + + /* Defined to 1 if the current compiler invocation provides a + floating-point type with the IEEE 754 binary128 format, and this glibc + includes corresponding *f128 interfaces for it. */ + #if defined _ARCH_PWR8 && defined __LITTLE_ENDIAN__ && (_CALL_ELF == 2) \ + && defined __FLOAT128__ && !defined __NO_LONG_DOUBLE_MATH + # define __HAVE_FLOAT128 1 + #else + # define __HAVE_FLOAT128 0 + #endif + +Fixes: + - http://autobuild.buildroot.org/results/5c9dd8fb3b6a128882b6250f197c80232d8a3b53 + +Signed-off-by: Fabrice Fontaine +Signed-off-by: Andrew Geissler +--- + src/powerpc/ffi_powerpc.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/powerpc/ffi_powerpc.h b/src/powerpc/ffi_powerpc.h +index 8e2f2f0e..960a5c42 100644 +--- a/src/powerpc/ffi_powerpc.h ++++ b/src/powerpc/ffi_powerpc.h +@@ -57,7 +57,7 @@ typedef union + double d; + } ffi_dblfl; + +-#if defined(__FLOAT128_TYPE__) ++#if defined(__FLOAT128_TYPE__) && defined(__HAVE_FLOAT128) + typedef _Float128 float128; + #elif defined(__FLOAT128__) + typedef __float128 float128; -- 2.29.2