svn commit: r554729 - in head/databases/galera26: . files
Mikael Urankar
mikael at FreeBSD.org
Mon Nov 9 15:59:43 UTC 2020
Author: mikael
Date: Mon Nov 9 15:59:42 2020
New Revision: 554729
URL: https://svnweb.freebsd.org/changeset/ports/554729
Log:
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)
Added:
head/databases/galera26/files/patch-galerautils_SConscript (contents, props changed)
head/databases/galera26/files/patch-galerautils_src_gu__byteswap.h (contents, props changed)
head/databases/galera26/files/patch-galerautils_src_gu__crc32c__arm64.c (contents, props changed)
Modified:
head/databases/galera26/Makefile
Modified: head/databases/galera26/Makefile
==============================================================================
--- head/databases/galera26/Makefile Mon Nov 9 15:28:13 2020 (r554728)
+++ head/databases/galera26/Makefile Mon Nov 9 15:59:42 2020 (r554729)
@@ -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
Added: head/databases/galera26/files/patch-galerautils_SConscript
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/databases/galera26/files/patch-galerautils_SConscript Mon Nov 9 15:59:42 2020 (r554729)
@@ -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);
Added: head/databases/galera26/files/patch-galerautils_src_gu__byteswap.h
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/databases/galera26/files/patch-galerautils_src_gu__byteswap.h Mon Nov 9 15:59:42 2020 (r554729)
@@ -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
Added: head/databases/galera26/files/patch-galerautils_src_gu__crc32c__arm64.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/databases/galera26/files/patch-galerautils_src_gu__crc32c__arm64.c Mon Nov 9 15:59:42 2020 (r554729)
@@ -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.");
More information about the svn-ports-all
mailing list