mirror of
https://git.freebsd.org/ports.git
synced 2025-07-18 17:59:20 -04:00
databases/galera26: fix build on aarch64
The __bswapXX_var macro are not available on arm*, use bswapXX instead Add cpu feature detection on arm* PR: 250664 Reported by: Vincent Milum Jr Approved by: portmgr (tier-2 blanket)
This commit is contained in:
parent
528f8f7211
commit
7a6e9183c8
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=554729
4 changed files with 50 additions and 3 deletions
|
@ -13,9 +13,6 @@ COMMENT= Synchronous multi-master replication engine
|
|||
|
||||
LICENSE= GPLv2
|
||||
|
||||
BROKEN_aarch64= fails to compile: gu_int128.h: use of undeclared identifier '__bswap64_var'
|
||||
BROKEN_armv6= fails to compile: gu_int128.h: use of undeclared identifier '__bswap64_var'
|
||||
BROKEN_armv7= fails to compile: gu_int128.h: use of undeclared identifier '__bswap64_var'
|
||||
NOT_FOR_ARCHS= i386
|
||||
# On i386 older versions of clang produce:
|
||||
# cannot compile this atomic library call yet ... __atomic_add_fetch
|
||||
|
|
12
databases/galera26/files/patch-galerautils_SConscript
Normal file
12
databases/galera26/files/patch-galerautils_SConscript
Normal file
|
@ -0,0 +1,12 @@
|
|||
--- galerautils/SConscript.orig 2020-10-27 20:24:02 UTC
|
||||
+++ galerautils/SConscript
|
||||
@@ -48,7 +48,9 @@ if not crc32c_no_hardware:
|
||||
|
||||
int main()
|
||||
{
|
||||
+ #if defined(__linux__)
|
||||
(void)getauxval(AT_HWCAP);
|
||||
+ #endif
|
||||
|
||||
(void)__crc32b(0, 0);
|
||||
(void)__crc32h(0, 0);
|
|
@ -0,0 +1,22 @@
|
|||
--- galerautils/src/gu_byteswap.h.orig 2020-10-12 06:33:51 UTC
|
||||
+++ galerautils/src/gu_byteswap.h
|
||||
@@ -54,10 +54,15 @@ static GU_FORCE_INLINE uint64_t GU_ROTL64 (uint64_t x,
|
||||
# define gu_bswap32 _OSSwapInt32
|
||||
# define gu_bswap64 _OSSwapInt64
|
||||
#elif defined(__FreeBSD__)
|
||||
-/* do not use bswapXX, because gcc44 gives old-style cast warnings */
|
||||
-# define gu_bswap16 __bswap16_var
|
||||
-# define gu_bswap32 __bswap32_var
|
||||
-# define gu_bswap64 __bswap64_var
|
||||
+# if defined(__aarch64__) || defined(__arm__)
|
||||
+# define gu_bswap16 bswap16
|
||||
+# define gu_bswap32 bswap32
|
||||
+# define gu_bswap64 bswap64
|
||||
+# else
|
||||
+# define gu_bswap16 __bswap16_var
|
||||
+# define gu_bswap32 __bswap32_var
|
||||
+# define gu_bswap64 __bswap64_var
|
||||
+# endif // __FreeBSD__
|
||||
#elif defined(__sun__)
|
||||
# define gu_bswap16 BSWAP_16
|
||||
# define gu_bswap32 BSWAP_32
|
|
@ -0,0 +1,16 @@
|
|||
--- galerautils/src/gu_crc32c_arm64.c.orig 2020-10-27 20:24:41 UTC
|
||||
+++ galerautils/src/gu_crc32c_arm64.c
|
||||
@@ -74,7 +74,13 @@ gu_crc32c_arm64(gu_crc32c_t state, const void* data, s
|
||||
gu_crc32c_func_t
|
||||
gu_crc32c_hardware()
|
||||
{
|
||||
+#if defined(__linux__)
|
||||
unsigned long int const hwcaps = getauxval(AT_HWCAP);
|
||||
+#endif
|
||||
+#if defined(__FreeBSD__)
|
||||
+ unsigned long hwcaps;
|
||||
+ elf_aux_info(AT_HWCAP, &hwcaps, sizeof(hwcaps));
|
||||
+#endif
|
||||
if (hwcaps & HWCAP_CRC32)
|
||||
{
|
||||
gu_info ("CRC-32C: using hardware acceleration.");
|
Loading…
Add table
Reference in a new issue