[MDEV-23892] Fails to compile on platforms that require libatomic Created: 2020-10-06  Updated: 2021-10-22  Resolved: 2021-10-22

Status: Closed
Project: MariaDB Server
Component/s: Compiling
Affects Version/s: 10.3.24
Fix Version/s: 10.3.32, 10.4.22, 10.5.13, 10.6.5, 10.7.1

Type: Bug Priority: Major
Reporter: Daniel Black Assignee: Vicențiu Ciorbaru
Resolution: Fixed Votes: 0
Labels: None
Environment:

aix / riscv64


Issue Links:
Blocks
blocks MDEV-20178 MariaDB server does not compile on AIX Closed
Duplicate
is duplicated by MDEV-24881 Compilation fails for ARMHF architect... Closed

 Description   

required by MDEV-20178 (AIX)

Risc64 - https://salsa.debian.org/mariadb-team/mariadb-10.3/blob/master/debian/patches/c11_atomics.patch

ref:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81358



 Comments   
Comment by Vicențiu Ciorbaru [ 2020-11-18 ]

Ok, some progress finally with the AIX build. This commit: https://github.com/MariaDB/server/pull/1515/commits/fc1884e45fb209e639636292ed4e9a326a015f63 makes the libatomic check unnecessary.

What I've discovered is by default, AIX compiler builds 32 bit apps, which don't have __sync_xxx_8 methods, which leads to compilation failure. Setting -maix64 will make the process succeed.

Comment by Vicențiu Ciorbaru [ 2020-11-18 ]

The patch that is now in debian should however be incorporated into MariaDB, as it solved a compilation failure for mips.

Comment by Otto Kekäläinen [ 2020-12-08 ]

Perhaps related failure on risc64:

[ 78%] Building CXX object storage/mroonga/CMakeFiles/mroonga.dir/lib/mrn_column_name.cpp.o
cd "/<<PKGBUILDDIR>>/builddir/storage/mroonga" && /usr/bin/riscv64-linux-gnu-g++  -DDBUG_TRACE -DHAVE_CONFIG_H -DMRN_GROONGA_EMBEDDED -DMRN_GROONGA_NORMALIZER_MYSQL_EMBEDDED -DMYSQL_DYNAMIC_PLUGIN -DWITH_GROONGA_NORMALIZER_MYSQL=1 -D_FILE_OFFSET_BITS=64 -Dmroonga_EXPORTS -I"/<<PKGBUILDDIR>>/wsrep-lib/include" -I"/<<PKGBUILDDIR>>/wsrep-lib/wsrep-API/v26" -I"/<<PKGBUILDDIR>>/builddir/include" -I"/<<PKGBUILDDIR>>/builddir/storage/mroonga" -I"/<<PKGBUILDDIR>>/storage/mroonga" -I"/<<PKGBUILDDIR>>/storage/mroonga/lib" -I"/<<PKGBUILDDIR>>/include" -I"/<<PKGBUILDDIR>>/sql" -I"/<<PKGBUILDDIR>>/regex" -I"/<<PKGBUILDDIR>>" -I"/<<PKGBUILDDIR>>/storage/mroonga/vendor/groonga/include"  -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -pie -fPIC -fstack-protector --param=ssp-buffer-size=4 -O3 -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -Wno-uninitialized -fno-omit-frame-pointer -D_FORTIFY_SOURCE=2 -DDBUG_OFF -Wall -Wextra -Wformat-security -Wno-format-truncation -Wno-init-self -Wno-nonnull-compare -Wno-unused-parameter -Woverloaded-virtual -Wnon-virtual-dtor -Wvla -Wwrite-strings -fPIC   -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu++11 -o CMakeFiles/mroonga.dir/lib/mrn_column_name.cpp.o -c "/<<PKGBUILDDIR>>/storage/mroonga/lib/mrn_column_name.cpp"
/usr/bin/ld: librocksdblib.a(memtable.cc.o): in function `rocksdb::SpinMutex::lock()':
./builddir/storage/rocksdb/./storage/rocksdb/rocksdb/util/mutexlock.h:117: undefined reference to `__atomic_compare_exchange_1'
/usr/bin/ld: librocksdblib.a(memtable.cc.o): in function `std::__atomic_base<bool>::compare_exchange_weak(bool&, bool, std::memory_order, std::memory_order)':
/usr/include/c++/9/bits/atomic_base.h:457: undefined reference to `__atomic_compare_exchange_1'
/usr/bin/ld: /usr/include/c++/9/bits/atomic_base.h:457: undefined reference to `__atomic_compare_exchange_1'
/usr/bin/ld: /usr/include/c++/9/bits/atomic_base.h:457: undefined reference to `__atomic_compare_exchange_1'
/usr/bin/ld: /usr/include/c++/9/bits/atomic_base.h:457: undefined reference to `__atomic_compare_exchange_1'
/usr/bin/ld: librocksdblib.a(memtable.cc.o):/usr/include/c++/9/bits/atomic_base.h:457: more undefined references to `__atomic_compare_exchange_1' follow
collect2: error: ld returned 1 exit status

Full log at https://launchpadlibrarian.net/510328436/buildlog_ubuntu-focal-riscv64.mariadb-10.5_1%3A10.5.0~ubuntu20.04.1~1607367090.7c53006b6a1+10.5_BUILDING.txt.gz

Comment by Otto Kekäläinen [ 2020-12-21 ]

Related:

Comment by Daniel Black [ 2021-01-10 ]

AIX adding -pthread to cflags is largely the same effect as #1717 so it sounds like the right way to go.

Comment by Daniel Black [ 2021-04-15 ]

pthread pushed to 10.3

Will process https://github.com/MariaDB/server/pull/1716 the libatomic bit next.

Generated at Thu Feb 08 09:25:51 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.