From d639e016504e16438a6de2e1b6bb06a16632ffa9 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Fri, 13 Jan 2023 19:54:05 +0100 Subject: [PATCH] runtime: implement math/rand.fastrand64 to fix linker error This is needed for Go 1.20 support. --- src/runtime/algorithm.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/runtime/algorithm.go b/src/runtime/algorithm.go index 35e2e260..11b39200 100644 --- a/src/runtime/algorithm.go +++ b/src/runtime/algorithm.go @@ -7,6 +7,14 @@ import ( "unsafe" ) +// This function is needed by math/rand since Go 1.20. +// See: https://github.com/golang/go/issues/54880 +// +//go:linkname rand_fastrand64 math/rand.fastrand64 +func rand_fastrand64() uint64 { + return fastrand64() +} + // This function is used by hash/maphash. func fastrand() uint32 { xorshift32State = xorshift32(xorshift32State)