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

Bug#1051821: a2jmidid: FTBFS: enable build for LoongArch



Package: a2jmidid
Version: 9-3
Severity: normal
Tags: patch ftbfs
User: debian-devel@lists.debian.org
Usertags: loongarch64

Dear maintainers,

When compiling the package a2jmidid for loong64 in the Debian Package Auto-Building environment [1], The error message is as follows:
......Omit
../sigsegv.c: In function ‘signal_segv’:
../sigsegv.c:97:20: error: ‘NGREG’ undeclared (first use in this function)
97 | for(i = 0; i < NGREG; i++)
| ^~~~~
../sigsegv.c:97:20: note: each undeclared identifier is reported only once for each function it appears in
In file included from ../sigsegv.c:39:
../sigsegv.c:106:39: error: ‘mcontext_t’ has no member named ‘gregs’; did you mean ‘__gregs’?
106 | ucontext->uc_mcontext.gregs[i]
| ^~~~~
../log.h:47:134: note: in definition of macro ‘a2j_error’
......Omit

The full compilation log can be found at [2].

Please consider the patch I have attached.
BTW, the patch I provided in the attachment doesn't affect other architectures and compiles fine on the loongarch architecture.
If you have any questions, you can contact me at any time.

[1]:https://buildd.debian.org/status/package.php?p=a2jmidid&suite=sid
[2]:https://buildd.debian.org/status/logs.php?pkg=a2jmidid&ver=9-3&arch=loong64

thanks,
Dandan Zhang

Description: Add support for loongarch
Last-Update: 2023-09-13

--- a2jmidid-9.orig/sigsegv.c
+++ a2jmidid-9/sigsegv.c
@@ -93,7 +93,7 @@ static void signal_segv(int signum, sigi
     a2j_error("info.si_addr  = %p", info->si_addr);
 #if !defined(__alpha__) && !defined(__ia64__) && \
     !defined(__FreeBSD_kernel__) && !defined(__arm__) && !defined(__hppa__) && \
-    !defined(__sh__) && !defined(__aarch64__) && !defined(__riscv)
+    !defined(__sh__) && !defined(__aarch64__) && !defined(__riscv) && !defined(__loongarch__)
     for(i = 0; i < NGREG; i++)
         a2j_error("reg[%02d]       = 0x" REGFORMAT, i,
 #if defined(__powerpc__) && !defined(__powerpc64__)
@@ -106,7 +106,7 @@ static void signal_segv(int signum, sigi
                 ucontext->uc_mcontext.gregs[i]
 #endif
                 );
-#endif /* alpha, ia64, kFreeBSD, arm, hppa, aarch64, riscv */
+#endif /* alpha, ia64, kFreeBSD, arm, hppa, aarch64, riscv, loongarch */
 
 #if defined(SIGSEGV_STACK_X86) || defined(SIGSEGV_STACK_IA64)
 # if defined(SIGSEGV_STACK_IA64)

Reply to: