Source: ceph
Version: 16.2.11+ds-5
Severity: wishlist
Tags: ftbfs patch
User: debian-loonga...@lists.debian.org
Usertags: loong64
Dear maintainers,
The package ceph failed to compile on loong64 in the Debian Package
Auto-Building environment. The error messages are as follows,
```
/usr/bin/ld: /usr/include/c++/13/bits/atomic_base.h:1015:(.text+0x9dc):
undefined reference to `__atomic_compare_exchange_16'
/usr/bin/ld: /usr/include/c++/13/bits/atomic_base.h:1015:(.text+0xa00):
undefined reference to `__atomic_compare_exchange_16'
[ 95%] Linking CXX shared library ../../lib/librbd.so
cd /<<PKGBUILDDIR>>/obj-loongarch64-linux-gnu/src/librbd &&
/usr/bin/cmake -E cmake_link_script CMakeFiles/librbd.dir/link.txt
--verbose=1
```
The full compilation log can be found at
https://buildd.debian.org/status/logs.php?pkg=ceph&ver=16.2.11%2Bds-5&arch=loong64
BTW, ceph upstream uses the "__SIZEOF_INT128__" macro definitions
starting with version v18.0.0, please see details at
https://github.com/ceph/ceph/blob/v18.0.0/cmake/modules/CheckCxxAtomic.cmake.
Environment information for loong64 rootfs:
root@localhost:/home/ceph# dpkg-architecture |grep DEB_HOST_ARCH_CPU
DEB_HOST_ARCH_CPU=loong64
root@localhost:/home/ceph# gcc -dM -E - </dev/null |grep __SIZEOF_INT128__
#define __SIZEOF_INT128__ 16
For the ceph version in the debian sid, please consider the patch I have
attached.
If you have any questions, you can contact me at any time.
thanks,
Dandan Zhang
diff -Nru ceph-16.2.11+ds/debian/control ceph-16.2.11+ds/debian/control
--- ceph-16.2.11+ds/debian/control 2023-10-09 06:53:31.000000000 +0000
+++ ceph-16.2.11+ds/debian/control 2023-10-09 06:53:31.000000000 +0000
@@ -50,7 +50,7 @@
libfuse-dev,
libgf-complete-dev,
libgnutls28-dev,
- libgoogle-perftools-dev [amd64 arm64 armel armhf i386 mips64el mipsel ppc64
ppc64el riscv64 powerpc s390x],
+ libgoogle-perftools-dev [amd64 arm64 armel armhf i386 loong64 mips64el mipsel
ppc64 ppc64el riscv64 powerpc s390x],
libhwloc-dev,
libibverbs-dev,
libicu-dev,
diff -Nru ceph-16.2.11+ds/debian/patches/add-support-for-loongarch64.patch
ceph-16.2.11+ds/debian/patches/add-support-for-loongarch64.patch
--- ceph-16.2.11+ds/debian/patches/add-support-for-loongarch64.patch
1970-01-01 00:00:00.000000000 +0000
+++ ceph-16.2.11+ds/debian/patches/add-support-for-loongarch64.patch
2023-10-09 06:53:31.000000000 +0000
@@ -0,0 +1,14 @@
+Description: add support for loongarch64
+Last-Update: 2023-10-30
+
+--- ceph-16.2.11+ds.orig/cmake/modules/CheckCxxAtomic.cmake
++++ ceph-16.2.11+ds/cmake/modules/CheckCxxAtomic.cmake
+@@ -12,7 +12,7 @@ function(check_cxx_atomics var)
+ #include <cstdint>
+
+ #if defined(__s390x__) || (defined(__mips__) && _MIPS_SIM ==_ABI64 ) \
+- || (defined __riscv && __riscv_xlen == 64)
++ || (defined __riscv && __riscv_xlen == 64) || defined(__loongarch64)
+ // Boost needs 16-byte atomics for tagged pointers.
+ // These are implemented via inline instructions on the platform
+ // if 16-byte alignment can be proven, and are delegated to libatomic