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 13:22:03.000000000 +0800 +++ golang-1.24-1.24.4/debian/changelog 2025-09-10 16:13:48.000000000 +0800 @@ -1,3 +1,11 @@ +golang-1.24 (1.24.4-3.1.1) UNRELEASED; urgency=medium + + * Non-maintainer upload. + * workaround to skip tsan test on riscv64. (Closes: #1112166) + * Fix cgo on riscv64 link issue. (Closes: #1114841) + + -- Bo YU 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 08:00:00.000000000 +0800 +++ golang-1.24-1.24.4/debian/patches/0003-Fix-cgo-on-rv64-gcc-15.patch 2025-09-10 16:13:26.000000000 +0800 @@ -0,0 +1,64 @@ +From 12e5efd71011fbb5816a1d815e91b5c865fa9a83 Mon Sep 17 00:00:00 2001 +From: Mark Ryan +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 +LUCI-TryBot-Result: Go LUCI +Reviewed-by: Dmitri Shuralyov +Reviewed-by: Joel Sing +Reviewed-by: Carlos Amedee +Reviewed-by: Meng Zhuo +--- + +--- 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-TestAsan-on-riscv64.patch golang-1.24-1.24.4/debian/patches/0003-Skip-TestAsan-on-riscv64.patch --- golang-1.24-1.24.4/debian/patches/0003-Skip-TestAsan-on-riscv64.patch 1970-01-01 08:00:00.000000000 +0800 +++ golang-1.24-1.24.4/debian/patches/0003-Skip-TestAsan-on-riscv64.patch 2025-09-10 16:13:48.000000000 +0800 @@ -0,0 +1,35 @@ +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 +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 +@@ -29,6 +29,10 @@ + if !compilerRequiredTsanVersion(goos, goarch) { + t.Skipf("skipping on %s/%s; compiler version for -tsan option is too old.", goos, goarch) + } ++ if goarch == "riscv64" { ++ t.Skipf("skipping TestTSAN test on %s", goarch) ++ } ++ + + t.Parallel() + requireOvercommit(t) +--- a/src/cmd/cgo/internal/testsanitizers/cshared_test.go ++++ b/src/cmd/cgo/internal/testsanitizers/cshared_test.go +@@ -65,6 +65,9 @@ + t.Logf("skipping %s test on %s/%s; compiler version too old for -tsan.", name, GOOS, GOARCH) + continue + } ++ if GOARCH == "riscv64" { ++ t.Skipf("skipping %s test on %s", name, 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 10:26:49.000000000 +0800 +++ golang-1.24-1.24.4/debian/patches/series 2025-09-10 16:13:48.000000000 +0800 @@ -1,2 +1,4 @@ 0001-Skip-flaky-TestCrashDumpsAllThreads-on-mips64le.patch 0002-Skip-flaky-TestCrashDumpsAllThreads-on-s390x.patch +0003-Skip-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 08:00:00.000000000 +0800 +++ golang-1.24-1.24.4/debian/patches/series.orig 2025-09-10 16:13:15.000000000 +0800 @@ -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