The Galera26 port for compiling on ARM64/Aarch64 is only missing a single function call to make it work. I pulled this out of sys/x86/include/endian.h #define __bswap64_gen(x) \ (((__uint64_t)__bswap32((x) & 0xffffffff) << 32) | __bswap32((x) >> 32)) static __inline __uint64_t __bswap64_var(__uint64_t _x) { return (__bswap64_gen(_x)); } After this, Galera26 compiles just fine on ARM. Next up, the MariaDB ports need a small fix as well. They're missing the wasrep_ shell scripts due to the following in databases/mariadb10x-sever/Makefile .if ${ARCH} != amd64 PLIST_SUB+= WSREP="@comment " .endif With this, I now have a Galera cluster up and running across 3 ARM VMs.
Hi, Please submit Galera fix upstream, https://github.com/codership/galera seems to be upstream repo. Best regards Daniel
In this particular case, the "upstream" I think is actually FreeBSD itself. The missing function is defined in the FreeBSD source tree for i386, amd64, and other platforms, but missing for arm and arm64. This was noted in my initial report showing that I pulled in the copy from i386, which made this port functional in arm64.
Created attachment 219152 [details] v1 Can you try this patch?
Created attachment 219153 [details] v2 with hwcap fix
(In reply to Vincent Milum Jr from comment #0) can you open another pr for mariadb please?
(In reply to Mikael Urankar from comment #4) Applied the patch, compiled cleanly, and am now running it on my test aarch64 cluster. As a side note, did a rolling upgrade from my 26.4.5 patch to your 26.4.6 patch without taking the cluster offline. All worked exactly as expected. :)
While I think its good to try to get upstream support, I'm going to once again reiterate that the missing functionality (64-bit byte swapping) is something that should be provided by the main FreeBSD source tree. I'm running into issues with other ports now that have similar endian/byte swapping functions missing. Please compare these two files https://github.com/freebsd/freebsd/blob/master/sys/x86/include/endian.h https://github.com/freebsd/freebsd/blob/master/sys/arm64/include/endian.h Correcting this in the FreeBSD source tree itself for arm64, getting its endian support up to date with x86 targets, will enable a number of ports beyond just databases/galera26 to start working.
(In reply to Vincent Milum Jr from comment #7) Do you have a phabricator account? Can you provide a patch and add the aarch64 group? Do you have a list of affected ports? We'll have to patch them anyway to support FreeBSD < 13.x
A commit references this bug: Author: mikael Date: Mon Nov 9 15:59:43 UTC 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) Changes: head/databases/galera26/Makefile head/databases/galera26/files/patch-galerautils_SConscript head/databases/galera26/files/patch-galerautils_src_gu__byteswap.h head/databases/galera26/files/patch-galerautils_src_gu__crc32c__arm64.c
Committed Nov 9 15:59:43 UTC 2020.