mirror of
https://github.com/golang/go
synced 2024-11-24 09:00:13 -07:00
cmd/link: only adjust pagezero for iOS on darwin/arm64
The new pagezero_size introduced by CL 72730 breaks on 32-bit systems, since it is 2³². Restrict the change to darwin/arm64, since it is intended for iOS only. We could plausibly allow GOARCH=amd64 as well, but without a compelling reason, changing the zero page size doesn't seem worth the risk. Change-Id: I5d6adcbaff8d0e5b169ff13512f188332cc7ed9a Reviewed-on: https://go-review.googlesource.com/73250 Run-TryBot: Russ Cox <rsc@golang.org> Run-TryBot: David Crawshaw <crawshaw@golang.org> Reviewed-by: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
parent
e7fed7fa35
commit
4a5b99c3a8
@ -1105,10 +1105,13 @@ func (ctxt *Link) hostlink() {
|
|||||||
switch ctxt.BuildMode {
|
switch ctxt.BuildMode {
|
||||||
case BuildModeExe:
|
case BuildModeExe:
|
||||||
if ctxt.HeadType == objabi.Hdarwin {
|
if ctxt.HeadType == objabi.Hdarwin {
|
||||||
// __PAGEZERO segment size determined empirically.
|
if ctxt.Arch.Family == sys.ARM64 {
|
||||||
// XCode 9.0.1 successfully uploads an iOS app with this value.
|
// __PAGEZERO segment size determined empirically.
|
||||||
// Also works for macOS apps.
|
// XCode 9.0.1 successfully uploads an iOS app with this value.
|
||||||
argv = append(argv, "-Wl,-pagezero_size,100000000")
|
argv = append(argv, "-Wl,-pagezero_size,100000000")
|
||||||
|
} else {
|
||||||
|
argv = append(argv, "-Wl,-pagezero_size,4000000")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
case BuildModePIE:
|
case BuildModePIE:
|
||||||
// ELF.
|
// ELF.
|
||||||
|
Loading…
Reference in New Issue
Block a user