[debian-mysql] Bug#933151: mariadb-10.3: FTBFS on riscv64

Aurelien Jarno aurelien at aurel32.net
Sun Jul 28 21:55:41 BST 2019


Hi,

On 2019-07-26 22:17, Otto Kekäläinen wrote:
> Package: mariadb-10.3
> X-Debbugs-CC: debian-riscv at lists.debian.org
> User: debian-riscv at lists.debian.org
> Usertags: riscv64
> 
> The version of the package currently FTBFS on the riscv64 port.
> 
> From https://buildd.debian.org/status/fetch.php?pkg=mariadb-10.3&arch=riscv64&ver=1%3A10.3.16-1&stamp=1561225015&raw=0
> 
> 
> /usr/bin/ld: librocksdblib.a(memtable.cc.o): in function `.L0 ':
> ./builddir/storage/rocksdb/./storage/rocksdb/rocksdb/util/dynamic_bloom.h:177:
> undefined reference to `__atomic_fetch_or_1'
> /usr/bin/ld: librocksdblib.a(memtable.cc.o): in function `.LVL1731':
> ./builddir/storage/rocksdb/./storage/rocksdb/rocksdb/util/dynamic_bloom.h:179:
> undefined reference to `__atomic_fetch_or_1'
> /usr/bin/ld: librocksdblib.a(memtable.cc.o): in function `SaveValue':
> ./builddir/storage/rocksdb/./storage/rocksdb/rocksdb/db/memtable.cc:596:
> undefined reference to `__atomic_compare_exchange_1'
> /usr/bin/ld: librocksdblib.a(memtable.cc.o): in function `.L0 ':
> /usr/include/c++/8/bits/atomic_base.h:434: undefined reference to
> `__atomic_compare_exchange_1'
> /usr/bin/ld: /usr/include/c++/8/bits/atomic_base.h:434: undefined
> reference to `__atomic_compare_exchange_1'
> /usr/bin/ld: /usr/include/c++/8/bits/atomic_base.h:434: undefined
> reference to `__atomic_compare_exchange_1'
> /usr/bin/ld: /usr/include/c++/8/bits/atomic_base.h:434: undefined
> reference to `__atomic_compare_exchange_1'
> /usr/bin/ld: librocksdblib.a(memtable.cc.o):/usr/include/c++/8/bits/atomic_base.h:434:
> more undefined references to `__atomic_compare_exchange_1' follow
> collect2: error: ld returned 1 exit status
> 
> If you are an RISC expert, feel free to fork
> https://salsa.debian.org/mariadb-team/mariadb-10.3, play around, and
> make a merge request.

The problem is that RISC-V only provides 4- and 8-byte atomic
instructions, so 1-byte atomic support has to be emulated by libatomic.
There is code for that in the rocksdb build system (however it probably
needs to be patch for riscv64), but it looks like more complex to do in
the mariadb build system.

Note that the issue likely affects some 32-bit architectures that do not
have 8-byte atomic instructions, however rocksdb support is disabled by
default for 32-bit architectures. It's also the strategy we have used
for the version we currently have in unreleased [1]. Here is the
corresponding patch:


diff -Nru mariadb-10.3-10.3.16/debian/rules mariadb-10.3-10.3.16/debian/rules
--- mariadb-10.3-10.3.16/debian/rules	2019-06-19 21:28:52.000000000 +0200
+++ mariadb-10.3-10.3.16/debian/rules	2019-07-23 17:48:12.000000000 +0200
@@ -47,6 +47,11 @@
     CMAKEFLAGS += -DWITHOUT_ROCKSDB=true
 endif
 
+# Skip RocksDB on riscv64, as it requires fixes wrt libatomic
+ifeq ($(DEB_HOST_ARCH),riscv64)
+    CMAKEFLAGS += -DWITHOUT_ROCKSDB=true
+endif
+
 # Skip TokuDB if arch is not amd64 (also disable for kfreebsd-amd64 as it FTBFS)
 # Skipped on the x32 ABI too; untested, but unlikely to work given i386 is not
 # supported.


I don't know if it is something you want to merge in the package or if
you prefer to have a real fix with to the rocksdb support.

Aurelien

[1] http://ftp.ports.debian.org/debian-ports/pool-riscv64/main/m/mariadb-10.3/

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurelien at aurel32.net                 http://www.aurel32.net



More information about the pkg-mysql-maint mailing list