From patchwork Tue Dec 15 09:32:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: dftxbs3e X-Patchwork-Id: 25789 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 7089E27BC04; Tue, 15 Dec 2020 09:33:13 +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=unavailable 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 A164C27BC05 for ; Tue, 15 Dec 2020 09:33:11 +0000 (GMT) Received: from localhost ([::1]:36168 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kp6hi-0000Ec-OT for patchwork@mira.cbaines.net; Tue, 15 Dec 2020 04:33:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:58376) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kp6ha-0000Cm-2o for guix-patches@gnu.org; Tue, 15 Dec 2020 04:33:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:44081) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kp6hZ-00047k-Rn for guix-patches@gnu.org; Tue, 15 Dec 2020 04:33:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kp6hZ-0006Wm-Pf for guix-patches@gnu.org; Tue, 15 Dec 2020 04:33:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#45252] [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: Tue, 15 Dec 2020 09:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 45252 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 45252@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.160802477225070 (code B ref -1); Tue, 15 Dec 2020 09:33:01 +0000 Received: (at submit) by debbugs.gnu.org; 15 Dec 2020 09:32:52 +0000 Received: from localhost ([127.0.0.1]:55627 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kp6hP-0006WH-Mm for submit@debbugs.gnu.org; Tue, 15 Dec 2020 04:32:52 -0500 Received: from lists.gnu.org ([209.51.188.17]:58482) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kp6hO-0006W8-5C for submit@debbugs.gnu.org; Tue, 15 Dec 2020 04:32:50 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:58326) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kp6hN-0000CE-Vp for guix-patches@gnu.org; Tue, 15 Dec 2020 04:32:49 -0500 Received: from smtp2-g21.free.fr ([212.27.42.2]:20544) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kp6hL-00042L-Of for guix-patches@gnu.org; Tue, 15 Dec 2020 04:32:49 -0500 Received: from [IPv6:2a01:e0a:2a2:1350:cd10:777c:7b57:3bb6] (unknown [IPv6:2a01:e0a:2a2:1350:cd10:777c:7b57:3bb6]) (Authenticated sender: dftxbs3e) by smtp2-g21.free.fr (Postfix) with ESMTPSA id A52872003E8 for ; Tue, 15 Dec 2020 10:32:42 +0100 (CET) Message-ID: <8fc771beb3f0f1e2886a238e0ef9087908c98fc1.camel@free.fr> From: dftxbs3e Date: Tue, 15 Dec 2020 10:32:42 +0100 User-Agent: Evolution 3.34.2 MIME-Version: 1.0 Received-SPF: none client-ip=212.27.42.2; envelope-from=dftxbs3e@free.fr; helo=smtp2-g21.free.fr X-Spam_score_int: -2 X-Spam_score: -0.3 X-Spam_bar: / X-Spam_report: (-0.3 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FROM=0.001, HK_RANDOM_ENVFROM=0.001, HK_RANDOM_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, SPOOFED_FREEMAIL=1.56 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! Based on previous discussions to apply < https://debbugs.gnu.org/cgi/bugreport.cgi?bug=44778> on the master branch instead I submit this new patch (attached) so that it does not cause a world rebuild by not altering the package definition hash on other platforms. Thank you! From 05c3dc588745240fb790f9a39111be70c153d70c Mon Sep 17 00:00:00 2001 From: John Doe Date: Tue, 15 Dec 2020 10:24:11 +0100 Subject: [PATCH] gnu: libffi: Add unreleased patch to fix float128 on powerpc64le. * gnu/packages/patches/libffi-float128-powerpc64le.patch: Import patch file from . * gnu/packages/libffi.scm (libffi): [arguments]: Apply patch conditionally for powerpc64le-* systems in a phase. [inputs]: Add patch as input conditionally for powerpc64le-* systems. * gnu/local.mk (dist_patch_DATA): Add patch file to build system. --- gnu/local.mk | 1 + gnu/packages/libffi.scm | 25 ++++++-- .../patches/libffi-float128-powerpc64le.patch | 58 +++++++++++++++++++ 3 files changed, 79 insertions(+), 5 deletions(-) create mode 100644 gnu/packages/patches/libffi-float128-powerpc64le.patch diff --git a/gnu/local.mk b/gnu/local.mk index 0b4cf23838..e190df0667 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1208,6 +1208,7 @@ dist_patch_DATA = \ %D%/packages/patches/julia-SOURCE_DATE_EPOCH-mtime.patch \ %D%/packages/patches/kdbusaddons-kinit-file-name.patch \ %D%/packages/patches/libffi-3.3-powerpc-fixes.patch \ + %D%/packages/patches/libffi-float128-powerpc64le.patch \ %D%/packages/patches/libvirt-create-machine-cgroup.patch \ %D%/packages/patches/libziparchive-add-includes.patch \ %D%/packages/patches/localed-xorg-keyboard.patch \ diff --git a/gnu/packages/libffi.scm b/gnu/packages/libffi.scm index d324892330..e4bfe6731b 100644 --- a/gnu/packages/libffi.scm +++ b/gnu/packages/libffi.scm @@ -57,7 +57,7 @@ ;; compiler. See "ax_cc_maxopt.m4" and "ax_gcc_archflag.m4". #:configure-flags '("--enable-portable-binary" "--without-gcc-arch") - ;; TODO: Inline patch on next rebuild cycle. + ;; TODO: Inline patches on next rebuild cycle. ,@(if (string-prefix? "powerpc-" (or (%current-target-system) (%current-system))) '(#:phases (modify-phases %standard-phases @@ -67,13 +67,28 @@ "powerpc-patch"))) (invoke "patch" "--batch" "-p1" "-i" patch)))))) + '()) + ,@(if (string-prefix? "powerpc64le-" (or (%current-target-system) + (%current-system))) + '(#:phases (modify-phases %standard-phases + (add-after 'unpack 'apply-patch2 + (lambda* (#:key inputs #:allow-other-keys) + (let ((patch (assoc-ref inputs + "powerpc64le-patch"))) + (invoke "patch" "--batch" "-p1" + "-i" patch)))))) '()))) (inputs - (if (string-prefix? "powerpc-" (or (%current-target-system) + (cond + ((string-prefix? "powerpc-" (or (%current-target-system) (%current-system))) - `(("powerpc-patch" ,@(search-patches - "libffi-3.3-powerpc-fixes.patch"))) - '())) + `(("powerpc-patch" ,@(search-patches + "libffi-3.3-powerpc-fixes.patch")))) + ((string-prefix? "powerpc64le-" (or (%current-target-system) + (%current-system))) + `(("powerpc64le-patch" ,@(search-patches + "libffi-float128-powerpc64le.patch")))) + (else '()))) (outputs '("out" "debug")) (synopsis "Foreign function call interface library") (description 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