]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link/internal/ld: use 12.0.0 OS/SDK versions for macOS linking
authorDmitri Shuralyov <dmitshur@golang.org>
Wed, 21 May 2025 17:13:48 +0000 (13:13 -0400)
committerGopher Robot <gobot@golang.org>
Wed, 21 May 2025 21:03:10 +0000 (14:03 -0700)
Go 1.25 will require macOS 12 Monterey or later, so macOS 11 will be
unsupported. The comment here suggests using a supported macOS version,
and that it can be the most recent one.

For now, make a minimal change of going from 11.0.0 to 12.0.0 so that
the chosen version is a supported one (although not the most recent).

However, it looks like even in CL 460476 (where the comment was added)
we were staying with the macOS version that matched Go's oldest, so we
might not have have recent experience with going beyond that. Update
the comment accordingly.

For #69839.

Change-Id: I90908971b0d5a8235ce77dc6bc9649e86008270a
Cq-Include-Trybots: luci.golang.try:gotip-darwin-amd64-longtest,gotip-darwin-arm64-longtest,gotip-darwin-amd64_12,gotip-darwin-amd64_14,gotip-darwin-arm64_12,gotip-darwin-arm64_15
Reviewed-on: https://go-review.googlesource.com/c/go/+/675095
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
src/cmd/link/internal/ld/macho.go
src/cmd/link/link_test.go

index f55f342d6eeb5f4b214d89f108167bea3669ded3..431dad9d6bcbaa476d833d829cb5b06fe52224a0 100644 (file)
@@ -430,8 +430,10 @@ func (ctxt *Link) domacho() {
                                // This must be fairly recent for Apple signing (go.dev/issue/30488).
                                // Having too old a version here was also implicated in some problems
                                // calling into macOS libraries (go.dev/issue/56784).
-                               // In general this can be the most recent supported macOS version.
-                               version = 11<<16 | 0<<8 | 0<<0 // 11.0.0
+                               // CL 460476 noted that in general this can be the most recent supported
+                               // macOS version, but we haven't tested if going higher than Go's oldest
+                               // supported macOS version could cause new problems.
+                               version = 12<<16 | 0<<8 | 0<<0 // 12.0.0
                        }
                        ml := newMachoLoad(ctxt.Arch, imacho.LC_BUILD_VERSION, 4)
                        ml.data[0] = uint32(machoPlatform)
index c3614c73f073c5d1113975e7bbfa84243f05cd13..7c3ca427edc5128068a88b7f524db9eb122e0cf5 100644 (file)
@@ -397,8 +397,8 @@ func TestMachOBuildVersion(t *testing.T) {
        found := false
        checkMin := func(ver uint32) {
                major, minor, patch := (ver>>16)&0xff, (ver>>8)&0xff, (ver>>0)&0xff
-               if major < 11 {
-                       t.Errorf("LC_BUILD_VERSION version %d.%d.%d < 11.0.0", major, minor, patch)
+               if major < 12 {
+                       t.Errorf("LC_BUILD_VERSION version %d.%d.%d < 12.0.0", major, minor, patch)
                }
        }
        for _, cmd := range exem.Loads {