Source: ucx
Version: 1.20.0+ds-3
Severity: normal
Tags: patch
User: [email protected]
Usertags: loong64

Dear maintainers,

Compiling the ucx 1.20 failed for loong64 in the Debian Package Auto-Building environment.
The error log is as follows,
```
In file included from /build/reproducible-path/ucx-1.20.0+ds/src/ucs/memory/rcache_int.h:16,
                 from debug/debug.c:15:
/build/reproducible-path/ucx-1.20.0+ds/src/ucs/type/rwlock.h: In function 'ucs_rw_spinlock_read_lock': /build/reproducible-path/ucx-1.20.0+ds/src/ucs/type/rwlock.h:64:13: error: implicit declaration of function 'ucs_cpu_relax' [-Wimplicit-function-declaration]
   64 |             ucs_cpu_relax();
      |             ^~~~~~~~~~~~~
/build/reproducible-path/ucx-1.20.0+ds/src/ucs/type/rwlock.h:64:13: error: nested extern declaration of 'ucs_cpu_relax' [-Werror=nested-externs]
cc1: all warnings being treated as errors
make[4]: *** [Makefile:1815: debug/libucs_la-debug.lo] Error 1
make[4]: *** Waiting for unfinished jobs....
```

Please consider the patch attached.
Based attached patch, I have built ucx 1.20.0+ds-3 successfully on loong64.
```
dpkg-deb: building package 'libucx-dev' in '../libucx-dev_1.20.0+ds-3+loong64_loong64.deb'. dpkg-deb: building package 'ucx-utils-dbgsym' in '../ucx-utils-dbgsym_1.20.0+ds-3+loong64_loong64.deb'. dpkg-deb: building package 'ucx-utils' in '../ucx-utils_1.20.0+ds-3+loong64_loong64.deb'. dpkg-deb: building package 'libucx0' in '../libucx0_1.20.0+ds-3+loong64_loong64.deb'. dpkg-deb: building package 'libucx0-dbgsym' in '../libucx0-dbgsym_1.20.0+ds-3+loong64_loong64.deb'.
 dpkg-genbuildinfo -O../ucx_1.20.0+ds-3+loong64_loong64.buildinfo
 dpkg-genchanges -O../ucx_1.20.0+ds-3+loong64_loong64.changes
```

Best regards,
Dandan Zhang

Description: Fix implicit declaration of function 'ucs_cpu_relax' 
 .
 ucx (1.20.0+ds-3+loong64) unstable; urgency=medium
 .
   * Fix implicit declaration of function 'ucs_cpu_relax' on loong64.
Author: Dandan Zhang <[email protected]>

---
Last-Update: 2026-01-08

--- ucx-1.20.0+ds.orig/src/ucs/arch/loongarch64/cpu.h
+++ ucx-1.20.0+ds/src/ucs/arch/loongarch64/cpu.h
@@ -109,6 +109,11 @@ ucs_memcpy_nontemporal(void *dst, const
     memcpy(dst, src, len);
 }
 
+static UCS_F_ALWAYS_INLINE void ucs_cpu_relax()
+{
+    asm volatile ("" ::: "memory");
+}
+
 END_C_DECLS
 
 #endif

Reply via email to