public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/golang] eln: Upstream fix for race detector on riscv64
@ 2026-11-24 17:45 Andrea Bolognani
  0 siblings, 0 replies; only message in thread
From: Andrea Bolognani @ 2026-11-24 17:45 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/golang
            Branch : eln
            Commit : a11b5e4b2e113aa369236ae67f25f56ff559a49a
            Author : Andrea Bolognani <abologna@redhat.com>
            Date   : 2026-11-23T11:15:37-05:00
            Stats  : +52/-0 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/golang/c/a11b5e4b2e113aa369236ae67f25f56ff559a49a?branch=eln

            Log:
            Upstream fix for race detector on riscv64

https://github.com/golang/go/commit/ba78072aeeab6893745b99d645c771165ff75f1d

---
diff --git a/fix-riscv64-race-detector.patch b/fix-riscv64-race-detector.patch
new file mode 100644
index 0000000..7ebc2d8
--- /dev/null
+++ b/fix-riscv64-race-detector.patch
@@ -0,0 +1,50 @@
+From ba78072aeeab6893745b99d645c771165ff75f1d Mon Sep 17 00:00:00 2001
+From: Qiuweihong <953950914@qq.com>
+Date: Tue, 3 Nov 2026 07:12:21 +0000
+Subject: [PATCH] runtime: fix register use in racecallbackthunk on riscv64
+
+X23 is callee-saved in the RISC-V C ABI, so racecallbackthunk, which is
+called from the C/C++ race runtime, must not use it without saving it.
+
+Use X5 instead: it is caller-saved, and a JALR through X5 gives the
+correct return-address-stack hint.
+
+Change-Id: Ia50b589495fbee03812bc76cbfba874b6ea7834e
+GitHub-Last-Rev: 7e5d41df0fc62c29ced984aa9a94d3cf88047543
+GitHub-Pull-Request: golang/go#82724
+Reviewed-on: https://go-review.googlesource.com/c/go/+/856701
+Reviewed-by: David Chase <drchase@google.com>
+Reviewed-by: Junyang Shao <shaojunyang@google.com>
+LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
+Auto-Submit: Joel Sing <joel@sing.id.au>
+Reviewed-by: Julian Zhu <jz531210@gmail.com>
+Reviewed-by: Joel Sing <joel@sing.id.au>
+---
+ src/runtime/race_riscv64.s | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/runtime/race_riscv64.s b/src/runtime/race_riscv64.s
+index 26ea43420c..68bd090587 100644
+--- a/src/runtime/race_riscv64.s
++++ b/src/runtime/race_riscv64.s
+@@ -459,7 +459,7 @@ TEXT	runtime·racecallbackthunk(SB), NOSPLIT|NOFRAME, $0
+ 	// can be executed on g0. Second, it is called frequently, so will
+ 	// benefit from this fast path.
+ 	BNEZ	X10, rest
+-	MOV	X1, X23
++	MOV	X1, X5
+ 	MOV	g, X6
+ 	CALL	runtime·load_g(SB)
+ 	MOV	g_m(g), X7
+@@ -467,7 +467,7 @@ TEXT	runtime·racecallbackthunk(SB), NOSPLIT|NOFRAME, $0
+ 	MOV	p_raceprocctx(X7), X7
+ 	MOV	X7, (X11)
+ 	MOV	X6, g
+-	JMP	(X23)
++	JMP	(X5)
+ rest:
+ 	// Save callee-save registers (X8, X9, X18..X27, F8, F9, F18..F27),
+ 	// since Go code will not respect this.
+-- 
+2.47.3
+

diff --git a/golang.spec b/golang.spec
index cf1fc42..5afe2a1 100644
--- a/golang.spec
+++ b/golang.spec
@@ -222,6 +222,8 @@ Patch1:         0001-Modify-go.env.patch
 Patch7:         revert_dwarf5.patch
 Patch8:         skip-TestTerminalSignal-in-container.patch
 Patch9:		skip-external-net-tests.patch
+# https://github.com/golang/go/commit/ba78072aeeab6893745b99d645c771165ff75f1d
+Patch10:        fix-riscv64-race-detector.patch
 
 # Having documentation separate was broken
 Obsoletes:      %{name}-docs < 1.1-4

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-24 17:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-24 17:45 [rpms/golang] eln: Upstream fix for race detector on riscv64 Andrea Bolognani

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox