[debian-mysql] Bug#915046: mariadb-10.3: Please build with -latomic where necessary

John Paul Adrian Glaubitz glaubitz at physik.fu-berlin.de
Thu Nov 29 19:01:16 GMT 2018


Source: mariadb-10.3
Version: 1:10.1.37-1
Severity: normal
User: debian-powerpc at lists.debian.org
Usertags: powerpc

Hello!

On some 32-bit targets like mips or powerpc, the mariabdb-10.3 build fails
with:

 error: #error atomic ops for this platform are not implemented

This is because the test for C++11 atomics in configure.cmake fails:

CHECK_CXX_SOURCE_COMPILES("
 int main()
 {
  long long int var= 1;
  long long int *ptr= &var;
  return (int)__atomic_load_n(ptr, __ATOMIC_SEQ_CST);
 }"
HAVE_GCC_C11_ATOMICS)

Trying to build this code on ppc64 works fine:

glaubitz at redpanda:~/mariadb$ g++ cpp11test.cpp -o cpp11test
glaubitz at redpanda:~/mariadb$ ./cpp11test

On powerpc, we need -latomic otherwise the compilation fails
and HAVE_GCC_C11_ATOMICS is set to false:

root at kapitsa:~# g++ cpp11test.cpp -o cpp11test
/usr/bin/ld: /tmp/ccyivhlO.o: in function `main':
cpp11test.cpp:(.text+0x48): undefined reference to `__atomic_load_8'
collect2: error: ld returned 1 exit status
root at kapitsa:~#

root at kapitsa:~# g++ cpp11test.cpp -o cpp11test -latomic
root at kapitsa:~#

I have no idea, however, how to tell cmake here to pass -latomic, I'm
not a cmake expert.

Adrian

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz at debian.org
`. `'   Freie Universitaet Berlin - glaubitz at physik.fu-berlin.de
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



More information about the pkg-mysql-maint mailing list