Source: golang-github-iovisor-gobpf
Version: 0.2.0-9
Severity: important
Tags: patch
User: debian-ri...@lists.debian.org
Usertags: riscv64
User: debian-loonga...@lists.debian.org 
Usertags: loong64
X-Debbugs-Cc: debian-ri...@lists.debian.org, debian-loonga...@lists.debian.org 

Dear Maintainer,

now golang-github-iovisor-gobpf is missing utsname support for riscv64
and loong64, this will lead to FTBFS from opensnitch on these
architectures, see [0] and [1]. In fact this will also casuse the build
to fail on these two architectures. Two PRs to support both architectures
separately has been sent upstream, but has not yet been merged(inactive
upstream), so I backport them to here. 

[0]: 
https://buildd.debian.org/status/fetch.php?pkg=opensnitch&arch=riscv64&ver=1.6.8-9&stamp=1745472487&raw=0
[1]: 
https://buildd.debian.org/status/fetch.php?pkg=opensnitch&arch=loong64&ver=1.6.8-9&stamp=1745476108&raw=0

Please note, even if apply this patch, the build will still fail on
riscv64(I test it on riscv64 not on loong64), but this is another
reason to lead this like:

```
...
-tautological-compare -Wno-unknown-warning-option -g -O2 -emit-llvm -c 
opensnitch.c -o opensnitch.o.partial     
In file included from opensnitch.c:3:                                           
                                
In file included from ./common_defs.h:4:                                        
                                
/lib/modules/6.12.22-riscv64/source/include/linux/sched.h:12:10: fatal error: 
'asm/current.h' file not found    
   12 | #include <asm/current.h>                                                
                                
      |          ^~~~~~~~~~~~~~~                                                
                                
1 error generated.                                                              
                                
make[2]: *** [Makefile:57: opensnitch.o] Error 1         
```

The same error has occurred on s390x[2] and I believe this is different issue. 
I will dig more this later.

[2]: 
https://buildd.debian.org/status/fetch.php?pkg=opensnitch&arch=s390x&ver=1.6.8-9&stamp=1745476829&raw=0

Could you apply this on next upload?

-- 
Regards,
--
  Bo YU

diff -Nru golang-github-iovisor-gobpf-0.2.0/debian/changelog 
golang-github-iovisor-gobpf-0.2.0/debian/changelog
--- golang-github-iovisor-gobpf-0.2.0/debian/changelog  2025-04-15 
15:42:23.000000000 +0000
+++ golang-github-iovisor-gobpf-0.2.0/debian/changelog  2025-04-24 
12:16:21.000000000 +0000
@@ -1,3 +1,10 @@
+golang-github-iovisor-gobpf (0.2.0-9.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Add build support for loong64 and riscv64. (Closes: #-1) 
+
+ -- Bo YU <vi...@debian.org>  Thu, 24 Apr 2025 12:16:21 +0000
+
 golang-github-iovisor-gobpf (0.2.0-9) unstable; urgency=medium
 
   * While checking if debian/copyright-scan is up to date, skip all the
diff -Nru golang-github-iovisor-gobpf-0.2.0/debian/patches/series 
golang-github-iovisor-gobpf-0.2.0/debian/patches/series
--- golang-github-iovisor-gobpf-0.2.0/debian/patches/series     2025-04-15 
15:42:23.000000000 +0000
+++ golang-github-iovisor-gobpf-0.2.0/debian/patches/series     2025-04-24 
11:43:19.000000000 +0000
@@ -1 +1,2 @@
 support-for-new-bcc_func_load-signature.patch
+support-loong64-and-rv64.patch
diff -Nru 
golang-github-iovisor-gobpf-0.2.0/debian/patches/support-loong64-and-rv64.patch 
golang-github-iovisor-gobpf-0.2.0/debian/patches/support-loong64-and-rv64.patch
--- 
golang-github-iovisor-gobpf-0.2.0/debian/patches/support-loong64-and-rv64.patch 
    1970-01-01 00:00:00.000000000 +0000
+++ 
golang-github-iovisor-gobpf-0.2.0/debian/patches/support-loong64-and-rv64.patch 
    2025-04-24 11:48:35.000000000 +0000
@@ -0,0 +1,26 @@
+From a8772aa7a6c088c9845406d9566e59630f7f4c92 Mon Sep 17 00:00:00 2001
+From: Ast-x64 <ast-...@protonmail.com>
+Date: Mon, 27 Feb 2023 18:30:03 +0900
+Subject: [PATCH] elf: Add utsname support for riscv64
+PR: https://github.com/iovisor/gobpf/pull/324
+
+According to https://go.dev/src/syscall/ztypes_linux_riscv64.go#L573 we
+should use uint8 on riscv64.
+
+From 65eb126ceb21b4b85de065fade83daa6f94c9826 Mon Sep 17 00:00:00 2001
+From: zhaixiaojuan <zhaixiaoj...@loongson.cn>
+Date: Mon, 28 Nov 2022 16:05:09 +0800
+Subject: [PATCH] Add utsname support for loong64
+PR: https://github.com/iovisor/gobpf/pull/316
+---
+ elf/utsname_uint8.go | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/elf/utsname_uint8.go
++++ b/elf/utsname_uint8.go
+@@ -1,4 +1,4 @@
+-// +build linux,arm linux,ppc64 linux,ppc64le s390x
++// +build linux,arm linux,ppc64 linux,ppc64le linux,loong64 linux,riscv64 
s390x
+ 
+ package elf
+ 

Attachment: signature.asc
Description: PGP signature

Reply via email to