FreeBSD Bugzilla – Attachment 231790 Details for
Bug 261660
databases/mysql80-server: Fails to build on aarch64: innobase/ut/crc32.cc:114:10: fatal error: 'asm/hwcap.h' file not found
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Updated CRC32 patch
patch-storage_innobase_ut_crc32.cc (text/plain), 3.88 KB, created by
Daniel O'Connor
on 2022-02-13 12:22:24 UTC
(
hide
)
Description:
Updated CRC32 patch
Filename:
MIME Type:
Creator:
Daniel O'Connor
Created:
2022-02-13 12:22:24 UTC
Size:
3.88 KB
patch
obsolete
>--- /usr/ports/databases/mysql80-server/work/mysql-8.0.27/storage/innobase/ut/crc32.cc.orig 2021-09-28 11:46:34.000000000 +0000 >+++ /usr/ports/databases/mysql80-server/work/mysql-8.0.27/storage/innobase/ut/crc32.cc 2022-02-13 04:21:20.413510000 +0000 >@@ -111,7 +111,9 @@ > #endif /* CRC32_ARM64 */ > > #ifdef CRC32_ARM64_DEFAULT >+#ifndef __FreeBSD__ > #include <asm/hwcap.h> >+#endif > #include <sys/auxv.h> > #endif /* CRC32_ARM64_DEFAULT */ > >@@ -360,8 +362,25 @@ > #endif /* CRC32_ARM64_APPLE */ > > #ifdef CRC32_ARM64_DEFAULT >+#ifdef __FreeBSD__ >+bool can_use_crc32() { >+ unsigned long capabilities; >+ >+ if (elf_aux_info(AT_HWCAP, &capabilities, sizeof(unsigned long))) >+ return false; >+ return capabilities & HWCAP_CRC32; >+} >+bool can_use_poly_mul() { >+ unsigned long capabilities; >+ >+ if (elf_aux_info(AT_HWCAP, &capabilities, sizeof(unsigned long))) >+ return false; >+ return capabilities & HWCAP_CRC32; >+} >+#else > bool can_use_crc32() { return getauxval(AT_HWCAP) & HWCAP_CRC32; } > bool can_use_poly_mul() { return getauxval(AT_HWCAP) & HWCAP_PMULL; } >+#endif > #endif /* CRC32_ARM64_DEFAULT */ > > /** A helper template to statically unroll a loop with a fixed number of >@@ -470,29 +489,65 @@ > > #ifdef CRC32_ARM64 > #ifdef CRC32_ARM64_DEFAULT >+#ifdef __clang__ >+MY_ATTRIBUTE((target("crc"))) >+#else > MY_ATTRIBUTE((target("+crc"))) >+#endif > #endif /* CRC32_ARM64_DEFAULT */ >+#ifdef __FreeBSD__ >+#include <arm_acle.h> > uint32_t crc32_impl::update(uint32_t crc, unsigned char data) { >- return __crc32cb(crc, data); >+ __crc32cb(crc, data); >+ return crc; > } >+uint32_t crc32_impl::update(uint32_t crc, uint16_t data) { >+ __crc32ch(crc, data); >+ return crc; >+} >+uint32_t crc32_impl::update(uint32_t crc, uint32_t data) { >+ __crc32cw(crc, data); >+ return crc; >+} >+uint64_t crc32_impl::update(uint64_t crc, uint64_t data) { >+ __crc32cd(crc, data); >+ return crc; >+} >+#else > #ifdef CRC32_ARM64_DEFAULT >+#ifdef __clang__ >+MY_ATTRIBUTE((target("crc"))) >+#else > MY_ATTRIBUTE((target("+crc"))) >+#endif > #endif /* CRC32_ARM64_DEFAULT */ > uint32_t crc32_impl::update(uint32_t crc, uint16_t data) { >- return __crc32ch(crc, data); >+ __crc32ch(crc, data); >+ return crc; > } > #ifdef CRC32_ARM64_DEFAULT >+#ifdef __clang__ >+MY_ATTRIBUTE((target("crc"))) >+#else > MY_ATTRIBUTE((target("+crc"))) >+#endif > #endif /* CRC32_ARM64_DEFAULT */ > uint32_t crc32_impl::update(uint32_t crc, uint32_t data) { >- return __crc32cw(crc, data); >+ __crc32cw(crc, data); >+ return crc; > } > #ifdef CRC32_ARM64_DEFAULT >+#ifdef __clang__ >+MY_ATTRIBUTE((target("crc"))) >+#else > MY_ATTRIBUTE((target("+crc"))) >+#endif > #endif /* CRC32_ARM64_DEFAULT */ > uint64_t crc32_impl::update(uint64_t crc, uint64_t data) { >- return (uint64_t)__crc32cd((uint32_t)crc, data); >+ __crc32cd((uint32_t)crc, data); >+ return crc; > } >+#endif > #endif /* CRC32_ARM64 */ > > /** Implementation of polynomial_mul_rev<w>(rev_u) function which uses hardware >@@ -534,7 +589,11 @@ > } > template <uint32_t w> > #ifdef CRC32_ARM64_DEFAULT >+#ifdef __clang__ >+MY_ATTRIBUTE((target("crypto"))) >+#else > MY_ATTRIBUTE((target("+crypto"))) >+#endif > #endif /* CRC32_ARM64_DEFAULT */ > uint64_t use_pclmul::polynomial_mul_rev(uint32_t rev_u) { > constexpr uint64_t flipped_w = flip_at_32(w); >@@ -777,7 +836,11 @@ > MY_ATTRIBUTE((flatten)) > #endif /* CRC32_ARM64_APPLE */ > #ifdef CRC32_ARM64_DEFAULT >+#ifdef __clang__ >+MY_ATTRIBUTE((target("crc,crypto"))) >+#else > MY_ATTRIBUTE((target("+crc+crypto"), flatten)) >+#endif > #endif /* CRC32_ARM64_DEFAULT */ > uint32_t crc32_using_pclmul(const byte *data, size_t len) { > return crc32<use_pclmul>(0, data, len); >@@ -797,7 +860,11 @@ > MY_ATTRIBUTE((flatten)) > #endif /* CRC32_ARM64_APPLE */ > #ifdef CRC32_ARM64_DEFAULT >+#ifdef __clang__ >+MY_ATTRIBUTE((target("crc"))) >+#else > MY_ATTRIBUTE((target("+crc"), flatten)) >+#endif > #endif /* CRC32_ARM64_DEFAULT */ > uint32_t crc32_using_unrolled_loop_poly_mul(const byte *data, size_t len) { > return crc32<use_unrolled_loop_poly_mul>(0, data, len);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 261660
:
231500
|
231777
|
231790
|
231833
|
231834