aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDamian Gryski <[email protected]>2022-08-18 14:00:57 -0700
committerRon Evans <[email protected]>2022-09-01 09:48:40 +0200
commit227a55d891b2bb32dc17ff13e0781a14e1d100f3 (patch)
tree6752009c2ced4f14791b90afb127e69b716e75f6
parentb485e8bfbd2c08a2db2d3a17a993054b7a2c4dde (diff)
downloadtinygo-227a55d891b2bb32dc17ff13e0781a14e1d100f3.tar.gz
tinygo-227a55d891b2bb32dc17ff13e0781a14e1d100f3.zip
loader,crypto: fix link error for crypto/internal/boring/sig.StandardCrypto
-rw-r--r--loader/goroot.go11
-rw-r--r--loader/loader.go2
-rw-r--r--src/crypto/internal/boring/sig/sig_other.go17
3 files changed, 27 insertions, 3 deletions
diff --git a/loader/goroot.go b/loader/goroot.go
index 1a16acf0a..ff2697fc0 100644
--- a/loader/goroot.go
+++ b/loader/goroot.go
@@ -46,7 +46,7 @@ func GetCachedGoroot(config *compileopts.Config) (string, error) {
}
// 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.
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
// 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{
"": true,
"crypto/": true,
@@ -243,6 +243,13 @@ func pathsToOverride(needsSyscallPackage bool) map[string]bool {
"sync/": true,
"testing/": true,
}
+
+ if goMinor >= 19 {
+ paths["crypto/internal/"] = true
+ paths["crypto/internal/boring/"] = true
+ paths["crypto/internal/boring/sig/"] = false
+ }
+
if needsSyscallPackage {
paths["syscall/"] = true // include syscall/js
}
diff --git a/loader/loader.go b/loader/loader.go
index 6ced36dcd..cc577da9d 100644
--- a/loader/loader.go
+++ b/loader/loader.go
@@ -264,7 +264,7 @@ func (p *Program) getOriginalPath(path string) string {
originalPath = realgorootPath
}
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" {
prefix = strings.ReplaceAll(prefix, "/", "\\")
}
diff --git a/src/crypto/internal/boring/sig/sig_other.go b/src/crypto/internal/boring/sig/sig_other.go
new file mode 100644
index 000000000..ee6ff8ee3
--- /dev/null
+++ b/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() {
+
+}