loader,crypto: fix link error for crypto/internal/boring/sig.StandardCrypto

Этот коммит содержится в:
Damian Gryski 2022-08-18 14:00:57 -07:00 коммит произвёл Ron Evans
родитель b485e8bfbd
коммит 227a55d891
3 изменённых файлов: 27 добавлений и 3 удалений

Просмотреть файл

@ -46,7 +46,7 @@ func GetCachedGoroot(config *compileopts.Config) (string, error) {
} }
// Find the overrides needed for the goroot. // Find the overrides needed for the goroot.
overrides := pathsToOverride(needsSyscallPackage(config.BuildTags())) overrides := pathsToOverride(config.GoMinorVersion, needsSyscallPackage(config.BuildTags()))
// Resolve the merge links within the goroot. // Resolve the merge links within the goroot.
merge, err := listGorootMergeLinks(goroot, tinygoroot, overrides) merge, err := listGorootMergeLinks(goroot, tinygoroot, overrides)
@ -223,7 +223,7 @@ func needsSyscallPackage(buildTags []string) bool {
// The boolean indicates whether to merge the subdirs. True means merge, false // The boolean indicates whether to merge the subdirs. True means merge, false
// means use the TinyGo version. // means use the TinyGo version.
func pathsToOverride(needsSyscallPackage bool) map[string]bool { func pathsToOverride(goMinor int, needsSyscallPackage bool) map[string]bool {
paths := map[string]bool{ paths := map[string]bool{
"": true, "": true,
"crypto/": true, "crypto/": true,
@ -243,6 +243,13 @@ func pathsToOverride(needsSyscallPackage bool) map[string]bool {
"sync/": true, "sync/": true,
"testing/": true, "testing/": true,
} }
if goMinor >= 19 {
paths["crypto/internal/"] = true
paths["crypto/internal/boring/"] = true
paths["crypto/internal/boring/sig/"] = false
}
if needsSyscallPackage { if needsSyscallPackage {
paths["syscall/"] = true // include syscall/js paths["syscall/"] = true // include syscall/js
} }

Просмотреть файл

@ -264,7 +264,7 @@ func (p *Program) getOriginalPath(path string) string {
originalPath = realgorootPath originalPath = realgorootPath
} }
maybeInTinyGoRoot := false maybeInTinyGoRoot := false
for prefix := range pathsToOverride(needsSyscallPackage(p.config.BuildTags())) { for prefix := range pathsToOverride(p.config.GoMinorVersion, needsSyscallPackage(p.config.BuildTags())) {
if runtime.GOOS == "windows" { if runtime.GOOS == "windows" {
prefix = strings.ReplaceAll(prefix, "/", "\\") prefix = strings.ReplaceAll(prefix, "/", "\\")
} }

17
src/crypto/internal/boring/sig/sig_other.go Обычный файл
Просмотреть файл

@ -0,0 +1,17 @@
// Package sig stubs crypto/internal/boring/sig
package sig
// BoringCrypto indicates that the BoringCrypto module is present.
func BoringCrypto() {
}
// FIPSOnly indicates that package crypto/tls/fipsonly is present.
func FIPSOnly() {
}
// StandardCrypto indicates that standard Go crypto is present.
func StandardCrypto() {
}