Open source some objc tests. Most notably, proto and j2objc tests still remain, but will follow.

RELNOTES: None.
PiperOrigin-RevId: 166635306
diff --git a/src/test/java/com/google/devtools/build/lib/BUILD b/src/test/java/com/google/devtools/build/lib/BUILD
index 7348bd6..6993b1f 100644
--- a/src/test/java/com/google/devtools/build/lib/BUILD
+++ b/src/test/java/com/google/devtools/build/lib/BUILD
@@ -39,6 +39,7 @@
         "//src/test/java/com/google/devtools/build/lib/rules/android:srcs",
         "//src/test/java/com/google/devtools/build/lib/rules/apple:srcs",
         "//src/test/java/com/google/devtools/build/lib/rules/config:srcs",
+        "//src/test/java/com/google/devtools/build/lib/rules/objc:srcs",
         "//src/test/java/com/google/devtools/build/lib/analysis/platform:srcs",
         "//src/test/java/com/google/devtools/build/lib/analysis/whitelisting:srcs",
         "//src/test/java/com/google/devtools/build/lib/rules/platform:srcs",
diff --git a/src/test/java/com/google/devtools/build/lib/analysis/mock/BazelAnalysisMock.java b/src/test/java/com/google/devtools/build/lib/analysis/mock/BazelAnalysisMock.java
index 96e6d17..bd6ce31 100644
--- a/src/test/java/com/google/devtools/build/lib/analysis/mock/BazelAnalysisMock.java
+++ b/src/test/java/com/google/devtools/build/lib/analysis/mock/BazelAnalysisMock.java
@@ -64,12 +64,14 @@
             "local_repository(name = 'local_config_xcode', path = '/local_config_xcode')",
             "bind(",
             "  name = 'objc_proto_lib',",
-            "  actual = '//objcproto:ProtocolBuffers_lib',",
+            "  actual = '@bazel_tools//objcproto:ProtocolBuffers_lib',",
             ")",
             "bind(",
             "  name = 'objc_protobuf_lib',",
-            "  actual = '//objcproto:protobuf_lib',",
+            "  actual = '@bazel_tools//objcproto:protobuf_lib',",
             ")",
+            "local_repository(name = 'com_google_protobuf', path = '/protobuf')",
+            "local_repository(name = 'com_google_protobuf_java', path = '/protobuf')",
             "bind(name = 'android/sdk', actual='@bazel_tools//tools/android:sdk')",
             "bind(name = 'tools/python', actual='//tools/python')"));
   }
@@ -79,7 +81,10 @@
     List<String> workspaceContents = getWorkspaceContents(config);
     config.create(
         "/local_config_xcode/BUILD", "xcode_config(name = 'host_xcodes')");
+    config.create(
+        "/protobuf/BUILD", "licenses(['notice'])", "exports_files(['protoc', 'cc_toolchain'])");
     config.create("/local_config_xcode/WORKSPACE");
+    config.create("/protobuf/WORKSPACE");
     config.overwrite("WORKSPACE", workspaceContents.toArray(new String[workspaceContents.size()]));
     config.create("/bazel_tools_workspace/WORKSPACE", "workspace(name = 'bazel_tools')");
     config.create(
@@ -159,6 +164,28 @@
         "package(default_visibility=['//visibility:public'])",
         "cc_binary(name='launcher', srcs=['launcher_main.cc'])");
 
+    config.create(
+        "/bazel_tools_workspace/objcproto/BUILD",
+        "package(default_visibility=['//visibility:public'])",
+        "objc_library(",
+        "  name = 'ProtocolBuffers_lib',",
+        "  srcs = ['empty.m'],",
+        ")",
+        "objc_library(",
+        "  name = 'protobuf_lib',",
+        "  srcs = ['empty.m'],",
+        "  hdrs = ['include/header.h'],",
+        "  includes = ['include'],",
+        ")",
+        "exports_files(['well_known_type.proto'])",
+        "proto_library(",
+        "  name = 'well_known_type_proto',",
+        "  srcs = ['well_known_type.proto'],",
+        ")");
+    config.create("/bazel_tools_workspace/objcproto/empty.m");
+    config.create("/bazel_tools_workspace/objcproto/empty.cc");
+    config.create("/bazel_tools_workspace/objcproto/well_known_type.proto");
+
     ccSupport().setup(config);
   }
 
diff --git a/src/test/java/com/google/devtools/build/lib/packages/util/BazelMockCcSupport.java b/src/test/java/com/google/devtools/build/lib/packages/util/BazelMockCcSupport.java
index c7c1258..296cd82 100644
--- a/src/test/java/com/google/devtools/build/lib/packages/util/BazelMockCcSupport.java
+++ b/src/test/java/com/google/devtools/build/lib/packages/util/BazelMockCcSupport.java
@@ -173,9 +173,7 @@
     } else {
       config.create("tools/cpp/link_dynamic_library.sh", "");
     }
-    config.create(
-        "/bazel_tools_workspace/tools/objc/BUILD",
-        "xcode_config(name = 'host_xcodes')");
+    MockObjcSupport.setup(config);
     MockPlatformSupport.setup(config, "/bazel_tools_workspace/tools/platforms");
   }
 
diff --git a/src/test/java/com/google/devtools/build/lib/packages/util/MOCK_OSX_CROSSTOOL b/src/test/java/com/google/devtools/build/lib/packages/util/MOCK_OSX_CROSSTOOL
index e1b2816..86e7e7c 100644
--- a/src/test/java/com/google/devtools/build/lib/packages/util/MOCK_OSX_CROSSTOOL
+++ b/src/test/java/com/google/devtools/build/lib/packages/util/MOCK_OSX_CROSSTOOL
@@ -26,6 +26,10 @@
   toolchain_identifier: "darwin_x86_64"
 }
 default_toolchain {
+  cpu: "x64_windows"
+  toolchain_identifier: "darwin_x86_64"
+}
+default_toolchain {
   cpu: "ios_x86_64"
   toolchain_identifier: "ios_x86_64"
 }
@@ -3324,6 +3328,3272 @@
   cc_target_os: "apple"
 }
 toolchain {
+  toolchain_identifier: "darwin_x86_64"
+  host_system_name: "x86_64-apple-macosx"
+  target_system_name: "x86_64-apple-macosx"
+  target_cpu: "x64_windows"
+  target_libc: "macosx"
+  compiler: "compiler"
+  abi_version: "darwin_x86_64"
+  abi_libc_version: "darwin_x86_64"
+  tool_path {
+    name: "ar"
+    path: "mac/ar_wrapper"
+  }
+  tool_path {
+    name: "compat-ld"
+    path: "mac/ld"
+  }
+  tool_path {
+    name: "cpp"
+    path: "mac/cpp"
+  }
+  tool_path {
+    name: "gcov"
+    path: "mac/gcov"
+  }
+  tool_path {
+    name: "gcc"
+    path: "mac/clang"
+  }
+  tool_path {
+    name: "ld"
+    path: "mac/ld"
+  }
+  tool_path {
+    name: "nm"
+    path: "mac/nm"
+  }
+  tool_path {
+    name: "strip"
+    path: "mac/strip"
+  }
+  tool_path {
+    name: "dwp"
+    path: "/usr/bin/dwp"
+  }
+  tool_path {
+    name: "objdump"
+    path: "/usr/bin/objdump"
+  }
+  needsPic: false
+  compiler_flag: "-DCOMPILER_GCC3"
+  compiler_flag: "-DCOMPILER_GCC4"
+  compiler_flag: "-Dunix"
+  compiler_flag: "-DOS_MACOSX"
+  compiler_flag: "-DU_HAVE_NL_LANGINFO_CODESET=0"
+  compiler_flag: "-DU_HAVE_STD_STRING"
+  compiler_flag: "-D__STDC_FORMAT_MACROS"
+  cxx_flag: "-std=gnu++11"
+  cxx_flag: "-stdlib=libc++"
+  linker_flag: "-lc++"
+  compilation_mode_flags {
+    mode: FASTBUILD
+    compiler_flag: "-O0"
+    compiler_flag: "-DDEBUG"
+  }
+  compilation_mode_flags {
+    mode: OPT
+    compiler_flag: "-Os"
+    compiler_flag: "-DNDEBUG"
+  }
+  compilation_mode_flags {
+    mode: DBG
+    compiler_flag: "-g"
+    compiler_flag: "-DDEBUG"
+  }
+  linking_mode_flags {
+    mode: DYNAMIC
+  }
+  make_variable {
+    name: "STACK_FRAME_UNLIMITED"
+    value: "-Wframe-larger-than=100000000 -Wno-vla"
+  }
+  cxx_builtin_include_directory: "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/"
+  cxx_builtin_include_directory: "/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/"
+  cxx_builtin_include_directory: "/Applications/Xcode_7.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/"
+  cxx_builtin_include_directory: "/Applications/Xcode_7.3.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/"
+  cxx_builtin_include_directory: "/Applications/Xcode_8.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/"
+  cxx_builtin_include_directory: "/Applications/Xcode_8.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/"
+  cxx_builtin_include_directory: "/Applications/Xcode_8.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/"
+  cxx_builtin_include_directory: "/Applications/Xcode_8.2.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/"
+  cxx_builtin_include_directory: "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs"
+  cxx_builtin_include_directory: "/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs"
+  cxx_builtin_include_directory: "/Applications/Xcode_7.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs"
+  cxx_builtin_include_directory: "/Applications/Xcode_7.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs"
+  cxx_builtin_include_directory: "/Applications/Xcode_8.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs"
+  cxx_builtin_include_directory: "/Applications/Xcode_8.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs"
+  cxx_builtin_include_directory: "/Applications/Xcode_8.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs"
+  cxx_builtin_include_directory: "/Applications/Xcode_8.2.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs"
+  cxx_builtin_include_directory: "/usr/include"
+  builtin_sysroot: ""
+  unfiltered_cxx_flag: "-no-canonical-prefixes"
+  unfiltered_cxx_flag: "-pthread"
+  supports_normalizing_ar: false
+  default_python_version: "python2.7"
+  feature {
+    name: "no_legacy_features"
+  }
+  feature {
+    name: "fastbuild"
+    implies: "fastbuild_only_flag"
+  }
+  feature {
+    name: "opt"
+    flag_set {
+      action: "c-compile"
+      action: "c++-compile"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-g0"
+      }
+      with_feature {
+        feature: "no_generate_debug_symbols"
+      }
+    }
+    implies: "opt_only_flag"
+  }
+  feature {
+    name: "dbg"
+    implies: "dbg_only_flag"
+  }
+  feature {
+    name: "compile_all_modules"
+  }
+  feature {
+    name: "exclude_private_headers_in_module_maps"
+  }
+  feature {
+    name: "has_configured_linker_path"
+  }
+  feature {
+    name: "only_doth_headers_in_module_maps"
+  }
+  feature {
+    name: "is_not_test_target"
+  }
+  feature {
+    name: "generate_dsym_file"
+    flag_set {
+      action: "c-compile"
+      action: "c++-compile"
+      action: "objc-compile"
+      action: "objc++-compile"
+      action: "objc-executable"
+      action: "objc++-executable"
+      flag_group {
+        flag: "-g"
+      }
+    }
+    flag_set {
+      action: "objc-executable"
+      action: "objc++-executable"
+      flag_group {
+        flag: "DSYM_HINT_LINKED_BINARY=%{linked_binary}"
+        flag: "DSYM_HINT_DSYM_PATH=%{dsym_path}"
+        flag: "DSYM_HINT_DSYM_BUNDLE_ZIP=%{dsym_bundle_zip}"
+      }
+    }
+  }
+  feature {
+    name: "no_generate_debug_symbols"
+  }
+  feature {
+    name: "generate_linkmap"
+    flag_set {
+      action: "objc-executable"
+      action: "objc++-executable"
+      flag_group {
+        flag: "-Xlinker -map"
+        flag: "-Xlinker %{linkmap_exec_path}"
+      }
+    }
+  }
+  feature {
+    name: "objc_actions"
+    implies: "objc-compile"
+    implies: "objc++-compile"
+    implies: "objc-fully-link"
+    implies: "objc-archive"
+    implies: "objc-executable"
+    implies: "objc++-executable"
+    implies: "assemble"
+    implies: "preprocess-assemble"
+    implies: "c-compile"
+    implies: "c++-compile"
+    implies: "c++-link-static-library"
+    implies: "c++-link-pic-static-library"
+    implies: "c++-link-interface-dynamic-library"
+    implies: "c++-link-dynamic-library"
+    implies: "c++-link-alwayslink-static-library"
+    implies: "c++-link-alwayslink-pic-static-library"
+    implies: "c++-link-executable"
+  }
+  feature {
+    name: "strip_debug_symbols"
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "c++-link-interface-dynamic-library"
+      flag_group {
+        flag: "-Wl,-S"
+        expand_if_all_available: "strip_debug_symbols"
+      }
+    }
+  }
+  feature {
+    name: "symbol_counts"
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      flag_group {
+        flag: "-Wl,--print-symbol-counts=%{symbol_counts_output}"
+      }
+      expand_if_all_available: "symbol_counts_output"
+    }
+  }
+  feature {
+    name: "shared_flag"
+    flag_set {
+      action: "c++-link-dynamic-library"
+      flag_group {
+        flag: "-shared"
+      }
+    }
+  }
+  feature {
+    name: "linkstamps"
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      flag_group {
+        flag: "%{linkstamp_paths}"
+        iterate_over: "linkstamp_paths"
+      }
+      expand_if_all_available: "linkstamp_paths"
+    }
+  }
+  feature {
+    name: "output_execpath_flags"
+    flag_set {
+      action: "c++-link-dynamic-library"
+      flag_group {
+        flag: "-o"
+        flag: "%{output_execpath}"
+      }
+      expand_if_all_available: "output_execpath"
+    }
+  }
+  feature {
+    name: "output_execpath_flags_executable"
+    flag_set {
+      action: "c++-link-executable"
+      flag_group {
+        flag: "-o"
+      }
+      expand_if_all_available: "output_execpath"
+    }
+    flag_set {
+      action: "c++-link-executable"
+      flag_group {
+        flag: "/dev/null"
+        flag: "-MMD"
+        flag: "-MF"
+      }
+      expand_if_all_available: "skip_mostly_static"
+      expand_if_all_available: "output_execpath"
+    }
+    flag_set {
+      action: "c++-link-executable"
+      flag_group {
+        flag: "%{output_execpath}"
+      }
+      expand_if_all_available: "output_execpath"
+    }
+  }
+  feature {
+    name: "global_whole_archive_open"
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "c++-link-static-library"
+      action: "c++-link-alwayslink-static-library"
+      action: "c++-link-pic-static-library"
+      action: "c++-link-alwayslink-pic-static-library"
+      flag_group {
+        flag: "-Wl,-all_load"
+      }
+      expand_if_all_available: "global_whole_archive"
+    }
+  }
+  feature {
+    name: "runtime_root_flags"
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "c++-link-static-library"
+      action: "c++-link-alwayslink-static-library"
+      action: "c++-link-pic-static-library"
+      action: "c++-link-alwayslink-pic-static-library"
+      flag_group {
+        flag: "-Wl,-rpath,$ORIGIN/%{runtime_library_search_directories}"
+        iterate_over: "runtime_library_search_directories"
+      }
+      expand_if_all_available: "runtime_library_search_directories"
+    }
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "c++-link-static-library"
+      action: "c++-link-alwayslink-static-library"
+      action: "c++-link-pic-static-library"
+      action: "c++-link-alwayslink-pic-static-library"
+      flag_group {
+        flag: "%{runtime_root_flags}"
+        iterate_over: "runtime_root_flags"
+      }
+      expand_if_all_available: "runtime_root_flags"
+    }
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "c++-link-static-library"
+      action: "c++-link-alwayslink-static-library"
+      action: "c++-link-pic-static-library"
+      action: "c++-link-alwayslink-pic-static-library"
+      flag_group {
+        flag: "%{runtime_root_entries}"
+        iterate_over: "runtime_root_entries"
+      }
+      expand_if_all_available: "runtime_root_entries"
+    }
+  }
+  feature {
+    name: "archiver_flags"
+    flag_set {
+      action: "c++-link-static-library"
+      action: "c++-link-alwayslink-static-library"
+      action: "c++-link-pic-static-library"
+      action: "c++-link-alwayslink-pic-static-library"
+      flag_group {
+        flag: "rcs"
+        flag: "%{output_execpath}"
+      }
+      expand_if_all_available: "output_execpath"
+    }
+  }
+  feature {
+    name: "input_param_flags"
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "c++-link-static-library"
+      action: "c++-link-alwayslink-static-library"
+      action: "c++-link-pic-static-library"
+      action: "c++-link-alwayslink-pic-static-library"
+      flag_group {
+        flag: "-L%{library_search_directories}"
+        iterate_over: "library_search_directories"
+      }
+      expand_if_all_available: "library_search_directories"
+    }
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "c++-link-static-library"
+      action: "c++-link-alwayslink-static-library"
+      action: "c++-link-pic-static-library"
+      action: "c++-link-alwayslink-pic-static-library"
+      flag_group {
+        flag: "%{libopts}"
+        iterate_over: "libopts"
+      }
+      expand_if_all_available: "libopts"
+    }
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "c++-link-static-library"
+      action: "c++-link-alwayslink-static-library"
+      action: "c++-link-pic-static-library"
+      action: "c++-link-alwayslink-pic-static-library"
+      flag_group {
+        flag: "-Wl,-force_load,%{whole_archive_linker_params}"
+        iterate_over: "whole_archive_linker_params"
+      }
+      expand_if_all_available: "whole_archive_linker_params"
+    }
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "c++-link-static-library"
+      action: "c++-link-alwayslink-static-library"
+      action: "c++-link-pic-static-library"
+      action: "c++-link-alwayslink-pic-static-library"
+      flag_group {
+        flag: "%{linker_input_params}"
+        iterate_over: "linker_input_params"
+      }
+      expand_if_all_available: "linker_input_params"
+    }
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "c++-link-static-library"
+      action: "c++-link-alwayslink-static-library"
+      action: "c++-link-pic-static-library"
+      action: "c++-link-alwayslink-pic-static-library"
+      flag_group {
+        flag_group {
+          flag: "-Wl,--start-lib"
+          expand_if_equal {
+            variable: "libraries_to_link.type"
+            value: "object_file_group"
+          }
+        }
+        flag_group {
+          flag_group {
+            flag: "%{libraries_to_link.object_files}"
+            expand_if_false: "libraries_to_link.is_whole_archive"
+          }
+          flag_group {
+            flag: "-Wl,-force_load,%{libraries_to_link.object_files}"
+            expand_if_true: "libraries_to_link.is_whole_archive"
+          }
+          iterate_over: "libraries_to_link.object_files"
+          expand_if_equal {
+            variable: "libraries_to_link.type"
+            value: "object_file_group"
+          }
+        }
+        flag_group {
+          flag: "-Wl,--end-lib"
+          expand_if_equal {
+            variable: "libraries_to_link.type"
+            value: "object_file_group"
+          }
+        }
+        flag_group {
+          flag_group {
+            flag: "%{libraries_to_link.name}"
+            expand_if_false: "libraries_to_link.is_whole_archive"
+          }
+          flag_group {
+            flag: "-Wl,-force_load,%{libraries_to_link.name}"
+            expand_if_true: "libraries_to_link.is_whole_archive"
+          }
+          expand_if_equal {
+            variable: "libraries_to_link.type"
+            value: "object_file"
+          }
+        }
+        flag_group {
+          flag_group {
+            flag: "%{libraries_to_link.name}"
+            expand_if_false: "libraries_to_link.is_whole_archive"
+          }
+          flag_group {
+            flag: "-Wl,-force_load,%{libraries_to_link.name}"
+            expand_if_true: "libraries_to_link.is_whole_archive"
+          }
+          expand_if_equal {
+            variable: "libraries_to_link.type"
+            value: "interface_library"
+          }
+        }
+        flag_group {
+          flag_group {
+            flag: "%{libraries_to_link.name}"
+            expand_if_false: "libraries_to_link.is_whole_archive"
+          }
+          flag_group {
+            flag: "-Wl,-force_load,%{libraries_to_link.name}"
+            expand_if_true: "libraries_to_link.is_whole_archive"
+          }
+          expand_if_equal {
+            variable: "libraries_to_link.type"
+            value: "static_library"
+          }
+        }
+        flag_group {
+          flag_group {
+            flag: "-l%{libraries_to_link.name}"
+            expand_if_false: "libraries_to_link.is_whole_archive"
+          }
+          flag_group {
+            flag: "-Wl,-force_load,-l%{libraries_to_link.name}"
+            expand_if_true: "libraries_to_link.is_whole_archive"
+          }
+          expand_if_equal {
+            variable: "libraries_to_link.type"
+            value: "dynamic_library"
+          }
+        }
+        flag_group {
+          flag_group {
+            flag: "-l:%{libraries_to_link.name}"
+            expand_if_false: "libraries_to_link.is_whole_archive"
+          }
+          flag_group {
+            flag: "-Wl,-force_load,-l:%{libraries_to_link.name}"
+            expand_if_true: "libraries_to_link.is_whole_archive"
+          }
+          expand_if_equal {
+            variable: "libraries_to_link.type"
+            value: "versioned_dynamic_library"
+          }
+        }
+        iterate_over: "libraries_to_link"
+      }
+      expand_if_all_available: "libraries_to_link"
+    }
+  }
+  feature {
+    name: "force_pic_flags"
+    flag_set {
+      action: "c++-link-executable"
+      flag_group {
+        flag: "-pie"
+      }
+      expand_if_all_available: "force_pic"
+    }
+  }
+  feature {
+    name: "pch"
+    flag_set {
+      action: "objc-compile"
+      action: "objc++-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      flag_group {
+        flag: "-include"
+        flag: "%{pch_file}"
+      }
+    }
+  }
+  feature {
+    name: "module_maps"
+  }
+  feature {
+    name: "use_objc_modules"
+    flag_set {
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-fmodule-name=%{module_name}"
+        flag: "-iquote"
+        flag: "%{module_maps_dir}"
+        flag: "-fmodules-cache-path=%{modules_cache_path}"
+      }
+    }
+  }
+  feature {
+    name: "no_enable_modules"
+    flag_set {
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-fmodule-maps"
+      }
+    }
+    requires {
+      feature: "use_objc_modules"
+    }
+  }
+  feature {
+    name: "apply_default_warnings"
+    flag_set {
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-Wshorten-64-to-32"
+        flag: "-Wbool-conversion"
+        flag: "-Wconstant-conversion"
+        flag: "-Wduplicate-method-match"
+        flag: "-Wempty-body"
+        flag: "-Wenum-conversion"
+        flag: "-Wint-conversion"
+        flag: "-Wunreachable-code"
+        flag: "-Wmismatched-return-types"
+        flag: "-Wundeclared-selector"
+        flag: "-Wuninitialized"
+        flag: "-Wunused-function"
+        flag: "-Wunused-variable"
+      }
+    }
+  }
+  feature {
+    name: "preprocessor_defines"
+    flag_set {
+      action: "preprocess-assemble"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-header-preprocessing"
+      action: "c++-module-compile"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-D%{preprocessor_defines}"
+        iterate_over: "preprocessor_defines"
+      }
+    }
+  }
+  feature {
+    name: "framework_paths"
+    flag_set {
+      action: "objc-compile"
+      action: "objc++-compile"
+      action: "objc-executable"
+      action: "objc++-executable"
+      flag_group {
+        flag: "-F%{framework_paths}"
+        iterate_over: "framework_paths"
+      }
+    }
+  }
+  feature {
+    name: "apply_default_compiler_flags"
+    flag_set {
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-DOS_MACOSX"
+      }
+    }
+  }
+  feature {
+    name: "include_system_dirs"
+    flag_set {
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-module-compile"
+      action: "c++-header-parsing"
+      action: "c++-header-preprocessing"
+      action: "objc-compile"
+      action: "objc++-compile"
+      action: "objc-executable"
+      action: "objc++-executable"
+      action: "assemble"
+      action: "preprocess-assemble"
+      flag_group {
+        flag: "-isysroot"
+        flag: "%{sdk_dir}"
+      }
+    }
+  }
+  feature {
+    name: "objc_arc"
+    flag_set {
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-module-compile"
+      action: "c++-header-parsing"
+      action: "c++-header-preprocessing"
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-fobjc-arc"
+      }
+      expand_if_all_available: "objc_arc"
+    }
+  }
+  feature {
+    name: "no_objc_arc"
+    flag_set {
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-module-compile"
+      action: "c++-header-parsing"
+      action: "c++-header-preprocessing"
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-fno-objc-arc"
+      }
+      expand_if_all_available: "no_objc_arc"
+    }
+  }
+  feature {
+    name: "apple_env"
+    env_set {
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-module-compile"
+      action: "c++-header-parsing"
+      action: "c++-header-preprocessing"
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "objc-compile"
+      action: "objc++-compile"
+      action: "objc-archive"
+      action: "objc-fully-link"
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "c++-link-static-library"
+      action: "c++-link-alwayslink-static-library"
+      action: "c++-link-pic-static-library"
+      action: "c++-link-alwayslink-pic-static-library"
+      action: "objc-executable"
+      action: "objc++-executable"
+      env_entry {
+        key: "XCODE_VERSION_OVERRIDE"
+        value: "%{xcode_version_override_value}"
+      }
+      env_entry {
+        key: "APPLE_SDK_VERSION_OVERRIDE"
+        value: "%{apple_sdk_version_override_value}"
+      }
+      env_entry {
+        key: "APPLE_SDK_PLATFORM"
+        value: "%{apple_sdk_platform_value}"
+      }
+    }
+  }
+  feature {
+    name: "legacy_link_flags"
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "objc-executable"
+      action: "objc++-executable"
+      flag_group {
+        flag: "%{legacy_link_flags}"
+        iterate_over: "legacy_link_flags"
+      }
+      expand_if_all_available: "legacy_link_flags"
+    }
+  }
+  feature {
+    name: "linker_param_file"
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      flag_group {
+        flag: "-Wl,@%{linker_param_file}"
+      }
+      expand_if_all_available: "linker_param_file"
+    }
+    flag_set {
+      action: "c++-link-static-library"
+      action: "c++-link-alwayslink-static-library"
+      action: "c++-link-pic-static-library"
+      action: "c++-link-alwayslink-pic-static-library"
+      flag_group {
+        flag: "@%{linker_param_file}"
+      }
+      expand_if_all_available: "linker_param_file"
+    }
+  }
+  feature {
+    name: "version_min"
+    flag_set {
+      action: "objc-executable"
+      action: "objc++-executable"
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "preprocess-assemble"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-header-preprocessing"
+      action: "c++-module-compile"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-mmacosx-version-min=%{version_min}"
+      }
+    }
+  }
+  feature {
+    name: "dead_strip"
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "objc-executable"
+      action: "objc++-executable"
+      flag_group {
+        flag: "-dead_strip"
+        flag: "-no_dead_strip_inits_and_terms"
+      }
+      with_feature {
+        feature: "is_not_test_target"
+      }
+    }
+    flag_set {
+      action: "c-compile"
+      action: "c++-compile"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-g"
+      }
+    }
+    requires {
+      feature: "opt"
+    }
+  }
+  feature {
+    name: "dependency_file"
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-module-compile"
+      action: "objc-compile"
+      action: "objc++-compile"
+      action: "c++-header-preprocessing"
+      action: "c++-header-parsing"
+      flag_group {
+        flag: "-MD"
+        flag: "-MF"
+        flag: "%{dependency_file}"
+      }
+      expand_if_all_available: "dependency_file"
+    }
+  }
+  feature {
+    name: "random_seed"
+    flag_set {
+      action: "c++-compile"
+      action: "c++-module-codegen"
+      action: "c++-module-compile"
+      flag_group {
+        flag: "-frandom-seed=%{output_file}"
+      }
+    }
+  }
+  feature {
+    name: "pic"
+    flag_set {
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-module-codegen"
+      action: "c++-module-compile"
+      action: "preprocess-assemble"
+      flag_group {
+        flag: "-fPIC"
+      }
+      expand_if_all_available: "pic"
+    }
+  }
+  feature {
+    name: "per_object_debug_info"
+    flag_set {
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-module-codegen"
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "lto-backend"
+      flag_group {
+        flag: "-gsplit-dwarf"
+      }
+      expand_if_all_available: "per_object_debug_info_file"
+    }
+  }
+  feature {
+    name: "include_paths"
+    flag_set {
+      action: "preprocess-assemble"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-header-preprocessing"
+      action: "c++-module-compile"
+      action: "clif-match"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-iquote"
+        flag: "%{quote_include_paths}"
+        iterate_over: "quote_include_paths"
+      }
+      flag_group {
+        flag: "-I%{include_paths}"
+        iterate_over: "include_paths"
+      }
+      flag_group {
+        flag: "-isystem"
+        flag: "%{system_include_paths}"
+        iterate_over: "system_include_paths"
+      }
+    }
+  }
+  feature {
+    name: "fdo_instrument"
+    flag_set {
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-link-interface-dynamic-library"
+      action: "c++-link-dynamic-library"
+      action: "c++-link-executable"
+      flag_group {
+        flag: "-fprofile-generate=%{fdo_instrument_path}"
+        flag: "-fno-data-sections"
+      }
+    }
+    provides: "profile"
+  }
+  feature {
+    name: "fdo_optimize"
+    flag_set {
+      action: "c-compile"
+      action: "c++-compile"
+      flag_group {
+        flag: "-fprofile-use=%{fdo_profile_path}"
+        flag: "-Xclang-only=-Wno-profile-instr-unprofiled"
+        flag: "-Xclang-only=-Wno-profile-instr-out-of-date"
+        flag: "-fprofile-correction"
+      }
+      expand_if_all_available: "fdo_profile_path"
+    }
+    provides: "profile"
+  }
+  feature {
+    name: "autofdo"
+    flag_set {
+      action: "c-compile"
+      action: "c++-compile"
+      flag_group {
+        flag: "-fauto-profile=%{fdo_profile_path}"
+        flag: "-fprofile-correction"
+      }
+      expand_if_all_available: "fdo_profile_path"
+    }
+    provides: "profile"
+  }
+  feature {
+    name: "lipo"
+    flag_set {
+      action: "c-compile"
+      action: "c++-compile"
+      flag_group {
+        flag: "-fripa"
+      }
+    }
+    requires {
+      feature: "autofdo"
+    }
+    requires {
+      feature: "fdo_optimize"
+    }
+    requires {
+      feature: "fdo_instrument"
+    }
+  }
+  feature {
+    name: "asan"
+    flag_set {
+      action: "c-compile"
+      action: "c++-compile"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-O1"
+        flag: "-gmlt"
+        flag: "-fsanitize=address,bool,float-cast-overflow,integer-divide-by-zero,return,returns-nonnull-attribute,shift-exponent,unreachable,vla-bound"
+        flag: "-fno-sanitize-recover=all"
+        flag: "-DHEAPCHECK_DISABLE"
+        flag: "-DADDRESS_SANITIZER"
+        flag: "-D_GLIBCXX_ADDRESS_SANITIZER_ANNOTATIONS"
+        flag: "-fno-omit-frame-pointer"
+      }
+    }
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "objc-executable"
+      action: "objc++-executable"
+      flag_group {
+        flag: "-fsanitize=address,bool,float-cast-overflow,integer-divide-by-zero,return,returns-nonnull-attribute,shift-exponent,unreachable,vla-bound"
+        flag: "-fsanitize-link-c++-runtime"
+      }
+    }
+  }
+  feature {
+    name: "coverage"
+  }
+  feature {
+    name: "llvm_coverage_map_format"
+    flag_set {
+      action: "preprocess-assemble"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-module-compile"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-fprofile-instr-generate"
+        flag: "-fcoverage-mapping"
+        flag: "-g"
+      }
+    }
+    flag_set {
+      action: "c++-link-interface-dynamic-library"
+      action: "c++-link-dynamic-library"
+      action: "c++-link-executable"
+      action: "objc-executable"
+      action: "objc++-executable"
+      flag_group {
+        flag: "-fprofile-instr-generate"
+      }
+    }
+    requires {
+      feature: "coverage"
+    }
+    provides: "profile"
+  }
+  feature {
+    name: "gcc_coverage_map_format"
+    flag_set {
+      action: "preprocess-assemble"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-module-compile"
+      action: "objc-compile"
+      action: "objc++-compile"
+      action: "objc-executable"
+      action: "objc++-executable"
+      flag_group {
+        flag: "-fprofile-arcs"
+        flag: "-ftest-coverage"
+        flag: "-g"
+      }
+    }
+    flag_set {
+      action: "c++-link-interface-dynamic-library"
+      action: "c++-link-dynamic-library"
+      action: "c++-link-executable"
+      flag_group {
+        flag: "-lgcov"
+      }
+    }
+    requires {
+      feature: "coverage"
+    }
+    provides: "profile"
+  }
+  feature {
+    name: "cpp_linker_flags"
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      flag_group {
+        flag: "-undefined"
+        flag: "dynamic_lookup"
+      }
+    }
+  }
+  feature {
+    name: "apply_implicit_frameworks"
+    flag_set {
+      action: "objc-executable"
+      action: "objc++-executable"
+      flag_group {
+        flag: "-framework Foundation"
+      }
+    }
+  }
+  feature {
+    name: "link_cocoa"
+    flag_set {
+      action: "objc-executable"
+      action: "objc++-executable"
+      flag_group {
+        flag: "-framework Cocoa"
+      }
+    }
+  }
+  feature {
+    name: "apply_simulator_compiler_flags"
+  }
+  feature {
+    name: "unfiltered_cxx_flags"
+  }
+  feature {
+    name: "bitcode_embedded_markers"
+  }
+  feature {
+    name: "bitcode_embedded"
+  }
+  feature {
+    name: "copts"
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-header-preprocessing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "%{copts}"
+        iterate_over: "copts"
+      }
+      expand_if_all_available: "copts"
+    }
+  }
+  feature {
+    name: "dbg_only_flag"
+    flag_set {
+      action: "objc-compile"
+      flag_group {
+        flag: "--DBG_ONLY_FLAG"
+      }
+    }
+  }
+  feature {
+    name: "fastbuild_only_flag"
+    flag_set {
+      action: "objc-compile"
+      flag_group {
+        flag: "--FASTBUILD_ONLY_FLAG"
+      }
+    }
+  }
+  feature {
+    name: "opt_only_flag"
+    flag_set {
+      action: "objc-compile"
+      flag_group {
+        flag: "--OPT_ONLY_FLAG"
+      }
+    }
+  }
+  action_config {
+    config_name: "strip"
+    action_name: "strip"
+    tool {
+      tool_path: "mac/strip"
+    }
+    flag_set {
+      flag_group {
+        flag: "-S"
+        flag: "-o"
+        flag: "%{output_file}"
+        flag: "-R"
+        flag: ".gnu.switches.text.quote_paths"
+        flag: "-R"
+        flag: ".gnu.switches.text.bracket_paths"
+        flag: "-R"
+        flag: ".gnu.switches.text.system_paths"
+        flag: "-R"
+        flag: ".gnu.switches.text.cpp_defines"
+        flag: "-R"
+        flag: ".gnu.switches.text.cpp_includes"
+        flag: "-R"
+        flag: ".gnu.switches.text.cl_args"
+        flag: "-R"
+        flag: ".gnu.switches.text.lipo_info"
+        flag: "-R"
+        flag: ".gnu.switches.text.annotation"
+      }
+      flag_group {
+        flag: "%{stripopts}"
+        iterate_over: "stripopts"
+      }
+      flag_group {
+        flag: "%{input_file}"
+      }
+    }
+  }
+  action_config {
+    config_name: "c-compile"
+    action_name: "c-compile"
+    tool {
+      tool_path: "mac/wrapped_clang"
+      execution_requirement: "requires-darwin"
+    }
+    flag_set {
+      flag_group {
+        flag: "-arch x86_64"
+      }
+    }
+    implies: "preprocessor_defines"
+    implies: "include_system_dirs"
+    implies: "version_min"
+    implies: "objc_arc"
+    implies: "no_objc_arc"
+    implies: "apple_env"
+    implies: "copts"
+  }
+  action_config {
+    config_name: "c++-compile"
+    action_name: "c++-compile"
+    tool {
+      tool_path: "mac/wrapped_clang"
+      execution_requirement: "requires-darwin"
+    }
+    flag_set {
+      flag_group {
+        flag: "-arch x86_64"
+      }
+    }
+    implies: "preprocessor_defines"
+    implies: "include_system_dirs"
+    implies: "version_min"
+    implies: "objc_arc"
+    implies: "no_objc_arc"
+    implies: "apple_env"
+    implies: "copts"
+  }
+  action_config {
+    config_name: "c++-module-compile"
+    action_name: "c++-module-compile"
+    tool {
+      tool_path: "mac/wrapped_clang"
+      execution_requirement: "requires-darwin"
+    }
+    implies: "preprocessor_defines"
+    implies: "include_system_dirs"
+    implies: "version_min"
+    implies: "objc_arc"
+    implies: "no_objc_arc"
+    implies: "apple_env"
+    implies: "copts"
+  }
+  action_config {
+    config_name: "c++-header-parsing"
+    action_name: "c++-header-parsing"
+    tool {
+      tool_path: "mac/wrapped_clang"
+      execution_requirement: "requires-darwin"
+    }
+    implies: "preprocessor_defines"
+    implies: "include_system_dirs"
+    implies: "version_min"
+    implies: "objc_arc"
+    implies: "no_objc_arc"
+    implies: "apple_env"
+    implies: "copts"
+  }
+  action_config {
+    config_name: "c++-header-preprocessing"
+    action_name: "c++-header-preprocessing"
+    tool {
+      tool_path: "mac/wrapped_clang"
+      execution_requirement: "requires-darwin"
+    }
+    implies: "preprocessor_defines"
+    implies: "include_system_dirs"
+    implies: "version_min"
+    implies: "objc_arc"
+    implies: "no_objc_arc"
+    implies: "apple_env"
+    implies: "copts"
+  }
+  action_config {
+    config_name: "objc-compile"
+    action_name: "objc-compile"
+    tool {
+      tool_path: "mac/wrapped_clang"
+      execution_requirement: "requires-darwin"
+    }
+    flag_set {
+      flag_group {
+        flag: "-arch x86_64"
+      }
+    }
+    implies: "objc_actions"
+    implies: "apply_default_compiler_flags"
+    implies: "apply_default_warnings"
+    implies: "framework_paths"
+    implies: "preprocessor_defines"
+    implies: "include_system_dirs"
+    implies: "version_min"
+    implies: "objc_arc"
+    implies: "no_objc_arc"
+    implies: "apple_env"
+    implies: "copts"
+  }
+  action_config {
+    config_name: "objc++-compile"
+    action_name: "objc++-compile"
+    tool {
+      tool_path: "mac/wrapped_clang"
+      execution_requirement: "requires-darwin"
+    }
+    flag_set {
+      flag_group {
+        flag: "-arch x86_64"
+        flag: "-stdlib=libc++"
+        flag: "-std=gnu++11"
+      }
+    }
+    implies: "apply_default_compiler_flags"
+    implies: "apply_default_warnings"
+    implies: "framework_paths"
+    implies: "preprocessor_defines"
+    implies: "include_system_dirs"
+    implies: "version_min"
+    implies: "objc_arc"
+    implies: "no_objc_arc"
+    implies: "apple_env"
+    implies: "copts"
+  }
+  action_config {
+    config_name: "assemble"
+    action_name: "assemble"
+    tool {
+      tool_path: "mac/wrapped_clang"
+      execution_requirement: "requires-darwin"
+    }
+    implies: "objc_arc"
+    implies: "no_objc_arc"
+    implies: "include_system_dirs"
+    implies: "apple_env"
+    implies: "copts"
+  }
+  action_config {
+    config_name: "preprocess-assemble"
+    action_name: "preprocess-assemble"
+    tool {
+      tool_path: "mac/wrapped_clang"
+      execution_requirement: "requires-darwin"
+    }
+    implies: "preprocessor_defines"
+    implies: "include_system_dirs"
+    implies: "version_min"
+    implies: "objc_arc"
+    implies: "no_objc_arc"
+    implies: "apple_env"
+    implies: "copts"
+  }
+  action_config {
+    config_name: "objc-archive"
+    action_name: "objc-archive"
+    tool {
+      tool_path: "mac/libtool"
+      execution_requirement: "requires-darwin"
+    }
+    flag_set {
+      flag_group {
+        flag: "-static"
+        flag: "-filelist"
+        flag: "%{obj_list_path}"
+        flag: "-arch_only"
+        flag: "x86_64"
+        flag: "-syslibroot"
+        flag: "%{sdk_dir}"
+        flag: "-o"
+        flag: "%{archive_path}"
+      }
+    }
+    implies: "apple_env"
+  }
+  action_config {
+    config_name: "objc-executable"
+    action_name: "objc-executable"
+    tool {
+      tool_path: "mac/wrapped_clang"
+      execution_requirement: "requires-darwin"
+    }
+    flag_set {
+      flag_group {
+        flag: "-arch x86_64"
+      }
+      flag_group {
+        flag: "-Xlinker"
+        flag: "-objc_abi_version"
+        flag: "-Xlinker"
+        flag: "2"
+        flag: "-Xlinker"
+        flag: "-rpath"
+        flag: "-Xlinker"
+        flag: "@executable_path/Frameworks"
+        flag: "-fobjc-link-runtime"
+        flag: "-ObjC"
+      }
+      flag_group {
+        flag: "-framework %{framework_names}"
+        iterate_over: "framework_names"
+      }
+      flag_group {
+        flag: "-weak_framework %{weak_framework_names}"
+        iterate_over: "weak_framework_names"
+      }
+      flag_group {
+        flag: "-l%{library_names}"
+        iterate_over: "library_names"
+      }
+      flag_group {
+        flag: "-filelist %{filelist}"
+      }
+      flag_group {
+        flag: "-o %{linked_binary}"
+      }
+      flag_group {
+        flag: "-force_load %{force_load_exec_paths}"
+        iterate_over: "force_load_exec_paths"
+      }
+      flag_group {
+        flag: "%{dep_linkopts}"
+        iterate_over: "dep_linkopts"
+      }
+      flag_group {
+        flag: "-Wl,%{attr_linkopts}"
+        iterate_over: "attr_linkopts"
+      }
+    }
+    implies: "include_system_dirs"
+    implies: "framework_paths"
+    implies: "version_min"
+    implies: "legacy_link_flags"
+    implies: "apple_env"
+    implies: "apply_implicit_frameworks"
+  }
+  action_config {
+    config_name: "objc++-executable"
+    action_name: "objc++-executable"
+    tool {
+      tool_path: "mac/wrapped_clang++"
+      execution_requirement: "requires-darwin"
+    }
+    flag_set {
+      flag_group {
+        flag: "-stdlib=libc++"
+        flag: "-std=gnu++11"
+      }
+      flag_group {
+        flag: "-arch x86_64"
+      }
+      flag_group {
+        flag: "-Xlinker"
+        flag: "-objc_abi_version"
+        flag: "-Xlinker"
+        flag: "2"
+        flag: "-Xlinker"
+        flag: "-rpath"
+        flag: "-Xlinker"
+        flag: "@executable_path/Frameworks"
+        flag: "-fobjc-link-runtime"
+        flag: "-ObjC"
+      }
+      flag_group {
+        flag: "-framework %{framework_names}"
+        iterate_over: "framework_names"
+      }
+      flag_group {
+        flag: "-weak_framework %{weak_framework_names}"
+        iterate_over: "weak_framework_names"
+      }
+      flag_group {
+        flag: "-l%{library_names}"
+        iterate_over: "library_names"
+      }
+      flag_group {
+        flag: "-filelist %{filelist}"
+      }
+      flag_group {
+        flag: "-o %{linked_binary}"
+      }
+      flag_group {
+        flag: "-force_load %{force_load_exec_paths}"
+        iterate_over: "force_load_exec_paths"
+      }
+      flag_group {
+        flag: "%{dep_linkopts}"
+        iterate_over: "dep_linkopts"
+      }
+      flag_group {
+        flag: "-Wl,%{attr_linkopts}"
+        iterate_over: "attr_linkopts"
+      }
+    }
+    implies: "include_system_dirs"
+    implies: "framework_paths"
+    implies: "version_min"
+    implies: "legacy_link_flags"
+    implies: "apple_env"
+    implies: "apply_implicit_frameworks"
+  }
+  action_config {
+    config_name: "c++-link-executable"
+    action_name: "c++-link-executable"
+    tool {
+      tool_path: "mac/clang"
+      execution_requirement: "requires-darwin"
+    }
+    implies: "symbol_counts"
+    implies: "linkstamps"
+    implies: "output_execpath_flags_executable"
+    implies: "global_whole_archive_open"
+    implies: "runtime_root_flags"
+    implies: "input_param_flags"
+    implies: "force_pic_flags"
+    implies: "legacy_link_flags"
+    implies: "strip_debug_symbols"
+    implies: "linker_param_file"
+    implies: "version_min"
+    implies: "apple_env"
+    implies: "cpp_linker_flags"
+  }
+  action_config {
+    config_name: "c++-link-dynamic-library"
+    action_name: "c++-link-dynamic-library"
+    tool {
+      tool_path: "mac/clang"
+      execution_requirement: "requires-darwin"
+    }
+    implies: "has_configured_linker_path"
+    implies: "symbol_counts"
+    implies: "shared_flag"
+    implies: "linkstamps"
+    implies: "output_execpath_flags"
+    implies: "global_whole_archive_open"
+    implies: "runtime_root_flags"
+    implies: "input_param_flags"
+    implies: "legacy_link_flags"
+    implies: "strip_debug_symbols"
+    implies: "linker_param_file"
+    implies: "version_min"
+    implies: "apple_env"
+    implies: "cpp_linker_flags"
+  }
+  action_config {
+    config_name: "c++-link-static-library"
+    action_name: "c++-link-static-library"
+    tool {
+      tool_path: "mac/ar_wrapper"
+      execution_requirement: "requires-darwin"
+    }
+    implies: "global_whole_archive_open"
+    implies: "runtime_root_flags"
+    implies: "archiver_flags"
+    implies: "input_param_flags"
+    implies: "linker_param_file"
+    implies: "apple_env"
+  }
+  action_config {
+    config_name: "c++-link-alwayslink-static-library"
+    action_name: "c++-link-alwayslink-static-library"
+    tool {
+      tool_path: "mac/ar_wrapper"
+      execution_requirement: "requires-darwin"
+    }
+    implies: "global_whole_archive_open"
+    implies: "runtime_root_flags"
+    implies: "archiver_flags"
+    implies: "input_param_flags"
+    implies: "linker_param_file"
+    implies: "apple_env"
+  }
+  action_config {
+    config_name: "c++-link-pic-static-library"
+    action_name: "c++-link-pic-static-library"
+    tool {
+      tool_path: "mac/ar_wrapper"
+      execution_requirement: "requires-darwin"
+    }
+    implies: "global_whole_archive_open"
+    implies: "runtime_root_flags"
+    implies: "archiver_flags"
+    implies: "input_param_flags"
+    implies: "linker_param_file"
+    implies: "apple_env"
+  }
+  action_config {
+    config_name: "c++-link-alwayslink-pic-static-library"
+    action_name: "c++-link-alwayslink-pic-static-library"
+    tool {
+      tool_path: "mac/ar_wrapper"
+      execution_requirement: "requires-darwin"
+    }
+    implies: "global_whole_archive_open"
+    implies: "runtime_root_flags"
+    implies: "archiver_flags"
+    implies: "input_param_flags"
+    implies: "linker_param_file"
+    implies: "apple_env"
+  }
+  action_config {
+    config_name: "c++-link-interface-dynamic-library"
+    action_name: "c++-link-interface-dynamic-library"
+    tool {
+      tool_path: "mac/clang"
+      execution_requirement: "requires-darwin"
+    }
+    implies: "strip_debug_symbols"
+    implies: "apple_env"
+  }
+  action_config {
+    config_name: "objc-fully-link"
+    action_name: "objc-fully-link"
+    tool {
+      tool_path: "mac/libtool"
+      execution_requirement: "requires-darwin"
+    }
+    flag_set {
+      flag_group {
+        flag: "-static"
+        flag: "-arch_only"
+        flag: "x86_64"
+        flag: "-syslibroot"
+        flag: "%{sdk_dir}"
+        flag: "-o"
+        flag: "%{fully_linked_archive_path}"
+      }
+      flag_group {
+        flag: "%{objc_library_exec_paths}"
+        iterate_over: "objc_library_exec_paths"
+      }
+      flag_group {
+        flag: "%{cc_library_exec_paths}"
+        iterate_over: "cc_library_exec_paths"
+      }
+      flag_group {
+        flag: "%{imported_library_exec_paths}"
+        iterate_over: "imported_library_exec_paths"
+      }
+    }
+    implies: "apple_env"
+  }
+  cc_target_os: "apple"
+}
+toolchain {
+  toolchain_identifier: "darwin_x86_64"
+  host_system_name: "x86_64-apple-macosx"
+  target_system_name: "x86_64-apple-macosx"
+  target_cpu: "darwin"
+  target_libc: "macosx"
+  compiler: "compiler"
+  abi_version: "darwin_x86_64"
+  abi_libc_version: "darwin_x86_64"
+  tool_path {
+    name: "ar"
+    path: "mac/ar_wrapper"
+  }
+  tool_path {
+    name: "compat-ld"
+    path: "mac/ld"
+  }
+  tool_path {
+    name: "cpp"
+    path: "mac/cpp"
+  }
+  tool_path {
+    name: "gcov"
+    path: "mac/gcov"
+  }
+  tool_path {
+    name: "gcc"
+    path: "mac/clang"
+  }
+  tool_path {
+    name: "ld"
+    path: "mac/ld"
+  }
+  tool_path {
+    name: "nm"
+    path: "mac/nm"
+  }
+  tool_path {
+    name: "strip"
+    path: "mac/strip"
+  }
+  tool_path {
+    name: "dwp"
+    path: "/usr/bin/dwp"
+  }
+  tool_path {
+    name: "objdump"
+    path: "/usr/bin/objdump"
+  }
+  needsPic: false
+  compiler_flag: "-DCOMPILER_GCC3"
+  compiler_flag: "-DCOMPILER_GCC4"
+  compiler_flag: "-Dunix"
+  compiler_flag: "-DOS_MACOSX"
+  compiler_flag: "-DU_HAVE_NL_LANGINFO_CODESET=0"
+  compiler_flag: "-DU_HAVE_STD_STRING"
+  compiler_flag: "-D__STDC_FORMAT_MACROS"
+  cxx_flag: "-std=gnu++11"
+  cxx_flag: "-stdlib=libc++"
+  linker_flag: "-lc++"
+  compilation_mode_flags {
+    mode: FASTBUILD
+    compiler_flag: "-O0"
+    compiler_flag: "-DDEBUG"
+  }
+  compilation_mode_flags {
+    mode: OPT
+    compiler_flag: "-Os"
+    compiler_flag: "-DNDEBUG"
+  }
+  compilation_mode_flags {
+    mode: DBG
+    compiler_flag: "-g"
+    compiler_flag: "-DDEBUG"
+  }
+  linking_mode_flags {
+    mode: DYNAMIC
+  }
+  make_variable {
+    name: "STACK_FRAME_UNLIMITED"
+    value: "-Wframe-larger-than=100000000 -Wno-vla"
+  }
+  cxx_builtin_include_directory: "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/"
+  cxx_builtin_include_directory: "/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/"
+  cxx_builtin_include_directory: "/Applications/Xcode_7.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/"
+  cxx_builtin_include_directory: "/Applications/Xcode_7.3.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/"
+  cxx_builtin_include_directory: "/Applications/Xcode_8.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/"
+  cxx_builtin_include_directory: "/Applications/Xcode_8.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/"
+  cxx_builtin_include_directory: "/Applications/Xcode_8.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/"
+  cxx_builtin_include_directory: "/Applications/Xcode_8.2.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/"
+  cxx_builtin_include_directory: "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs"
+  cxx_builtin_include_directory: "/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs"
+  cxx_builtin_include_directory: "/Applications/Xcode_7.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs"
+  cxx_builtin_include_directory: "/Applications/Xcode_7.3.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs"
+  cxx_builtin_include_directory: "/Applications/Xcode_8.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs"
+  cxx_builtin_include_directory: "/Applications/Xcode_8.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs"
+  cxx_builtin_include_directory: "/Applications/Xcode_8.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs"
+  cxx_builtin_include_directory: "/Applications/Xcode_8.2.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs"
+  cxx_builtin_include_directory: "/usr/include"
+  builtin_sysroot: ""
+  unfiltered_cxx_flag: "-no-canonical-prefixes"
+  unfiltered_cxx_flag: "-pthread"
+  supports_normalizing_ar: false
+  default_python_version: "python2.7"
+  feature {
+    name: "no_legacy_features"
+  }
+  feature {
+    name: "fastbuild"
+    implies: "fastbuild_only_flag"
+  }
+  feature {
+    name: "opt"
+    flag_set {
+      action: "c-compile"
+      action: "c++-compile"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-g0"
+      }
+      with_feature {
+        feature: "no_generate_debug_symbols"
+      }
+    }
+    implies: "opt_only_flag"
+  }
+  feature {
+    name: "dbg"
+    implies: "dbg_only_flag"
+  }
+  feature {
+    name: "compile_all_modules"
+  }
+  feature {
+    name: "exclude_private_headers_in_module_maps"
+  }
+  feature {
+    name: "has_configured_linker_path"
+  }
+  feature {
+    name: "only_doth_headers_in_module_maps"
+  }
+  feature {
+    name: "is_not_test_target"
+  }
+  feature {
+    name: "generate_dsym_file"
+    flag_set {
+      action: "c-compile"
+      action: "c++-compile"
+      action: "objc-compile"
+      action: "objc++-compile"
+      action: "objc-executable"
+      action: "objc++-executable"
+      flag_group {
+        flag: "-g"
+      }
+    }
+    flag_set {
+      action: "objc-executable"
+      action: "objc++-executable"
+      flag_group {
+        flag: "DSYM_HINT_LINKED_BINARY=%{linked_binary}"
+        flag: "DSYM_HINT_DSYM_PATH=%{dsym_path}"
+        flag: "DSYM_HINT_DSYM_BUNDLE_ZIP=%{dsym_bundle_zip}"
+      }
+    }
+  }
+  feature {
+    name: "no_generate_debug_symbols"
+  }
+  feature {
+    name: "generate_linkmap"
+    flag_set {
+      action: "objc-executable"
+      action: "objc++-executable"
+      flag_group {
+        flag: "-Xlinker -map"
+        flag: "-Xlinker %{linkmap_exec_path}"
+      }
+    }
+  }
+  feature {
+    name: "objc_actions"
+    implies: "objc-compile"
+    implies: "objc++-compile"
+    implies: "objc-fully-link"
+    implies: "objc-archive"
+    implies: "objc-executable"
+    implies: "objc++-executable"
+    implies: "assemble"
+    implies: "preprocess-assemble"
+    implies: "c-compile"
+    implies: "c++-compile"
+    implies: "c++-link-static-library"
+    implies: "c++-link-pic-static-library"
+    implies: "c++-link-interface-dynamic-library"
+    implies: "c++-link-dynamic-library"
+    implies: "c++-link-alwayslink-static-library"
+    implies: "c++-link-alwayslink-pic-static-library"
+    implies: "c++-link-executable"
+  }
+  feature {
+    name: "strip_debug_symbols"
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "c++-link-interface-dynamic-library"
+      flag_group {
+        flag: "-Wl,-S"
+        expand_if_all_available: "strip_debug_symbols"
+      }
+    }
+  }
+  feature {
+    name: "symbol_counts"
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      flag_group {
+        flag: "-Wl,--print-symbol-counts=%{symbol_counts_output}"
+      }
+      expand_if_all_available: "symbol_counts_output"
+    }
+  }
+  feature {
+    name: "shared_flag"
+    flag_set {
+      action: "c++-link-dynamic-library"
+      flag_group {
+        flag: "-shared"
+      }
+    }
+  }
+  feature {
+    name: "linkstamps"
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      flag_group {
+        flag: "%{linkstamp_paths}"
+        iterate_over: "linkstamp_paths"
+      }
+      expand_if_all_available: "linkstamp_paths"
+    }
+  }
+  feature {
+    name: "output_execpath_flags"
+    flag_set {
+      action: "c++-link-dynamic-library"
+      flag_group {
+        flag: "-o"
+        flag: "%{output_execpath}"
+      }
+      expand_if_all_available: "output_execpath"
+    }
+  }
+  feature {
+    name: "output_execpath_flags_executable"
+    flag_set {
+      action: "c++-link-executable"
+      flag_group {
+        flag: "-o"
+      }
+      expand_if_all_available: "output_execpath"
+    }
+    flag_set {
+      action: "c++-link-executable"
+      flag_group {
+        flag: "/dev/null"
+        flag: "-MMD"
+        flag: "-MF"
+      }
+      expand_if_all_available: "skip_mostly_static"
+      expand_if_all_available: "output_execpath"
+    }
+    flag_set {
+      action: "c++-link-executable"
+      flag_group {
+        flag: "%{output_execpath}"
+      }
+      expand_if_all_available: "output_execpath"
+    }
+  }
+  feature {
+    name: "global_whole_archive_open"
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "c++-link-static-library"
+      action: "c++-link-alwayslink-static-library"
+      action: "c++-link-pic-static-library"
+      action: "c++-link-alwayslink-pic-static-library"
+      flag_group {
+        flag: "-Wl,-all_load"
+      }
+      expand_if_all_available: "global_whole_archive"
+    }
+  }
+  feature {
+    name: "runtime_root_flags"
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "c++-link-static-library"
+      action: "c++-link-alwayslink-static-library"
+      action: "c++-link-pic-static-library"
+      action: "c++-link-alwayslink-pic-static-library"
+      flag_group {
+        flag: "-Wl,-rpath,$ORIGIN/%{runtime_library_search_directories}"
+        iterate_over: "runtime_library_search_directories"
+      }
+      expand_if_all_available: "runtime_library_search_directories"
+    }
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "c++-link-static-library"
+      action: "c++-link-alwayslink-static-library"
+      action: "c++-link-pic-static-library"
+      action: "c++-link-alwayslink-pic-static-library"
+      flag_group {
+        flag: "%{runtime_root_flags}"
+        iterate_over: "runtime_root_flags"
+      }
+      expand_if_all_available: "runtime_root_flags"
+    }
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "c++-link-static-library"
+      action: "c++-link-alwayslink-static-library"
+      action: "c++-link-pic-static-library"
+      action: "c++-link-alwayslink-pic-static-library"
+      flag_group {
+        flag: "%{runtime_root_entries}"
+        iterate_over: "runtime_root_entries"
+      }
+      expand_if_all_available: "runtime_root_entries"
+    }
+  }
+  feature {
+    name: "archiver_flags"
+    flag_set {
+      action: "c++-link-static-library"
+      action: "c++-link-alwayslink-static-library"
+      action: "c++-link-pic-static-library"
+      action: "c++-link-alwayslink-pic-static-library"
+      flag_group {
+        flag: "rcs"
+        flag: "%{output_execpath}"
+      }
+      expand_if_all_available: "output_execpath"
+    }
+  }
+  feature {
+    name: "input_param_flags"
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "c++-link-static-library"
+      action: "c++-link-alwayslink-static-library"
+      action: "c++-link-pic-static-library"
+      action: "c++-link-alwayslink-pic-static-library"
+      flag_group {
+        flag: "-L%{library_search_directories}"
+        iterate_over: "library_search_directories"
+      }
+      expand_if_all_available: "library_search_directories"
+    }
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "c++-link-static-library"
+      action: "c++-link-alwayslink-static-library"
+      action: "c++-link-pic-static-library"
+      action: "c++-link-alwayslink-pic-static-library"
+      flag_group {
+        flag: "%{libopts}"
+        iterate_over: "libopts"
+      }
+      expand_if_all_available: "libopts"
+    }
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "c++-link-static-library"
+      action: "c++-link-alwayslink-static-library"
+      action: "c++-link-pic-static-library"
+      action: "c++-link-alwayslink-pic-static-library"
+      flag_group {
+        flag: "-Wl,-force_load,%{whole_archive_linker_params}"
+        iterate_over: "whole_archive_linker_params"
+      }
+      expand_if_all_available: "whole_archive_linker_params"
+    }
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "c++-link-static-library"
+      action: "c++-link-alwayslink-static-library"
+      action: "c++-link-pic-static-library"
+      action: "c++-link-alwayslink-pic-static-library"
+      flag_group {
+        flag: "%{linker_input_params}"
+        iterate_over: "linker_input_params"
+      }
+      expand_if_all_available: "linker_input_params"
+    }
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "c++-link-static-library"
+      action: "c++-link-alwayslink-static-library"
+      action: "c++-link-pic-static-library"
+      action: "c++-link-alwayslink-pic-static-library"
+      flag_group {
+        flag_group {
+          flag: "-Wl,--start-lib"
+          expand_if_equal {
+            variable: "libraries_to_link.type"
+            value: "object_file_group"
+          }
+        }
+        flag_group {
+          flag_group {
+            flag: "%{libraries_to_link.object_files}"
+            expand_if_false: "libraries_to_link.is_whole_archive"
+          }
+          flag_group {
+            flag: "-Wl,-force_load,%{libraries_to_link.object_files}"
+            expand_if_true: "libraries_to_link.is_whole_archive"
+          }
+          iterate_over: "libraries_to_link.object_files"
+          expand_if_equal {
+            variable: "libraries_to_link.type"
+            value: "object_file_group"
+          }
+        }
+        flag_group {
+          flag: "-Wl,--end-lib"
+          expand_if_equal {
+            variable: "libraries_to_link.type"
+            value: "object_file_group"
+          }
+        }
+        flag_group {
+          flag_group {
+            flag: "%{libraries_to_link.name}"
+            expand_if_false: "libraries_to_link.is_whole_archive"
+          }
+          flag_group {
+            flag: "-Wl,-force_load,%{libraries_to_link.name}"
+            expand_if_true: "libraries_to_link.is_whole_archive"
+          }
+          expand_if_equal {
+            variable: "libraries_to_link.type"
+            value: "object_file"
+          }
+        }
+        flag_group {
+          flag_group {
+            flag: "%{libraries_to_link.name}"
+            expand_if_false: "libraries_to_link.is_whole_archive"
+          }
+          flag_group {
+            flag: "-Wl,-force_load,%{libraries_to_link.name}"
+            expand_if_true: "libraries_to_link.is_whole_archive"
+          }
+          expand_if_equal {
+            variable: "libraries_to_link.type"
+            value: "interface_library"
+          }
+        }
+        flag_group {
+          flag_group {
+            flag: "%{libraries_to_link.name}"
+            expand_if_false: "libraries_to_link.is_whole_archive"
+          }
+          flag_group {
+            flag: "-Wl,-force_load,%{libraries_to_link.name}"
+            expand_if_true: "libraries_to_link.is_whole_archive"
+          }
+          expand_if_equal {
+            variable: "libraries_to_link.type"
+            value: "static_library"
+          }
+        }
+        flag_group {
+          flag_group {
+            flag: "-l%{libraries_to_link.name}"
+            expand_if_false: "libraries_to_link.is_whole_archive"
+          }
+          flag_group {
+            flag: "-Wl,-force_load,-l%{libraries_to_link.name}"
+            expand_if_true: "libraries_to_link.is_whole_archive"
+          }
+          expand_if_equal {
+            variable: "libraries_to_link.type"
+            value: "dynamic_library"
+          }
+        }
+        flag_group {
+          flag_group {
+            flag: "-l:%{libraries_to_link.name}"
+            expand_if_false: "libraries_to_link.is_whole_archive"
+          }
+          flag_group {
+            flag: "-Wl,-force_load,-l:%{libraries_to_link.name}"
+            expand_if_true: "libraries_to_link.is_whole_archive"
+          }
+          expand_if_equal {
+            variable: "libraries_to_link.type"
+            value: "versioned_dynamic_library"
+          }
+        }
+        iterate_over: "libraries_to_link"
+      }
+      expand_if_all_available: "libraries_to_link"
+    }
+  }
+  feature {
+    name: "force_pic_flags"
+    flag_set {
+      action: "c++-link-executable"
+      flag_group {
+        flag: "-pie"
+      }
+      expand_if_all_available: "force_pic"
+    }
+  }
+  feature {
+    name: "pch"
+    flag_set {
+      action: "objc-compile"
+      action: "objc++-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      flag_group {
+        flag: "-include"
+        flag: "%{pch_file}"
+      }
+    }
+  }
+  feature {
+    name: "module_maps"
+  }
+  feature {
+    name: "use_objc_modules"
+    flag_set {
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-fmodule-name=%{module_name}"
+        flag: "-iquote"
+        flag: "%{module_maps_dir}"
+        flag: "-fmodules-cache-path=%{modules_cache_path}"
+      }
+    }
+  }
+  feature {
+    name: "no_enable_modules"
+    flag_set {
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-fmodule-maps"
+      }
+    }
+    requires {
+      feature: "use_objc_modules"
+    }
+  }
+  feature {
+    name: "apply_default_warnings"
+    flag_set {
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-Wshorten-64-to-32"
+        flag: "-Wbool-conversion"
+        flag: "-Wconstant-conversion"
+        flag: "-Wduplicate-method-match"
+        flag: "-Wempty-body"
+        flag: "-Wenum-conversion"
+        flag: "-Wint-conversion"
+        flag: "-Wunreachable-code"
+        flag: "-Wmismatched-return-types"
+        flag: "-Wundeclared-selector"
+        flag: "-Wuninitialized"
+        flag: "-Wunused-function"
+        flag: "-Wunused-variable"
+      }
+    }
+  }
+  feature {
+    name: "preprocessor_defines"
+    flag_set {
+      action: "preprocess-assemble"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-header-preprocessing"
+      action: "c++-module-compile"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-D%{preprocessor_defines}"
+        iterate_over: "preprocessor_defines"
+      }
+    }
+  }
+  feature {
+    name: "framework_paths"
+    flag_set {
+      action: "objc-compile"
+      action: "objc++-compile"
+      action: "objc-executable"
+      action: "objc++-executable"
+      flag_group {
+        flag: "-F%{framework_paths}"
+        iterate_over: "framework_paths"
+      }
+    }
+  }
+  feature {
+    name: "apply_default_compiler_flags"
+    flag_set {
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-DOS_MACOSX"
+      }
+    }
+  }
+  feature {
+    name: "include_system_dirs"
+    flag_set {
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-module-compile"
+      action: "c++-header-parsing"
+      action: "c++-header-preprocessing"
+      action: "objc-compile"
+      action: "objc++-compile"
+      action: "objc-executable"
+      action: "objc++-executable"
+      action: "assemble"
+      action: "preprocess-assemble"
+      flag_group {
+        flag: "-isysroot"
+        flag: "%{sdk_dir}"
+      }
+    }
+  }
+  feature {
+    name: "objc_arc"
+    flag_set {
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-module-compile"
+      action: "c++-header-parsing"
+      action: "c++-header-preprocessing"
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-fobjc-arc"
+      }
+      expand_if_all_available: "objc_arc"
+    }
+  }
+  feature {
+    name: "no_objc_arc"
+    flag_set {
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-module-compile"
+      action: "c++-header-parsing"
+      action: "c++-header-preprocessing"
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-fno-objc-arc"
+      }
+      expand_if_all_available: "no_objc_arc"
+    }
+  }
+  feature {
+    name: "apple_env"
+    env_set {
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-module-compile"
+      action: "c++-header-parsing"
+      action: "c++-header-preprocessing"
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "objc-compile"
+      action: "objc++-compile"
+      action: "objc-archive"
+      action: "objc-fully-link"
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "c++-link-static-library"
+      action: "c++-link-alwayslink-static-library"
+      action: "c++-link-pic-static-library"
+      action: "c++-link-alwayslink-pic-static-library"
+      action: "objc-executable"
+      action: "objc++-executable"
+      env_entry {
+        key: "XCODE_VERSION_OVERRIDE"
+        value: "%{xcode_version_override_value}"
+      }
+      env_entry {
+        key: "APPLE_SDK_VERSION_OVERRIDE"
+        value: "%{apple_sdk_version_override_value}"
+      }
+      env_entry {
+        key: "APPLE_SDK_PLATFORM"
+        value: "%{apple_sdk_platform_value}"
+      }
+    }
+  }
+  feature {
+    name: "legacy_link_flags"
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "objc-executable"
+      action: "objc++-executable"
+      flag_group {
+        flag: "%{legacy_link_flags}"
+        iterate_over: "legacy_link_flags"
+      }
+      expand_if_all_available: "legacy_link_flags"
+    }
+  }
+  feature {
+    name: "linker_param_file"
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      flag_group {
+        flag: "-Wl,@%{linker_param_file}"
+      }
+      expand_if_all_available: "linker_param_file"
+    }
+    flag_set {
+      action: "c++-link-static-library"
+      action: "c++-link-alwayslink-static-library"
+      action: "c++-link-pic-static-library"
+      action: "c++-link-alwayslink-pic-static-library"
+      flag_group {
+        flag: "@%{linker_param_file}"
+      }
+      expand_if_all_available: "linker_param_file"
+    }
+  }
+  feature {
+    name: "version_min"
+    flag_set {
+      action: "objc-executable"
+      action: "objc++-executable"
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "preprocess-assemble"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-header-preprocessing"
+      action: "c++-module-compile"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-mmacosx-version-min=%{version_min}"
+      }
+    }
+  }
+  feature {
+    name: "dead_strip"
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "objc-executable"
+      action: "objc++-executable"
+      flag_group {
+        flag: "-dead_strip"
+        flag: "-no_dead_strip_inits_and_terms"
+      }
+      with_feature {
+        feature: "is_not_test_target"
+      }
+    }
+    flag_set {
+      action: "c-compile"
+      action: "c++-compile"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-g"
+      }
+    }
+    requires {
+      feature: "opt"
+    }
+  }
+  feature {
+    name: "dependency_file"
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-module-compile"
+      action: "objc-compile"
+      action: "objc++-compile"
+      action: "c++-header-preprocessing"
+      action: "c++-header-parsing"
+      flag_group {
+        flag: "-MD"
+        flag: "-MF"
+        flag: "%{dependency_file}"
+      }
+      expand_if_all_available: "dependency_file"
+    }
+  }
+  feature {
+    name: "random_seed"
+    flag_set {
+      action: "c++-compile"
+      action: "c++-module-codegen"
+      action: "c++-module-compile"
+      flag_group {
+        flag: "-frandom-seed=%{output_file}"
+      }
+    }
+  }
+  feature {
+    name: "pic"
+    flag_set {
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-module-codegen"
+      action: "c++-module-compile"
+      action: "preprocess-assemble"
+      flag_group {
+        flag: "-fPIC"
+      }
+      expand_if_all_available: "pic"
+    }
+  }
+  feature {
+    name: "per_object_debug_info"
+    flag_set {
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-module-codegen"
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "lto-backend"
+      flag_group {
+        flag: "-gsplit-dwarf"
+      }
+      expand_if_all_available: "per_object_debug_info_file"
+    }
+  }
+  feature {
+    name: "include_paths"
+    flag_set {
+      action: "preprocess-assemble"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-header-preprocessing"
+      action: "c++-module-compile"
+      action: "clif-match"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-iquote"
+        flag: "%{quote_include_paths}"
+        iterate_over: "quote_include_paths"
+      }
+      flag_group {
+        flag: "-I%{include_paths}"
+        iterate_over: "include_paths"
+      }
+      flag_group {
+        flag: "-isystem"
+        flag: "%{system_include_paths}"
+        iterate_over: "system_include_paths"
+      }
+    }
+  }
+  feature {
+    name: "fdo_instrument"
+    flag_set {
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-link-interface-dynamic-library"
+      action: "c++-link-dynamic-library"
+      action: "c++-link-executable"
+      flag_group {
+        flag: "-fprofile-generate=%{fdo_instrument_path}"
+        flag: "-fno-data-sections"
+      }
+    }
+    provides: "profile"
+  }
+  feature {
+    name: "fdo_optimize"
+    flag_set {
+      action: "c-compile"
+      action: "c++-compile"
+      flag_group {
+        flag: "-fprofile-use=%{fdo_profile_path}"
+        flag: "-Xclang-only=-Wno-profile-instr-unprofiled"
+        flag: "-Xclang-only=-Wno-profile-instr-out-of-date"
+        flag: "-fprofile-correction"
+      }
+      expand_if_all_available: "fdo_profile_path"
+    }
+    provides: "profile"
+  }
+  feature {
+    name: "autofdo"
+    flag_set {
+      action: "c-compile"
+      action: "c++-compile"
+      flag_group {
+        flag: "-fauto-profile=%{fdo_profile_path}"
+        flag: "-fprofile-correction"
+      }
+      expand_if_all_available: "fdo_profile_path"
+    }
+    provides: "profile"
+  }
+  feature {
+    name: "lipo"
+    flag_set {
+      action: "c-compile"
+      action: "c++-compile"
+      flag_group {
+        flag: "-fripa"
+      }
+    }
+    requires {
+      feature: "autofdo"
+    }
+    requires {
+      feature: "fdo_optimize"
+    }
+    requires {
+      feature: "fdo_instrument"
+    }
+  }
+  feature {
+    name: "asan"
+    flag_set {
+      action: "c-compile"
+      action: "c++-compile"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-O1"
+        flag: "-gmlt"
+        flag: "-fsanitize=address,bool,float-cast-overflow,integer-divide-by-zero,return,returns-nonnull-attribute,shift-exponent,unreachable,vla-bound"
+        flag: "-fno-sanitize-recover=all"
+        flag: "-DHEAPCHECK_DISABLE"
+        flag: "-DADDRESS_SANITIZER"
+        flag: "-D_GLIBCXX_ADDRESS_SANITIZER_ANNOTATIONS"
+        flag: "-fno-omit-frame-pointer"
+      }
+    }
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "objc-executable"
+      action: "objc++-executable"
+      flag_group {
+        flag: "-fsanitize=address,bool,float-cast-overflow,integer-divide-by-zero,return,returns-nonnull-attribute,shift-exponent,unreachable,vla-bound"
+        flag: "-fsanitize-link-c++-runtime"
+      }
+    }
+  }
+  feature {
+    name: "coverage"
+  }
+  feature {
+    name: "llvm_coverage_map_format"
+    flag_set {
+      action: "preprocess-assemble"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-module-compile"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-fprofile-instr-generate"
+        flag: "-fcoverage-mapping"
+        flag: "-g"
+      }
+    }
+    flag_set {
+      action: "c++-link-interface-dynamic-library"
+      action: "c++-link-dynamic-library"
+      action: "c++-link-executable"
+      action: "objc-executable"
+      action: "objc++-executable"
+      flag_group {
+        flag: "-fprofile-instr-generate"
+      }
+    }
+    requires {
+      feature: "coverage"
+    }
+    provides: "profile"
+  }
+  feature {
+    name: "gcc_coverage_map_format"
+    flag_set {
+      action: "preprocess-assemble"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-module-compile"
+      action: "objc-compile"
+      action: "objc++-compile"
+      action: "objc-executable"
+      action: "objc++-executable"
+      flag_group {
+        flag: "-fprofile-arcs"
+        flag: "-ftest-coverage"
+        flag: "-g"
+      }
+    }
+    flag_set {
+      action: "c++-link-interface-dynamic-library"
+      action: "c++-link-dynamic-library"
+      action: "c++-link-executable"
+      flag_group {
+        flag: "-lgcov"
+      }
+    }
+    requires {
+      feature: "coverage"
+    }
+    provides: "profile"
+  }
+  feature {
+    name: "cpp_linker_flags"
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      flag_group {
+        flag: "-undefined"
+        flag: "dynamic_lookup"
+      }
+    }
+  }
+  feature {
+    name: "apply_implicit_frameworks"
+    flag_set {
+      action: "objc-executable"
+      action: "objc++-executable"
+      flag_group {
+        flag: "-framework Foundation"
+      }
+    }
+  }
+  feature {
+    name: "link_cocoa"
+    flag_set {
+      action: "objc-executable"
+      action: "objc++-executable"
+      flag_group {
+        flag: "-framework Cocoa"
+      }
+    }
+  }
+  feature {
+    name: "apply_simulator_compiler_flags"
+  }
+  feature {
+    name: "unfiltered_cxx_flags"
+  }
+  feature {
+    name: "bitcode_embedded_markers"
+  }
+  feature {
+    name: "bitcode_embedded"
+  }
+  feature {
+    name: "copts"
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-header-preprocessing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "%{copts}"
+        iterate_over: "copts"
+      }
+      expand_if_all_available: "copts"
+    }
+  }
+  feature {
+    name: "dbg_only_flag"
+    flag_set {
+      action: "objc-compile"
+      flag_group {
+        flag: "--DBG_ONLY_FLAG"
+      }
+    }
+  }
+  feature {
+    name: "fastbuild_only_flag"
+    flag_set {
+      action: "objc-compile"
+      flag_group {
+        flag: "--FASTBUILD_ONLY_FLAG"
+      }
+    }
+  }
+  feature {
+    name: "opt_only_flag"
+    flag_set {
+      action: "objc-compile"
+      flag_group {
+        flag: "--OPT_ONLY_FLAG"
+      }
+    }
+  }
+  action_config {
+    config_name: "strip"
+    action_name: "strip"
+    tool {
+      tool_path: "mac/strip"
+    }
+    flag_set {
+      flag_group {
+        flag: "-S"
+        flag: "-o"
+        flag: "%{output_file}"
+        flag: "-R"
+        flag: ".gnu.switches.text.quote_paths"
+        flag: "-R"
+        flag: ".gnu.switches.text.bracket_paths"
+        flag: "-R"
+        flag: ".gnu.switches.text.system_paths"
+        flag: "-R"
+        flag: ".gnu.switches.text.cpp_defines"
+        flag: "-R"
+        flag: ".gnu.switches.text.cpp_includes"
+        flag: "-R"
+        flag: ".gnu.switches.text.cl_args"
+        flag: "-R"
+        flag: ".gnu.switches.text.lipo_info"
+        flag: "-R"
+        flag: ".gnu.switches.text.annotation"
+      }
+      flag_group {
+        flag: "%{stripopts}"
+        iterate_over: "stripopts"
+      }
+      flag_group {
+        flag: "%{input_file}"
+      }
+    }
+  }
+  action_config {
+    config_name: "c-compile"
+    action_name: "c-compile"
+    tool {
+      tool_path: "mac/wrapped_clang"
+      execution_requirement: "requires-darwin"
+    }
+    flag_set {
+      flag_group {
+        flag: "-arch x86_64"
+      }
+    }
+    implies: "preprocessor_defines"
+    implies: "include_system_dirs"
+    implies: "version_min"
+    implies: "objc_arc"
+    implies: "no_objc_arc"
+    implies: "apple_env"
+    implies: "copts"
+  }
+  action_config {
+    config_name: "c++-compile"
+    action_name: "c++-compile"
+    tool {
+      tool_path: "mac/wrapped_clang"
+      execution_requirement: "requires-darwin"
+    }
+    flag_set {
+      flag_group {
+        flag: "-arch x86_64"
+      }
+    }
+    implies: "preprocessor_defines"
+    implies: "include_system_dirs"
+    implies: "version_min"
+    implies: "objc_arc"
+    implies: "no_objc_arc"
+    implies: "apple_env"
+    implies: "copts"
+  }
+  action_config {
+    config_name: "c++-module-compile"
+    action_name: "c++-module-compile"
+    tool {
+      tool_path: "mac/wrapped_clang"
+      execution_requirement: "requires-darwin"
+    }
+    implies: "preprocessor_defines"
+    implies: "include_system_dirs"
+    implies: "version_min"
+    implies: "objc_arc"
+    implies: "no_objc_arc"
+    implies: "apple_env"
+    implies: "copts"
+  }
+  action_config {
+    config_name: "c++-header-parsing"
+    action_name: "c++-header-parsing"
+    tool {
+      tool_path: "mac/wrapped_clang"
+      execution_requirement: "requires-darwin"
+    }
+    implies: "preprocessor_defines"
+    implies: "include_system_dirs"
+    implies: "version_min"
+    implies: "objc_arc"
+    implies: "no_objc_arc"
+    implies: "apple_env"
+    implies: "copts"
+  }
+  action_config {
+    config_name: "c++-header-preprocessing"
+    action_name: "c++-header-preprocessing"
+    tool {
+      tool_path: "mac/wrapped_clang"
+      execution_requirement: "requires-darwin"
+    }
+    implies: "preprocessor_defines"
+    implies: "include_system_dirs"
+    implies: "version_min"
+    implies: "objc_arc"
+    implies: "no_objc_arc"
+    implies: "apple_env"
+    implies: "copts"
+  }
+  action_config {
+    config_name: "objc-compile"
+    action_name: "objc-compile"
+    tool {
+      tool_path: "mac/wrapped_clang"
+      execution_requirement: "requires-darwin"
+    }
+    flag_set {
+      flag_group {
+        flag: "-arch x86_64"
+      }
+    }
+    implies: "objc_actions"
+    implies: "apply_default_compiler_flags"
+    implies: "apply_default_warnings"
+    implies: "framework_paths"
+    implies: "preprocessor_defines"
+    implies: "include_system_dirs"
+    implies: "version_min"
+    implies: "objc_arc"
+    implies: "no_objc_arc"
+    implies: "apple_env"
+    implies: "copts"
+  }
+  action_config {
+    config_name: "objc++-compile"
+    action_name: "objc++-compile"
+    tool {
+      tool_path: "mac/wrapped_clang"
+      execution_requirement: "requires-darwin"
+    }
+    flag_set {
+      flag_group {
+        flag: "-arch x86_64"
+        flag: "-stdlib=libc++"
+        flag: "-std=gnu++11"
+      }
+    }
+    implies: "apply_default_compiler_flags"
+    implies: "apply_default_warnings"
+    implies: "framework_paths"
+    implies: "preprocessor_defines"
+    implies: "include_system_dirs"
+    implies: "version_min"
+    implies: "objc_arc"
+    implies: "no_objc_arc"
+    implies: "apple_env"
+    implies: "copts"
+  }
+  action_config {
+    config_name: "assemble"
+    action_name: "assemble"
+    tool {
+      tool_path: "mac/wrapped_clang"
+      execution_requirement: "requires-darwin"
+    }
+    implies: "objc_arc"
+    implies: "no_objc_arc"
+    implies: "include_system_dirs"
+    implies: "apple_env"
+    implies: "copts"
+  }
+  action_config {
+    config_name: "preprocess-assemble"
+    action_name: "preprocess-assemble"
+    tool {
+      tool_path: "mac/wrapped_clang"
+      execution_requirement: "requires-darwin"
+    }
+    implies: "preprocessor_defines"
+    implies: "include_system_dirs"
+    implies: "version_min"
+    implies: "objc_arc"
+    implies: "no_objc_arc"
+    implies: "apple_env"
+    implies: "copts"
+  }
+  action_config {
+    config_name: "objc-archive"
+    action_name: "objc-archive"
+    tool {
+      tool_path: "mac/libtool"
+      execution_requirement: "requires-darwin"
+    }
+    flag_set {
+      flag_group {
+        flag: "-static"
+        flag: "-filelist"
+        flag: "%{obj_list_path}"
+        flag: "-arch_only"
+        flag: "x86_64"
+        flag: "-syslibroot"
+        flag: "%{sdk_dir}"
+        flag: "-o"
+        flag: "%{archive_path}"
+      }
+    }
+    implies: "apple_env"
+  }
+  action_config {
+    config_name: "objc-executable"
+    action_name: "objc-executable"
+    tool {
+      tool_path: "mac/wrapped_clang"
+      execution_requirement: "requires-darwin"
+    }
+    flag_set {
+      flag_group {
+        flag: "-arch x86_64"
+      }
+      flag_group {
+        flag: "-Xlinker"
+        flag: "-objc_abi_version"
+        flag: "-Xlinker"
+        flag: "2"
+        flag: "-Xlinker"
+        flag: "-rpath"
+        flag: "-Xlinker"
+        flag: "@executable_path/Frameworks"
+        flag: "-fobjc-link-runtime"
+        flag: "-ObjC"
+      }
+      flag_group {
+        flag: "-framework %{framework_names}"
+        iterate_over: "framework_names"
+      }
+      flag_group {
+        flag: "-weak_framework %{weak_framework_names}"
+        iterate_over: "weak_framework_names"
+      }
+      flag_group {
+        flag: "-l%{library_names}"
+        iterate_over: "library_names"
+      }
+      flag_group {
+        flag: "-filelist %{filelist}"
+      }
+      flag_group {
+        flag: "-o %{linked_binary}"
+      }
+      flag_group {
+        flag: "-force_load %{force_load_exec_paths}"
+        iterate_over: "force_load_exec_paths"
+      }
+      flag_group {
+        flag: "%{dep_linkopts}"
+        iterate_over: "dep_linkopts"
+      }
+      flag_group {
+        flag: "-Wl,%{attr_linkopts}"
+        iterate_over: "attr_linkopts"
+      }
+    }
+    implies: "include_system_dirs"
+    implies: "framework_paths"
+    implies: "version_min"
+    implies: "legacy_link_flags"
+    implies: "apple_env"
+    implies: "apply_implicit_frameworks"
+  }
+  action_config {
+    config_name: "objc++-executable"
+    action_name: "objc++-executable"
+    tool {
+      tool_path: "mac/wrapped_clang++"
+      execution_requirement: "requires-darwin"
+    }
+    flag_set {
+      flag_group {
+        flag: "-stdlib=libc++"
+        flag: "-std=gnu++11"
+      }
+      flag_group {
+        flag: "-arch x86_64"
+      }
+      flag_group {
+        flag: "-Xlinker"
+        flag: "-objc_abi_version"
+        flag: "-Xlinker"
+        flag: "2"
+        flag: "-Xlinker"
+        flag: "-rpath"
+        flag: "-Xlinker"
+        flag: "@executable_path/Frameworks"
+        flag: "-fobjc-link-runtime"
+        flag: "-ObjC"
+      }
+      flag_group {
+        flag: "-framework %{framework_names}"
+        iterate_over: "framework_names"
+      }
+      flag_group {
+        flag: "-weak_framework %{weak_framework_names}"
+        iterate_over: "weak_framework_names"
+      }
+      flag_group {
+        flag: "-l%{library_names}"
+        iterate_over: "library_names"
+      }
+      flag_group {
+        flag: "-filelist %{filelist}"
+      }
+      flag_group {
+        flag: "-o %{linked_binary}"
+      }
+      flag_group {
+        flag: "-force_load %{force_load_exec_paths}"
+        iterate_over: "force_load_exec_paths"
+      }
+      flag_group {
+        flag: "%{dep_linkopts}"
+        iterate_over: "dep_linkopts"
+      }
+      flag_group {
+        flag: "-Wl,%{attr_linkopts}"
+        iterate_over: "attr_linkopts"
+      }
+    }
+    implies: "include_system_dirs"
+    implies: "framework_paths"
+    implies: "version_min"
+    implies: "legacy_link_flags"
+    implies: "apple_env"
+    implies: "apply_implicit_frameworks"
+  }
+  action_config {
+    config_name: "c++-link-executable"
+    action_name: "c++-link-executable"
+    tool {
+      tool_path: "mac/clang"
+      execution_requirement: "requires-darwin"
+    }
+    implies: "symbol_counts"
+    implies: "linkstamps"
+    implies: "output_execpath_flags_executable"
+    implies: "global_whole_archive_open"
+    implies: "runtime_root_flags"
+    implies: "input_param_flags"
+    implies: "force_pic_flags"
+    implies: "legacy_link_flags"
+    implies: "strip_debug_symbols"
+    implies: "linker_param_file"
+    implies: "version_min"
+    implies: "apple_env"
+    implies: "cpp_linker_flags"
+  }
+  action_config {
+    config_name: "c++-link-dynamic-library"
+    action_name: "c++-link-dynamic-library"
+    tool {
+      tool_path: "mac/clang"
+      execution_requirement: "requires-darwin"
+    }
+    implies: "has_configured_linker_path"
+    implies: "symbol_counts"
+    implies: "shared_flag"
+    implies: "linkstamps"
+    implies: "output_execpath_flags"
+    implies: "global_whole_archive_open"
+    implies: "runtime_root_flags"
+    implies: "input_param_flags"
+    implies: "legacy_link_flags"
+    implies: "strip_debug_symbols"
+    implies: "linker_param_file"
+    implies: "version_min"
+    implies: "apple_env"
+    implies: "cpp_linker_flags"
+  }
+  action_config {
+    config_name: "c++-link-static-library"
+    action_name: "c++-link-static-library"
+    tool {
+      tool_path: "mac/ar_wrapper"
+      execution_requirement: "requires-darwin"
+    }
+    implies: "global_whole_archive_open"
+    implies: "runtime_root_flags"
+    implies: "archiver_flags"
+    implies: "input_param_flags"
+    implies: "linker_param_file"
+    implies: "apple_env"
+  }
+  action_config {
+    config_name: "c++-link-alwayslink-static-library"
+    action_name: "c++-link-alwayslink-static-library"
+    tool {
+      tool_path: "mac/ar_wrapper"
+      execution_requirement: "requires-darwin"
+    }
+    implies: "global_whole_archive_open"
+    implies: "runtime_root_flags"
+    implies: "archiver_flags"
+    implies: "input_param_flags"
+    implies: "linker_param_file"
+    implies: "apple_env"
+  }
+  action_config {
+    config_name: "c++-link-pic-static-library"
+    action_name: "c++-link-pic-static-library"
+    tool {
+      tool_path: "mac/ar_wrapper"
+      execution_requirement: "requires-darwin"
+    }
+    implies: "global_whole_archive_open"
+    implies: "runtime_root_flags"
+    implies: "archiver_flags"
+    implies: "input_param_flags"
+    implies: "linker_param_file"
+    implies: "apple_env"
+  }
+  action_config {
+    config_name: "c++-link-alwayslink-pic-static-library"
+    action_name: "c++-link-alwayslink-pic-static-library"
+    tool {
+      tool_path: "mac/ar_wrapper"
+      execution_requirement: "requires-darwin"
+    }
+    implies: "global_whole_archive_open"
+    implies: "runtime_root_flags"
+    implies: "archiver_flags"
+    implies: "input_param_flags"
+    implies: "linker_param_file"
+    implies: "apple_env"
+  }
+  action_config {
+    config_name: "c++-link-interface-dynamic-library"
+    action_name: "c++-link-interface-dynamic-library"
+    tool {
+      tool_path: "mac/clang"
+      execution_requirement: "requires-darwin"
+    }
+    implies: "strip_debug_symbols"
+    implies: "apple_env"
+  }
+  action_config {
+    config_name: "objc-fully-link"
+    action_name: "objc-fully-link"
+    tool {
+      tool_path: "mac/libtool"
+      execution_requirement: "requires-darwin"
+    }
+    flag_set {
+      flag_group {
+        flag: "-static"
+        flag: "-arch_only"
+        flag: "x86_64"
+        flag: "-syslibroot"
+        flag: "%{sdk_dir}"
+        flag: "-o"
+        flag: "%{fully_linked_archive_path}"
+      }
+      flag_group {
+        flag: "%{objc_library_exec_paths}"
+        iterate_over: "objc_library_exec_paths"
+      }
+      flag_group {
+        flag: "%{cc_library_exec_paths}"
+        iterate_over: "cc_library_exec_paths"
+      }
+      flag_group {
+        flag: "%{imported_library_exec_paths}"
+        iterate_over: "imported_library_exec_paths"
+      }
+    }
+    implies: "apple_env"
+  }
+  cc_target_os: "apple"
+}
+toolchain {
   toolchain_identifier: "ios_x86_64"
   host_system_name: "x86_64-apple-macosx"
   target_system_name: "x86_64-apple-ios"
diff --git a/src/test/java/com/google/devtools/build/lib/packages/util/MockCcSupport.java b/src/test/java/com/google/devtools/build/lib/packages/util/MockCcSupport.java
index 7f2ab2b..39c4b11 100644
--- a/src/test/java/com/google/devtools/build/lib/packages/util/MockCcSupport.java
+++ b/src/test/java/com/google/devtools/build/lib/packages/util/MockCcSupport.java
@@ -676,7 +676,7 @@
     try {
       return PackageIdentifier.create(
           RepositoryName.create(TestConstants.TOOLS_REPOSITORY),
-          PathFragment.create(TestConstants.TOOLS_REPOSITORY_PATH));
+          PathFragment.create(TestConstants.MOCK_CC_CROSSTOOL_PATH));
     } catch (LabelSyntaxException e) {
       Verify.verify(false);
       throw new AssertionError();
diff --git a/src/test/java/com/google/devtools/build/lib/packages/util/MockObjcSupport.java b/src/test/java/com/google/devtools/build/lib/packages/util/MockObjcSupport.java
index 4cbf95a..73f9e9b 100644
--- a/src/test/java/com/google/devtools/build/lib/packages/util/MockObjcSupport.java
+++ b/src/test/java/com/google/devtools/build/lib/packages/util/MockObjcSupport.java
@@ -37,6 +37,11 @@
   private static final String DEFAULT_OSX_CROSSTOOL_DIR = "tools/osx/crosstool";
   private static final String MOCK_OSX_CROSSTOOL_FILE =
       "com/google/devtools/build/lib/packages/util/MOCK_OSX_CROSSTOOL";
+
+  /** The label of the {@code xcode_config} target used in test to enumerate available xcodes. */
+  public static final String XCODE_VERSION_CONFIG =
+      TestConstants.TOOLS_REPOSITORY + "//tools/objc:host_xcodes";
+
   /**
    * The build label for the mock OSX crosstool configuration.
    */
@@ -69,10 +74,10 @@
             "xcrunwrapper",
             "mcov",
             "libtool")) {
-      config.create("tools/objc/" + tool);
+      config.create(TestConstants.TOOLS_REPOSITORY_SCRATCH + "tools/objc/" + tool);
     }
     config.create(
-        "tools/objc/BUILD",
+        TestConstants.TOOLS_REPOSITORY_SCRATCH + "tools/objc/BUILD",
         "package(default_visibility=['//visibility:public'])",
         "exports_files(glob(['**']))",
         "filegroup(name = 'default_provisioning_profile', srcs = ['foo.mobileprovision'])",
@@ -89,7 +94,8 @@
         "objc_binary(name = 'xctest_appbin', srcs = ['objc_dummy.mm'])",
         "filegroup(",
         "  name = 'protobuf_well_known_types',",
-        "  srcs = ['//objcproto:well_known_type.proto'],",
+        String.format(
+            "  srcs = ['%s//objcproto:well_known_type.proto'],", TestConstants.TOOLS_REPOSITORY),
         ")",
         "xcode_config(name = 'host_xcodes', default = ':version7_3_1')",
         "xcode_version(",
@@ -98,24 +104,42 @@
         "  default_ios_sdk_version = \"" + DEFAULT_IOS_SDK_VERSION + "\",",
         ")",
         "objc_library(name = 'dummy_lib', srcs = ['objc_dummy.mm'])");
-    config.create("tools/objc/foo.mobileprovision", "No such luck");
-    config.create("tools/objc/compile_protos.py");
-    config.create("tools/objc/xctest.plist");
-    config.create("tools/objc/proto_support");
-    config.create("tools/objc/ios_runner.sh.mac_template");
-    config.create("tools/objc/j2objc_dead_code_pruner.py");
-    config.create("tools/objc/header_scanner");
+    // If the bazel tools repository is not in the workspace, also create a workspace tools/objc
+    // package with a few lingering dependencies.
+    // TODO(b/64537078): Move these dependencies underneath the tools workspace.
+    if (TestConstants.TOOLS_REPOSITORY_SCRATCH.length() > 0) {
+      config.create(
+          "tools/objc/BUILD",
+          "package(default_visibility=['//visibility:public'])",
+          "exports_files(glob(['**']))",
+          "ios_application(name = 'xctest_app', binary = ':xctest_appbin')",
+          "objc_binary(name = 'xctest_appbin', srcs = ['objc_dummy.mm'])",
+          "filegroup(name = 'default_provisioning_profile', srcs = ['foo.mobileprovision'])",
+          "filegroup(name = 'xctest_infoplist', srcs = ['xctest.plist'])");
+    }
+    config.create(
+        TestConstants.TOOLS_REPOSITORY_SCRATCH + "tools/objc/foo.mobileprovision", "No such luck");
+    config.create(TestConstants.TOOLS_REPOSITORY_SCRATCH + "tools/objc/compile_protos.py");
+    config.create(TestConstants.TOOLS_REPOSITORY_SCRATCH + "tools/objc/xctest.plist");
+    config.create(TestConstants.TOOLS_REPOSITORY_SCRATCH + "tools/objc/proto_support");
+    config.create(TestConstants.TOOLS_REPOSITORY_SCRATCH + "tools/objc/ios_runner.sh.mac_template");
+    config.create(TestConstants.TOOLS_REPOSITORY_SCRATCH + "tools/objc/j2objc_dead_code_pruner.py");
+    config.create(TestConstants.TOOLS_REPOSITORY_SCRATCH + "tools/objc/header_scanner");
     createCrosstoolPackage(config, partialToolchainLines);
+    setupIosSimDevice(config);
+    setupIosTest(config);
+    setupObjcProto(config);
   }
 
   /**
    * Sets up mock IOS test support.
    */
   public static void setupIosTest(MockToolsConfig config) throws IOException {
-    config.create("tools/objc/precomp_testrunner_deploy.jar");
-    config.create("tools/objc/StdRedirect.dylib");
+    config.create(
+        TestConstants.TOOLS_REPOSITORY_SCRATCH + "tools/objc/precomp_testrunner_deploy.jar");
+    config.create(TestConstants.TOOLS_REPOSITORY_SCRATCH + "tools/objc/StdRedirect.dylib");
     createMemleaksSim(config);
-    config.create("tools/objc/ios_test.sh.bazel_template");
+    config.create(TestConstants.TOOLS_REPOSITORY_SCRATCH + "tools/objc/ios_test.sh.bazel_template");
   }
 
   /**
@@ -123,7 +147,7 @@
    */
   public static void setupIosSimDevice(MockToolsConfig config) throws IOException {
     config.create(
-        "tools/objc/sim_devices/BUILD",
+        TestConstants.TOOLS_REPOSITORY_SCRATCH + "tools/objc/sim_devices/BUILD",
         "ios_device(",
         "  name = 'default',",
         "  ios_version = '9.8',",
@@ -132,34 +156,22 @@
   }
 
   private static void createMemleaksSim(MockToolsConfig config) throws IOException {
-    config.create("tools/objc/memleaks/BUILD",
-       "package(default_visibility=['//visibility:public'])",
+    config.create(
+        TestConstants.TOOLS_REPOSITORY_SCRATCH + "tools/objc/memleaks/BUILD",
+        "package(default_visibility=['//visibility:public'])",
         "objc_library(",
         "  name = 'memleaks',",
         "  srcs = ['memleaks.m'],",
         ")");
 
-    config.create("tools/objc/memleaks/libmemleaks.a");
-    config.create("tools/objc/memleaks_plugin");
+    config.create(TestConstants.TOOLS_REPOSITORY_SCRATCH + "tools/objc/memleaks/libmemleaks.a");
+    config.create(TestConstants.TOOLS_REPOSITORY_SCRATCH + "tools/objc/memleaks_plugin");
   }
 
-  /**
-   * Sets up the support for building protocol buffers for ObjC.
-   */
-  public static void setupObjcProto(MockToolsConfig config) throws IOException {
-    config.overwrite(
-        "WORKSPACE",
-        TestConstants.WORKSPACE_CONTENT + "bind(",
-        "  name = 'objc_proto_lib',",
-        "  actual = '//objcproto:ProtocolBuffers_lib',",
-        ")",
-        "bind(",
-        "  name = 'objc_protobuf_lib',",
-        "  actual = '//objcproto:protobuf_lib',",
-        ")");
-
+  /** Sets up the support for building protocol buffers for ObjC. */
+  private static void setupObjcProto(MockToolsConfig config) throws IOException {
     config.create(
-        "objcproto/BUILD",
+        TestConstants.TOOLS_REPOSITORY_SCRATCH + "objcproto/BUILD",
         "package(default_visibility=['//visibility:public'])",
         "objc_library(",
         "  name = 'ProtocolBuffers_lib',",
@@ -176,9 +188,9 @@
         "  name = 'well_known_type_proto',",
         "  srcs = ['well_known_type.proto'],",
         ")");
-    config.create("objcproto/empty.m");
-    config.create("objcproto/empty.cc");
-    config.create("objcproto/well_known_type.proto");
+    config.create(TestConstants.TOOLS_REPOSITORY_SCRATCH + "objcproto/empty.m");
+    config.create(TestConstants.TOOLS_REPOSITORY_SCRATCH + "objcproto/empty.cc");
+    config.create(TestConstants.TOOLS_REPOSITORY_SCRATCH + "objcproto/well_known_type.proto");
   }
 
   /**
@@ -250,12 +262,18 @@
                   "    srcs = [",
                   "        'ar',",
                   "        'libempty.a',",
-                  "        '//tools/objc:libtool'",
+                  String.format("        '%s//tools/objc:libtool'", TestConstants.TOOLS_REPOSITORY),
                   "    ],",
                   ")");
 
       for (String arch :
           ImmutableList.of(
+              // TODO(b/64492583): Remove 'darwin', as this is legacy and redundant with
+              // darwin_x86_64.
+              "darwin",
+              // TODO(b/36471772): Remove 'k8' once unit tests do not require a host configuration
+              // transition from the apple crosstool configuration.
+              "x64_windows",
               "ios_x86_64",
               "ios_i386",
               "ios_armv7",
diff --git a/src/test/java/com/google/devtools/build/lib/rules/cpp/CrosstoolConfigurationLoaderTest.java b/src/test/java/com/google/devtools/build/lib/rules/cpp/CrosstoolConfigurationLoaderTest.java
index f879b16..c0a2457 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/cpp/CrosstoolConfigurationLoaderTest.java
+++ b/src/test/java/com/google/devtools/build/lib/rules/cpp/CrosstoolConfigurationLoaderTest.java
@@ -682,7 +682,7 @@
         PackageIdentifier.create(
             TestConstants.TOOLS_REPOSITORY,
             PathFragment.create(
-                PathFragment.create(TestConstants.TOOLS_REPOSITORY_PATH),
+                PathFragment.create(TestConstants.MOCK_CC_CROSSTOOL_PATH),
                 PathFragment.create(path)));
     return packageIdentifier.getPathUnderExecRoot();
   }
diff --git a/src/test/java/com/google/devtools/build/lib/rules/objc/AppleStaticLibraryTest.java b/src/test/java/com/google/devtools/build/lib/rules/objc/AppleStaticLibraryTest.java
index 346e235..d76970a 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/objc/AppleStaticLibraryTest.java
+++ b/src/test/java/com/google/devtools/build/lib/rules/objc/AppleStaticLibraryTest.java
@@ -242,7 +242,6 @@
 
     useConfiguration(
         "--ios_multi_cpus=i386,x86_64",
-        "--experimental_disable_go",
         "--experimental_disable_jvm",
         "--crosstool_top=//tools/osx/crosstool:crosstool");
 
@@ -594,7 +593,7 @@
         "objc_library(name = 'objcLib', srcs = [ 'b.m' ], deps = [':avoidLib'])",
         "objc_library(name = 'avoidLib', srcs = [ 'c.m' ])");
 
-    useConfiguration("--experimental_disable_go", "--experimental_disable_jvm");
+    useConfiguration("--experimental_disable_jvm");
     CommandAction action = linkLibAction("//package:test");
     assertThat(Artifact.toRootRelativePaths(action.getInputs())).contains(
         "package/libobjcLib.a");
@@ -617,11 +616,11 @@
         "objc_library(name = 'objcLib', srcs = [ 'b.m' ])",
         "objc_library(name = 'avoidLib', srcs = [ 'c.m' ])");
 
-    useConfiguration("--experimental_disable_go", "--experimental_disable_jvm");
+    useConfiguration("--experimental_disable_jvm");
     CommandAction action = linkLibAction("//package:test");
     assertThat(Artifact.toRootRelativePaths(action.getInputs())).contains(
         "package/libobjcLib.a");
     assertThat(Artifact.toRootRelativePaths(action.getInputs())).doesNotContain(
         "package/libavoidCcLib.a");
   }
-}
+}
\ No newline at end of file
diff --git a/src/test/java/com/google/devtools/build/lib/rules/objc/AppleToolchainSelectionTest.java b/src/test/java/com/google/devtools/build/lib/rules/objc/AppleToolchainSelectionTest.java
index b062851..cc2b748 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/objc/AppleToolchainSelectionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/rules/objc/AppleToolchainSelectionTest.java
@@ -94,9 +94,7 @@
   
   @Test
   public void testToolchainSelectionCcDepDefault() throws Exception {
-    useConfiguration(
-        "--experimental_disable_jvm",
-        "--experimental_disable_go");
+    useConfiguration("--experimental_disable_jvm");
     ScratchAttributeWriter
         .fromLabelString(this, "cc_library", "//b:lib")
         .setList("srcs", "b.cc")
diff --git a/src/test/java/com/google/devtools/build/lib/rules/objc/BUILD b/src/test/java/com/google/devtools/build/lib/rules/objc/BUILD
new file mode 100644
index 0000000..00620ee
--- /dev/null
+++ b/src/test/java/com/google/devtools/build/lib/rules/objc/BUILD
@@ -0,0 +1,82 @@
+package(default_visibility = ["//visibility:private"])
+
+filegroup(
+    name = "srcs",
+    srcs = glob(["**"]),
+    visibility = ["//src/test/java/com/google/devtools/build/lib:__pkg__"],
+)
+
+java_library(
+    name = "ObjcRulesTests_lib",
+    srcs = [
+        # TODO(b/64531582): Finish fixing all test files in this directory.
+        "AppleBinaryTest.java",
+        "AppleDynamicLibraryTest.java",
+        "AppleStaticLibraryTest.java",
+        "AppleStubBinaryTest.java",
+        "AppleToolchainSelectionTest.java",
+        "BinaryRuleType.java",
+        "BinaryRuleTypePair.java",
+        "HeaderDiscoveryTest.java",
+        "HeaderThinningTest.java",
+        "InterspersingTest.java",
+        "IosDeviceTest.java",
+        "J2ObjcLibraryTest.java",
+        "J2ObjcSourceTest.java",
+        "LegacyAppleBinaryTest.java",
+        "LegacyAppleDynamicLibraryTest.java",
+        "LegacyAppleStaticLibraryTest.java",
+        "LegacyObjcBundleLibraryTest.java",
+        "LegacyObjcBundleTest.java",
+        "LegacyObjcFrameworkTest.java",
+        "LegacyObjcImportTest.java",
+        "LegacyObjcLibraryTest.java",
+        "ObjcBundleLibraryTest.java",
+        "ObjcBundleTest.java",
+        "ObjcFrameworkTest.java",
+        "ObjcImportTest.java",
+        "ObjcLibraryTest.java",
+        "ObjcProviderTest.java",
+        "ObjcRuleTestCase.java",
+        "ObjcSkylarkTest.java",
+        "OnlyNeedsSourcesRuleType.java",
+        "RuleType.java",
+        "TargetDeviceFamilyTest.java",
+        "ValueTest.java",
+    ],
+    deps = [
+        "//src/main/java/com/google/devtools/build/lib:build-base",
+        "//src/main/java/com/google/devtools/build/lib:packages-internal",
+        "//src/main/java/com/google/devtools/build/lib:util",
+        "//src/main/java/com/google/devtools/build/lib:vfs",
+        "//src/main/java/com/google/devtools/build/lib/actions",
+        "//src/main/java/com/google/devtools/build/lib/cmdline",
+        "//src/main/java/com/google/devtools/build/lib/rules/apple",
+        "//src/main/java/com/google/devtools/build/lib/rules/cpp",
+        "//src/main/java/com/google/devtools/build/lib/rules/objc",
+        "//src/main/java/com/google/devtools/common/options",
+        "//src/main/protobuf:bundlemerge_java_proto",
+        "//src/main/protobuf:plmerge_java_proto",
+        "//src/test/java/com/google/devtools/build/lib:actions_testutil",
+        "//src/test/java/com/google/devtools/build/lib:analysis_testutil",
+        "//src/test/java/com/google/devtools/build/lib:packages_testutil",
+        "//src/test/java/com/google/devtools/build/lib:testutil",
+        "//third_party:guava",
+        "//third_party:guava-testlib",
+        "//third_party:jsr305",
+        "//third_party:junit4",
+        "//third_party:truth",
+        "//third_party/java/dd_plist",
+    ],
+)
+
+java_test(
+    name = "ObjcRulesTests",
+    shard_count = 20,
+    test_class = "com.google.devtools.build.lib.AllTests",
+    runtime_deps = [
+        ":ObjcRulesTests_lib",
+        "//src/main/java/com/google/devtools/build/lib:util",
+        "//src/test/java/com/google/devtools/build/lib:testutil",
+    ],
+)
diff --git a/src/test/java/com/google/devtools/build/lib/rules/objc/IosExtensionBinaryTest.java b/src/test/java/com/google/devtools/build/lib/rules/objc/IosExtensionBinaryTest.java
index a0c95d2..01754e5 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/objc/IosExtensionBinaryTest.java
+++ b/src/test/java/com/google/devtools/build/lib/rules/objc/IosExtensionBinaryTest.java
@@ -40,7 +40,7 @@
   @Before
   public final void initializeToolsConfigMock() throws Exception {
     MockProtoSupport.setup(mockToolsConfig);
-    MockObjcSupport.setupObjcProto(mockToolsConfig);
+    MockObjcSupport.setup(mockToolsConfig);
   }
 
   @Test
diff --git a/src/test/java/com/google/devtools/build/lib/rules/objc/IosTestTest.java b/src/test/java/com/google/devtools/build/lib/rules/objc/IosTestTest.java
index 224559e..7bb3872 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/objc/IosTestTest.java
+++ b/src/test/java/com/google/devtools/build/lib/rules/objc/IosTestTest.java
@@ -56,7 +56,7 @@
     MockObjcSupport.setupIosTest(mockToolsConfig);
     MockObjcSupport.setupIosSimDevice(mockToolsConfig);
     MockProtoSupport.setup(mockToolsConfig);
-    MockObjcSupport.setupObjcProto(mockToolsConfig);
+    MockObjcSupport.setup(mockToolsConfig);
 
     invalidatePackages();
   }
diff --git a/src/test/java/com/google/devtools/build/lib/rules/objc/J2ObjcLibraryTest.java b/src/test/java/com/google/devtools/build/lib/rules/objc/J2ObjcLibraryTest.java
index 3fff23e..e0e5098 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/objc/J2ObjcLibraryTest.java
+++ b/src/test/java/com/google/devtools/build/lib/rules/objc/J2ObjcLibraryTest.java
@@ -83,7 +83,6 @@
     MockObjcSupport.setupIosTest(mockToolsConfig);
     MockJ2ObjcSupport.setup(mockToolsConfig);
     MockProtoSupport.setup(mockToolsConfig);
-    MockObjcSupport.setupObjcProto(mockToolsConfig);
 
     useConfiguration("--proto_toolchain_for_java=//tools/proto/toolchains:java");
 
diff --git a/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcBinaryTest.java b/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcBinaryTest.java
index acc3362..4775e2d 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcBinaryTest.java
+++ b/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcBinaryTest.java
@@ -71,7 +71,7 @@
   @Before
   public final void initializeToolsConfigMock() throws Exception {
     MockProtoSupport.setup(mockToolsConfig);
-    MockObjcSupport.setupObjcProto(mockToolsConfig);
+    MockObjcSupport.setup(mockToolsConfig);
   }
 
   @Test
diff --git a/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcLibraryTest.java b/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcLibraryTest.java
index 3409176..08b1d0b 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcLibraryTest.java
+++ b/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcLibraryTest.java
@@ -81,7 +81,6 @@
 
   @Test
   public void testFilesToBuild() throws Exception {
-    useConfiguration("--crosstool_top=" + MockObjcSupport.DEFAULT_OSX_CROSSTOOL);
     ConfiguredTarget target =
         createLibraryTargetWriter("//objc:One")
             .setAndCreateFiles("srcs", "a.m", "b.m", "private.h")
@@ -93,7 +92,6 @@
 
   @Test
   public void testCompilesSources() throws Exception {
-    useConfiguration("--crosstool_top=" + MockObjcSupport.DEFAULT_OSX_CROSSTOOL);
     createLibraryTargetWriter("//objc/lib1")
         .setAndCreateFiles("srcs", "a.m")
         .setAndCreateFiles("hdrs", "hdr.h")
@@ -122,8 +120,6 @@
   @Test
   public void testObjcPlusPlusCompile() throws Exception {
     useConfiguration(
-        "--crosstool_top=" + MockObjcSupport.DEFAULT_OSX_CROSSTOOL,
-        "--experimental_disable_go",
         "--cpu=ios_i386",
         "--ios_cpu=i386",
         "--ios_minimum_os=9.10.11");
@@ -138,7 +134,6 @@
   @Test
   public void testObjcPlusPlusCompileDarwin() throws Exception {
     useConfiguration(ObjcCrosstoolMode.ALL,
-        "--experimental_disable_go",
         "--cpu=darwin_x86_64",
         "--macos_minimum_os=9.10.11",
         // TODO(b/36126423): Darwin should imply macos, so the
@@ -155,8 +150,6 @@
   @Test
   public void testCompilationModeDbg() throws Exception {
     useConfiguration(
-        "--crosstool_top=" + MockObjcSupport.DEFAULT_OSX_CROSSTOOL,
-        "--experimental_disable_go",
         "--cpu=ios_i386",
         "--ios_cpu=i386",
         "--compilation_mode=dbg");
@@ -180,8 +173,6 @@
   @Test
   public void testCompilationModeFastbuild() throws Exception {
     useConfiguration(
-        "--crosstool_top=" + MockObjcSupport.DEFAULT_OSX_CROSSTOOL,
-        "--experimental_disable_go",
         "--cpu=ios_i386",
         "--ios_cpu=i386",
         "--compilation_mode=fastbuild");
@@ -205,8 +196,6 @@
   @Test
   public void testCompilationModeOpt() throws Exception {
     useConfiguration(
-        "--crosstool_top=" + MockObjcSupport.DEFAULT_OSX_CROSSTOOL,
-        "--experimental_disable_go",
         "--cpu=ios_i386",
         "--ios_cpu=i386",
         "--compilation_mode=opt");
@@ -408,8 +397,6 @@
   @Test
   public void testCompilationActions_simulator() throws Exception {
     useConfiguration(
-        "--crosstool_top=" + MockObjcSupport.DEFAULT_OSX_CROSSTOOL,
-        "--experimental_disable_go",
         "--cpu=ios_i386",
         "--ios_cpu=i386");
 
@@ -462,8 +449,6 @@
   @Test
   public void testCompilationActions_device() throws Exception {
     useConfiguration(
-        "--crosstool_top=" + MockObjcSupport.DEFAULT_OSX_CROSSTOOL,
-        "--experimental_disable_go",
         "--cpu=ios_armv7",
         "--ios_cpu=armv7");
 
@@ -558,11 +543,7 @@
 
   @Test
   public void testCompilationActionsWithCopts() throws Exception {
-    useConfiguration(
-        "--crosstool_top=" + MockObjcSupport.DEFAULT_OSX_CROSSTOOL,
-        "--cpu=ios_i386",
-        "--ios_cpu=i386",
-        "--experimental_disable_go");
+    useConfiguration("--cpu=ios_i386", "--ios_cpu=i386");
     createLibraryTargetWriter("//objc:lib")
         .setAndCreateFiles("srcs", "a.m", "b.m", "private.h")
         .setAndCreateFiles("hdrs", "c.h")
@@ -711,8 +692,6 @@
   @Test
   public void testArchiveAction_simulator() throws Exception {
     useConfiguration(
-        "--crosstool_top=" + MockObjcSupport.DEFAULT_OSX_CROSSTOOL,
-        "--experimental_disable_go",
         "--cpu=ios_i386",
         "--ios_cpu=i386");
     createLibraryTargetWriter("//objc:lib")
@@ -743,8 +722,6 @@
   @Test
   public void testArchiveAction_device() throws Exception {
     useConfiguration(
-        "--crosstool_top=" + MockObjcSupport.DEFAULT_OSX_CROSSTOOL,
-        "--experimental_disable_go",
         "--cpu=ios_armv7",
         "--ios_cpu=armv7");
     createLibraryTargetWriter("//objc:lib")
@@ -775,8 +752,6 @@
   @Test
   public void testFullyLinkArchiveAction_simulator() throws Exception {
     useConfiguration(
-        "--crosstool_top=" + MockObjcSupport.DEFAULT_OSX_CROSSTOOL,
-        "--experimental_disable_go",
         "--cpu=ios_i386",
         "--ios_cpu=i386");
     createLibraryTargetWriter("//objc:lib_dep")
@@ -815,8 +790,6 @@
   @Test
   public void testFullyLinkArchiveAction_device() throws Exception {
     useConfiguration(
-        "--crosstool_top=" + MockObjcSupport.DEFAULT_OSX_CROSSTOOL,
-        "--experimental_disable_go",
         "--cpu=ios_armv7",
         "--ios_cpu=armv7");
     createLibraryTargetWriter("//objc:lib_dep")
@@ -886,8 +859,6 @@
   @Test
   public void testPropagatesDefinesToDependersTransitively() throws Exception {
     useConfiguration(
-        "--crosstool_top=" + MockObjcSupport.DEFAULT_OSX_CROSSTOOL,
-        "--experimental_disable_go",
         "--cpu=ios_x86_64",
         "--ios_cpu=x86_64");
     createLibraryTargetWriter("//lib1:lib1")
@@ -1352,9 +1323,7 @@
 
   @Test
   public void testApplePlatformEnvForCcLibraryDep() throws Exception {
-    useConfiguration(
-        "--experimental_disable_go", "--experimental_disable_jvm", "--cpu=ios_i386",
-        "--crosstool_top=//tools/osx/crosstool:crosstool");
+    useConfiguration("--experimental_disable_jvm", "--cpu=ios_i386");
 
     scratch.file("package/BUILD",
         "cc_library(",
@@ -1483,8 +1452,6 @@
   @Test
   public void testCompilationActionsWithIQuotesInCopts() throws Exception {
     useConfiguration(
-        "--crosstool_top=" + MockObjcSupport.DEFAULT_OSX_CROSSTOOL,
-        "--experimental_disable_go",
         "--cpu=ios_i386",
         "--ios_cpu=i386");
     createLibraryTargetWriter("//objc:lib")
@@ -1552,7 +1519,6 @@
     MockObjcSupport.setup(mockToolsConfig, "default_grte_top : '//x'");
     useConfiguration(
         ObjcCrosstoolMode.ALL,
-        "--experimental_disable_go",
         "--cpu=ios_x86_64",
         "--ios_cpu=x86_64");
     scratch.file(
@@ -1584,7 +1550,6 @@
         "}");
     useConfiguration(
         ObjcCrosstoolMode.ALL,
-        "--experimental_disable_go",
         "--cpu=ios_x86_64",
         "--ios_cpu=x86_64");
     scratch.file(
diff --git a/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcProtoAspectTest.java b/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcProtoAspectTest.java
index 83611a5..35adffb 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcProtoAspectTest.java
+++ b/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcProtoAspectTest.java
@@ -36,7 +36,7 @@
   @Before
   public final void initializeToolsConfigMock() throws Exception {
     MockProtoSupport.setup(mockToolsConfig);
-    MockObjcSupport.setupObjcProto(mockToolsConfig);
+    MockObjcSupport.setup(mockToolsConfig);
   }
 
   @Test
diff --git a/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcProtoLibraryTest.java b/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcProtoLibraryTest.java
index a2689cd..043f21b 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcProtoLibraryTest.java
+++ b/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcProtoLibraryTest.java
@@ -44,7 +44,7 @@
   @Before
   public final void initializeToolsConfigMock() throws Exception {
     MockProtoSupport.setup(mockToolsConfig);
-    MockObjcSupport.setupObjcProto(mockToolsConfig);
+    MockObjcSupport.setup(mockToolsConfig);
   }
 
   @Before
diff --git a/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcRuleTestCase.java b/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcRuleTestCase.java
index 2f4d819..b48d242 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcRuleTestCase.java
+++ b/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcRuleTestCase.java
@@ -95,6 +95,7 @@
 import com.google.devtools.build.lib.rules.cpp.CppLinkAction;
 import com.google.devtools.build.lib.rules.objc.CompilationSupport.ExtraLinkArgs;
 import com.google.devtools.build.lib.rules.objc.ObjcCommandLineOptions.ObjcCrosstoolMode;
+import com.google.devtools.build.lib.testutil.TestConstants;
 import com.google.devtools.build.lib.vfs.PathFragment;
 import com.google.devtools.build.xcode.bundlemerge.proto.BundleMergeProtos;
 import com.google.devtools.build.xcode.bundlemerge.proto.BundleMergeProtos.BundleFile;
@@ -122,14 +123,17 @@
  * simply call a check... method) across several rule types.
  */
 public abstract class ObjcRuleTestCase extends BuildViewTestCase {
-  protected static final String MOCK_ACTOOLWRAPPER_PATH = "tools/objc/actoolwrapper";
-  protected static final String MOCK_IBTOOLWRAPPER_PATH = "tools/objc/ibtoolwrapper";
-  protected static final String MOCK_BUNDLEMERGE_PATH = "tools/objc/bundlemerge";
-  protected static final String MOCK_MOMCWRAPPER_PATH = "tools/objc/momcwrapper";
+  protected static final String MOCK_ACTOOLWRAPPER_PATH =
+      toolsRepoExecPath("tools/objc/actoolwrapper");
+  protected static final String MOCK_IBTOOLWRAPPER_PATH =
+      toolsRepoExecPath("tools/objc/ibtoolwrapper");
+  protected static final String MOCK_BUNDLEMERGE_PATH = toolsRepoExecPath("tools/objc/bundlemerge");
+  protected static final String MOCK_MOMCWRAPPER_PATH = toolsRepoExecPath("tools/objc/momcwrapper");
   protected static final String MOCK_SWIFTSTDLIBTOOLWRAPPER_PATH =
-      "tools/objc/swiftstdlibtoolwrapper";
-  protected static final String MOCK_LIBTOOL_PATH = "tools/objc/libtool";
-  protected static final String MOCK_XCRUNWRAPPER_PATH = "tools/objc/xcrunwrapper";
+      toolsRepoExecPath("tools/objc/swiftstdlibtoolwrapper");
+  protected static final String MOCK_LIBTOOL_PATH = toolsRepoExecPath("tools/objc/libtool");
+  protected static final String MOCK_XCRUNWRAPPER_PATH =
+      toolsRepoExecPath("tools/objc/xcrunwrapper");
   protected static final ImmutableList<String> FASTBUILD_COPTS =
       ImmutableList.of("-O0", "-DDEBUG=1");
 
@@ -200,15 +204,23 @@
       DottedVersion minOsVersion) {
     switch (configurationDistinguisher) {
       case UNKNOWN:
-        return String.format("blaze-out/ios_%s-fastbuild/", arch);
+        return String.format("%s-out/ios_%s-fastbuild/", TestConstants.PRODUCT_NAME, arch);
       case IOS_EXTENSION: // Intentional fall-through.
       case IOS_APPLICATION:
       case APPLEBIN_IOS:
-        return String.format("blaze-out/ios-%1$s-min%3$s-%2$s-ios_%1$s-fastbuild/",
-            arch, configurationDistinguisher.toString().toLowerCase(Locale.US), minOsVersion);
+        return String.format(
+            "%1$s-out/ios-%2$s-min%4$s-%3$s-ios_%2$s-fastbuild/",
+            TestConstants.PRODUCT_NAME,
+            arch,
+            configurationDistinguisher.toString().toLowerCase(Locale.US),
+            minOsVersion);
       case APPLEBIN_WATCHOS:
-         return String.format("blaze-out/watchos-%1$s-min%3$s-%2$s-watchos_%1$s-fastbuild/",
-            arch, configurationDistinguisher.toString().toLowerCase(Locale.US), minOsVersion);
+        return String.format(
+            "%1$s-out/watchos-%2$s-min%4$s-%3$s-watchos_%2$s-fastbuild/",
+            TestConstants.PRODUCT_NAME,
+            arch,
+            configurationDistinguisher.toString().toLowerCase(Locale.US),
+            minOsVersion);
       default:
         throw new AssertionError();
     }
@@ -239,11 +251,14 @@
     switch (configurationDistinguisher) {
       case IOS_EXTENSION:
       case APPLEBIN_IOS:
-        return String.format("blaze-out/%s-ios_%s-fastbuild/bin/",
-            configurationDistinguisher.toString().toLowerCase(Locale.US), arch);
+        return String.format(
+            "%s-out/%s-ios_%s-fastbuild/bin/",
+            TestConstants.PRODUCT_NAME,
+            configurationDistinguisher.toString().toLowerCase(Locale.US),
+            arch);
       case UNKNOWN: // Intentional fall-through.
       case IOS_APPLICATION:
-        return String.format("blaze-out/ios_%s-fastbuild/bin/", arch);
+        return String.format("%s-out/ios_%s-fastbuild/bin/", TestConstants.PRODUCT_NAME, arch);
       default:
         throw new AssertionError();
     }
@@ -273,7 +288,7 @@
    * Returns the genfiles dir for iOS builds in the root architecture.
    */
   protected static String rootConfigurationGenfiles() {
-    return "blaze-out/gcc-4.4.0-glibc-2.3.6-grte-k8-fastbuild/genfiles/";
+    return TestConstants.PRODUCT_NAME + "-out/gcc-4.4.0-glibc-2.3.6-grte-k8-fastbuild/genfiles/";
   }
 
   protected String execPathEndingWith(Iterable<Artifact> artifacts, String suffix) {
@@ -284,7 +299,9 @@
   public final void initializeMockToolsConfig() throws Exception {
     MockObjcSupport.setup(mockToolsConfig);
     MockProtoSupport.setup(mockToolsConfig);
-    MockObjcSupport.setupObjcProto(mockToolsConfig);
+
+    // Set flags required by objc builds.
+    useConfiguration();
   }
 
   protected static String frameworkDir(ConfiguredTarget target) {
@@ -368,6 +385,8 @@
   protected void useConfiguration(ObjcCrosstoolMode objcCrosstoolMode, String... args)
       throws Exception {
     ImmutableList.Builder<String> extraArgsBuilder = ImmutableList.builder();
+    extraArgsBuilder.addAll(TestConstants.OSX_CROSSTOOL_FLAGS);
+
     switch(objcCrosstoolMode) {
       case ALL:
         extraArgsBuilder.add("--experimental_objc_crosstool=all");
@@ -381,7 +400,8 @@
     }
 
     extraArgsBuilder
-        .add("--experimental_disable_go")
+        .add("--xcode_version_config=" + MockObjcSupport.XCODE_VERSION_CONFIG)
+        .add("--apple_crosstool_top=" + MockObjcSupport.DEFAULT_OSX_CROSSTOOL)
         .add("--crosstool_top=" + MockObjcSupport.DEFAULT_OSX_CROSSTOOL);
 
     ImmutableList<String> extraArgs = extraArgsBuilder.build();
@@ -468,10 +488,7 @@
 
   protected void checkLinkActionCorrect(RuleType ruleType, ExtraLinkArgs extraLinkArgs)
       throws Exception {
-    useConfiguration(
-        "--cpu=ios_i386",
-        "--crosstool_top=" + MockObjcSupport.DEFAULT_OSX_CROSSTOOL,
-        "--experimental_disable_go");
+    useConfiguration("--cpu=ios_i386");
 
     createLibraryTargetWriter("//lib1:lib1")
         .setAndCreateFiles("srcs", "a.m", "b.m", "private.h")
@@ -501,11 +518,7 @@
   // Regression test for b/29094356.
   protected void checkLinkActionDuplicateInputs(RuleType ruleType, ExtraLinkArgs extraLinkArgs)
       throws Exception {
-    useConfiguration(
-        "--experimental_disable_go",
-        "--experimental_disable_jvm",
-        "--cpu=ios_i386",
-        "--crosstool_top=//tools/osx/crosstool:crosstool");
+    useConfiguration("--experimental_disable_jvm", "--cpu=ios_i386");
 
     scratch.file("lib/BUILD",
         "cc_library(",
@@ -717,13 +730,18 @@
         .containsExactly("ios_runner.sh.mac_template");
     assertThat(Artifact.toRootRelativePaths(action.getOutputs()))
         .containsExactly("x/x_runner.sh");
-    assertThat(action.getSubstitutions())
-        .containsExactly(
-            Substitution.of("%ipa_file%", "x/x.ipa"),
-            Substitution.of("%sim_device%", "'iPhone X'"),
-            Substitution.of("%sdk_version%", "3"),
-            Substitution.of("%app_name%", "x"),
-            Substitution.of("%std_redirect_dylib_path%", "tools/objc/StdRedirect.dylib"));
+    Map<String, String> substitutions =
+        action
+            .getSubstitutions()
+            .stream()
+            .collect(ImmutableMap.toImmutableMap(sub -> sub.getKey(), s -> s.getValue()));
+    ;
+    assertThat(substitutions.get("%ipa_file%")).isEqualTo("x/x.ipa");
+    assertThat(substitutions.get("%sim_device%")).isEqualTo("'iPhone X'");
+    assertThat(substitutions.get("%sdk_version%")).isEqualTo("3");
+    assertThat(substitutions.get("%app_name%")).isEqualTo("x");
+    assertThat(substitutions.get("%std_redirect_dylib_path%"))
+        .endsWith("tools/objc/StdRedirect.dylib");
   }
 
   protected void checkGenerateRunnerScriptAction_escaped(RuleType ruleType) throws Exception {
@@ -892,7 +910,7 @@
     SpawnAction mergeAction = (SpawnAction) getGeneratingAction(entitlements);
 
     assertThat(Artifact.toExecPaths(mergeAction.getInputs()))
-        .contains("tools/objc/device_debug_entitlements.plist");
+        .contains(toolsRepoExecPath("tools/objc/device_debug_entitlements.plist"));
 
     Artifact mergeControl =
         getFirstArtifactEndingWith(mergeAction.getInputs(), ".merge-entitlements-control");
@@ -905,7 +923,7 @@
     }
 
     assertThat(mergeControlProto.getSourceFileList())
-        .contains("tools/objc/device_debug_entitlements.plist");
+        .contains(toolsRepoExecPath("tools/objc/device_debug_entitlements.plist"));
   }
 
   private void assertNoDebugEntitlements(RuleType ruleType) throws Exception {
@@ -916,7 +934,7 @@
     SpawnAction entitlementsAction = (SpawnAction) getGeneratingAction(entitlements);
 
     assertThat(Artifact.toExecPaths(entitlementsAction.getInputs()))
-        .doesNotContain("tools/objc/device_debug_entitlements.plist");
+        .doesNotContain(toolsRepoExecPath("tools/objc/device_debug_entitlements.plist"));
   }
 
   protected void checkCompilesSources(RuleType ruleType) throws Exception {
@@ -2153,7 +2171,7 @@
   }
 
   protected void checkProvidesStoryboardObjects(RuleType ruleType) throws Exception {
-    useConfiguration("--crosstool_top=" + MockObjcSupport.DEFAULT_OSX_CROSSTOOL);
+    useConfiguration();
     createTargetWithStoryboards(ruleType);
     ObjcProvider provider = providerForTarget("//x:x");
     ImmutableList<Artifact> storyboardInputs = ImmutableList.of(
@@ -2186,16 +2204,14 @@
       throws Exception {
     Artifact storyboardZip = getBinArtifact("x/1.storyboard.zip", target);
     CommandAction compileAction = (CommandAction) getGeneratingAction(storyboardZip);
-    assertThat(compileAction.getInputs()).containsExactly(
-        getSourceArtifact(MOCK_IBTOOLWRAPPER_PATH),
-        getSourceArtifact("x/1.storyboard")
-    );
+    assertThat(Artifact.toExecPaths(compileAction.getInputs()))
+        .containsExactly(MOCK_IBTOOLWRAPPER_PATH, "x/1.storyboard");
     String archiveRoot = targetDevices.contains("watch") ? "." : "1.storyboardc";
     assertThat(compileAction.getOutputs()).containsExactly(storyboardZip);
     assertThat(compileAction.getArguments())
         .containsExactlyElementsIn(
             new Builder()
-                .add(MOCK_IBTOOLWRAPPER_PATH)
+                .addDynamicString(MOCK_IBTOOLWRAPPER_PATH)
                 .addExecPath(storyboardZip)
                 .addDynamicString(archiveRoot) // archive root
                 .add("--minimum-deployment-target", minimumOsVersion.toString())
@@ -2209,16 +2225,14 @@
 
     storyboardZip = getBinArtifact("x/ja.lproj/loc.storyboard.zip", target);
     compileAction = (CommandAction) getGeneratingAction(storyboardZip);
-    assertThat(compileAction.getInputs()).containsExactly(
-        getSourceArtifact(MOCK_IBTOOLWRAPPER_PATH),
-        getSourceArtifact("x/ja.lproj/loc.storyboard")
-    );
+    assertThat(Artifact.toExecPaths(compileAction.getInputs()))
+        .containsExactly(MOCK_IBTOOLWRAPPER_PATH, "x/ja.lproj/loc.storyboard");
     assertThat(compileAction.getOutputs()).containsExactly(storyboardZip);
     archiveRoot = targetDevices.contains("watch") ? "ja.lproj/" : "ja.lproj/loc.storyboardc";
     assertThat(compileAction.getArguments())
         .containsExactlyElementsIn(
             new Builder()
-                .add(MOCK_IBTOOLWRAPPER_PATH)
+                .addDynamicString(MOCK_IBTOOLWRAPPER_PATH)
                 .addExecPath(storyboardZip)
                 .addDynamicString(archiveRoot) // archive root
                 .add("--minimum-deployment-target", minimumOsVersion.toString())
@@ -2243,13 +2257,12 @@
     Artifact binary = getBinArtifact("x_lipobin", target);
     SpawnAction toolAction = (SpawnAction) getGeneratingAction(swiftLibsZip);
 
-    assertThat(toolAction.getInputs()).containsExactly(
-        binary,
-        getSourceArtifact(MOCK_SWIFTSTDLIBTOOLWRAPPER_PATH));
+    assertThat(Artifact.toExecPaths(toolAction.getInputs()))
+        .containsExactly(binary.getExecPathString(), MOCK_SWIFTSTDLIBTOOLWRAPPER_PATH);
     assertThat(toolAction.getOutputs()).containsExactly(swiftLibsZip);
 
     CustomCommandLine.Builder expectedCommandLine =
-        CustomCommandLine.builder().add(MOCK_SWIFTSTDLIBTOOLWRAPPER_PATH);
+        CustomCommandLine.builder().addDynamicString(MOCK_SWIFTSTDLIBTOOLWRAPPER_PATH);
 
     if (toolchain != null) {
       expectedCommandLine.add("--toolchain", toolchain);
@@ -2704,7 +2717,7 @@
   }
 
   protected void checkDefinesFromCcLibraryDep(RuleType ruleType) throws Exception {
-    useConfiguration("--crosstool_top=" + MockObjcSupport.DEFAULT_OSX_CROSSTOOL);
+    useConfiguration();
     ScratchAttributeWriter.fromLabelString(this, "cc_library", "//dep:lib")
         .setList("srcs", "a.cc")
         .setList("defines", "foo", "bar")
@@ -2933,7 +2946,7 @@
         .containsExactly(
             "x/foo.png",
             "x/x_lipobin",
-            "tools/objc/bundlemerge",
+            toolsRepoExecPath("tools/objc/bundlemerge"),
             "x/x.ipa-control",
             "x/x-MergedInfo.plist");
   }
@@ -2953,7 +2966,7 @@
   }
 
   public void checkCppSourceCompilesWithCppFlags(RuleType ruleType) throws Exception {
-    useConfiguration("--crosstool_top=" + MockObjcSupport.DEFAULT_OSX_CROSSTOOL);
+    useConfiguration();
 
     ruleType.scratchTarget(
         scratch, "srcs", "['a.mm', 'b.cc', 'c.mm', 'd.cxx', 'e.c', 'f.m', 'g.C']");
@@ -3568,11 +3581,7 @@
 
   private void checkCcDependency(
       ConfigurationDistinguisher configurationDistinguisher, String targetName) throws Exception {
-    useConfiguration(
-        "--experimental_disable_go",
-        "--experimental_disable_jvm",
-        "--cpu=ios_i386",
-        "--crosstool_top=//tools/osx/crosstool:crosstool");
+    useConfiguration("--experimental_disable_jvm", "--cpu=ios_i386");
 
     scratch.file("lib/BUILD",
         "cc_library(",
@@ -3600,8 +3609,7 @@
 
   protected void checkCcDependencyMultiArch(BinaryRuleTypePair ruleTypePair,
       ConfigurationDistinguisher configurationDistinguisher) throws Exception {
-    useConfiguration("--experimental_disable_go", "--experimental_disable_jvm",
-        "--ios_multi_cpus=armv7,arm64", "--crosstool_top=//tools/osx/crosstool:crosstool");
+    useConfiguration("--experimental_disable_jvm", "--ios_multi_cpus=armv7,arm64");
 
     scratch.file("lib/BUILD",
         "cc_library(",
@@ -3701,8 +3709,7 @@
 
   protected void checkGenruleWithoutJavaCcDependency(BinaryRuleTypePair ruleTypePair)
       throws Exception {
-    useConfiguration("--experimental_disable_go", "--experimental_disable_jvm",
-        "--ios_multi_cpus=armv7,arm64", "--crosstool_top=//tools/osx/crosstool:crosstool");
+    useConfiguration("--experimental_disable_jvm", "--ios_multi_cpus=armv7,arm64");
 
     String targets = ruleTypePair.targets(scratch, "x", "srcs", "['gen.m']");
     scratch.file("x/BUILD",
@@ -3735,11 +3742,7 @@
   protected void checkCcDependencyWithProtoDependency(BinaryRuleTypePair ruleTypePair,
       ConfigurationDistinguisher configurationDistinguisher) throws Exception {
     MockProtoSupport.setup(mockToolsConfig);
-    useConfiguration(
-        "--experimental_disable_go",
-        "--experimental_disable_jvm",
-        "--cpu=ios_i386",
-        "--crosstool_top=//tools/osx/crosstool:crosstool");
+    useConfiguration("--experimental_disable_jvm", "--cpu=ios_i386");
     scratch.file("lib/BUILD",
         "proto_library(",
         "    name = 'protolib',",
@@ -3781,10 +3784,7 @@
       ConfigurationDistinguisher configurationDistinguisher) throws Exception {
     MockProtoSupport.setup(mockToolsConfig);
     MockJ2ObjcSupport.setup(mockToolsConfig);
-    useConfiguration(
-        "--experimental_disable_go",
-        "--cpu=ios_i386",
-        "--crosstool_top=//tools/osx/crosstool:crosstool");
+    useConfiguration("--cpu=ios_i386");
 
     scratch.file("lib/BUILD",
         "java_library(",
@@ -3810,11 +3810,12 @@
         getFirstArtifactEndingWith(appLipoAction.getInputs(), "bin_bin"));
 
     String i386Prefix = iosConfigurationCcDepsBin("i386", configurationDistinguisher);
-    ImmutableList<String> archiveFilenames = ImmutableList.of(
-        i386Prefix + "lib/libcclib.a",
-        i386Prefix + "x/libbin.a",
-        i386Prefix + "lib/libjavalib_j2objc.a",
-        i386Prefix + "third_party/java/j2objc/libjre_core_lib.a");
+    ImmutableList<String> archiveFilenames =
+        ImmutableList.of(
+            i386Prefix + "lib/libcclib.a",
+            i386Prefix + "x/libbin.a",
+            i386Prefix + "lib/libjavalib_j2objc.a",
+            i386Prefix + toolsRepoExecPath("third_party/java/j2objc/libjre_core_lib.a"));
 
     verifyObjlist(binBinAction, "x/bin-linker.objlist",
         archiveFilenames.toArray(new String[archiveFilenames.size()]));
@@ -3830,8 +3831,7 @@
   protected void checkCcDependencyWithProtoDependencyMultiArch(BinaryRuleTypePair ruleTypePair,
       ConfigurationDistinguisher configurationDistinguisher) throws Exception {
     MockProtoSupport.setup(mockToolsConfig);
-    useConfiguration("--experimental_disable_go", "--experimental_disable_jvm",
-        "--ios_multi_cpus=armv7,arm64", "--crosstool_top=//tools/osx/crosstool:crosstool");
+    useConfiguration("--experimental_disable_jvm", "--ios_multi_cpus=armv7,arm64");
     scratch.file("lib/BUILD",
         "proto_library(",
         "    name = 'protolib',",
@@ -3900,15 +3900,13 @@
     Artifact storyboardZip = getBinArtifact("x/launch.storyboard.zip", target);
     CommandAction storyboardCompile = (CommandAction) getGeneratingAction(storyboardZip);
 
-    assertThat(storyboardCompile.getInputs())
-        .containsExactly(
-            getSourceArtifact(MOCK_IBTOOLWRAPPER_PATH),
-            getSourceArtifact("x/launch.storyboard"));
+    assertThat(Artifact.toExecPaths(storyboardCompile.getInputs()))
+        .containsExactly(MOCK_IBTOOLWRAPPER_PATH, "x/launch.storyboard");
 
     assertThat(storyboardCompile.getArguments())
         .isEqualTo(
             new CustomCommandLine.Builder()
-                .add(MOCK_IBTOOLWRAPPER_PATH)
+                .addDynamicString(MOCK_IBTOOLWRAPPER_PATH)
                 .addExecPath(storyboardZip)
                 .add("launch.storyboardc")
                 .add("--minimum-deployment-target")
@@ -4255,8 +4253,7 @@
         "    framework_imports = glob(['MyFramework.framework/*']),",
         "    is_dynamic = 1,",
         ")");
-    useConfiguration("--ios_multi_cpus=i386,x86_64", "--experimental_disable_go",
-        "--experimental_disable_jvm", "--crosstool_top=//tools/osx/crosstool:crosstool");
+    useConfiguration("--ios_multi_cpus=i386,x86_64", "--experimental_disable_jvm");
 
     Action lipobinAction = lipoBinAction("//x:x");
 
@@ -4322,8 +4319,7 @@
     scratch.file("package/BUILD",
         "cc_library(name = 'cclib', srcs = ['dep.c'])");
 
-    useConfiguration("--ios_multi_cpus=i386,x86_64", "--experimental_disable_go",
-        "--experimental_disable_jvm", "--crosstool_top=//tools/osx/crosstool:crosstool");
+    useConfiguration("--ios_multi_cpus=i386,x86_64", "--experimental_disable_jvm");
 
     Action appLipoAction = actionProducingArtifact("//x:x", "_lipobin");
     String i386Prefix =
@@ -4369,8 +4365,7 @@
     ruleType.scratchTarget(scratch,
         "srcs", "['a.m']",
         "deps", "['//lib1:lib1', '//lib2:lib2']");
-    useConfiguration("--ios_multi_cpus=i386,x86_64", "--experimental_disable_go",
-        "--experimental_disable_jvm", "--crosstool_top=//tools/osx/crosstool:crosstool");
+    useConfiguration("--ios_multi_cpus=i386,x86_64", "--experimental_disable_jvm");
 
     Action lipobinAction = lipoBinAction("//x:x");
 
@@ -4405,8 +4400,7 @@
 
   // Regression test for b/32310268.
   protected void checkAliasedLinkoptsThroughObjcLibrary(RuleType ruleType) throws Exception {
-    useConfiguration("--experimental_disable_go", "--experimental_disable_jvm",
-        "--cpu=ios_i386", "--crosstool_top=//tools/osx/crosstool:crosstool");
+    useConfiguration("--experimental_disable_jvm", "--cpu=ios_i386");
 
     scratch.file("bin/BUILD",
         "objc_library(",
@@ -4435,8 +4429,7 @@
 
   protected void checkCcDependencyLinkoptsArePropagatedToLinkAction(
       RuleType ruleType) throws Exception {
-    useConfiguration("--experimental_disable_go", "--experimental_disable_jvm",
-        "--cpu=ios_i386", "--crosstool_top=//tools/osx/crosstool:crosstool");
+    useConfiguration("--experimental_disable_jvm", "--cpu=ios_i386");
 
     scratch.file("bin/BUILD",
         "cc_library(",
@@ -4529,8 +4522,6 @@
   protected void checkAppleSdkIphoneosPlatformEnv(RuleType ruleType) throws Exception {
     ruleType.scratchTarget(scratch);
     useConfiguration(
-        "--crosstool_top=" + MockObjcSupport.DEFAULT_OSX_CROSSTOOL,
-        "--experimental_disable_go",
         "--cpu=ios_arm64");
 
     CommandAction action = linkAction("//x:x");
@@ -4986,4 +4977,16 @@
     assertThat(Joiner.on(" ").join(nineObjcLibCompileAction.getArguments()))
         .contains("-mios-simulator-version-min=9.0");
   }
+
+  /** Returns the full label string for labels within the main tools repository. */
+  protected static String toolsRepoLabel(String label) {
+    return TestConstants.TOOLS_REPOSITORY + label;
+  }
+
+  /**
+   * Returns the full exec path string for exec paths of targets within the main tools repository.
+   */
+  protected static String toolsRepoExecPath(String execPath) {
+    return TestConstants.TOOLS_REPOSITORY_PATH_PREFIX + execPath;
+  }
 }
diff --git a/src/test/java/com/google/devtools/build/lib/testutil/TestConstants.java b/src/test/java/com/google/devtools/build/lib/testutil/TestConstants.java
index e7662a4..dc7271c 100644
--- a/src/test/java/com/google/devtools/build/lib/testutil/TestConstants.java
+++ b/src/test/java/com/google/devtools/build/lib/testutil/TestConstants.java
@@ -74,9 +74,15 @@
 
   public static final String GCC_INCLUDE_PATH = "external/bazel_tools/tools/cpp/gcc3";
 
-  public static final String TOOLS_REPOSITORY = "@bazel_tools";
+  /** The path in which the mock cc crosstool resides. */
+  public static final String MOCK_CC_CROSSTOOL_PATH = "tools/cpp";
 
-  public static final String TOOLS_REPOSITORY_PATH = "tools/cpp";
+  /** The workspace repository label under which built-in tools reside. */
+  public static final String TOOLS_REPOSITORY = "@bazel_tools";
+  /** The file path in which to create files so that they end up under {@link #TOOLS_REPOSITORY}. */
+  public static final String TOOLS_REPOSITORY_SCRATCH = "/bazel_tools_workspace/";
+  /** The output file path prefix for tool file dependencies. */
+  public static final String TOOLS_REPOSITORY_PATH_PREFIX = "external/bazel_tools/";
 
   public static final ImmutableList<String> DOCS_RULES_PATHS = ImmutableList.of(
       "src/main/java/com/google/devtools/build/lib/rules");
@@ -85,6 +91,12 @@
   public static final String GENRULE_SETUP = "@bazel_tools//tools/genrule:genrule-setup.sh";
   public static final String GENRULE_SETUP_PATH = "genrule-setup.sh";
 
+  /**
+   * A list of flags required to support use of the crosstool on OSX.
+   */
+  public static final ImmutableList<String> OSX_CROSSTOOL_FLAGS =
+      ImmutableList.of();
+
   public static final InvocationPolicy TEST_INVOCATION_POLICY =
       InvocationPolicy.getDefaultInstance();