Skip to content

Commit

Permalink
misc/ios: rework exec wrapper to only support simulator
Browse files Browse the repository at this point in the history
This updates the tools used to execute Go binaries on the Apple iOS
Simulator to (a) work with newer arm64 macOS, (b) remove support
for running binaries on physical devices, and (c) remove the reliance on
LLDB and third-party Python packages. This makes the wrapper somewhat
simpler, and easier to understand and maintain. Additionally
clangwrap.sh is updated to reflect dropping support for targeting
physical devices.

This smoothes out the path for #66360.

Change-Id: I769127e65f5e8c6c727841168890fd8557fb0e1d
Reviewed-on: https://go-review.googlesource.com/c/go/+/573175
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
  • Loading branch information
rolandshoemaker committed Jun 18, 2024
1 parent e44fa1c commit 4cf2b02
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 565 deletions.
19 changes: 11 additions & 8 deletions misc/ios/clangwrap.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
#!/bin/sh
# This uses the latest available iOS SDK, which is recommended.
# To select a specific SDK, run 'xcodebuild -showsdks'
# to see the available SDKs and replace iphoneos with one of them.

# This script configures clang to target the iOS simulator. If you'd like to
# build for real iOS devices, change SDK to "iphoneos" and PLATFORM to "ios".
# This uses the latest available iOS SDK, which is recommended. To select a
# specific SDK, run 'xcodebuild -showsdks' to see the available SDKs and replace
# iphonesimulator with one of them.

SDK=iphonesimulator
PLATFORM=ios-simulator

if [ "$GOARCH" == "arm64" ]; then
SDK=iphoneos
PLATFORM=ios
CLANGARCH="arm64"
else
SDK=iphonesimulator
PLATFORM=ios-simulator
CLANGARCH="x86_64"
fi

SDK_PATH=`xcrun --sdk $SDK --show-sdk-path`
export IPHONEOS_DEPLOYMENT_TARGET=5.1

# cmd/cgo doesn't support llvm-gcc-4.2, so we have to use clang.
CLANG=`xcrun --sdk $SDK --find clang`

Expand Down
Loading

0 comments on commit 4cf2b02

Please sign in to comment.