[Bug 253612] databases/galera26: Fix build on FreeBSD13

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Thu Feb 18 08:18:20 UTC 2021


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=253612

            Bug ID: 253612
           Summary: databases/galera26: Fix build on FreeBSD13
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: Individual Port(s)
          Assignee: ports-bugs at FreeBSD.org
          Reporter: devin at sevenlayer.studio
                CC: devel at galeracluster.com
             Flags: maintainer-feedback?(devel at galeracluster.com)
                CC: devel at galeracluster.com

Created attachment 222548
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=222548&action=edit
Patch to databases/galera26

galera26 is currently marked as broken on FreeBSD 13 due to __bswap_64_var
being undefined.

In the unpatched source code for galera26, in galerautils/src/gu_byteswap.h, we
have:

#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

Based on the comment, this appears to be a workaround for a problem that no
longer exists (because we don't use gcc44 anymore).  This worked by using
__bswap_xx_var which in earlier versions of FreeBSD was an implementation
detail of the bswapXX macros.  This detail no longer exists in FreeBSD 13 and
later.

The correct thing to do is simply use the bswap16, bswap32 and bswap64 macros
as provided by FreeBSD.

Later in the gu_byteswap.h file it checks for these macros and defines
accordingly:

#elif defined(bswap16)
#  define gu_bswap16 bswap16
#  define gu_bswap32 bswap32
#  define gu_bswap64 bswap64

So the easiest fix here is simply to remove any special-casing for FreeBSD in
galerautils/src/gu_byteswap.h.

Attached is a patch to update the port to do exactly this, and remove the
BROKEN_FreeBSD_13, BROKEN_FreeBSD_14, and BROKEN_riscv64 lines.

I have tested that this change allows the port to build for FreeBSD 11.4, 12.2
and 13.0 on amd64.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-ports-bugs mailing list