[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#915046: mariadb-10.3: Please build with -latomic where necessary

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


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

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

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

 int main()
  long long int var= 1;
  long long int *ptr= &var;
  return (int)__atomic_load_n(ptr, __ATOMIC_SEQ_CST);

Trying to build this code on ppc64 works fine:

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

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

root@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@kapitsa:~# g++ cpp11test.cpp -o cpp11test -latomic

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


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

Reply to: