Skip to content

Commit

Permalink
Apply patch from bazelbuild/bazel#13870
Browse files Browse the repository at this point in the history
  • Loading branch information
BalestraPatrick committed Oct 19, 2021
1 parent 168d321 commit 2b219ed
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
4 changes: 4 additions & 0 deletions 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 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 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 2b219ed

Please sign in to comment.