Source: hyperic-sigar
Version: 1.6.4+dfsg-5
Severity: wishlist
Tags: ftbfs patch upstream
User: debian-ri...@lists.debian.org
Usertags: riscv64

Dear maintainer,

hyperic-sigar fails to build from source on riscv64:

| jni-compile:
| 
| jni-cc:
|     [mkdir] Created dir: 
/<<PKGBUILDDIR>>/bindings/java/build/obj/riscv64-linux/lib
|      [echo] jni libname=sigar
|        [cc] 13 total files to be compiled.
|        [cc] gcc: error: unrecognized command-line option ‘-m64’
| 
| BUILD FAILED
| /<<PKGBUILDDIR>>/bindings/java/hyperic_jni/jni-build.xml:224: The following 
error occurred while executing this line:
| /<<PKGBUILDDIR>>/bindings/java/hyperic_jni/jni-build.xml:270: gcc failed with 
return code 1
| 
| Total time: 1 minute 21 seconds
| dh_auto_build: error: cd bindings/java && ant -Duser.name debian returned 
exit code 1
| make: *** [debian/rules:6: binary-arch] Error 25
| dpkg-buildpackage: error: debian/rules binary-arch subprocess returned exit 
status 2

The full build log is available there:
https://buildd.debian.org/status/fetch.php?pkg=hyperic-sigar&arch=riscv64&ver=1.6.4%2Bdfsg-5&stamp=1630049820&raw=0

The issue is that -m64 is not understood by GCC on riscv64. This is also
the case on a few other architectures, and I have noticed that you
already have a patch for that. I have tried to extend it (see attached
patch), and hyperic-sigar builds fine on riscv64. Could you please
consider applying it in the future uploads?

Note however that instead of maintaining a long list of architectures
where -m64 is not needed might not be the best way, as this flag is
basically understood only on x86, p(ower)pc*, sparc* and s390*. In
addition this flag is basically not needed for a standard Debian
installation, where gcc already defaults to the correct bitness. You
might therefore want to simply drop those few lines.

Regards,
Aurelien
--- hyperic-sigar-1.6.4+dfsg/debian/patches/no-m64-mips-arm.diff
+++ hyperic-sigar-1.6.4+dfsg/debian/patches/no-m64-mips-arm.diff
@@ -2,13 +2,14 @@
 ===================================================================
 --- 
hyperic-sigar-1.6.4+dfsg.orig/bindings/java/hyperic_jni/src/org/hyperic/jni/ArchNameTask.java
      2014-11-03 13:25:30.620030459 +0800
 +++ 
hyperic-sigar-1.6.4+dfsg/bindings/java/hyperic_jni/src/org/hyperic/jni/ArchNameTask.java
   2014-11-03 13:25:30.608030459 +0800
-@@ -75,7 +75,8 @@
+@@ -75,7 +75,9 @@
          if (ArchName.is64()) {
              getProject().setProperty("jni.arch64", "true");
              if (ArchLoader.IS_LINUX) {
 -                if (!osArch.equals("ia64")) {
 +                if (!osArch.equals("ia64") && !osArch.equals("mips64el")
-+                      && !osArch.equals("mips64") && 
!osArch.equals("aarch64")) {
++                      && !osArch.equals("mips64") && !osArch.equals("aarch64")
++                      && !osArch.equals("riscv64")) {
                      getProject().setProperty("jni.gccm", "-m64");
                  }
              }

Reply via email to