--- Begin Message ---
Package: golang-1.24
Version: 1.24.4-3
Severity: important
Tags: patch
X-Debbugs-Cc: [email protected], Meng Zhuo <[email protected]>
User: [email protected]
Usertags: riscv64
Control: affects -1 src:glow
Control: affects -1 src:gocryptfs
Hi,
Recently some go-* packages has ftbfs issue, like gocryptfs[0], glow[1]:
```
# github.com/rfjakob/gocryptfs/internal/ctlsocksrv.test
loadelf: $WORK/b132/_pkg_.a(_x001.o): 190878: sym#47 (".LVUS0"): ignoring
symbol in section 8 (".debug_loclists") (type 0)
panic: unexpected empty container symbol
goroutine 1 [running]:
cmd/link/internal/loader.(*Loader).AddInteriorSym(0x3f7417e008, 0x2e99f,
0x2e9b3)
cmd/link/internal/loader/loader.go:1745 +0x238
cmd/link/internal/loader.(*SymbolBuilder).AddInteriorSym(...)
cmd/link/internal/loader/symbolbuilder.go:202
cmd/link/internal/loadelf.Load(0x3f7417e008, 0x55da40, 0xb2, 0x3f7402c550,
{0x3f7810aee7, 0x3}, 0xdc0, {0x3f746b4930, 0x2d}, 0x4)
cmd/link/internal/loadelf/ldelf.go:633 +0x3518
cmd/link/internal/ld.ldobj.func1(0x3f741c4200, 0xc0eefc90dd5e1e7c?,
{0x3f7810aee7?, 0x1?}, 0x4000?, {0x3f746b4930?, 0x0?})
cmd/link/internal/ld/lib.go:2278 +0xa8
cmd/link/internal/ld.hostobjs(0x3f741c4200)
cmd/link/internal/ld/lib.go:1241 +0x14c
cmd/link/internal/ld.(*Link).loadlib(0x3f741c4200)
cmd/link/internal/ld/lib.go:615 +0x534
cmd/link/internal/ld.Main(_, {0x8, 0x20, 0x1, 0x2, 0x1, 0x1, {0x0, 0x0, 0x0},
...})
cmd/link/internal/ld/main.go:360 +0x11c4
main.main()
```
This is due to gcc-15 has some changes and golang upstream has
backported some commits to 1.24 branch but it seems this[2] was
missing.
I have tested both build for gocryptfs and glow with the commit[2],
they are okay. thanks for Meng zhuo's pointer.
Yeah, this upload need to fix #1112166 issue first.
[0]:
https://buildd.debian.org/status/fetch.php?pkg=gocryptfs&arch=riscv64&ver=2.6.1-1&stamp=1757333291&raw=0
[1]:
https://buildd.debian.org/status/fetch.php?pkg=glow&arch=riscv64&ver=2.1.1-1&stamp=1757466612&raw=0
[2]: https://go-review.googlesource.com/c/go/+/668276
[3]: https://bugs.debian.org/1112166
--
Regards,
--
Bo YU
diff -Nru golang-1.24-1.24.4/debian/changelog
golang-1.24-1.24.4/debian/changelog
--- golang-1.24-1.24.4/debian/changelog 2025-08-19 05:22:03.000000000 +0000
+++ golang-1.24-1.24.4/debian/changelog 2025-09-10 08:13:48.000000000 +0000
@@ -1,3 +1,11 @@
+golang-1.24 (1.24.4-3.1) UNRELEASED; urgency=medium
+
+ * Non-maintainer upload.
+ * Fix cgo on riscv64 link issue. (Closes: #-1)
+ * workaround to skip tsan test on riscv64. (Closes: #1112166)
+
+ -- Bo YU <[email protected]> Wed, 10 Sep 2025 16:13:48 +0800
+
golang-1.24 (1.24.4-3) unstable; urgency=medium
* Set better CC defaults around arm* (native for arm*, armhf for others)
diff -Nru golang-1.24-1.24.4/debian/patches/0003-Fix-cgo-on-rv64-gcc-15.patch
golang-1.24-1.24.4/debian/patches/0003-Fix-cgo-on-rv64-gcc-15.patch
--- golang-1.24-1.24.4/debian/patches/0003-Fix-cgo-on-rv64-gcc-15.patch
1970-01-01 00:00:00.000000000 +0000
+++ golang-1.24-1.24.4/debian/patches/0003-Fix-cgo-on-rv64-gcc-15.patch
2025-09-10 08:13:26.000000000 +0000
@@ -0,0 +1,64 @@
+From 12e5efd71011fbb5816a1d815e91b5c865fa9a83 Mon Sep 17 00:00:00 2001
+From: Mark Ryan <[email protected]>
+Date: Fri, 25 Apr 2025 17:23:49 +0200
+Subject: [PATCH] cmd/link: fix cgo on riscv64 when building with gcc-15
+
+It's not currently possible to build cgo programs that are partially
+compiled with gcc-15 on riscv64 using the internal linker. There are
+two reasons for this.
+
+1. When gcc-15 compiles _cgo_export.c, which contains no actual code,
+ for a riscv64 target, it emits a label in the .text section called
+ .Letext0. This label is referred to by another section, .debug_line,
+ and an entry is generated in the symbol table for it. The Go linker
+ panics when processing the .Letext0 symbol in _cgo_export.o, as it
+ occurs in an empty section.
+2. GCC-15 is generating additional debug symbols with the .LVUS
+ prefix, e.g., .LVUS33, that need to be ignored.
+
+We fix the issue by removing the check in
+cmd/link/internal/loader/loader.go that panics if we encounter a
+symbol in an empty section (the comments preceding this check suggest
+it's safe to remove it) and by adding .LVUS to the list of symbol
+prefixes to ignore.
+
+Fixes #72840
+
+Change-Id: I00658b6bdd01606dde1581b5bc2f42edfc37de82
+Reviewed-on: https://go-review.googlesource.com/c/go/+/668276
+Auto-Submit: Dmitri Shuralyov <[email protected]>
+LUCI-TryBot-Result: Go LUCI
<[email protected]>
+Reviewed-by: Dmitri Shuralyov <[email protected]>
+Reviewed-by: Joel Sing <[email protected]>
+Reviewed-by: Carlos Amedee <[email protected]>
+Reviewed-by: Meng Zhuo <[email protected]>
+---
+
+--- a/src/cmd/link/internal/loadelf/ldelf.go
++++ b/src/cmd/link/internal/loadelf/ldelf.go
+@@ -609,7 +609,7 @@
+ continue
+ }
+
+- if strings.HasPrefix(elfsym.name, ".LASF") ||
strings.HasPrefix(elfsym.name, ".LLRL") || strings.HasPrefix(elfsym.name,
".LLST") {
++ if strings.HasPrefix(elfsym.name, ".LASF") ||
strings.HasPrefix(elfsym.name, ".LLRL") || strings.HasPrefix(elfsym.name,
".LLST") || strings.HasPrefix(elfsym.name, ".LVUS") {
+ // gcc on s390x and riscv64 does this.
+ continue
+ }
+--- a/src/cmd/link/internal/loader/loader.go
++++ b/src/cmd/link/internal/loader/loader.go
+@@ -1736,14 +1736,6 @@
+ // expected to have the actual content/payload) and then a set of
+ // interior loader.Sym's that point into a portion of the container.
+ func (l *Loader) AddInteriorSym(container Sym, interior Sym) {
+- // Container symbols are expected to have content/data.
+- // NB: this restriction may turn out to be too strict (it's possible
+- // to imagine a zero-sized container with an interior symbol pointing
+- // into it); it's ok to relax or remove it if we counter an
+- // oddball host object that triggers this.
+- if l.SymSize(container) == 0 && len(l.Data(container)) == 0 {
+- panic("unexpected empty container symbol")
+- }
+ // The interior symbols for a container are not expected to have
+ // content/data or relocations.
+ if len(l.Data(interior)) != 0 {
diff -Nru
golang-1.24-1.24.4/debian/patches/0003-Skip-flasky-TestAsan-on-riscv64.patch
golang-1.24-1.24.4/debian/patches/0003-Skip-flasky-TestAsan-on-riscv64.patch
---
golang-1.24-1.24.4/debian/patches/0003-Skip-flasky-TestAsan-on-riscv64.patch
1970-01-01 00:00:00.000000000 +0000
+++
golang-1.24-1.24.4/debian/patches/0003-Skip-flasky-TestAsan-on-riscv64.patch
2025-09-10 08:13:48.000000000 +0000
@@ -0,0 +1,51 @@
+Description: skip tsan test on riscv64
+ Race detector on riscv64 is not support yet, this is usually no problem on
Debian
+ building because it will be skipped automatically. But others package updated
+ recently lead to the test failed.
+Author: Bo YU <[email protected]>
+Origin: upstream, https://github.com/golang/go/issues/64345
+Bug: https://bugs.debian.org/1112166
+Last-Update: 2025-08-30
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/src/cmd/cgo/internal/testsanitizers/tsan_test.go
++++ b/src/cmd/cgo/internal/testsanitizers/tsan_test.go
+@@ -11,6 +11,7 @@
+ "os/exec"
+ "strings"
+ "testing"
++ "runtime"
+ )
+
+ func TestTSAN(t *testing.T) {
+@@ -29,6 +30,10 @@
+ if !compilerRequiredTsanVersion(goos, goarch) {
+ t.Skipf("skipping on %s/%s; compiler version for -tsan option
is too old.", goos, goarch)
+ }
++ if runtime.GOARCH == "riscv64" {
++ t.Skipf("skipping; flaky on %s", runtime.GOARCH)
++ }
++
+
+ t.Parallel()
+ requireOvercommit(t)
+--- a/src/cmd/cgo/internal/testsanitizers/cshared_test.go
++++ b/src/cmd/cgo/internal/testsanitizers/cshared_test.go
+@@ -14,6 +14,7 @@
+ "os/exec"
+ "strings"
+ "testing"
++ "runtime"
+ )
+
+ func TestShared(t *testing.T) {
+@@ -65,6 +66,9 @@
+ t.Logf("skipping %s test on %s/%s; compiler version too
old for -tsan.", name, GOOS, GOARCH)
+ continue
+ }
++ if runtime.GOARCH == "riscv64" {
++ t.Skipf("skipping; flaky on %s", runtime.GOARCH)
++ }
+
+ t.Run(name, func(t *testing.T) {
+ t.Parallel()
diff -Nru golang-1.24-1.24.4/debian/patches/series
golang-1.24-1.24.4/debian/patches/series
--- golang-1.24-1.24.4/debian/patches/series 2025-08-08 02:26:49.000000000
+0000
+++ golang-1.24-1.24.4/debian/patches/series 2025-09-10 08:13:48.000000000
+0000
@@ -1,2 +1,4 @@
0001-Skip-flaky-TestCrashDumpsAllThreads-on-mips64le.patch
0002-Skip-flaky-TestCrashDumpsAllThreads-on-s390x.patch
+0003-Skip-flasky-TestAsan-on-riscv64.patch
+0003-Fix-cgo-on-rv64-gcc-15.patch
diff -Nru golang-1.24-1.24.4/debian/patches/series.orig
golang-1.24-1.24.4/debian/patches/series.orig
--- golang-1.24-1.24.4/debian/patches/series.orig 1970-01-01
00:00:00.000000000 +0000
+++ golang-1.24-1.24.4/debian/patches/series.orig 2025-09-10
08:13:15.000000000 +0000
@@ -0,0 +1,3 @@
+0001-Skip-flaky-TestCrashDumpsAllThreads-on-mips64le.patch
+0002-Skip-flaky-TestCrashDumpsAllThreads-on-s390x.patch
+0003-Fix-cgo-on-rv64-gcc-15.patch
signature.asc
Description: PGP signature
--- End Message ---