git: c287365d3861 - main - sysutils/openzfs-kmod: fix build on powerpc64*

From: Piotr Kubaj <pkubaj_at_FreeBSD.org>
Date: Tue, 06 Sep 2022 11:26:48 UTC
The branch main has been updated by pkubaj:

URL: https://cgit.FreeBSD.org/ports/commit/?id=c287365d38616071659aa5800616085fe0327da1

commit c287365d38616071659aa5800616085fe0327da1
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2022-09-06 11:25:50 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2022-09-06 11:26:31 +0000

    sysutils/openzfs-kmod: fix build on powerpc64*
    
    /wrkdirs/usr/ports/sysutils/openzfs-kmod/work/zfs-2d5622f5b/module/icp/algs/blake3/blake3_x86-64.c:78:28: error: implicit declaration of function 'zfs_vsx_available' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
            return (kfpu_allowed() && zfs_vsx_available());
                                      ^
    /wrkdirs/usr/ports/sysutils/openzfs-kmod/work/zfs-2d5622f5b/module/icp/algs/blake3/blake3_x86-64.c:144:28: error: implicit declaration of function 'zfs_vsx_available' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
            return (kfpu_allowed() && zfs_vsx_available());
---
 .../patch-module_icp_algs_blake3_blake3__x86-64.c    | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/sysutils/openzfs-kmod/files/patch-module_icp_algs_blake3_blake3__x86-64.c b/sysutils/openzfs-kmod/files/patch-module_icp_algs_blake3_blake3__x86-64.c
new file mode 100644
index 000000000000..1508bfec6339
--- /dev/null
+++ b/sysutils/openzfs-kmod/files/patch-module_icp_algs_blake3_blake3__x86-64.c
@@ -0,0 +1,20 @@
+--- module/icp/algs/blake3/blake3_x86-64.c.orig	2022-09-06 07:44:01 UTC
++++ module/icp/algs/blake3/blake3_x86-64.c
+@@ -74,7 +74,7 @@ static boolean_t blake3_is_sse2_supported(void)
+ {
+ #if defined(__x86_64)
+ 	return (kfpu_allowed() && zfs_sse2_available());
+-#elif defined(__PPC64__)
++#elif defined(__PPC64__) && defined(__linux__)
+ 	return (kfpu_allowed() && zfs_vsx_available());
+ #else
+ 	return (kfpu_allowed());
+@@ -140,7 +140,7 @@ static boolean_t blake3_is_sse41_supported(void)
+ {
+ #if defined(__x86_64)
+ 	return (kfpu_allowed() && zfs_sse4_1_available());
+-#elif defined(__PPC64__)
++#elif defined(__PPC64__) && defined(__linux__)
+ 	return (kfpu_allowed() && zfs_vsx_available());
+ #else
+ 	return (kfpu_allowed());