mirror of
https://github.com/golang/go.git
synced 2026-04-02 17:30:01 +09:00
cmd/link: fix macOS 13 build
Write our own load command for macOS builds, to make sure we can put the versions in. Builds on older macOS were seeing an LC_VERSION_MIN instead and scribbling over fields that didn't exist. Fixes #78070. Change-Id: If338d0506b1156b133253e496f29818a29a22a91 Reviewed-on: https://go-review.googlesource.com/c/go/+/754241 Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Russ Cox <rsc@golang.org>
This commit is contained in:
@@ -461,14 +461,9 @@ func (ctxt *Link) domacho() {
|
||||
if err != nil {
|
||||
Exitf("%v", err)
|
||||
}
|
||||
if load != nil {
|
||||
machoPlatform = load.platform
|
||||
if load != nil && load.platform != PLATFORM_MACOS {
|
||||
ml := newMachoLoad(ctxt.Arch, load.cmd.type_, uint32(len(load.cmd.data)))
|
||||
copy(ml.data, load.cmd.data)
|
||||
if machoPlatform == PLATFORM_MACOS {
|
||||
ml.data[1] = macOS.version()
|
||||
ml.data[2] = macSDK.version()
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
@@ -477,7 +472,7 @@ func (ctxt *Link) domacho() {
|
||||
if buildcfg.GOOS == "ios" {
|
||||
machoPlatform = PLATFORM_IOS
|
||||
}
|
||||
if ctxt.LinkMode == LinkInternal && machoPlatform == PLATFORM_MACOS {
|
||||
if load == nil && machoPlatform == PLATFORM_MACOS {
|
||||
ml := newMachoLoad(ctxt.Arch, imacho.LC_BUILD_VERSION, 4)
|
||||
ml.data[0] = uint32(machoPlatform)
|
||||
ml.data[1] = macOS.version()
|
||||
|
||||
Reference in New Issue
Block a user