- Register hash/maphash in hasAltPkg map in runtime/build.go - Add rand() function that bridges to fastrand64() in runtime overlay - Add memhash() function that bridges to internal memhash() in runtime overlay - Fixes issue where hash/maphash package failed with undefined symbols Fixes #1338 Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: luoliwoshang <luoliwoshang@users.noreply.github.com> Co-authored-by: xgopilot <noreply@goplus.org>
63 lines
1.7 KiB
Go
63 lines
1.7 KiB
Go
package runtime
|
|
|
|
func SkipToBuild(pkgPath string) bool {
|
|
if _, ok := hasAltPkg[pkgPath]; ok {
|
|
return false
|
|
}
|
|
return pkgPath == "unsafe"
|
|
}
|
|
|
|
func HasAltPkg(path string) (b bool) {
|
|
_, b = hasAltPkg[path]
|
|
return
|
|
}
|
|
|
|
type none struct{}
|
|
|
|
var hasAltPkg = map[string]none{
|
|
"crypto/hmac": {},
|
|
"crypto/md5": {},
|
|
"crypto/rand": {},
|
|
"crypto/sha1": {},
|
|
"crypto/sha256": {},
|
|
"crypto/sha512": {},
|
|
"crypto/subtle": {},
|
|
"go/parser": {},
|
|
"hash/crc32": {},
|
|
"hash/maphash": {},
|
|
"internal/abi": {},
|
|
"internal/bytealg": {},
|
|
"internal/chacha8rand": {},
|
|
"internal/cpu": {},
|
|
"internal/itoa": {},
|
|
"internal/godebug": {},
|
|
"internal/oserror": {},
|
|
"internal/poll": {},
|
|
"internal/reflectlite": {},
|
|
"internal/runtime/atomic": {},
|
|
"internal/runtime/maps": {},
|
|
"internal/runtime/sys": {},
|
|
"internal/sync": {},
|
|
"internal/syscall/execenv": {},
|
|
"internal/syscall/unix": {},
|
|
"math": {},
|
|
"math/cmplx": {},
|
|
"math/rand": {},
|
|
"reflect": {},
|
|
"sync": {},
|
|
"sync/atomic": {},
|
|
"syscall": {},
|
|
"syscall/js": {},
|
|
"time": {},
|
|
"os": {},
|
|
"os/exec": {},
|
|
"os/signal": {},
|
|
"runtime": {},
|
|
"runtime/debug": {},
|
|
"runtime/pprof": {},
|
|
"runtime/trace": {},
|
|
"runtime/internal/syscall": {},
|
|
"io": {},
|
|
"io/fs": {},
|
|
}
|