#1146742 Add loong64 support for delve

#1146742#5
Date:
2026-09-05 08:49:42 UTC
From:
To:
Dear maintainers,
  The delve source package currently does not build a binary package on loong64, although upstream already has linux/loong64 support.
  I prepared a patch to enable loong64 support in the Debian package. The changes are split into two parts:

  1. Debian packaging changes

  These are Debian-specific changes needed to make the package build correctly on loong64:

  - add loong64 to the binary package Architecture
  - pass exp.linuxloong64 when building and testing
  - pass exp.linuxloong64 when generating the Debian manpages
  - run dh_golang dependency scanning with GOFLAGS containing exp.linuxloong64, otherwise go list sees the unsupported-architecture sentinel in pkg/proc/native

diff -Naur delve-1.27.1-ori/cmd/dlv/manpages.go delve-1.27.1/cmd/dlv/manpages.go
--- delve-1.27.1-ori/cmd/dlv/manpages.go        2026-09-05 16:19:16.000000000 +0800
+++ delve-1.27.1/cmd/dlv/manpages.go    2026-09-05 16:28:17.219928991 +0800
@@ -1,3 +1,3 @@
 package main

-//go:generate go run -tags exp.linuxppc64le,exp.linuxriscv64 ./manpages_generator.go
+//go:generate go run -tags exp.linuxloong64,exp.linuxppc64le,exp.linuxriscv64 ./manpages_generator.go
diff -Naur delve-1.27.1-ori/debian/control delve-1.27.1/debian/control
--- delve-1.27.1-ori/debian/control     2026-08-18 15:51:06.000000000 +0800
+++ delve-1.27.1/debian/control 2026-09-05 16:25:31.764837309 +0800
@@ -34,7 +34,7 @@
 Testsuite: autopkgtest-pkg-go

 Package: delve
-Architecture: amd64 arm64 i386 ppc64el riscv64
+Architecture: amd64 arm64 i386 loong64 ppc64el riscv64
 Built-Using: ${misc:Built-Using},
 Depends: ${misc:Depends},
          ${shlibs:Depends},
diff -Naur delve-1.27.1-ori/debian/rules delve-1.27.1/debian/rules
--- delve-1.27.1-ori/debian/rules       2026-08-18 15:51:06.000000000 +0800
+++ delve-1.27.1/debian/rules   2026-09-05 16:27:27.199920433 +0800
@@ -16,8 +16,11 @@
        DH_GOLANG_BUILDPKG=" \
                github.com/go-delve/delve/pkg/proc/internal/ebpf \
                github.com/go-delve/delve/cmd/dlv" \
-       dh_auto_build
-       dh_auto_build -- -tags exp.linuxppc64le,exp.linuxriscv64
+       dh_auto_build -- -tags exp.linuxloong64,exp.linuxppc64le,exp.linuxriscv64
+       dh_auto_build -- -tags exp.linuxloong64,exp.linuxppc64le,exp.linuxriscv64

 override_dh_auto_test:
-       dh_auto_test -- -tags exp.linuxppc64le,exp.linuxriscv64
+       dh_auto_test -- -tags exp.linuxloong64,exp.linuxppc64le,exp.linuxriscv64
+
+override_dh_golang:
+       GOFLAGS="-tags=exp.linuxloong64,exp.linuxppc64le,exp.linuxriscv64" dh_golang

  2. Upstream patch backport

  The package also needs the upstream fix for range-over-func stepping tests on linux/loong64:
https://github.com/go-delve/delve/pull/4441
  This upstream patch adjusts the loong64 test expectations to match the existing arm64 special cases. The PR has been merged upstream as: d9542bc6dac525c8e58a4beecd360850103a9aea
  With the attached patch applied, I verified the package locally on loong64,the binary packages were built successfully:


   dh_md5sums -O--buildsystem=golang
   dh_builddeb -O--buildsystem=golang
dpkg-deb: 正在 '../delve_1.27.1-4_loong64.deb' 中构建软件包 'delve'。
dpkg-deb: 正在 '../delve-dbgsym_1.27.1-4_loong64.deb' 中构建软件包 'delve-dbgsym'。
 dpkg-genbuildinfo -O../delve_1.27.1-4_loong64.buildinfo
 dpkg-genchanges -O../delve_1.27.1-4_loong64.changes
dpkg-genchanges: info: not including original source code in upload
 dpkg-source --after-build .
dpkg-buildpackage: info: binary and diff upload (original source NOT included)


  Please consider adding loong64 support.


  Best regards,
  Na Zhang