FreeBSD Bugzilla – Attachment 231777 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]
Patch for ARM64 CRC code
patch-storage_innobase_ut_crc32.cc (text/plain), 2.46 KB, created by
Daniel O'Connor
on 2022-02-12 23:33:24 UTC
(
hide
)
Description:
Patch for ARM64 CRC code
Filename:
MIME Type:
Creator:
Daniel O'Connor
Created:
2022-02-12 23:33:24 UTC
Size:
2.46 KB
patch
obsolete
>--- storage/innobase/ut/crc32.cc.orig 2022-02-12 11:34:14.081122000 +0000 >+++ storage/innobase/ut/crc32.cc 2022-02-12 11:34:30.069919000 +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 >@@ -472,27 +491,47 @@ > #ifdef CRC32_ARM64_DEFAULT > MY_ATTRIBUTE((target("+crc"))) > #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 > MY_ATTRIBUTE((target("+crc"))) > #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 > MY_ATTRIBUTE((target("+crc"))) > #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 > MY_ATTRIBUTE((target("+crc"))) > #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
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