[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1012302: apbs: ftbfs on riscv64: error: ‘_FPU_MASK_IM’ undeclared (first use in this function)



Package: apbs
Version: 3.4.1-4
Severity: minor
Tags: ftbfs, patch
User: debian-riscv@lists.debian.org
Usertags: riscv64
X-Debbugs-Cc: debian-riscv@lists.debian.org

Dear Maintainer,

The apbs package has ftbfs on riscv64:

```
/<<PKGBUILDDIR>>/debian/external_deps/fetk/punc/src/vf2c/uninit.c:305:17: error: ‘_FPU_MASK_IM’ undeclared (first use in this function)
  305 |         cw &= ~(_FPU_MASK_IM | _FPU_MASK_ZM | _FPU_MASK_OM);
      |                 ^~~~~~~~~~~~
/<<PKGBUILDDIR>>/debian/external_deps/fetk/punc/src/vf2c/uninit.c:305:17: note: each undeclared identifier is reported only once for each function it appears in
/<<PKGBUILDDIR>>/debian/external_deps/fetk/punc/src/vf2c/uninit.c:305:32: error: ‘_FPU_MASK_ZM’ undeclared (first use in this function)
  305 |         cw &= ~(_FPU_MASK_IM | _FPU_MASK_ZM | _FPU_MASK_OM);
      |                                ^~~~~~~~~~~~
[  8%] Building C object _deps/fetk-build/punc/src/cgcode/CMakeFiles/cgcode.dir/spcgnr.c.o
/<<PKGBUILDDIR>>/debian/external_deps/fetk/punc/src/vf2c/uninit.c:305:47: error: ‘_FPU_MASK_OM’ undeclared (first use in this function)
  305 |         cw &= ~(_FPU_MASK_IM | _FPU_MASK_ZM | _FPU_MASK_OM);
      |                                               ^~~~~~~~~~~~
```

The full buildd is here:

https://buildd.debian.org/status/fetch.php?pkg=apbs&arch=riscv64&ver=3.4.1-3&stamp=1654099965&raw=0

And I refer to here[0], becasue the fpu_control.h on riscv64 does not
have these macroes are defined, so I am intend to add these macroes in
uninit.c by manual.

Tha patch attached is fix the issue and it is build ok on localy.

```
Build Architecture: riscv64
Build Type: binary
Build-Space: 436052
Build-Time: 1883
Distribution: UNRELEASED
Host Architecture: riscv64
Install-Time: 245
Job: /home/vimer/build/06/02_apbs/apbs_3.4.1-4.dsc
Lintian: warn
Machine Architecture: amd64
Package: apbs
Package-Time: 2170
Source-Version: 3.4.1-4
Space: 436052
Status: successful
Version: 3.4.1-4
--------------------------------------------------------------------------------
Finished at 2022-06-03T07:43:04Z
Build needed 00:36:10, 436052k disk space
```

Please consider to apply it in next upload and if any issue please let
me know.

PS: I noticed there is different with abps on sala repo and sid.
I have to switch the newest repo to build it:)

[0]: https://github.com/Electrostatics/FETK/issues/71
--- debian/external_deps/fetk/punc/src/vf2c/uninit-old.c	2022-06-03 17:08:45.698221199 +0800
+++ debian/external_deps/fetk/punc/src/vf2c/uninit.c	2022-06-03 17:15:06.365211794 +0800
@@ -148,6 +148,16 @@
 #endif
 #endif

+
+#if defined(__riscv) && defined(__riscv_xlen) && __riscv_xlen == 64
+/* Masks for interrupts.  */
+#define _FPU_MASK_V     0x0800  /* Invalid operation */
+#define _FPU_MASK_Z     0x0400  /* Division by zero  */
+#define _FPU_MASK_O     0x0200  /* Overflow          */
+#define _FPU_MASK_U     0x0100  /* Underflow         */
+#define _FPU_MASK_I     0x0080  /* Inexact operation */
+#endif
+
 #ifdef MSpc
 #define IEEE0_done
 #include "float.h"
@@ -178,7 +188,7 @@
 	}
 #endif /* MSpc */

-#if defined (__mips) && !defined (__linux__)	/* must link with -lfpe */
+#if defined (__mips) && !defined (__linux__)   /* must link with -lfpe */
 #define IEEE0_done
 /* code from Eric Grosse */
 #include <stdlib.h>

Attachment: signature.asc
Description: PGP signature


Reply to: