Source: uhub
Version: 0.4.1-3.2
Severity: normal
Tags: patch
User: [email protected]
Usertags: loong64

Dear maintainers,

Compiling the uhub failed for loong64 in the Debian Package Auto-Building environment.
Build failed 14 times.
The build error log is as follows,
```
/<<PKGBUILDDIR>>/src/tools/adcclient.c:178:33: error: implicit declaration of function ‘ADC_client_connect_internal’; did you mean ‘ADC_client_connect’? [-Werror=implicit-function-declaration]
  178 | ADC_client_connect_internal(client);
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                 ADC_client_connect
[ 16%] Linking C static library libutils.a
```
The above error is a common bug in the source code and will occur in others architectures.
Please consider the patch (uhub-implicit-declarations.patch) I attached.

In addition, base on the above patch, compiling the uhub failed for loong64, the error log is as follows,
```
/home/uhub-0.4.1/src/core/commands.c:395:86: error: expected ')' before 'CPUINFO'   395 |                 buf = cbuf_create_const("Powered by " PRODUCT_STRING " on " OPSYS "/" CPUINFO);
      | ~                                             ^~~~~~~~
      |
```
The uhub source package lacks LoongArch architecture support.
Please consider the patch (uhub-add-loongarch-support.patch) I have attached. And the uhub source package was compiled successfully on my local loong64 rootfs environment.
```
......
dpkg-deb: building package 'uhub-dbgsym' in '../uhub-dbgsym_0.4.1-3.2_loong64.deb'.
 dpkg-genbuildinfo -O../uhub_0.4.1-3.2_loong64.buildinfo
 dpkg-genchanges -O../uhub_0.4.1-3.2_loong64.changes
```
Would it be possible to include the support for LoongArch in the next upload?

thanks,
Dandan Zhang
Description: Add loongarch support 
Last-Update: 2024-06-28

--- uhub-0.4.1.orig/src/system.h
+++ uhub-0.4.1/src/system.h
@@ -218,6 +218,10 @@
 #define CPUINFO "PARISC"
 #endif
 
+#if defined(__loongarch__)
+#define CPUINFO "LoongArch"
+#endif
+
 #if defined(__m68k__) || defined(M68000)
 #define CPUINFO "M68K"
 #endif
Description: Fix implicit declarations 
Last-Update: 2024-06-28

--- uhub-0.4.1.orig/src/tools/adcclient.c
+++ uhub-0.4.1/src/tools/adcclient.c
@@ -88,6 +88,7 @@ static void ADC_client_on_login(struct A
 static int ADC_client_parse_address(struct ADC_client* client, const char* arg);
 static int ADC_client_on_recv_line(struct ADC_client* client, const char* line, size_t length);
 static int ADC_client_send_queue(struct ADC_client* client);
+int ADC_client_connect_internal(struct ADC_client* client);
 
 static void ADC_client_debug(struct ADC_client* client, const char* format, ...)
 {

Reply via email to