Source: protobuf
Version: 3.21.12-10
Severity: normal
Tags: patch
User: debian-loonga...@lists.debian.org
Usertags: loong64

Dear maintainers,

The protobuf package was built on loong64.
But I found that there is a lack of loongarch64 support in src/google/protobuf.

If the support for loong64 is missing in protobuf, packages that build-depend on protobuf will fail to build, for example, Compiling the justbuild(Need to add loongarch64 support first) failed for loong64.
The build error log is as follows,
```
......
In file included from work/google/api/http.pb.cc:4:
In file included from work/google/api/http.pb.h:23:
In file included from /usr/include/google/protobuf/io/coded_stream.h:131:
In file included from /usr/include/google/protobuf/stubs/common.h:47:
/usr/include/google/protobuf/stubs/platform_macros.h:98:1: error: expected unqualified-id
   98 | GOOGLE_PROTOBUF_PLATFORM_ERROR
      | ^
......
```

Please consider the patch I attached for protobuf.
Based on attached patch, I have built protobuf successfully on locally.
Based on local libprotobuf-dev, I have built justbuild(Need to add loongarch64 support first. I have submitted patch to justbuild source pacakge) successfully on locally.
```
......
   dh_builddeb
dpkg-deb: building package 'justbuild' in '../justbuild_1.5.1-1+loong64_loong64.deb'. dpkg-deb: building package 'justbuild-dbgsym' in '../justbuild-dbgsym_1.5.1-1+loong64_loong64.deb'.  dpkg-genbuildinfo --build=binary -O../justbuild_1.5.1-1+loong64_loong64.buildinfo  dpkg-genchanges --build=binary -O../justbuild_1.5.1-1+loong64_loong64.changes
```

Please add loongarch64 support in protobuf.
Your opinions are welcome.

Best regards,
Dandan Zhang

Description: Add loongarch64 support 
 .
 protobuf (3.21.12-10+loong64) unstable; urgency=medium
 .
   * src/google/protobuf/stubs/platform_macros.h
     - Add loongarch64 support
Author: Dandan Zhang <zhangdan...@loongson.cn>

---
Last-Update: 2025-04-28

--- protobuf-3.21.12.orig/src/google/protobuf/stubs/platform_macros.h
+++ protobuf-3.21.12/src/google/protobuf/stubs/platform_macros.h
@@ -60,6 +60,9 @@
 #elif defined(__aarch64__)
 #define GOOGLE_PROTOBUF_ARCH_AARCH64 1
 #define GOOGLE_PROTOBUF_ARCH_64_BIT 1
+#elif defined(__loongarch64)
+#define GOOGLE_PROTOBUF_ARCH_LOONGARCH64 1
+#define GOOGLE_PROTOBUF_ARCH_64_BIT 1
 #elif defined(__mips__)
 #if defined(__LP64__)
 #define GOOGLE_PROTOBUF_ARCH_MIPS64 1

Reply via email to