There's a merged pull request on the void-packages repository mariadb: simplify handling of atomics/libatomic, fix ppc32 build https://github.com/void-linux/void-packages/pull/15511 Description: Platforms such as ppc32 and mips do not have the __sync builtins in gcc, which breaks compilation. However, that code is not even necessary, as proper implementations of the higher level atomic primitives are available as builtins in any modern toolchain (and definitely ours) and mariadb in fact already uses those when available. So basically ditch all this effectively dead code to fix build on those platforms. While at it, remove the wrong checks in cmake and fix properly linking against libatomic only when needed (this also affects ARMv5/6) and simplify the template. These changes have already been done upstream, but we're sticking with an older version for now because of libmysqlclient ABI compat, so fix this downstream until we can upgrade. Also add another patch for ppc/ppc64+musl to use a gcc builtin instead of a glibc extension.