diff options
author | Piotr Kubaj <pkubaj@FreeBSD.org> | 2020-12-06 19:41:43 +0000 |
---|---|---|
committer | Piotr Kubaj <pkubaj@FreeBSD.org> | 2020-12-06 19:41:43 +0000 |
commit | 2ddf2a38cc565b6b0dde4ebe3552f4f35531a337 (patch) | |
tree | cb0be4284e63ed901db9485fd05e921f7f1e675b /databases/mariadb105-server/files/patch-mysys_crc32_crc32c.cc | |
parent | math/arb: Update 2.18.1 -> 2.19.0 (diff) |
databases/mariadb105-server: fix build on powerpc64
Add powerpc64 as an alternative to ppc64.
Fix crc32c the same way it was fixed already for databases/rocksdb.
Approved by: tier 2 blanket
MFH: 2020Q4
Diffstat (limited to 'databases/mariadb105-server/files/patch-mysys_crc32_crc32c.cc')
-rw-r--r-- | databases/mariadb105-server/files/patch-mysys_crc32_crc32c.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/databases/mariadb105-server/files/patch-mysys_crc32_crc32c.cc b/databases/mariadb105-server/files/patch-mysys_crc32_crc32c.cc new file mode 100644 index 000000000000..68eb0a285ef8 --- /dev/null +++ b/databases/mariadb105-server/files/patch-mysys_crc32_crc32c.cc @@ -0,0 +1,24 @@ +--- mysys/crc32/crc32c.cc.orig 2020-12-06 15:58:40 UTC ++++ mysys/crc32/crc32c.cc +@@ -475,6 +475,21 @@ static int arch_ppc_probe(void) { + + return arch_ppc_crc32; + } ++#elif __FreeBSD__ ++#include <machine/cpu.h> ++#include <sys/auxv.h> ++#include <sys/elf_common.h> ++static int arch_ppc_probe(void) { ++ unsigned long cpufeatures; ++ arch_ppc_crc32 = 0; ++ ++#if defined(__powerpc64__) ++ elf_aux_info(AT_HWCAP2, &cpufeatures, sizeof(cpufeatures)); ++ if (cpufeatures & PPC_FEATURE2_HAS_VEC_CRYPTO) arch_ppc_crc32 = 1; ++#endif /* __powerpc64__ */ ++ ++ return arch_ppc_crc32; ++} + #endif // __linux__ + + static bool isAltiVec() { |