Source: faketime
Version: 0.9.10-2.2
Severity: normal
Tags: patch
User: debian-loonga...@lists.debian.org
Usertags: loong64

Hi maintainers,

Compiling the faketime failed for loong64 in the Debian Package Auto-Building environment.
The build error log is as follows,
```
 Running the test program with no faked time specified
$ LD_PRELOAD=../src/libfaketime.so.1 ./timetest
pthread_cond_timedwait: CLOCK_REALTIME test
(Intentionally sleeping 1 second...)
pthread_cond_timedwait: CLOCK_MONOTONIC test
(Intentionally sleeping 1 second...)
(If this test hangs for more than a few seconds, please report
 your glibc version and system details as FORCE_MONOTONIC_FIX
 issue at https://github.com/wolfcw/libfaketime)
.....
```
The full log can be found at https://buildd.debian.org/status/logs.php?pkg=faketime&ver=0.9.10-2.2&arch=loong64.

I acquire the below solution from https://github.com/wolfcw/libfaketime/.
```
If you observe hangs on the CLOCK_REALTIME test, add the CFLAG -DFORCE_PTHREAD_NONVER. Also set this FORCE_PTHREAD_NONVER flag in case FORCE_MONOTONIC_FIX alone does not solve the hang on the MONOTONIC_CLOCK test.
```

So, we could set FORCE_PTHREAD_NONVER on loong64. Your opinions are welcome.
Please consider the patch attached.
I have built faketime successfully in my local ENV and all test cases passed.
```
dpkg-deb: building package 'libfaketime-dbgsym' in '../libfaketime-dbgsym_0.9.10-2.2_loong64.deb'.
 dpkg-genbuildinfo -O../faketime_0.9.10-2.2_loong64.buildinfo
 dpkg-genchanges -O../faketime_0.9.10-2.2_loong64.changes
```

Thanks,
Dandan Zhang

diff -Nru faketime-0.9.10/debian/rules faketime-0.9.10/debian/rules
--- faketime-0.9.10/debian/rules        2022-08-13 18:58:42.000000000 +0000
+++ faketime-0.9.10/debian/rules        2024-07-18 21:45:30.000000000 +0000
@@ -5,7 +5,7 @@
 # why -DFORCE_PTHREAD_NONVER: see README and
 # timetest.c and https://github.com/wolfcw/libfaketime/issues/278
 # (FORCE_MONOTONIC_FIX should now be autodetected)
-ifneq (,$(filter $(DEB_HOST_ARCH),ppc64el riscv64 x32))
+ifneq (,$(filter $(DEB_HOST_ARCH),ppc64el riscv64 x32 loong64))
 DEB_CFLAGS_MAINT_APPEND += -DFORCE_PTHREAD_NONVER
 endif
 

Reply via email to