Source: firebuild
Version: 0.8.6.1-1
Severity: normal
Tags: FTBFS patch
User: [email protected]
Usertags: loong64
X-Debbugs-Cc: [email protected]

Dear maintainers,

Compiling the firebuild failed for loong64 in the Debian Package Auto-Building environment.
The error log is as follows,
```
3: Overridden methods that do not exist in libc, libdl or libpthread:
3:   __fxstat
3:   __fxstat64
3:   __fxstatat
3:   __fxstatat64
3:   __lxstat
3:   __lxstat64
3:   __xmknod
3:   __xmknodat
3:   __xstat
3:   __xstat64
3: All expected fortified methods overridden
3: All expected 64bit methods overridden
3: All expected time64 methods overridden
3: All expected underscore methods overridden
3/3 Test #3: test-symbols .....................***Failed    2.64 sec

67% tests passed, 1 tests failed out of 3

Total Test time (real) =  17.50 sec

The following tests FAILED:
      3 - test-symbols (Failed)
Errors while running CTest
```

After analyzing, glibc uses standard stat interfaces directly for loongarch64, without legacy versioned internal symbols (__xstat/__fxstat/__lxstat series). We need to filter out the glibc legacy versioned internal symbols (__xstat series) for loongarch64.

Please consider the patch attached.
Based attached patch, I have built firebuild successfully on loong64.
```
dpkg-deb: building package 'firebuild' in '../firebuild_0.8.6.1-1+loong64_loong64.deb'. dpkg-deb: building package 'firebuild-dbgsym' in '../firebuild-dbgsym_0.8.6.1-1+loong64_loong64.deb'. dpkg-deb: building package 'libfirebuild0' in '../libfirebuild0_0.8.6.1-1+loong64_loong64.deb'. dpkg-deb: building package 'libfirebuild0-dbgsym' in '../libfirebuild0-dbgsym_0.8.6.1-1+loong64_loong64.deb'.
 dpkg-genbuildinfo -O../firebuild_0.8.6.1-1+loong64_loong64.buildinfo
 dpkg-genchanges -O../firebuild_0.8.6.1-1+loong64_loong64.changes
```

Best regards,
Dandan Zhang

Description: Fix build error on loongarch64 
 .
 firebuild (0.8.6.1-1+loong64) unstable; urgency=medium
 .
   * Fix loongarch64 build in test/test_symbols
     - Filter out the glibc legacy versioned internal symbols
       (__xstat/__fxstat/__lxstat series) on loongarch64.
Author: Dandan Zhang <[email protected]>

---
Last-Update: 2026-03-05

--- firebuild-0.8.6.1.orig/test/test_symbols
+++ firebuild-0.8.6.1/test/test_symbols
@@ -52,6 +52,24 @@ known_missing_Darwin_underscore="___fork
 ___sigaction
 ___wait4"
 
+# Detect architecture
+arch=$(uname -m)
+# LoongArch64: glibc uses standard stat interfaces directly, without legacy
+# versioned internal symbols (__xstat/__fxstat/__lxstat series).
+# These symbols are not generated on loongarch64, but exist in gen_list.txt.
+if [ "$arch" = "loongarch64" ]; then
+  known_missing_Linux_loongarch64="__fxstat
+__fxstat64
+__fxstatat
+__fxstatat64
+__lxstat
+__lxstat64
+__xmknod
+__xmknodat
+__xstat
+__xstat64"
+fi
+
 function check_function_class () {
     local fix=$1
     local class=$2
@@ -186,6 +204,14 @@ esac
 # Get the list of extra ones
 extra=$(LC_ALL=C comm -23 public-symbols.txt libc-symbols.txt)
 
+# LoongArch64: filter out the glibc legacy versioned internal symbols (__xstat series).
+if [ "$arch" = "loongarch64" ]; then
+  # Remove the known missing symbols from the extra list
+  for sym in $known_missing_Linux_loongarch64; do
+    extra=$(echo "$extra" | grep -v "^${sym}$")
+  done
+fi
+
 # Report the list of extra ones
 if [ -z "$extra" ]; then
   echo "No unexpected overridden methods"

Reply via email to