From: Elias Naur Date: Wed, 6 Nov 2019 12:41:56 +0000 (+0100) Subject: cmd/link/internal/ld: omit bitcode-incompatible flags on iOS simulator X-Git-Tag: go1.14beta1~382 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=1bd974eeb7238f1f8c09e037a86988d1d2b1e33a;p=gostls13.git cmd/link/internal/ld: omit bitcode-incompatible flags on iOS simulator The -Wl,-headerpad, -Wl,-no_pie, -Wl,-pagezero_size flags are incompatible with the bitcode-related flags used for iOS. We already omitted the flags on darwin/arm and darwin/arm64; this change omits the flags on all platforms != macOS so that building for the iOS simulator works. Updates #32963 Change-Id: Ic9af0daf01608f5ae0f70858e3045e399de7e95b Reviewed-on: https://go-review.googlesource.com/c/go/+/205340 Run-TryBot: Elias Naur TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go index 63987bb14a..9a72d4ff0d 100644 --- a/src/cmd/link/internal/ld/lib.go +++ b/src/cmd/link/internal/ld/lib.go @@ -1187,7 +1187,7 @@ func (ctxt *Link) hostlink() { switch ctxt.HeadType { case objabi.Hdarwin: - if !ctxt.Arch.InFamily(sys.ARM, sys.ARM64) { + if machoPlatform == PLATFORM_MACOS { // -headerpad is incompatible with -fembed-bitcode. argv = append(argv, "-Wl,-headerpad,1144") } @@ -1227,7 +1227,7 @@ func (ctxt *Link) hostlink() { switch ctxt.BuildMode { case BuildModeExe: if ctxt.HeadType == objabi.Hdarwin { - if !ctxt.Arch.InFamily(sys.ARM, sys.ARM64) { + if machoPlatform == PLATFORM_MACOS { argv = append(argv, "-Wl,-no_pie") argv = append(argv, "-Wl,-pagezero_size,4000000") }