Source: collectd
Version: 5.12.0-19
Severity: normal
Tags: patch
User: debian-loonga...@lists.debian.org
Usertags: loong64
Hi maintainers,
Compiling the collectd(5.12.0-19) failed for loong64 in the Debian
Package Auto-Building environment.
The build error log is as follows(at configure stage),
```
gpu_nvidia . . . . . no (disabled on command line)
grpc . . . . . . . . no (libgrpc++ not found) (dependency error)
hddtemp . . . . . . . no (disabled on command line)
......
gpu_nvidia . . . . . no (disabled on command line)
grpc . . . . . . . . no (libgrpc++ not found) (dependency error)
hddtemp . . . . . . . no (disabled on command line)
......
configure: error: "Some plugins are missing dependencies - see the
summary above for details"
-e
.....
```
The full log can be found at
https://buildd.debian.org/status/fetch.php?pkg=collectd&arch=loong64&ver=5.12.0-19&stamp=1729640044&raw=0.
After analyzing, there are 2 reasons.
1. missing loong64 dependency for libgrpc++-dev in d/control.
2. for loong64 (build zero in openjdk-21), libjvm.so was supported in
/usr/lib/jvm/default-java/lib/zero/ [1][2], not
/usr/lib/jvm/default-java/lib/server/.
use command 'JAVA_LDFLAGS = -L$(JVM_SERVER_DIR) -Wl,-rpath
-Wl,$(JVM_SERVER_DIR)'.
output is JAVA_LDFLAGS="-L -Wl,-rpath -Wl," , can not found libjvm.so
for loong64.
Please consider the patch I attached.
Please consider the patch I attached.
1. found grpc in configure stage.
* d/control: add libgrpc++-dev dependency for loong64.
2. output of $JAVA_LDFLAGS is normal.
* d/rules: find libjvm.so from $(JAVA_HOME)/lib/zero for loong64.
JAVA_LDFLAGS="-L/usr/lib/jvm/default-java/lib/zero -Wl,-rpath
-Wl,/usr/lib/jvm/default-java/lib/zero" \
I have built collectd successfully in my local ENV and all test cases
passed.
```
Testsuite summary for collectd 5.12.0.git
=========================================
# TOTAL: 34
# PASS: 34
# SKIP: 0
# XFAIL: 0
# FAIL: 0
# XPASS: 0
# ERROR: 0
......
dpkg-deb: building package 'libcollectdclient1t64' in
'../libcollectdclient1t64_5.12.0-19+loong64_loong64.deb'.
dpkg-genbuildinfo -O../collectd_5.12.0-19+loong64_loong64.buildinfo
dpkg-genchanges -O../collectd_5.12.0-19+loong64_loong64.changes
```
Please add loong64 support in the next upload.
Your opinions are welcome.
[1]: https://github.com/openjdk/jdk/pull/5440
[2]: https://github.com/openjdk/jdk/pull/4787
Thanks,
Dandan Zhang
diff -Nru collectd-5.12.0/debian/.gitignore collectd-5.12.0/debian/.gitignore
--- collectd-5.12.0/debian/.gitignore 2024-10-19 23:11:57.000000000 +0000
+++ collectd-5.12.0/debian/.gitignore 1970-01-01 00:00:00.000000000 +0000
@@ -1 +0,0 @@
-*.swp
diff -Nru collectd-5.12.0/debian/changelog collectd-5.12.0/debian/changelog
--- collectd-5.12.0/debian/changelog 2024-10-19 23:11:57.000000000 +0000
+++ collectd-5.12.0/debian/changelog 2024-10-24 09:22:15.000000000 +0000
@@ -1,3 +1,10 @@
+collectd (5.12.0-19+loong64) unreleased; urgency=medium
+
+ * d/control: add libgrpc++-dev dependency for loong64.
+ * d/rules: find libjvm.so from $(JAVA_HOME)/lib/zero for loong64.
+
+ -- Dandan Zhang <zhangdan...@loongson.cn> Thu, 24 Oct 2024 17:22:15 +0800
+
collectd (5.12.0-19) unstable; urgency=medium
[ James Morris ]
diff -Nru collectd-5.12.0/debian/control collectd-5.12.0/debian/control
--- collectd-5.12.0/debian/control 2024-10-19 23:11:57.000000000 +0000
+++ collectd-5.12.0/debian/control 2024-10-24 09:16:38.000000000 +0000
@@ -21,7 +21,7 @@
libgeom-dev [kfreebsd-any],
libgcrypt20-dev,
libglib2.0-dev,
- libgrpc++-dev [amd64 arm64 armel armhf i386 mips64el mipsel ppc64el s390x],
+ libgrpc++-dev [amd64 arm64 armel armhf i386 mips64el mipsel ppc64el s390x
loong64],
libgps-dev,
libhiredis-dev,
libi2c-dev [!hurd-any],
diff -Nru collectd-5.12.0/debian/rules collectd-5.12.0/debian/rules
--- collectd-5.12.0/debian/rules 2024-10-19 23:11:57.000000000 +0000
+++ collectd-5.12.0/debian/rules 2024-10-24 09:19:58.000000000 +0000
@@ -49,6 +49,12 @@
JAVA_CPPFLAGS = -I$(JAVA_HOME)/include
JAVA_LDFLAGS = -L$(JVM_SERVER_DIR) -Wl,-rpath -Wl,$(JVM_SERVER_DIR)
+# find libjvm.so from $(JAVA_HOME)/lib/zero
+ifeq ($(DEB_HOST_ARCH),loong64)
+ JVM_DIR = $(shell find -L "$(JAVA_HOME)" -type f \( -name libjvm.so \) -exec
'dirname' '{}' ';' 2>/dev/null | LC_ALL=C sort | head -n 1)
+ JAVA_LDFLAGS = -L$(JVM_DIR) -Wl,-rpath -Wl,$(JVM_DIR)
+endif
+
confflags = --host=$(DEB_HOST_GNU_TYPE) \
--build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr \
--mandir=\$${prefix}/share/man \