Skip to content

Commit

Permalink
skip internal linking
Browse files Browse the repository at this point in the history
  • Loading branch information
gdams committed Jan 10, 2025
1 parent 8bd9fd4 commit e2f7895
Showing 1 changed file with 37 additions and 1 deletion.
38 changes: 37 additions & 1 deletion patches/0006-Add-Darwin-crypto-backend.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Subject: [PATCH] Add Darwin crypto backend

---
.gitignore | 2 +
src/cmd/dist/test.go | 17 +
src/cmd/go/go_boring_test.go | 9 +-
src/cmd/go/testdata/script/darwin_no_cgo.txt | 2 +
src/crypto/ecdsa/ecdsa.go | 6 +-
Expand All @@ -26,7 +27,7 @@ Subject: [PATCH] Add Darwin crypto backend
src/internal/goexperiment/flags.go | 1 +
src/net/lookup_test.go | 3 +
src/runtime/pprof/vminfo_darwin_test.go | 6 +
22 files changed, 523 insertions(+), 14 deletions(-)
23 files changed, 540 insertions(+), 14 deletions(-)
create mode 100644 src/crypto/internal/backend/bbig/big_darwin.go
create mode 100644 src/crypto/internal/backend/darwin_darwin.go
create mode 100644 src/crypto/internal/backend/fips140/darwin.go
Expand All @@ -47,6 +48,41 @@ index c6512e64a4ef39..b3b01db73b009d 100644
# This file includes artifacts of Go build that should not be checked in.
# For files created by specific development environment (e.g. editor),
# use alternative ways to exclude files from git.
diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go
index 0de6e80fd985a3..5f7bada61a6225 100644
--- a/src/cmd/dist/test.go
+++ b/src/cmd/dist/test.go
@@ -888,6 +888,18 @@ func (t *tester) registerTests() {
runTests: "TestFIPSCheck",
})
}
+ if goos == "darwin" && (strings.Contains(goexperiment, "systemcrypto") || strings.Contains(goexperiment, "darwincrypto")) {
+ t.registerTest("external linking, -buildmode=exe",
+ &goTest{
+ variant: "exe_external",
+ timeout: 60 * time.Second,
+ buildmode: "exe",
+ ldflags: "-linkmode=external",
+ env: []string{"CGO_ENABLED=1"},
+ pkg: "crypto/internal/fips140test",
+ runTests: "TestFIPSCheck",
+ })
+ }
if t.externalLinkPIE() && !disablePIE {
t.registerTest("external linking, -buildmode=pie",
&goTest{
@@ -1161,6 +1173,11 @@ func (t *tester) internalLink() bool {
if goos == "windows" && goarch == "arm64" {
return false
}
+ if goos == "darwin" && (strings.Contains(goexperiment, "systemcrypto") || strings.Contains(goexperiment, "darwincrypto")) {
+ // linkmode=internal isn't supported with system/darwin crypto.
+ // see https://github.com/microsoft/go-crypto-darwin/issues/33
+ return false
+ }
// Internally linking cgo is incomplete on some architectures.
// https://golang.org/issue/10373
// https://golang.org/issue/14449
diff --git a/src/cmd/go/go_boring_test.go b/src/cmd/go/go_boring_test.go
index 06478963f4be44..8111b143a1295b 100644
--- a/src/cmd/go/go_boring_test.go
Expand Down

0 comments on commit e2f7895

Please sign in to comment.