Skip to content

Commit

Permalink
Add ios_sim_arm64 crosstool support
Browse files Browse the repository at this point in the history
Now that c1ea2d4 has landed this updates the crosstool to make use of the new arch.

Closes #13870.

PiperOrigin-RevId: 404628877
  • Loading branch information
keith authored and copybara-github committed Oct 20, 2021
1 parent 15a0939 commit 101e526
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
4 changes: 4 additions & 0 deletions tools/osx/crosstool/BUILD.toolchains
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ OSX_TOOLS_CONSTRAINTS = {
"@platforms//os:ios",
"@platforms//cpu:x86_64",
],
"ios_sim_arm64": [
"@platforms//os:ios",
"@platforms//cpu:aarch64",
],
"tvos_arm64": [
"@platforms//os:ios",
"@platforms//cpu:aarch64",
Expand Down
12 changes: 11 additions & 1 deletion tools/osx/crosstool/cc_toolchain_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ def _impl(ctx):
target_system_name = "i386-apple-watchos"
elif (ctx.attr.cpu == "ios_x86_64"):
target_system_name = "x86_64-apple-ios"
elif (ctx.attr.cpu == "ios_sim_arm64"):
target_system_name = "arm64-apple-ios-simulator"
elif (ctx.attr.cpu == "darwin_x86_64"):
target_system_name = "x86_64-apple-macosx"
elif (ctx.attr.cpu == "darwin_arm64"):
Expand Down Expand Up @@ -100,6 +102,8 @@ def _impl(ctx):

host_system_name = "x86_64-apple-macosx"
arch = ctx.attr.cpu.split("_", 1)[-1]
if ctx.attr.cpu == "ios_sim_arm64":
arch = "arm64"

all_compile_actions = [
ACTION_NAMES.c_compile,
Expand Down Expand Up @@ -735,6 +739,7 @@ def _impl(ctx):
ctx.attr.cpu == "ios_armv7" or
ctx.attr.cpu == "ios_i386" or
ctx.attr.cpu == "ios_x86_64" or
ctx.attr.cpu == "ios_sim_arm64" or
ctx.attr.cpu == "watchos_arm64_32" or
ctx.attr.cpu == "watchos_armv7k" or
ctx.attr.cpu == "watchos_i386" or
Expand Down Expand Up @@ -919,6 +924,7 @@ def _impl(ctx):

if (ctx.attr.cpu == "ios_i386" or
ctx.attr.cpu == "ios_x86_64" or
ctx.attr.cpu == "ios_sim_arm64" or
ctx.attr.cpu == "tvos_x86_64" or
ctx.attr.cpu == "watchos_i386" or
ctx.attr.cpu == "watchos_x86_64"):
Expand Down Expand Up @@ -987,6 +993,7 @@ def _impl(ctx):
ctx.attr.cpu == "ios_armv7" or
ctx.attr.cpu == "ios_i386" or
ctx.attr.cpu == "ios_x86_64" or
ctx.attr.cpu == "ios_sim_arm64" or
ctx.attr.cpu == "tvos_arm64" or
ctx.attr.cpu == "tvos_x86_64" or
ctx.attr.cpu == "watchos_arm64_32" or
Expand Down Expand Up @@ -1220,7 +1227,8 @@ def _impl(ctx):
)

if (ctx.attr.cpu == "ios_i386" or
ctx.attr.cpu == "ios_x86_64"):
ctx.attr.cpu == "ios_x86_64" or
ctx.attr.cpu == "ios_sim_arm64"):
version_min_feature = feature(
name = "version_min",
flag_sets = [
Expand Down Expand Up @@ -1747,6 +1755,7 @@ def _impl(ctx):
ctx.attr.cpu == "ios_armv7" or
ctx.attr.cpu == "ios_i386" or
ctx.attr.cpu == "ios_x86_64" or
ctx.attr.cpu == "ios_sim_arm64" or
ctx.attr.cpu == "tvos_arm64" or
ctx.attr.cpu == "tvos_x86_64" or
ctx.attr.cpu == "watchos_arm64_32" or
Expand Down Expand Up @@ -2830,6 +2839,7 @@ def _impl(ctx):
ctx.attr.cpu == "ios_armv7" or
ctx.attr.cpu == "ios_i386" or
ctx.attr.cpu == "ios_x86_64" or
ctx.attr.cpu == "ios_sim_arm64" or
ctx.attr.cpu == "tvos_arm64" or
ctx.attr.cpu == "tvos_x86_64" or
ctx.attr.cpu == "watchos_arm64_32" or
Expand Down
1 change: 1 addition & 0 deletions tools/osx/crosstool/osx_archs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ OSX_TOOLS_NON_DEVICE_ARCHS = [
"darwin_arm64e",
"ios_i386",
"ios_x86_64",
"ios_sim_arm64",
"watchos_i386",
"watchos_x86_64",
"tvos_x86_64",
Expand Down

0 comments on commit 101e526

Please sign in to comment.