Add --disable_legacy_crosstool_fields to host configuration

https://github.com/bazelbuild/bazel/issues/6861
https://github.com/bazelbuild/bazel/issues/5883

RELNOTES: None
PiperOrigin-RevId: 229770248
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java
index 51a1108..ab9ab55 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java
@@ -884,7 +884,7 @@
     host.disableExpandIfAllAvailableInFlagSet = disableExpandIfAllAvailableInFlagSet;
     host.disableLegacyCcProvider = disableLegacyCcProvider;
     host.removeCpuCompilerCcToolchainAttributes = removeCpuCompilerCcToolchainAttributes;
-
+    host.disableLegacyCrosstoolFields = disableLegacyCrosstoolFields;
     return host;
   }
 
diff --git a/tools/cpp/CROSSTOOL b/tools/cpp/CROSSTOOL
index 1eef9de..c4a247e 100644
--- a/tools/cpp/CROSSTOOL
+++ b/tools/cpp/CROSSTOOL
@@ -1,524 +1,1239 @@
 major_version: "local"
 minor_version: ""
-
 toolchain {
+  toolchain_identifier: "stub_armeabi-v7a"
+  host_system_name: "armeabi-v7a"
+  target_system_name: "armeabi-v7a"
+  target_cpu: "armeabi-v7a"
+  target_libc: "armeabi-v7a"
+  compiler: "compiler"
   abi_version: "armeabi-v7a"
   abi_libc_version: "armeabi-v7a"
+  tool_path {
+    name: "ar"
+    path: "/bin/false"
+  }
+  tool_path {
+    name: "compat-ld"
+    path: "/bin/false"
+  }
+  tool_path {
+    name: "cpp"
+    path: "/bin/false"
+  }
+  tool_path {
+    name: "dwp"
+    path: "/bin/false"
+  }
+  tool_path {
+    name: "gcc"
+    path: "/bin/false"
+  }
+  tool_path {
+    name: "gcov"
+    path: "/bin/false"
+  }
+  tool_path {
+    name: "ld"
+    path: "/bin/false"
+  }
+  tool_path {
+    name: "nm"
+    path: "/bin/false"
+  }
+  tool_path {
+    name: "objcopy"
+    path: "/bin/false"
+  }
+  tool_path {
+    name: "objdump"
+    path: "/bin/false"
+  }
+  tool_path {
+    name: "strip"
+    path: "/bin/false"
+  }
   builtin_sysroot: ""
-  compiler: "compiler"
-  host_system_name: "armeabi-v7a"
-  needsPic: true
-  supports_incremental_linker: false
-  supports_fission: false
-  supports_interface_shared_objects: false
-  supports_normalizing_ar: false
-  supports_start_end_lib: false
-  target_libc: "armeabi-v7a"
-  target_cpu: "armeabi-v7a"
-  target_system_name: "armeabi-v7a"
-  toolchain_identifier: "stub_armeabi-v7a"
-
-  tool_path { name: "ar" path: "/bin/false" }
-  tool_path { name: "compat-ld" path: "/bin/false" }
-  tool_path { name: "cpp" path: "/bin/false" }
-  tool_path { name: "dwp" path: "/bin/false" }
-  tool_path { name: "gcc" path: "/bin/false" }
-  tool_path { name: "gcov" path: "/bin/false" }
-  tool_path { name: "ld" path: "/bin/false" }
-
-  tool_path { name: "nm" path: "/bin/false" }
-  tool_path { name: "objcopy" path: "/bin/false" }
-  tool_path { name: "objdump" path: "/bin/false" }
-  tool_path { name: "strip" path: "/bin/false" }
-  linking_mode_flags { mode: DYNAMIC }
+  feature {
+    name: "supports_dynamic_linker"
+    enabled: true
+  }
+  feature {
+    name: "supports_pic"
+    enabled: true
+  }
 }
-
 toolchain {
+  toolchain_identifier: "local_linux"
+  host_system_name: "local"
+  target_system_name: "local"
+  target_cpu: "local"
+  target_libc: "local"
+  compiler: "compiler"
   abi_version: "local"
   abi_libc_version: "local"
-  builtin_sysroot: ""
-  compiler: "compiler"
-  host_system_name: "local"
-  needsPic: true
-  supports_incremental_linker: false
-  supports_fission: false
-  supports_interface_shared_objects: false
-  supports_normalizing_ar: false
-  supports_start_end_lib: false
-  target_libc: "local"
-  target_cpu: "local"
-  target_system_name: "local"
-  toolchain_identifier: "local_linux"
-
-  tool_path { name: "ar" path: "/usr/bin/ar" }
-  tool_path { name: "compat-ld" path: "/usr/bin/ld" }
-  tool_path { name: "cpp" path: "/usr/bin/cpp" }
-  tool_path { name: "dwp" path: "/usr/bin/dwp" }
-  tool_path { name: "gcc" path: "/usr/bin/gcc" }
-  cxx_flag: "-std=c++0x"
-  linker_flag: "-lstdc++"
-
-  # TODO(bazel-team): In theory, the path here ought to exactly match the path
-  # used by gcc. That works because bazel currently doesn't track files at
-  # absolute locations and has no remote execution, yet. However, this will need
-  # to be fixed, maybe with auto-detection?
+  tool_path {
+    name: "ar"
+    path: "/usr/bin/ar"
+  }
+  tool_path {
+    name: "compat-ld"
+    path: "/usr/bin/ld"
+  }
+  tool_path {
+    name: "cpp"
+    path: "/usr/bin/cpp"
+  }
+  tool_path {
+    name: "dwp"
+    path: "/usr/bin/dwp"
+  }
+  tool_path {
+    name: "gcc"
+    path: "/usr/bin/gcc"
+  }
+  tool_path {
+    name: "gcov"
+    path: "/usr/bin/gcov"
+  }
+  tool_path {
+    name: "ld"
+    path: "/usr/bin/ld"
+  }
+  tool_path {
+    name: "nm"
+    path: "/usr/bin/nm"
+  }
+  tool_path {
+    name: "objcopy"
+    path: "/usr/bin/objcopy"
+  }
+  tool_path {
+    name: "objdump"
+    path: "/usr/bin/objdump"
+  }
+  tool_path {
+    name: "strip"
+    path: "/usr/bin/strip"
+  }
   cxx_builtin_include_directory: "/usr/lib/gcc/"
   cxx_builtin_include_directory: "/usr/local/include"
   cxx_builtin_include_directory: "/usr/include"
-  tool_path { name: "gcov" path: "/usr/bin/gcov" }
-
-  # C(++) compiles invoke the compiler (as that is the one knowing where
-  # to find libraries), but we provide LD so other rules can invoke the linker.
-  tool_path { name: "ld" path: "/usr/bin/ld" }
-
-  tool_path { name: "nm" path: "/usr/bin/nm" }
-  tool_path { name: "objcopy" path: "/usr/bin/objcopy" }
-  objcopy_embed_flag: "-I"
-  objcopy_embed_flag: "binary"
-  tool_path { name: "objdump" path: "/usr/bin/objdump" }
-  tool_path { name: "strip" path: "/usr/bin/strip" }
-
-  # Anticipated future default.
-  unfiltered_cxx_flag: "-no-canonical-prefixes"
-  unfiltered_cxx_flag: "-fno-canonical-system-headers"
-
-  # Make C++ compilation deterministic. Use linkstamping instead of these
-  # compiler symbols.
-  unfiltered_cxx_flag: "-Wno-builtin-macro-redefined"
-  unfiltered_cxx_flag: "-D__DATE__=\"redacted\""
-  unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\""
-  unfiltered_cxx_flag: "-D__TIME__=\"redacted\""
-
-  # Security hardening on by default.
-  # Conservative choice; -D_FORTIFY_SOURCE=2 may be unsafe in some cases.
-  # We need to undef it before redefining it as some distributions now have
-  # it enabled by default.
-  compiler_flag: "-U_FORTIFY_SOURCE"
-  compiler_flag: "-D_FORTIFY_SOURCE=1"
-  compiler_flag: "-fstack-protector"
-  linker_flag: "-Wl,-z,relro,-z,now"
-
-  # Enable coloring even if there's no attached terminal. Bazel removes the
-  # escape sequences if --nocolor is specified. This isn't supported by gcc
-  # on Ubuntu 14.04.
-  # compiler_flag: "-fcolor-diagnostics"
-
-  # All warnings are enabled. Maybe enable -Werror as well?
-  compiler_flag: "-Wall"
-  # Enable a few more warnings that aren't part of -Wall.
-  compiler_flag: "-Wunused-but-set-parameter"
-  # But disable some that are problematic.
-  compiler_flag: "-Wno-free-nonheap-object" # has false positives
-
-  # Keep stack frames for debugging, even in opt mode.
-  compiler_flag: "-fno-omit-frame-pointer"
-
-  # Anticipated future default.
-  linker_flag: "-no-canonical-prefixes"
-  # Have gcc return the exit code from ld.
-  linker_flag: "-pass-exit-codes"
-  # Gold linker only? Can we enable this by default?
-  # linker_flag: "-Wl,--warn-execstack"
-  # linker_flag: "-Wl,--detect-odr-violations"
-
-  compilation_mode_flags {
-    mode: DBG
-    # Enable debug symbols.
-    compiler_flag: "-g"
-  }
-  compilation_mode_flags {
-    mode: OPT
-
-    # No debug symbols.
-    # Maybe we should enable https://gcc.gnu.org/wiki/DebugFission for opt or
-    # even generally? However, that can't happen here, as it requires special
-    # handling in Bazel.
-    compiler_flag: "-g0"
-
-    # Conservative choice for -O
-    # -O3 can increase binary size and even slow down the resulting binaries.
-    # Profile first and / or use FDO if you need better performance than this.
-    compiler_flag: "-O2"
-
-    # Disable assertions
-    compiler_flag: "-DNDEBUG"
-
-    # Removal of unused code and data at link time (can this increase binary size in some cases?).
-    compiler_flag: "-ffunction-sections"
-    compiler_flag: "-fdata-sections"
-    linker_flag: "-Wl,--gc-sections"
-  }
-  linking_mode_flags { mode: DYNAMIC }
-}
-
-toolchain {
-  abi_version: "local"
-  abi_libc_version: "local"
   builtin_sysroot: ""
-  compiler: "compiler"
-  host_system_name: "local"
-  needsPic: true
-  target_libc: "macosx"
-  target_cpu: "darwin"
-  target_system_name: "local"
+  feature {
+    name: "default_compile_flags"
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      flag_group {
+        flag: "-U_FORTIFY_SOURCE"
+        flag: "-D_FORTIFY_SOURCE=1"
+        flag: "-fstack-protector"
+        flag: "-Wall"
+        flag: "-Wunused-but-set-parameter"
+        flag: "-Wno-free-nonheap-object"
+        flag: "-fno-omit-frame-pointer"
+      }
+    }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      flag_group {
+        flag: "-g"
+      }
+      with_feature {
+        feature: "dbg"
+      }
+    }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      flag_group {
+        flag: "-g0"
+        flag: "-O2"
+        flag: "-DNDEBUG"
+        flag: "-ffunction-sections"
+        flag: "-fdata-sections"
+      }
+      with_feature {
+        feature: "opt"
+      }
+    }
+    flag_set {
+      action: "linkstamp-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      flag_group {
+        flag: "-std=c++0x"
+      }
+    }
+    enabled: true
+  }
+  feature {
+    name: "default_link_flags"
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "c++-link-nodeps-dynamic-library"
+      flag_group {
+        flag: "-lstdc++"
+        flag: "-Wl,-z,relro,-z,now"
+        flag: "-no-canonical-prefixes"
+        flag: "-pass-exit-codes"
+      }
+    }
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "c++-link-nodeps-dynamic-library"
+      flag_group {
+        flag: "-Wl,--gc-sections"
+      }
+      with_feature {
+        feature: "opt"
+      }
+    }
+    enabled: true
+  }
+  feature {
+    name: "supports_dynamic_linker"
+    enabled: true
+  }
+  feature {
+    name: "supports_pic"
+    enabled: true
+  }
+  feature {
+    name: "objcopy_embed_flags"
+    flag_set {
+      action: "objcopy_embed_data"
+      flag_group {
+        flag: "-I"
+        flag: "binary"
+      }
+    }
+    enabled: true
+  }
+  feature {
+    name: "opt"
+  }
+  feature {
+    name: "dbg"
+  }
+  feature {
+    name: "user_compile_flags"
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      flag_group {
+        flag: "%{user_compile_flags}"
+        iterate_over: "user_compile_flags"
+        expand_if_all_available: "user_compile_flags"
+      }
+    }
+    enabled: true
+  }
+  feature {
+    name: "sysroot"
+    flag_set {
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "c++-link-nodeps-dynamic-library"
+      flag_group {
+        flag: "--sysroot=%{sysroot}"
+        expand_if_all_available: "sysroot"
+      }
+    }
+    enabled: true
+  }
+  feature {
+    name: "unfiltered_compile_flags"
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      flag_group {
+        flag: "-no-canonical-prefixes"
+        flag: "-fno-canonical-system-headers"
+        flag: "-Wno-builtin-macro-redefined"
+        flag: "-D__DATE__=\"redacted\""
+        flag: "-D__TIMESTAMP__=\"redacted\""
+        flag: "-D__TIME__=\"redacted\""
+      }
+    }
+    enabled: true
+  }
+  action_config {
+    config_name: "objcopy_embed_data"
+    action_name: "objcopy_embed_data"
+    tool {
+      tool_path: "/usr/bin/objcopy"
+    }
+    enabled: true
+  }
+}
+toolchain {
   toolchain_identifier: "local_darwin"
-
-  tool_path { name: "ar" path: "/usr/bin/libtool" }
-  tool_path { name: "compat-ld" path: "/usr/bin/ld" }
-  tool_path { name: "cpp" path: "/usr/bin/cpp" }
-  tool_path { name: "dwp" path: "/usr/bin/dwp" }
-  tool_path { name: "gcc" path: "osx_cc_wrapper.sh" }
-  cxx_flag: "-std=c++0x"
-  linker_flag: "-lstdc++"
-  linker_flag: "-undefined"
-  linker_flag: "dynamic_lookup"
-  linker_flag: "-headerpad_max_install_names"
-  # TODO(ulfjack): This is wrong on so many levels. Figure out a way to auto-detect the proper
-  # setting from the local compiler, and also how to make incremental builds correct.
-  cxx_builtin_include_directory: "/"
-  tool_path { name: "gcov" path: "/usr/bin/gcov" }
-  tool_path { name: "ld" path: "/usr/bin/ld" }
-  tool_path { name: "nm" path: "/usr/bin/nm" }
-  tool_path { name: "objcopy" path: "/usr/bin/objcopy" }
-  objcopy_embed_flag: "-I"
-  objcopy_embed_flag: "binary"
-  tool_path { name: "objdump" path: "/usr/bin/objdump" }
-  tool_path { name: "strip" path: "/usr/bin/strip" }
-
-  # Anticipated future default.
-  unfiltered_cxx_flag: "-no-canonical-prefixes"
-
-  # Make C++ compilation deterministic. Use linkstamping instead of these
-  # compiler symbols.
-  unfiltered_cxx_flag: "-Wno-builtin-macro-redefined"
-  unfiltered_cxx_flag: "-D__DATE__=\"redacted\""
-  unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\""
-  unfiltered_cxx_flag: "-D__TIME__=\"redacted\""
-
-  # Security hardening on by default.
-  # Conservative choice; -D_FORTIFY_SOURCE=2 may be unsafe in some cases.
-  compiler_flag: "-D_FORTIFY_SOURCE=1"
-  compiler_flag: "-fstack-protector"
-
-  # Enable coloring even if there's no attached terminal. Bazel removes the
-  # escape sequences if --nocolor is specified.
-  compiler_flag: "-fcolor-diagnostics"
-
-  # All warnings are enabled. Maybe enable -Werror as well?
-  compiler_flag: "-Wall"
-  # Enable a few more warnings that aren't part of -Wall.
-  compiler_flag: "-Wthread-safety"
-  compiler_flag: "-Wself-assign"
-
-  # Keep stack frames for debugging, even in opt mode.
-  compiler_flag: "-fno-omit-frame-pointer"
-
-  # Anticipated future default.
-  linker_flag: "-no-canonical-prefixes"
-
-  compilation_mode_flags {
-    mode: DBG
-    # Enable debug symbols.
-    compiler_flag: "-g"
-  }
-  compilation_mode_flags {
-    mode: OPT
-    # No debug symbols.
-    # Maybe we should enable https://gcc.gnu.org/wiki/DebugFission for opt or even generally?
-    # However, that can't happen here, as it requires special handling in Bazel.
-    compiler_flag: "-g0"
-
-    # Conservative choice for -O
-    # -O3 can increase binary size and even slow down the resulting binaries.
-    # Profile first and / or use FDO if you need better performance than this.
-    compiler_flag: "-O2"
-
-    # Disable assertions
-    compiler_flag: "-DNDEBUG"
-
-    # Removal of unused code and data at link time (can this increase binary size in some cases?).
-    compiler_flag: "-ffunction-sections"
-    compiler_flag: "-fdata-sections"
-  }
-  linking_mode_flags { mode: DYNAMIC }
-}
-
-toolchain {
+  host_system_name: "local"
+  target_system_name: "local"
+  target_cpu: "darwin"
+  target_libc: "macosx"
+  compiler: "compiler"
   abi_version: "local"
   abi_libc_version: "local"
+  tool_path {
+    name: "ar"
+    path: "/usr/bin/libtool"
+  }
+  tool_path {
+    name: "compat-ld"
+    path: "/usr/bin/ld"
+  }
+  tool_path {
+    name: "cpp"
+    path: "/usr/bin/cpp"
+  }
+  tool_path {
+    name: "dwp"
+    path: "/usr/bin/dwp"
+  }
+  tool_path {
+    name: "gcc"
+    path: "osx_cc_wrapper.sh"
+  }
+  tool_path {
+    name: "gcov"
+    path: "/usr/bin/gcov"
+  }
+  tool_path {
+    name: "ld"
+    path: "/usr/bin/ld"
+  }
+  tool_path {
+    name: "nm"
+    path: "/usr/bin/nm"
+  }
+  tool_path {
+    name: "objcopy"
+    path: "/usr/bin/objcopy"
+  }
+  tool_path {
+    name: "objdump"
+    path: "/usr/bin/objdump"
+  }
+  tool_path {
+    name: "strip"
+    path: "/usr/bin/strip"
+  }
+  cxx_builtin_include_directory: "/"
   builtin_sysroot: ""
-  compiler: "compiler"
-  host_system_name: "local"
-  needsPic: true
-  supports_incremental_linker: false
-  supports_fission: false
-  supports_interface_shared_objects: false
-  supports_normalizing_ar: false
-  supports_start_end_lib: false
-  target_libc: "local"
-  target_cpu: "freebsd"
-  target_system_name: "local"
+  feature {
+    name: "default_compile_flags"
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      flag_group {
+        flag: "-D_FORTIFY_SOURCE=1"
+        flag: "-fstack-protector"
+        flag: "-fcolor-diagnostics"
+        flag: "-Wall"
+        flag: "-Wthread-safety"
+        flag: "-Wself-assign"
+        flag: "-fno-omit-frame-pointer"
+      }
+    }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      flag_group {
+        flag: "-g"
+      }
+      with_feature {
+        feature: "dbg"
+      }
+    }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      flag_group {
+        flag: "-g0"
+        flag: "-O2"
+        flag: "-DNDEBUG"
+        flag: "-ffunction-sections"
+        flag: "-fdata-sections"
+      }
+      with_feature {
+        feature: "opt"
+      }
+    }
+    flag_set {
+      action: "linkstamp-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      flag_group {
+        flag: "-std=c++0x"
+      }
+    }
+    enabled: true
+  }
+  feature {
+    name: "default_link_flags"
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "c++-link-nodeps-dynamic-library"
+      flag_group {
+        flag: "-lstdc++"
+        flag: "-undefined"
+        flag: "dynamic_lookup"
+        flag: "-headerpad_max_install_names"
+        flag: "-no-canonical-prefixes"
+      }
+    }
+    enabled: true
+  }
+  feature {
+    name: "supports_dynamic_linker"
+    enabled: true
+  }
+  feature {
+    name: "supports_pic"
+    enabled: true
+  }
+  feature {
+    name: "objcopy_embed_flags"
+    flag_set {
+      action: "objcopy_embed_data"
+      flag_group {
+        flag: "-I"
+        flag: "binary"
+      }
+    }
+    enabled: true
+  }
+  feature {
+    name: "dbg"
+  }
+  feature {
+    name: "opt"
+  }
+  feature {
+    name: "user_compile_flags"
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      flag_group {
+        flag: "%{user_compile_flags}"
+        iterate_over: "user_compile_flags"
+        expand_if_all_available: "user_compile_flags"
+      }
+    }
+    enabled: true
+  }
+  feature {
+    name: "sysroot"
+    flag_set {
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "c++-link-nodeps-dynamic-library"
+      flag_group {
+        flag: "--sysroot=%{sysroot}"
+        expand_if_all_available: "sysroot"
+      }
+    }
+    enabled: true
+  }
+  feature {
+    name: "unfiltered_compile_flags"
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      flag_group {
+        flag: "-no-canonical-prefixes"
+        flag: "-Wno-builtin-macro-redefined"
+        flag: "-D__DATE__=\"redacted\""
+        flag: "-D__TIMESTAMP__=\"redacted\""
+        flag: "-D__TIME__=\"redacted\""
+      }
+    }
+    enabled: true
+  }
+  action_config {
+    config_name: "objcopy_embed_data"
+    action_name: "objcopy_embed_data"
+    tool {
+      tool_path: "/usr/bin/objcopy"
+    }
+    enabled: true
+  }
+}
+toolchain {
   toolchain_identifier: "local_freebsd"
-
-  tool_path { name: "ar" path: "/usr/bin/ar" }
-  tool_path { name: "compat-ld" path: "/usr/bin/ld" }
-  tool_path { name: "cpp" path: "/usr/bin/cpp" }
-  tool_path { name: "dwp" path: "/usr/bin/dwp" }
-  tool_path { name: "gcc" path: "/usr/bin/clang" }
-  cxx_flag: "-std=c++0x"
-  linker_flag: "-lstdc++"
-
-  # TODO(bazel-team): In theory, the path here ought to exactly match the path
-  # used by gcc. That works because bazel currently doesn't track files at
-  # absolute locations and has no remote execution, yet. However, this will need
-  # to be fixed, maybe with auto-detection?
+  host_system_name: "local"
+  target_system_name: "local"
+  target_cpu: "freebsd"
+  target_libc: "local"
+  compiler: "compiler"
+  abi_version: "local"
+  abi_libc_version: "local"
+  tool_path {
+    name: "ar"
+    path: "/usr/bin/ar"
+  }
+  tool_path {
+    name: "compat-ld"
+    path: "/usr/bin/ld"
+  }
+  tool_path {
+    name: "cpp"
+    path: "/usr/bin/cpp"
+  }
+  tool_path {
+    name: "dwp"
+    path: "/usr/bin/dwp"
+  }
+  tool_path {
+    name: "gcc"
+    path: "/usr/bin/clang"
+  }
+  tool_path {
+    name: "gcov"
+    path: "/usr/bin/gcov"
+  }
+  tool_path {
+    name: "ld"
+    path: "/usr/bin/ld"
+  }
+  tool_path {
+    name: "nm"
+    path: "/usr/bin/nm"
+  }
+  tool_path {
+    name: "objcopy"
+    path: "/usr/bin/objcopy"
+  }
+  tool_path {
+    name: "objdump"
+    path: "/usr/bin/objdump"
+  }
+  tool_path {
+    name: "strip"
+    path: "/usr/bin/strip"
+  }
   cxx_builtin_include_directory: "/usr/lib/clang"
   cxx_builtin_include_directory: "/usr/local/include"
   cxx_builtin_include_directory: "/usr/include"
-  tool_path { name: "gcov" path: "/usr/bin/gcov" }
-
-  # C(++) compiles invoke the compiler (as that is the one knowing where
-  # to find libraries), but we provide LD so other rules can invoke the linker.
-  tool_path { name: "ld" path: "/usr/bin/ld" }
-
-  tool_path { name: "nm" path: "/usr/bin/nm" }
-  tool_path { name: "objcopy" path: "/usr/bin/objcopy" }
-  objcopy_embed_flag: "-I"
-  objcopy_embed_flag: "binary"
-  tool_path { name: "objdump" path: "/usr/bin/objdump" }
-  tool_path { name: "strip" path: "/usr/bin/strip" }
-
-  # Anticipated future default.
-  unfiltered_cxx_flag: "-no-canonical-prefixes"
-
-  # Make C++ compilation deterministic. Use linkstamping instead of these
-  # compiler symbols.
-  unfiltered_cxx_flag: "-Wno-builtin-macro-redefined"
-  unfiltered_cxx_flag: "-D__DATE__=\"redacted\""
-  unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\""
-  unfiltered_cxx_flag: "-D__TIME__=\"redacted\""
-
-  # Security hardening on by default.
-  # Conservative choice; -D_FORTIFY_SOURCE=2 may be unsafe in some cases.
-  # We need to undef it before redefining it as some distributions now have
-  # it enabled by default.
-  compiler_flag: "-U_FORTIFY_SOURCE"
-  compiler_flag: "-D_FORTIFY_SOURCE=1"
-  compiler_flag: "-fstack-protector"
-  linker_flag: "-Wl,-z,relro,-z,now"
-
-  # Enable coloring even if there's no attached terminal. Bazel removes the
-  # escape sequences if --nocolor is specified. This isn't supported by gcc
-  # on Ubuntu 14.04.
-  # compiler_flag: "-fcolor-diagnostics"
-
-  # All warnings are enabled. Maybe enable -Werror as well?
-  compiler_flag: "-Wall"
-  # Enable a few more warnings that aren't part of -Wall.
-  #compiler_flag: "-Wunused-but-set-parameter"
-  # But disable some that are problematic.
-  #compiler_flag: "-Wno-free-nonheap-object" # has false positives
-
-  # Keep stack frames for debugging, even in opt mode.
-  compiler_flag: "-fno-omit-frame-pointer"
-
-  # Anticipated future default.
-  linker_flag: "-no-canonical-prefixes"
-  # Have gcc return the exit code from ld.
-  #linker_flag: "-pass-exit-codes"
-  # Stamp the binary with a unique identifier.
-  # Gold linker only? Can we enable this by default?
-  # linker_flag: "-Wl,--warn-execstack"
-  # linker_flag: "-Wl,--detect-odr-violations"
-
-  compilation_mode_flags {
-    mode: DBG
-    # Enable debug symbols.
-    compiler_flag: "-g"
+  builtin_sysroot: ""
+  feature {
+    name: "default_compile_flags"
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      flag_group {
+        flag: "-U_FORTIFY_SOURCE"
+        flag: "-D_FORTIFY_SOURCE=1"
+        flag: "-fstack-protector"
+        flag: "-Wall"
+        flag: "-fno-omit-frame-pointer"
+      }
+    }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      flag_group {
+        flag: "-g"
+      }
+      with_feature {
+        feature: "dbg"
+      }
+    }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      flag_group {
+        flag: "-g0"
+        flag: "-O2"
+        flag: "-DNDEBUG"
+        flag: "-ffunction-sections"
+        flag: "-fdata-sections"
+      }
+      with_feature {
+        feature: "opt"
+      }
+    }
+    flag_set {
+      action: "linkstamp-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      flag_group {
+        flag: "-std=c++0x"
+      }
+    }
+    enabled: true
   }
-  compilation_mode_flags {
-    mode: OPT
-
-    # No debug symbols.
-    # Maybe we should enable https://gcc.gnu.org/wiki/DebugFission for opt or
-    # even generally? However, that can't happen here, as it requires special
-    # handling in Bazel.
-    compiler_flag: "-g0"
-
-    # Conservative choice for -O
-    # -O3 can increase binary size and even slow down the resulting binaries.
-    # Profile first and / or use FDO if you need better performance than this.
-    compiler_flag: "-O2"
-
-    # Disable assertions
-    compiler_flag: "-DNDEBUG"
-
-    # Removal of unused code and data at link time (can this increase binary size in some cases?).
-    compiler_flag: "-ffunction-sections"
-    compiler_flag: "-fdata-sections"
-    linker_flag: "-Wl,--gc-sections"
+  feature {
+    name: "default_link_flags"
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "c++-link-nodeps-dynamic-library"
+      flag_group {
+        flag: "-lstdc++"
+        flag: "-Wl,-z,relro,-z,now"
+        flag: "-no-canonical-prefixes"
+      }
+    }
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "c++-link-nodeps-dynamic-library"
+      flag_group {
+        flag: "-Wl,--gc-sections"
+      }
+      with_feature {
+        feature: "opt"
+      }
+    }
+    enabled: true
   }
-  linking_mode_flags { mode: DYNAMIC }
+  feature {
+    name: "supports_dynamic_linker"
+    enabled: true
+  }
+  feature {
+    name: "supports_pic"
+    enabled: true
+  }
+  feature {
+    name: "objcopy_embed_flags"
+    flag_set {
+      action: "objcopy_embed_data"
+      flag_group {
+        flag: "-I"
+        flag: "binary"
+      }
+    }
+    enabled: true
+  }
+  feature {
+    name: "opt"
+  }
+  feature {
+    name: "dbg"
+  }
+  feature {
+    name: "user_compile_flags"
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      flag_group {
+        flag: "%{user_compile_flags}"
+        iterate_over: "user_compile_flags"
+        expand_if_all_available: "user_compile_flags"
+      }
+    }
+    enabled: true
+  }
+  feature {
+    name: "sysroot"
+    flag_set {
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "c++-link-nodeps-dynamic-library"
+      flag_group {
+        flag: "--sysroot=%{sysroot}"
+        expand_if_all_available: "sysroot"
+      }
+    }
+    enabled: true
+  }
+  feature {
+    name: "unfiltered_compile_flags"
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      flag_group {
+        flag: "-no-canonical-prefixes"
+        flag: "-Wno-builtin-macro-redefined"
+        flag: "-D__DATE__=\"redacted\""
+        flag: "-D__TIMESTAMP__=\"redacted\""
+        flag: "-D__TIME__=\"redacted\""
+      }
+    }
+    enabled: true
+  }
+  action_config {
+    config_name: "objcopy_embed_data"
+    action_name: "objcopy_embed_data"
+    tool {
+      tool_path: "/usr/bin/objcopy"
+    }
+    enabled: true
+  }
 }
-
 toolchain {
+  toolchain_identifier: "local_windows_mingw"
+  host_system_name: "local"
+  target_system_name: "local"
+  target_cpu: "x64_windows"
+  target_libc: "local"
+  compiler: "windows_mingw"
   abi_version: "local"
   abi_libc_version: "local"
-  builtin_sysroot: ""
-  compiler: "windows_mingw"
-  host_system_name: "local"
-  needsPic: false
-  target_libc: "local"
-  target_cpu: "x64_windows"
-  target_system_name: "local"
-  toolchain_identifier: "local_windows_mingw"
-
-  tool_path { name: "ar" path: "C:/mingw/bin/ar" }
-  tool_path { name: "compat-ld" path: "C:/mingw/bin/ld" }
-  tool_path { name: "cpp" path: "C:/mingw/bin/cpp" }
-  tool_path { name: "dwp" path: "C:/mingw/bin/dwp" }
-  tool_path { name: "gcc" path: "C:/mingw/bin/gcc" }
-  cxx_flag: "-std=c++0x"
-  # TODO(bazel-team): In theory, the path here ought to exactly match the path
-  # used by gcc. That works because bazel currently doesn't track files at
-  # absolute locations and has no remote execution, yet. However, this will need
-  # to be fixed, maybe with auto-detection?
+  tool_path {
+    name: "ar"
+    path: "C:/mingw/bin/ar"
+  }
+  tool_path {
+    name: "compat-ld"
+    path: "C:/mingw/bin/ld"
+  }
+  tool_path {
+    name: "cpp"
+    path: "C:/mingw/bin/cpp"
+  }
+  tool_path {
+    name: "dwp"
+    path: "C:/mingw/bin/dwp"
+  }
+  tool_path {
+    name: "gcc"
+    path: "C:/mingw/bin/gcc"
+  }
+  tool_path {
+    name: "gcov"
+    path: "C:/mingw/bin/gcov"
+  }
+  tool_path {
+    name: "ld"
+    path: "C:/mingw/bin/ld"
+  }
+  tool_path {
+    name: "nm"
+    path: "C:/mingw/bin/nm"
+  }
+  tool_path {
+    name: "objcopy"
+    path: "C:/mingw/bin/objcopy"
+  }
+  tool_path {
+    name: "objdump"
+    path: "C:/mingw/bin/objdump"
+  }
+  tool_path {
+    name: "strip"
+    path: "C:/mingw/bin/strip"
+  }
   cxx_builtin_include_directory: "C:/mingw/include"
   cxx_builtin_include_directory: "C:/mingw/lib/gcc"
-  tool_path { name: "gcov" path: "C:/mingw/bin/gcov" }
-  tool_path { name: "ld" path: "C:/mingw/bin/ld" }
-  tool_path { name: "nm" path: "C:/mingw/bin/nm" }
-  tool_path { name: "objcopy" path: "C:/mingw/bin/objcopy" }
-  objcopy_embed_flag: "-I"
-  objcopy_embed_flag: "binary"
-  tool_path { name: "objdump" path: "C:/mingw/bin/objdump" }
-  tool_path { name: "strip" path: "C:/mingw/bin/strip" }
-  linking_mode_flags { mode: DYNAMIC }
-}
-
-toolchain {
-  abi_version: "local"
-  abi_libc_version: "local"
   builtin_sysroot: ""
-  compiler: "windows_msys64_mingw64"
-  host_system_name: "local"
-  needsPic: false
-  target_libc: "local"
-  target_cpu: "x64_windows"
-  target_system_name: "local"
+  feature {
+    name: "default_compile_flags"
+    flag_set {
+      action: "linkstamp-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      flag_group {
+        flag: "-std=c++0x"
+      }
+    }
+    enabled: true
+  }
+  feature {
+    name: "supports_dynamic_linker"
+    enabled: true
+  }
+  feature {
+    name: "objcopy_embed_flags"
+    flag_set {
+      action: "objcopy_embed_data"
+      flag_group {
+        flag: "-I"
+        flag: "binary"
+      }
+    }
+    enabled: true
+  }
+  action_config {
+    config_name: "objcopy_embed_data"
+    action_name: "objcopy_embed_data"
+    tool {
+      tool_path: "C:/mingw/bin/objcopy"
+    }
+    enabled: true
+  }
+}
+toolchain {
   toolchain_identifier: "local_windows_msys64_mingw64"
-
-  tool_path { name: "ar" path: "C:/tools/msys64/mingw64/bin/ar" }
-  tool_path { name: "compat-ld" path: "C:/tools/msys64/mingw64/bin/ld" }
-  tool_path { name: "cpp" path: "C:/tools/msys64/mingw64/bin/cpp" }
-  tool_path { name: "dwp" path: "C:/tools/msys64/mingw64/bin/dwp" }
-  tool_path { name: "gcc" path: "C:/tools/msys64/mingw64/bin/gcc" }
-  cxx_flag: "-std=c++0x"
-  # TODO(bazel-team): In theory, the path here ought to exactly match the path
-  # used by gcc. That works because bazel currently doesn't track files at
-  # absolute locations and has no remote execution, yet. However, this will need
-  # to be fixed, maybe with auto-detection?
-  cxx_builtin_include_directory: "C:/tools/msys64/mingw64/x86_64-w64-mingw32/include"
-  tool_path { name: "gcov" path: "C:/tools/msys64/mingw64/bin/gcov" }
-  tool_path { name: "ld" path: "C:/tools/msys64/mingw64/bin/ld" }
-  tool_path { name: "nm" path: "C:/tools/msys64/mingw64/bin/nm" }
-  tool_path { name: "objcopy" path: "C:/tools/msys64/mingw64/bin/objcopy" }
-  objcopy_embed_flag: "-I"
-  objcopy_embed_flag: "binary"
-  tool_path { name: "objdump" path: "C:/tools/msys64/mingw64/bin/objdump" }
-  tool_path { name: "strip" path: "C:/tools/msys64/mingw64/bin/strip" }
-  linking_mode_flags { mode: DYNAMIC }
-}
-
-toolchain {
+  host_system_name: "local"
+  target_system_name: "local"
+  target_cpu: "x64_windows"
+  target_libc: "local"
+  compiler: "windows_msys64_mingw64"
   abi_version: "local"
   abi_libc_version: "local"
+  tool_path {
+    name: "ar"
+    path: "C:/tools/msys64/mingw64/bin/ar"
+  }
+  tool_path {
+    name: "compat-ld"
+    path: "C:/tools/msys64/mingw64/bin/ld"
+  }
+  tool_path {
+    name: "cpp"
+    path: "C:/tools/msys64/mingw64/bin/cpp"
+  }
+  tool_path {
+    name: "dwp"
+    path: "C:/tools/msys64/mingw64/bin/dwp"
+  }
+  tool_path {
+    name: "gcc"
+    path: "C:/tools/msys64/mingw64/bin/gcc"
+  }
+  tool_path {
+    name: "gcov"
+    path: "C:/tools/msys64/mingw64/bin/gcov"
+  }
+  tool_path {
+    name: "ld"
+    path: "C:/tools/msys64/mingw64/bin/ld"
+  }
+  tool_path {
+    name: "nm"
+    path: "C:/tools/msys64/mingw64/bin/nm"
+  }
+  tool_path {
+    name: "objcopy"
+    path: "C:/tools/msys64/mingw64/bin/objcopy"
+  }
+  tool_path {
+    name: "objdump"
+    path: "C:/tools/msys64/mingw64/bin/objdump"
+  }
+  tool_path {
+    name: "strip"
+    path: "C:/tools/msys64/mingw64/bin/strip"
+  }
+  cxx_builtin_include_directory: "C:/tools/msys64/mingw64/x86_64-w64-mingw32/include"
   builtin_sysroot: ""
-  compiler: "windows_clang"
-  host_system_name: "local"
-  needsPic: false
-  target_libc: "local"
-  target_cpu: "x64_windows"
-  target_system_name: "local"
+  feature {
+    name: "default_compile_flags"
+    flag_set {
+      action: "linkstamp-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      flag_group {
+        flag: "-std=c++0x"
+      }
+    }
+    enabled: true
+  }
+  feature {
+    name: "supports_dynamic_linker"
+    enabled: true
+  }
+  feature {
+    name: "objcopy_embed_flags"
+    flag_set {
+      action: "objcopy_embed_data"
+      flag_group {
+        flag: "-I"
+        flag: "binary"
+      }
+    }
+    enabled: true
+  }
+  action_config {
+    config_name: "objcopy_embed_data"
+    action_name: "objcopy_embed_data"
+    tool {
+      tool_path: "C:/tools/msys64/mingw64/bin/objcopy"
+    }
+    enabled: true
+  }
+}
+toolchain {
   toolchain_identifier: "local_windows_clang"
-
-  tool_path { name: "ar" path: "C:/mingw/bin/ar" }
-  tool_path { name: "compat-ld" path: "C:/Program Files (x86)/LLVM/bin/ld" }
-  tool_path { name: "cpp" path: "C:/Program Files (x86)/LLVM/bin/cpp" }
-  tool_path { name: "dwp" path: "C:/Program Files (x86)/LLVM/bin/dwp" }
-  tool_path { name: "gcc" path: "C:/Program Files (x86)/LLVM/bin/clang" }
-  cxx_flag: "-std=c++0x"
-  # TODO(bazel-team): In theory, the path here ought to exactly match the path
-  # used by gcc. That works because bazel currently doesn't track files at
-  # absolute locations and has no remote execution, yet. However, this will need
-  # to be fixed, maybe with auto-detection?
+  host_system_name: "local"
+  target_system_name: "local"
+  target_cpu: "x64_windows"
+  target_libc: "local"
+  compiler: "windows_clang"
+  abi_version: "local"
+  abi_libc_version: "local"
+  tool_path {
+    name: "ar"
+    path: "C:/mingw/bin/ar"
+  }
+  tool_path {
+    name: "compat-ld"
+    path: "C:/Program Files (x86)/LLVM/bin/ld"
+  }
+  tool_path {
+    name: "cpp"
+    path: "C:/Program Files (x86)/LLVM/bin/cpp"
+  }
+  tool_path {
+    name: "dwp"
+    path: "C:/Program Files (x86)/LLVM/bin/dwp"
+  }
+  tool_path {
+    name: "gcc"
+    path: "C:/Program Files (x86)/LLVM/bin/clang"
+  }
+  tool_path {
+    name: "gcov"
+    path: "C:/Program Files (x86)/LLVM/bin/gcov"
+  }
+  tool_path {
+    name: "ld"
+    path: "C:/Program Files (x86)/LLVM/bin/ld"
+  }
+  tool_path {
+    name: "nm"
+    path: "C:/Program Files (x86)/LLVM/bin/nm"
+  }
+  tool_path {
+    name: "objcopy"
+    path: "C:/Program Files (x86)/LLVM/bin/objcopy"
+  }
+  tool_path {
+    name: "objdump"
+    path: "C:/Program Files (x86)/LLVM/bin/objdump"
+  }
+  tool_path {
+    name: "strip"
+    path: "C:/Program Files (x86)/LLVM/bin/strip"
+  }
   cxx_builtin_include_directory: "/usr/lib/gcc/"
   cxx_builtin_include_directory: "/usr/local/include"
   cxx_builtin_include_directory: "/usr/include"
-  tool_path { name: "gcov" path: "C:/Program Files (x86)/LLVM/bin/gcov" }
-  tool_path { name: "ld" path: "C:/Program Files (x86)/LLVM/bin/ld" }
-  tool_path { name: "nm" path: "C:/Program Files (x86)/LLVM/bin/nm" }
-  tool_path { name: "objcopy" path: "C:/Program Files (x86)/LLVM/bin/objcopy" }
-  objcopy_embed_flag: "-I"
-  objcopy_embed_flag: "binary"
-  tool_path { name: "objdump" path: "C:/Program Files (x86)/LLVM/bin/objdump" }
-  tool_path { name: "strip" path: "C:/Program Files (x86)/LLVM/bin/strip" }
-  linking_mode_flags { mode: DYNAMIC }
+  builtin_sysroot: ""
+  feature {
+    name: "default_compile_flags"
+    flag_set {
+      action: "linkstamp-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      flag_group {
+        flag: "-std=c++0x"
+      }
+    }
+    enabled: true
+  }
+  feature {
+    name: "supports_dynamic_linker"
+    enabled: true
+  }
+  feature {
+    name: "objcopy_embed_flags"
+    flag_set {
+      action: "objcopy_embed_data"
+      flag_group {
+        flag: "-I"
+        flag: "binary"
+      }
+    }
+    enabled: true
+  }
+  action_config {
+    config_name: "objcopy_embed_data"
+    action_name: "objcopy_embed_data"
+    tool {
+      tool_path: "C:/Program Files (x86)/LLVM/bin/objcopy"
+    }
+    enabled: true
+  }
 }
-
 toolchain {
+  toolchain_identifier: "local_windows_msys64"
+  host_system_name: "local"
+  target_system_name: "local"
+  target_cpu: "x64_windows"
+  target_libc: "local"
+  compiler: "windows_msys64"
   abi_version: "local"
   abi_libc_version: "local"
-  builtin_sysroot: ""
-  compiler: "windows_msys64"
-  host_system_name: "local"
-  needsPic: false
-  target_libc: "local"
-  target_cpu: "x64_windows"
-  target_system_name: "local"
-  toolchain_identifier: "local_windows_msys64"
-
-  tool_path { name: "ar" path: "C:/tools/msys64/usr/bin/ar" }
-  tool_path { name: "compat-ld" path: "C:/tools/msys64/usr/bin/ld" }
-  tool_path { name: "cpp" path: "C:/tools/msys64/usr/bin/cpp" }
-  tool_path { name: "dwp" path: "C:/tools/msys64/usr/bin/dwp" }
-  # Use gcc instead of g++ so that C will compile correctly.
-  tool_path { name: "gcc" path: "C:/tools/msys64/usr/bin/gcc" }
-  cxx_flag: "-std=gnu++0x"
-  linker_flag: "-lstdc++"
-  # TODO(bazel-team): In theory, the path here ought to exactly match the path
-  # used by gcc. That works because bazel currently doesn't track files at
-  # absolute locations and has no remote execution, yet. However, this will need
-  # to be fixed, maybe with auto-detection?
+  tool_path {
+    name: "ar"
+    path: "C:/tools/msys64/usr/bin/ar"
+  }
+  tool_path {
+    name: "compat-ld"
+    path: "C:/tools/msys64/usr/bin/ld"
+  }
+  tool_path {
+    name: "cpp"
+    path: "C:/tools/msys64/usr/bin/cpp"
+  }
+  tool_path {
+    name: "dwp"
+    path: "C:/tools/msys64/usr/bin/dwp"
+  }
+  tool_path {
+    name: "gcc"
+    path: "C:/tools/msys64/usr/bin/gcc"
+  }
+  tool_path {
+    name: "gcov"
+    path: "C:/tools/msys64/usr/bin/gcov"
+  }
+  tool_path {
+    name: "ld"
+    path: "C:/tools/msys64/usr/bin/ld"
+  }
+  tool_path {
+    name: "nm"
+    path: "C:/tools/msys64/usr/bin/nm"
+  }
+  tool_path {
+    name: "objcopy"
+    path: "C:/tools/msys64/usr/bin/objcopy"
+  }
+  tool_path {
+    name: "objdump"
+    path: "C:/tools/msys64/usr/bin/objdump"
+  }
+  tool_path {
+    name: "strip"
+    path: "C:/tools/msys64/usr/bin/strip"
+  }
   cxx_builtin_include_directory: "C:/tools/msys64/"
   cxx_builtin_include_directory: "/usr/"
-  tool_path { name: "gcov" path: "C:/tools/msys64/usr/bin/gcov" }
-  tool_path { name: "ld" path: "C:/tools/msys64/usr/bin/ld" }
-  tool_path { name: "nm" path: "C:/tools/msys64/usr/bin/nm" }
-  tool_path { name: "objcopy" path: "C:/tools/msys64/usr/bin/objcopy" }
-  objcopy_embed_flag: "-I"
-  objcopy_embed_flag: "binary"
-  tool_path { name: "objdump" path: "C:/tools/msys64/usr/bin/objdump" }
-  tool_path { name: "strip" path: "C:/tools/msys64/usr/bin/strip" }
-  linking_mode_flags { mode: DYNAMIC }
+  builtin_sysroot: ""
+  feature {
+    name: "default_compile_flags"
+    flag_set {
+      action: "linkstamp-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      flag_group {
+        flag: "-std=gnu++0x"
+      }
+    }
+    enabled: true
+  }
+  feature {
+    name: "default_link_flags"
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "c++-link-nodeps-dynamic-library"
+      flag_group {
+        flag: "-lstdc++"
+      }
+    }
+    enabled: true
+  }
+  feature {
+    name: "supports_dynamic_linker"
+    enabled: true
+  }
+  feature {
+    name: "objcopy_embed_flags"
+    flag_set {
+      action: "objcopy_embed_data"
+      flag_group {
+        flag: "-I"
+        flag: "binary"
+      }
+    }
+    enabled: true
+  }
+  action_config {
+    config_name: "objcopy_embed_data"
+    action_name: "objcopy_embed_data"
+    tool {
+      tool_path: "C:/tools/msys64/usr/bin/objcopy"
+    }
+    enabled: true
+  }
 }
-
 toolchain {
   toolchain_identifier: "vc_14_0_x64"
   host_system_name: "local"
   target_system_name: "local"
-
+  target_cpu: "x64_windows_msvc"
+  target_libc: "msvcrt140"
+  compiler: "cl"
   abi_version: "local"
   abi_libc_version: "local"
-  target_cpu: "x64_windows_msvc"
-  compiler: "cl"
-  target_libc: "msvcrt140"
-  default_python_version: "python2.7"
-  cxx_builtin_include_directory: "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/INCLUDE"
-  cxx_builtin_include_directory: "C:/Program Files (x86)/Windows Kits/10/include/"
-  cxx_builtin_include_directory: "C:/Program Files (x86)/Windows Kits/8.1/include/"
-  cxx_builtin_include_directory: "C:/Program Files (x86)/GnuWin32/include/"
-  cxx_builtin_include_directory: "C:/python_27_amd64/files/include"
   tool_path {
     name: "ar"
     path: "wrapper/bin/msvc_link.bat"
@@ -555,289 +1270,308 @@
     name: "strip"
     path: "wrapper/bin/msvc_nop.bat"
   }
-  supports_start_end_lib: false
-  supports_interface_shared_objects: false
-  supports_incremental_linker: false
-  supports_normalizing_ar: true
-  needsPic: false
-
-  compiler_flag: "-m64"
-  compiler_flag: "/D__inline__=__inline"
-  # TODO(pcloudy): Review those flags below, they should be defined by cl.exe
-  compiler_flag: "/DCOMPILER_MSVC"
-
-  # Don't pollute with GDI macros in windows.h.
-  compiler_flag: "/DNOGDI"
-  # Don't define min/max macros in windows.h.
-  compiler_flag: "/DNOMINMAX"
-  compiler_flag: "/DPRAGMA_SUPPORTED"
-  # Platform defines.
-  compiler_flag: "/D_WIN32_WINNT=0x0601"
-  # Turn off warning messages.
-  compiler_flag: "/D_CRT_SECURE_NO_DEPRECATE"
-  compiler_flag: "/D_CRT_SECURE_NO_WARNINGS"
-  compiler_flag: "/D_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS"
-  # Use math constants (M_PI, etc.) from the math library
-  compiler_flag: "/D_USE_MATH_DEFINES"
-
-  # Useful options to have on for compilation.
-  # Suppress startup banner.
-  compiler_flag: "/nologo"
-  # Increase the capacity of object files to 2^32 sections.
-  compiler_flag: "/bigobj"
-  # Allocate 500MB for precomputed headers.
-  compiler_flag: "/Zm500"
-  # Use unsigned char by default.
-  compiler_flag: "/J"
-  # Use function level linking.
-  compiler_flag: "/Gy"
-  # Use string pooling.
-  compiler_flag: "/GF"
-  # Warning level 3 (could possibly go to 4 in the future).
-  compiler_flag: "/W3"
-  # Catch both asynchronous (structured) and synchronous (C++) exceptions.
-  compiler_flag: "/EHsc"
-
-  # Globally disabled warnings.
-  # Don't warn about elements of array being be default initialized.
-  compiler_flag: "/wd4351"
-  # Don't warn about no matching delete found.
-  compiler_flag: "/wd4291"
-  # Don't warn about diamond inheritance patterns.
-  compiler_flag: "/wd4250"
-  # Don't warn about insecure functions (e.g. non _s functions).
-  compiler_flag: "/wd4996"
-
-  linker_flag: "-m64"
-  # Stop passing -frandom-seed option
+  cxx_builtin_include_directory: "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/INCLUDE"
+  cxx_builtin_include_directory: "C:/Program Files (x86)/Windows Kits/10/include/"
+  cxx_builtin_include_directory: "C:/Program Files (x86)/Windows Kits/8.1/include/"
+  cxx_builtin_include_directory: "C:/Program Files (x86)/GnuWin32/include/"
+  cxx_builtin_include_directory: "C:/python_27_amd64/files/include"
   feature {
-    name: 'random_seed'
+    name: "default_link_flags"
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "c++-link-nodeps-dynamic-library"
+      flag_group {
+        flag: "-m64"
+      }
+    }
+    enabled: true
   }
-
+  feature {
+    name: "random_seed"
+  }
+  feature {
+    name: "default_compile_flags"
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      flag_group {
+        flag: "-m64"
+        flag: "/D__inline__=__inline"
+        flag: "/DCOMPILER_MSVC"
+        flag: "/DNOGDI"
+        flag: "/DNOMINMAX"
+        flag: "/DPRAGMA_SUPPORTED"
+        flag: "/D_WIN32_WINNT=0x0601"
+        flag: "/D_CRT_SECURE_NO_DEPRECATE"
+        flag: "/D_CRT_SECURE_NO_WARNINGS"
+        flag: "/D_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS"
+        flag: "/D_USE_MATH_DEFINES"
+        flag: "/nologo"
+        flag: "/bigobj"
+        flag: "/Zm500"
+        flag: "/J"
+        flag: "/Gy"
+        flag: "/GF"
+        flag: "/W3"
+        flag: "/EHsc"
+        flag: "/wd4351"
+        flag: "/wd4291"
+        flag: "/wd4250"
+        flag: "/wd4996"
+      }
+    }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      flag_group {
+        flag: "/DDEBUG=1"
+        flag: "-g"
+        flag: "/Od"
+        flag: "-Xcompilation-mode=dbg"
+      }
+      with_feature {
+        feature: "dbg"
+      }
+    }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      flag_group {
+        flag: "/DNDEBUG"
+        flag: "/Od"
+        flag: "-Xcompilation-mode=fastbuild"
+      }
+      with_feature {
+        feature: "fastbuild"
+      }
+    }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      flag_group {
+        flag: "/DNDEBUG"
+        flag: "/O2"
+        flag: "-Xcompilation-mode=opt"
+      }
+      with_feature {
+        feature: "opt"
+      }
+    }
+    enabled: true
+  }
+  feature {
+    name: "include_paths"
+    flag_set {
+      action: "preprocess-assemble"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      flag_group {
+        flag: "/I%{quote_include_paths}"
+        iterate_over: "quote_include_paths"
+      }
+      flag_group {
+        flag: "/I%{include_paths}"
+        iterate_over: "include_paths"
+      }
+      flag_group {
+        flag: "/I%{system_include_paths}"
+        iterate_over: "system_include_paths"
+      }
+    }
+  }
+  feature {
+    name: "dependency_file"
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-module-compile"
+      action: "c++-header-parsing"
+      flag_group {
+        flag: "/DEPENDENCY_FILE"
+        flag: "%{dependency_file}"
+        expand_if_all_available: "dependency_file"
+      }
+    }
+  }
+  feature {
+    name: "user_compile_flags"
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      flag_group {
+        flag: "%{user_compile_flags}"
+        iterate_over: "user_compile_flags"
+        expand_if_all_available: "user_compile_flags"
+      }
+    }
+  }
+  feature {
+    name: "sysroot"
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "c++-link-nodeps-dynamic-library"
+      flag_group {
+        flag: "--sysroot=%{sysroot}"
+        iterate_over: "sysroot"
+        expand_if_all_available: "sysroot"
+      }
+    }
+  }
+  feature {
+    name: "unfiltered_compile_flags"
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      flag_group {
+        flag: "%{unfiltered_compile_flags}"
+        iterate_over: "unfiltered_compile_flags"
+        expand_if_all_available: "unfiltered_compile_flags"
+      }
+    }
+  }
+  feature {
+    name: "compiler_output_flags"
+    flag_set {
+      action: "assemble"
+      flag_group {
+        flag: "/Fo%{output_file}"
+        flag: "/Zi"
+        expand_if_all_available: "output_file"
+        expand_if_none_available: "output_assembly_file"
+        expand_if_none_available: "output_preprocess_file"
+      }
+    }
+    flag_set {
+      action: "preprocess-assemble"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      flag_group {
+        flag: "/Fo%{output_file}"
+        expand_if_all_available: "output_file"
+        expand_if_none_available: "output_assembly_file"
+        expand_if_none_available: "output_preprocess_file"
+      }
+      flag_group {
+        flag: "/Fa%{output_file}"
+        expand_if_all_available: "output_file"
+        expand_if_all_available: "output_assembly_file"
+      }
+      flag_group {
+        flag: "/P"
+        flag: "/Fi%{output_file}"
+        expand_if_all_available: "output_file"
+        expand_if_all_available: "output_preprocess_file"
+      }
+    }
+  }
+  feature {
+    name: "compiler_input_flags"
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      flag_group {
+        flag: "/c"
+        flag: "%{source_file}"
+        expand_if_all_available: "source_file"
+      }
+    }
+  }
+  feature {
+    name: "dbg"
+  }
+  feature {
+    name: "fastbuild"
+  }
+  feature {
+    name: "opt"
+  }
   action_config {
-    config_name: 'c-compile'
-    action_name: 'c-compile'
+    config_name: "c-compile"
+    action_name: "c-compile"
     tool {
-      tool_path: 'wrapper/bin/msvc_cl.bat'
+      tool_path: "wrapper/bin/msvc_cl.bat"
     }
-    implies: 'compiler_input_flags'
-    implies: 'compiler_output_flags'
-    implies: 'legacy_compile_flags'
-    implies: 'user_compile_flags'
-    implies: 'sysroot'
-    implies: 'unfiltered_compile_flags'
+    implies: "compiler_input_flags"
+    implies: "compiler_output_flags"
+    implies: "default_compile_flags"
+    implies: "user_compile_flags"
+    implies: "sysroot"
+    implies: "unfiltered_compile_flags"
   }
-
   action_config {
-    config_name: 'c++-compile'
-    action_name: 'c++-compile'
+    config_name: "c++-compile"
+    action_name: "c++-compile"
     tool {
-      tool_path: 'wrapper/bin/msvc_cl.bat'
+      tool_path: "wrapper/bin/msvc_cl.bat"
     }
-    implies: 'compiler_input_flags'
-    implies: 'compiler_output_flags'
-    implies: 'legacy_compile_flags'
-    implies: 'user_compile_flags'
-    implies: 'sysroot'
-    implies: 'unfiltered_compile_flags'
-  }
-
-  # TODO(b/65151735): Remove legacy_compile_flags feature when legacy fields are
-  # not used in this crosstool
-  feature {
-    name: 'legacy_compile_flags'
-    flag_set {
-      action: 'assemble'
-      action: 'preprocess-assemble'
-      action: 'c-compile'
-      action: 'c++-compile'
-      action: 'c++-header-parsing'
-      action: 'c++-module-compile'
-      action: 'c++-module-codegen'
-      flag_group {
-        expand_if_all_available: 'legacy_compile_flags'
-        iterate_over: 'legacy_compile_flags'
-        flag: '%{legacy_compile_flags}'
-      }
-    }
-  }
-
-  feature {
-    name: 'include_paths'
-    flag_set {
-      action: 'preprocess-assemble'
-      action: 'c-compile'
-      action: 'c++-compile'
-      action: 'c++-header-parsing'
-      action: 'c++-module-compile'
-      flag_group {
-        iterate_over: 'quote_include_paths'
-        flag: '/I%{quote_include_paths}'
-      }
-      flag_group {
-        iterate_over: 'include_paths'
-        flag: '/I%{include_paths}'
-      }
-      flag_group {
-        iterate_over: 'system_include_paths'
-        flag: '/I%{system_include_paths}'
-      }
-    }
-  }
-
-  feature {
-    name: 'dependency_file'
-    flag_set {
-      action: 'assemble'
-      action: 'preprocess-assemble'
-      action: 'c-compile'
-      action: 'c++-compile'
-      action: 'c++-module-compile'
-      action: 'c++-header-parsing'
-      flag_group {
-        expand_if_all_available: 'dependency_file'
-        flag: '/DEPENDENCY_FILE'
-        flag: '%{dependency_file}'
-      }
-    }
-  }
-
-  feature {
-    name: 'user_compile_flags'
-    flag_set {
-      action: 'assemble'
-      action: 'preprocess-assemble'
-      action: 'c-compile'
-      action: 'c++-compile'
-      action: 'c++-header-parsing'
-      action: 'c++-module-compile'
-      action: 'c++-module-codegen'
-      flag_group {
-        expand_if_all_available: 'user_compile_flags'
-        iterate_over: 'user_compile_flags'
-        flag: '%{user_compile_flags}'
-      }
-    }
-  }
-
-  feature {
-    name: 'sysroot'
-    flag_set {
-      action: 'assemble'
-      action: 'preprocess-assemble'
-      action: 'c-compile'
-      action: 'c++-compile'
-      action: 'c++-header-parsing'
-      action: 'c++-module-compile'
-      action: 'c++-module-codegen'
-      action: 'c++-link-executable'
-      action: 'c++-link-dynamic-library'
-      action: 'c++-link-nodeps-dynamic-library'
-      flag_group {
-        expand_if_all_available: 'sysroot'
-        iterate_over: 'sysroot'
-        flag: '--sysroot=%{sysroot}'
-      }
-    }
-  }
-
-  feature {
-    name: 'unfiltered_compile_flags'
-    flag_set {
-      action: 'assemble'
-      action: 'preprocess-assemble'
-      action: 'c-compile'
-      action: 'c++-compile'
-      action: 'c++-header-parsing'
-      action: 'c++-module-compile'
-      action: 'c++-module-codegen'
-      flag_group {
-        expand_if_all_available: 'unfiltered_compile_flags'
-        iterate_over: 'unfiltered_compile_flags'
-        flag: '%{unfiltered_compile_flags}'
-      }
-    }
-  }
-
-  feature {
-    name: 'compiler_output_flags'
-    flag_set {
-      action: 'assemble'
-      flag_group {
-        expand_if_all_available: 'output_file'
-        expand_if_none_available: 'output_assembly_file'
-        expand_if_none_available: 'output_preprocess_file'
-        flag: '/Fo%{output_file}'
-        flag: '/Zi'
-      }
-    }
-    flag_set {
-      action: 'preprocess-assemble'
-      action: 'c-compile'
-      action: 'c++-compile'
-      action: 'c++-header-parsing'
-      action: 'c++-module-compile'
-      action: 'c++-module-codegen'
-      flag_group {
-        expand_if_all_available: 'output_file'
-        expand_if_none_available: 'output_assembly_file'
-        expand_if_none_available: 'output_preprocess_file'
-        flag: '/Fo%{output_file}'
-      }
-      flag_group {
-        expand_if_all_available: 'output_file'
-        expand_if_all_available: 'output_assembly_file'
-        flag: '/Fa%{output_file}'
-      }
-      flag_group {
-        expand_if_all_available: 'output_file'
-        expand_if_all_available: 'output_preprocess_file'
-        flag: '/P'
-        flag: '/Fi%{output_file}'
-      }
-    }
-  }
-
-  feature {
-    name: 'compiler_input_flags'
-    flag_set {
-      action: 'assemble'
-      action: 'preprocess-assemble'
-      action: 'c-compile'
-      action: 'c++-compile'
-      action: 'c++-header-parsing'
-      action: 'c++-module-compile'
-      action: 'c++-module-codegen'
-      flag_group {
-        expand_if_all_available: 'source_file'
-        flag: '/c'
-        flag: '%{source_file}'
-      }
-    }
-  }
-
-  compilation_mode_flags {
-    mode: DBG
-    compiler_flag: "/DDEBUG=1"
-    # This will signal the wrapper that we are doing a debug build, which sets
-    # some internal state of the toolchain wrapper. It is intentionally a "-"
-    # flag to make this very obvious.
-    compiler_flag: "-g"
-    compiler_flag: "/Od"
-    compiler_flag: "-Xcompilation-mode=dbg"
-  }
-
-  compilation_mode_flags {
-    mode: FASTBUILD
-    compiler_flag: "/DNDEBUG"
-    compiler_flag: "/Od"
-    compiler_flag: "-Xcompilation-mode=fastbuild"
-  }
-
-  compilation_mode_flags {
-    mode: OPT
-    compiler_flag: "/DNDEBUG"
-    compiler_flag: "/O2"
-    compiler_flag: "-Xcompilation-mode=opt"
+    implies: "compiler_input_flags"
+    implies: "compiler_output_flags"
+    implies: "default_compile_flags"
+    implies: "user_compile_flags"
+    implies: "sysroot"
+    implies: "unfiltered_compile_flags"
   }
 }
diff --git a/tools/cpp/CROSSTOOL.empty b/tools/cpp/CROSSTOOL.empty
index f1ecf9b..e68936c 100644
--- a/tools/cpp/CROSSTOOL.empty
+++ b/tools/cpp/CROSSTOOL.empty
@@ -1,14 +1,12 @@
 major_version: "local"
 minor_version: ""
-
 toolchain {
+  toolchain_identifier: "local"
+  host_system_name: "local"
+  target_system_name: "local"
+  target_cpu: "local"
+  target_libc: "local"
+  compiler: "local"
   abi_version: "local"
   abi_libc_version: "local"
-  compiler: "local"
-  host_system_name: "local"
-  target_libc: "local"
-  target_cpu: "local"
-  target_system_name: "local"
-  toolchain_identifier: "local"
 }
-
diff --git a/tools/cpp/CROSSTOOL.tpl b/tools/cpp/CROSSTOOL.tpl
index 3088437..91487b9 100644
--- a/tools/cpp/CROSSTOOL.tpl
+++ b/tools/cpp/CROSSTOOL.tpl
@@ -1,121 +1,320 @@
-# Copyright 2016 The Bazel Authors. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
 major_version: "local"
 minor_version: ""
-
-# Android tooling requires a default toolchain for the armeabi-v7a cpu.
 toolchain {
+  toolchain_identifier: "stub_armeabi-v7a"
+  host_system_name: "armeabi-v7a"
+  target_system_name: "armeabi-v7a"
+  target_cpu: "armeabi-v7a"
+  target_libc: "armeabi-v7a"
+  compiler: "compiler"
   abi_version: "armeabi-v7a"
   abi_libc_version: "armeabi-v7a"
+  tool_path {
+    name: "ar"
+    path: "/bin/false"
+  }
+  tool_path {
+    name: "compat-ld"
+    path: "/bin/false"
+  }
+  tool_path {
+    name: "cpp"
+    path: "/bin/false"
+  }
+  tool_path {
+    name: "dwp"
+    path: "/bin/false"
+  }
+  tool_path {
+    name: "gcc"
+    path: "/bin/false"
+  }
+  tool_path {
+    name: "gcov"
+    path: "/bin/false"
+  }
+  tool_path {
+    name: "ld"
+    path: "/bin/false"
+  }
+  tool_path {
+    name: "nm"
+    path: "/bin/false"
+  }
+  tool_path {
+    name: "objcopy"
+    path: "/bin/false"
+  }
+  tool_path {
+    name: "objdump"
+    path: "/bin/false"
+  }
+  tool_path {
+    name: "strip"
+    path: "/bin/false"
+  }
   builtin_sysroot: ""
-  compiler: "compiler"
-  host_system_name: "armeabi-v7a"
-  needsPic: true
-  supports_incremental_linker: false
-  supports_fission: false
-  supports_interface_shared_objects: false
-  supports_normalizing_ar: false
-  supports_start_end_lib: false
-  target_libc: "armeabi-v7a"
-  target_cpu: "armeabi-v7a"
-  target_system_name: "armeabi-v7a"
-  toolchain_identifier: "stub_armeabi-v7a"
-
-  tool_path { name: "ar" path: "/bin/false" }
-  tool_path { name: "compat-ld" path: "/bin/false" }
-  tool_path { name: "cpp" path: "/bin/false" }
-  tool_path { name: "dwp" path: "/bin/false" }
-  tool_path { name: "gcc" path: "/bin/false" }
-  tool_path { name: "gcov" path: "/bin/false" }
-  tool_path { name: "ld" path: "/bin/false" }
-
-  tool_path { name: "nm" path: "/bin/false" }
-  tool_path { name: "objcopy" path: "/bin/false" }
-  tool_path { name: "objdump" path: "/bin/false" }
-  tool_path { name: "strip" path: "/bin/false" }
-  linking_mode_flags { mode: DYNAMIC }
+  feature {
+    name: "supports_dynamic_linker"
+    enabled: true
+  }
+  feature {
+    name: "supports_pic"
+    enabled: true
+  }
 }
-
 toolchain {
   toolchain_identifier: "%{toolchain_name}"
-%{content}
-
-  compilation_mode_flags {
-    mode: DBG
-%{dbg_content}
-  }
-  compilation_mode_flags {
-    mode: OPT
-%{opt_content}
-  }
-  linking_mode_flags { mode: DYNAMIC }
-
-%{coverage}
-
+%{top_level_content}
   feature {
-    name: 'fdo_optimize'
-    provides: 'profile'
+    name: "default_compile_flags"
     flag_set {
-      action: 'c-compile'
-      action: 'c++-compile'
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
       flag_group {
-        expand_if_all_available: 'fdo_profile_path'
-        flag: '-fprofile-use=%{fdo_profile_path}'
-        flag: '-fprofile-correction',
+%{compile_content}
       }
     }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      flag_group {
+%{dbg_compile_content}
+      }
+      with_feature {
+        feature: "dbg"
+      }
+    }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      flag_group {
+%{opt_compile_content}
+      }
+      with_feature {
+        feature: "opt"
+      }
+    }
+    flag_set {
+      action: "linkstamp-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      flag_group {
+%{cxx_content}
+      }
+    }
+    enabled: true
+  }
+  feature {
+    name: "default_link_flags"
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "c++-link-nodeps-dynamic-library"
+      flag_group {
+%{link_content}
+      }
+    }
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "c++-link-nodeps-dynamic-library"
+      flag_group {
+%{opt_link_content}
+      }
+      with_feature {
+        feature: "opt"
+      }
+    }
+    enabled: true
+  }
+  feature {
+    name: "fdo_optimize"
+    flag_set {
+      action: "c-compile"
+      action: "c++-compile"
+      flag_group {
+        flag: "-fprofile-use=%{fdo_profile_path}"
+        flag: "-fprofile-correction"
+        expand_if_all_available: "fdo_profile_path"
+      }
+    }
+    provides: "profile"
+  }
+  feature {
+    name: "supports_dynamic_linker"
+    enabled: true
+  }
+  feature {
+    name: "dbg"
+  }
+  feature {
+    name: "opt"
+  }
+  feature {
+    name: "user_compile_flags"
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      flag_group {
+        flag: "%{user_compile_flags}"
+        iterate_over: "user_compile_flags"
+        expand_if_all_available: "user_compile_flags"
+      }
+    }
+    enabled: true
+  }
+  feature {
+    name: "sysroot"
+    flag_set {
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "c++-link-nodeps-dynamic-library"
+      flag_group {
+        flag: "--sysroot=%{sysroot}"
+        expand_if_all_available: "sysroot"
+      }
+    }
+    enabled: true
+  }
+  feature {
+    name: "unfiltered_compile_flags"
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      flag_group {
+%{unfiltered_content}
+      }
+    }
+    enabled: true
   }
 }
-
 toolchain {
   toolchain_identifier: "msys_x64_mingw"
+  host_system_name: "local"
+  target_system_name: "local"
+  target_cpu: "x64_windows"
+  target_libc: "mingw"
+  compiler: "mingw-gcc"
   abi_version: "local"
   abi_libc_version: "local"
   builtin_sysroot: ""
-  compiler: "mingw-gcc"
-  host_system_name: "local"
-  needsPic: false
-  target_libc: "mingw"
-  target_cpu: "x64_windows"
-  target_system_name: "local"
-
-  artifact_name_pattern {
-     category_name: 'executable'
-     prefix: ''
-     extension: '.exe'
+%{msys_x64_mingw_top_level_content}
+  feature {
+    name: "default_compile_flags"
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      flag_group {
+      }
+    }
+    flag_set {
+      action: "linkstamp-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      flag_group {
+%{msys_x64_mingw_cxx_content}
+      }
+    }
+    enabled: true
   }
-
-%{msys_x64_mingw_content}
-
-  linking_mode_flags { mode: DYNAMIC }
+  feature {
+    name: "default_link_flags"
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "c++-link-nodeps-dynamic-library"
+      flag_group {
+%{msys_x64_mingw_link_content}
+      }
+    }
+    enabled: true
+  }
+  feature {
+    name: "supports_dynamic_linker"
+    enabled: true
+  }
+  artifact_name_pattern {
+    category_name: "executable"
+    prefix: ""
+    extension: ".exe"
+  }
 }
-
 toolchain {
   toolchain_identifier: "msvc_x64"
   host_system_name: "local"
   target_system_name: "local"
-
+  target_cpu: "x64_windows"
+  target_libc: "msvcrt"
+  compiler: "msvc-cl"
   abi_version: "local"
   abi_libc_version: "local"
-  target_cpu: "x64_windows"
-  compiler: "msvc-cl"
-  target_libc: "msvcrt"
-  default_python_version: "python2.7"
-
-%{cxx_builtin_include_directory}
-
+%{msvc_x64_top_level_content}
   tool_path {
     name: "ar"
     path: "%{msvc_lib_path}"
@@ -156,86 +355,9 @@
     name: "strip"
     path: "wrapper/bin/msvc_nop.bat"
   }
-  supports_start_end_lib: false
-  supports_interface_shared_objects: true
-  supports_incremental_linker: false
-  supports_normalizing_ar: true
-  needsPic: false
-
-  # TODO(pcloudy): Review those flags below, they should be defined by cl.exe
-  compiler_flag: "/DCOMPILER_MSVC"
-
-  # Don't define min/max macros in windows.h.
-  compiler_flag: "/DNOMINMAX"
-
-  # Platform defines.
-  compiler_flag: "/D_WIN32_WINNT=0x0601"
-  # Turn off warning messages.
-  compiler_flag: "/D_CRT_SECURE_NO_DEPRECATE"
-  compiler_flag: "/D_CRT_SECURE_NO_WARNINGS"
-
-  # Useful options to have on for compilation.
-  # Increase the capacity of object files to 2^32 sections.
-  compiler_flag: "/bigobj"
-  # Allocate 500MB for precomputed headers.
-  compiler_flag: "/Zm500"
-  # Catch C++ exceptions only and tell the compiler to assume that functions declared
-  # as extern "C" never throw a C++ exception.
-  compiler_flag: "/EHsc"
-
-  # Globally disabled warnings.
-  # Don't warn about elements of array being be default initialized.
-  compiler_flag: "/wd4351"
-  # Don't warn about no matching delete found.
-  compiler_flag: "/wd4291"
-  # Don't warn about diamond inheritance patterns.
-  compiler_flag: "/wd4250"
-  # Don't warn about insecure functions (e.g. non _s functions).
-  compiler_flag: "/wd4996"
-
-  linker_flag: "/MACHINE:X64"
-
   feature {
     name: "no_legacy_features"
   }
-
-  artifact_name_pattern {
-     category_name: 'object_file'
-     prefix: ''
-     extension: '.obj'
-  }
-
-  artifact_name_pattern {
-     category_name: 'static_library'
-     prefix: ''
-     extension: '.lib'
-  }
-
-  artifact_name_pattern {
-     category_name: 'alwayslink_static_library'
-     prefix: ''
-     extension: '.lo.lib'
-  }
-
-  artifact_name_pattern {
-     category_name: 'executable'
-     prefix: ''
-     extension: '.exe'
-  }
-
-  artifact_name_pattern {
-     category_name: 'dynamic_library'
-     prefix: ''
-     extension: '.dll'
-  }
-
-  artifact_name_pattern {
-     category_name: 'interface_library'
-     prefix: ''
-     extension: '.if.lib'
-  }
-
-  # Suppress startup banner.
   feature {
     name: "nologo"
     flag_set {
@@ -255,181 +377,54 @@
       }
     }
   }
-
   feature {
-    name: 'has_configured_linker_path'
+    name: "has_configured_linker_path"
   }
-
-  # This feature indicates strip is not supported, building stripped binary will just result a copy of orignial binary
   feature {
-    name: 'no_stripping'
+    name: "no_stripping"
   }
-
-  # This feature indicates this is a toolchain targeting Windows.
   feature {
-    name: 'targets_windows'
-    implies: 'copy_dynamic_libraries_to_binary'
+    name: "targets_windows"
+    implies: "copy_dynamic_libraries_to_binary"
     enabled: true
   }
-
   feature {
-    name: 'copy_dynamic_libraries_to_binary'
+    name: "copy_dynamic_libraries_to_binary"
   }
-
-  action_config {
-    config_name: 'assemble'
-    action_name: 'assemble'
-    tool {
-      tool_path: '%{msvc_ml_path}'
-    }
-    implies: 'compiler_input_flags'
-    implies: 'compiler_output_flags'
-    implies: 'nologo'
-    implies: 'msvc_env'
-    implies: 'sysroot'
-  }
-
-  action_config {
-    config_name: 'preprocess-assemble'
-    action_name: 'preprocess-assemble'
-    tool {
-      tool_path: '%{msvc_ml_path}'
-    }
-    implies: 'compiler_input_flags'
-    implies: 'compiler_output_flags'
-    implies: 'nologo'
-    implies: 'msvc_env'
-    implies: 'sysroot'
-  }
-
-  action_config {
-    config_name: 'c-compile'
-    action_name: 'c-compile'
-    tool {
-      tool_path: '%{msvc_cl_path}'
-    }
-    implies: 'compiler_input_flags'
-    implies: 'compiler_output_flags'
-    implies: 'legacy_compile_flags'
-    implies: 'nologo'
-    implies: 'msvc_env'
-    implies: 'parse_showincludes'
-    implies: 'user_compile_flags'
-    implies: 'sysroot'
-    implies: 'unfiltered_compile_flags'
-  }
-
-  action_config {
-    config_name: 'c++-compile'
-    action_name: 'c++-compile'
-    tool {
-      tool_path: '%{msvc_cl_path}'
-    }
-    implies: 'compiler_input_flags'
-    implies: 'compiler_output_flags'
-    implies: 'legacy_compile_flags'
-    implies: 'nologo'
-    implies: 'msvc_env'
-    implies: 'parse_showincludes'
-    implies: 'user_compile_flags'
-    implies: 'sysroot'
-    implies: 'unfiltered_compile_flags'
-  }
-
-  action_config {
-    config_name: 'c++-link-executable'
-    action_name: 'c++-link-executable'
-    tool {
-      tool_path: '%{msvc_link_path}'
-    }
-    implies: 'nologo'
-    implies: 'linkstamps'
-    implies: 'output_execpath_flags'
-    implies: 'input_param_flags'
-    implies: 'user_link_flags'
-    implies: 'legacy_link_flags'
-    implies: 'linker_subsystem_flag'
-    implies: 'linker_param_file'
-    implies: 'msvc_env'
-    implies: 'no_stripping'
-  }
-
-  action_config {
-    config_name: 'c++-link-dynamic-library'
-    action_name: 'c++-link-dynamic-library'
-    tool {
-      tool_path: '%{msvc_link_path}'
-    }
-    implies: 'nologo'
-    implies: 'shared_flag'
-    implies: 'linkstamps'
-    implies: 'output_execpath_flags'
-    implies: 'input_param_flags'
-    implies: 'user_link_flags'
-    implies: 'legacy_link_flags'
-    implies: 'linker_subsystem_flag'
-    implies: 'linker_param_file'
-    implies: 'msvc_env'
-    implies: 'no_stripping'
-    implies: 'has_configured_linker_path'
-    implies: 'def_file'
-  }
-
-  action_config {
-      config_name: 'c++-link-nodeps-dynamic-library'
-      action_name: 'c++-link-nodeps-dynamic-library'
-      tool {
-        tool_path: '%{msvc_link_path}'
-      }
-      implies: 'nologo'
-      implies: 'shared_flag'
-      implies: 'linkstamps'
-      implies: 'output_execpath_flags'
-      implies: 'input_param_flags'
-      implies: 'user_link_flags'
-      implies: 'legacy_link_flags'
-      implies: 'linker_subsystem_flag'
-      implies: 'linker_param_file'
-      implies: 'msvc_env'
-      implies: 'no_stripping'
-      implies: 'has_configured_linker_path'
-      implies: 'def_file'
-    }
-
-  action_config {
-    config_name: 'c++-link-static-library'
-    action_name: 'c++-link-static-library'
-    tool {
-      tool_path: '%{msvc_lib_path}'
-    }
-    implies: 'nologo'
-    implies: 'archiver_flags'
-    implies: 'input_param_flags'
-    implies: 'linker_param_file'
-    implies: 'msvc_env'
-  }
-
-  # TODO(b/65151735): Remove legacy_compile_flags feature when legacy fields are
-  # not used in this crosstool
   feature {
-    name: 'legacy_compile_flags'
+    name: "default_compile_flags"
     flag_set {
-      action: 'preprocess-assemble'
-      action: 'c-compile'
-      action: 'c++-compile'
-      action: 'c++-header-parsing'
-      action: 'c++-module-compile'
-      action: 'c++-module-codegen'
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
       flag_group {
-        expand_if_all_available: 'legacy_compile_flags'
-        iterate_over: 'legacy_compile_flags'
-        flag: '%{legacy_compile_flags}'
+        flag: "/DCOMPILER_MSVC"
+        flag: "/DNOMINMAX"
+        flag: "/D_WIN32_WINNT=0x0601"
+        flag: "/D_CRT_SECURE_NO_DEPRECATE"
+        flag: "/D_CRT_SECURE_NO_WARNINGS"
+        flag: "/bigobj"
+        flag: "/Zm500"
+        flag: "/EHsc"
+        flag: "/wd4351"
+        flag: "/wd4291"
+        flag: "/wd4250"
+        flag: "/wd4996"
       }
     }
+    enabled: true
   }
-
   feature {
     name: "msvc_env"
+    implies: "msvc_compile_env"
+    implies: "msvc_link_env"
     env_set {
       action: "c-compile"
       action: "c++-compile"
@@ -455,10 +450,7 @@
         value: "%{msvc_env_tmp}"
       }
     }
-    implies: 'msvc_compile_env'
-    implies: 'msvc_link_env'
   }
-
   feature {
     name: "msvc_compile_env"
     env_set {
@@ -475,7 +467,6 @@
       }
     }
   }
-
   feature {
     name: "msvc_link_env"
     env_set {
@@ -489,31 +480,29 @@
       }
     }
   }
-
   feature {
-    name: 'include_paths'
+    name: "include_paths"
     flag_set {
       action: "assemble"
-      action: 'preprocess-assemble'
-      action: 'c-compile'
-      action: 'c++-compile'
-      action: 'c++-header-parsing'
-      action: 'c++-module-compile'
+      action: "preprocess-assemble"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
       flag_group {
-        iterate_over: 'quote_include_paths'
-        flag: '/I%{quote_include_paths}'
+        flag: "/I%{quote_include_paths}"
+        iterate_over: "quote_include_paths"
       }
       flag_group {
-        iterate_over: 'include_paths'
-        flag: '/I%{include_paths}'
+        flag: "/I%{include_paths}"
+        iterate_over: "include_paths"
       }
       flag_group {
-        iterate_over: 'system_include_paths'
-        flag: '/I%{system_include_paths}'
+        flag: "/I%{system_include_paths}"
+        iterate_over: "system_include_paths"
       }
     }
   }
-
   feature {
     name: "preprocessor_defines"
     flag_set {
@@ -529,363 +518,341 @@
       }
     }
   }
-
-  # Tell Bazel to parse the output of /showIncludes
   feature {
-    name: 'parse_showincludes'
+    name: "parse_showincludes"
     flag_set {
-      action: 'preprocess-assemble'
-      action: 'c-compile'
-      action: 'c++-compile'
-      action: 'c++-module-compile'
-      action: 'c++-header-parsing'
+      action: "preprocess-assemble"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-module-compile"
+      action: "c++-header-parsing"
       flag_group {
         flag: "/showIncludes"
       }
     }
   }
-
-
   feature {
-    name: 'generate_pdb_file'
-    requires: {
-      feature: 'dbg'
+    name: "generate_pdb_file"
+    requires {
+      feature: "dbg"
     }
-    requires: {
-      feature: 'fastbuild'
+    requires {
+      feature: "fastbuild"
     }
   }
-
   feature {
-    name: 'shared_flag'
+    name: "shared_flag"
     flag_set {
-      action: 'c++-link-dynamic-library'
+      action: "c++-link-dynamic-library"
       action: "c++-link-nodeps-dynamic-library"
       flag_group {
-        flag: '/DLL'
+        flag: "/DLL"
       }
     }
   }
-
   feature {
-    name: 'linkstamps'
+    name: "linkstamps"
     flag_set {
-      action: 'c++-link-executable'
-      action: 'c++-link-dynamic-library'
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
       action: "c++-link-nodeps-dynamic-library"
       flag_group {
-        expand_if_all_available: 'linkstamp_paths'
-        iterate_over: 'linkstamp_paths'
-        flag: '%{linkstamp_paths}'
+        flag: "%{linkstamp_paths}"
+        iterate_over: "linkstamp_paths"
+        expand_if_all_available: "linkstamp_paths"
       }
     }
   }
-
   feature {
-    name: 'output_execpath_flags'
+    name: "output_execpath_flags"
     flag_set {
-      action: 'c++-link-executable'
-      action: 'c++-link-dynamic-library'
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
       action: "c++-link-nodeps-dynamic-library"
       flag_group {
-        expand_if_all_available: 'output_execpath'
-        flag: '/OUT:%{output_execpath}'
+        flag: "/OUT:%{output_execpath}"
+        expand_if_all_available: "output_execpath"
       }
     }
   }
-
   feature {
-    name: 'archiver_flags'
+    name: "archiver_flags"
     flag_set {
-      action: 'c++-link-static-library'
+      action: "c++-link-static-library"
       flag_group {
-        expand_if_all_available: 'output_execpath'
-        flag: '/OUT:%{output_execpath}'
+        flag: "/OUT:%{output_execpath}"
+        expand_if_all_available: "output_execpath"
       }
     }
   }
-
   feature {
-    name: 'input_param_flags'
+    name: "input_param_flags"
     flag_set {
-      action: 'c++-link-dynamic-library'
+      action: "c++-link-dynamic-library"
       action: "c++-link-nodeps-dynamic-library"
       flag_group {
-        expand_if_all_available: 'interface_library_output_path'
         flag: "/IMPLIB:%{interface_library_output_path}"
+        expand_if_all_available: "interface_library_output_path"
       }
     }
     flag_set {
-      action: 'c++-link-executable'
-      action: 'c++-link-dynamic-library'
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
       action: "c++-link-nodeps-dynamic-library"
       flag_group {
-        expand_if_all_available: 'libopts'
-        iterate_over: 'libopts'
-        flag: '%{libopts}'
+        flag: "%{libopts}"
+        iterate_over: "libopts"
+        expand_if_all_available: "libopts"
       }
     }
     flag_set {
-      action: 'c++-link-executable'
-      action: 'c++-link-dynamic-library'
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
       action: "c++-link-nodeps-dynamic-library"
-      action: 'c++-link-static-library'
+      action: "c++-link-static-library"
       flag_group {
-        expand_if_all_available: 'libraries_to_link'
-        iterate_over: 'libraries_to_link'
         flag_group {
-          expand_if_equal: {
-            variable: 'libraries_to_link.type'
-            value: 'object_file_group'
-          }
-          iterate_over: 'libraries_to_link.object_files'
           flag_group {
-            flag: '%{libraries_to_link.object_files}'
+            flag: "%{libraries_to_link.object_files}"
+          }
+          iterate_over: "libraries_to_link.object_files"
+          expand_if_equal {
+            variable: "libraries_to_link.type"
+            value: "object_file_group"
           }
         }
         flag_group {
-          expand_if_equal: {
-            variable: 'libraries_to_link.type'
-            value: 'object_file'
-          }
           flag_group {
-            flag: '%{libraries_to_link.name}'
+            flag: "%{libraries_to_link.name}"
+          }
+          expand_if_equal {
+            variable: "libraries_to_link.type"
+            value: "object_file"
           }
         }
         flag_group {
-          expand_if_equal: {
-            variable: 'libraries_to_link.type'
-            value: 'interface_library'
-          }
           flag_group {
-            flag: '%{libraries_to_link.name}'
+            flag: "%{libraries_to_link.name}"
+          }
+          expand_if_equal {
+            variable: "libraries_to_link.type"
+            value: "interface_library"
           }
         }
         flag_group {
-          expand_if_equal: {
-            variable: 'libraries_to_link.type'
-            value: 'static_library'
+          flag_group {
+            flag: "%{libraries_to_link.name}"
+            expand_if_false: "libraries_to_link.is_whole_archive"
           }
           flag_group {
-            expand_if_false: 'libraries_to_link.is_whole_archive'
-            flag: '%{libraries_to_link.name}'
+            flag: "/WHOLEARCHIVE:%{libraries_to_link.name}"
+            expand_if_true: "libraries_to_link.is_whole_archive"
           }
-          flag_group {
-            expand_if_true: 'libraries_to_link.is_whole_archive'
-            flag: '/WHOLEARCHIVE:%{libraries_to_link.name}'
+          expand_if_equal {
+            variable: "libraries_to_link.type"
+            value: "static_library"
           }
         }
+        iterate_over: "libraries_to_link"
+        expand_if_all_available: "libraries_to_link"
       }
     }
   }
-
-  # Since this feature is declared earlier in the CROSSTOOL than
-  # "user_link_flags", this feature will be applied prior to it anwyhere they
-  # are both implied. And since "user_link_flags" contains the linkopts from
-  # the build rule, this allows the user to override the /SUBSYSTEM in the BUILD
-  # file.
   feature {
-    name: 'linker_subsystem_flag'
+    name: "linker_subsystem_flag"
     flag_set {
-      action: 'c++-link-executable'
-      action: 'c++-link-dynamic-library'
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
       action: "c++-link-nodeps-dynamic-library"
       flag_group {
-        flag: '/SUBSYSTEM:CONSOLE'
+        flag: "/SUBSYSTEM:CONSOLE"
       }
     }
   }
-
-  # The "user_link_flags" contains user-defined linkopts (from build rules)
-  # so it should be defined after features that declare user-overridable flags.
-  # For example the "linker_subsystem_flag" defines a default "/SUBSYSTEM" flag
-  # but we want to let the user override it, therefore "link_flag_subsystem" is
-  # defined earlier in the CROSSTOOL file than "user_link_flags".
   feature {
-    name: 'user_link_flags'
+    name: "user_link_flags"
     flag_set {
-      action: 'c++-link-executable'
-      action: 'c++-link-dynamic-library'
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
       action: "c++-link-nodeps-dynamic-library"
       flag_group {
-        expand_if_all_available: 'user_link_flags'
-        iterate_over: 'user_link_flags'
-        flag: '%{user_link_flags}'
+        flag: "%{user_link_flags}"
+        iterate_over: "user_link_flags"
+        expand_if_all_available: "user_link_flags"
       }
     }
   }
   feature {
-    name: 'legacy_link_flags'
+    name: "default_link_flags"
     flag_set {
-      action: 'c++-link-executable'
-      action: 'c++-link-dynamic-library'
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
       action: "c++-link-nodeps-dynamic-library"
       flag_group {
-        expand_if_all_available: 'legacy_link_flags'
-        iterate_over: 'legacy_link_flags'
-        flag: '%{legacy_link_flags}'
+        flag: "/MACHINE:X64"
       }
     }
+    enabled: true
   }
-
   feature {
-    name: 'linker_param_file'
+    name: "linker_param_file"
     flag_set {
-      action: 'c++-link-executable'
-      action: 'c++-link-dynamic-library'
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
       action: "c++-link-nodeps-dynamic-library"
-      action: 'c++-link-static-library'
+      action: "c++-link-static-library"
       flag_group {
-        expand_if_all_available: 'linker_param_file'
-        flag: '@%{linker_param_file}'
+        flag: "@%{linker_param_file}"
+        expand_if_all_available: "linker_param_file"
       }
     }
   }
-
   feature {
-    name: 'static_link_msvcrt'
+    name: "static_link_msvcrt"
   }
-
   feature {
-    name: 'static_link_msvcrt_no_debug'
+    name: "static_link_msvcrt_no_debug"
     flag_set {
-      action: 'c-compile'
-      action: 'c++-compile'
+      action: "c-compile"
+      action: "c++-compile"
       flag_group {
         flag: "/MT"
       }
     }
     flag_set {
-      action: 'c++-link-executable'
-      action: 'c++-link-dynamic-library'
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
       action: "c++-link-nodeps-dynamic-library"
       flag_group {
         flag: "/DEFAULTLIB:libcmt.lib"
       }
     }
-    requires: { feature: 'fastbuild'}
-    requires: { feature: 'opt'}
+    requires {
+      feature: "fastbuild"
+    }
+    requires {
+      feature: "opt"
+    }
   }
-
   feature {
-    name: 'dynamic_link_msvcrt_no_debug'
+    name: "dynamic_link_msvcrt_no_debug"
     flag_set {
-      action: 'c-compile'
-      action: 'c++-compile'
+      action: "c-compile"
+      action: "c++-compile"
       flag_group {
         flag: "/MD"
       }
     }
     flag_set {
-      action: 'c++-link-executable'
-      action: 'c++-link-dynamic-library'
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
       action: "c++-link-nodeps-dynamic-library"
       flag_group {
         flag: "/DEFAULTLIB:msvcrt.lib"
       }
     }
-    requires: { feature: 'fastbuild'}
-    requires: { feature: 'opt'}
+    requires {
+      feature: "fastbuild"
+    }
+    requires {
+      feature: "opt"
+    }
   }
-
   feature {
-    name: 'static_link_msvcrt_debug'
+    name: "static_link_msvcrt_debug"
     flag_set {
-      action: 'c-compile'
-      action: 'c++-compile'
+      action: "c-compile"
+      action: "c++-compile"
       flag_group {
         flag: "/MTd"
       }
     }
     flag_set {
-      action: 'c++-link-executable'
-      action: 'c++-link-dynamic-library'
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
       action: "c++-link-nodeps-dynamic-library"
       flag_group {
         flag: "/DEFAULTLIB:libcmtd.lib"
       }
     }
-    requires: { feature: 'dbg'}
+    requires {
+      feature: "dbg"
+    }
   }
-
   feature {
-    name: 'dynamic_link_msvcrt_debug'
+    name: "dynamic_link_msvcrt_debug"
     flag_set {
-      action: 'c-compile'
-      action: 'c++-compile'
+      action: "c-compile"
+      action: "c++-compile"
       flag_group {
         flag: "/MDd"
       }
     }
     flag_set {
-      action: 'c++-link-executable'
-      action: 'c++-link-dynamic-library'
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
       action: "c++-link-nodeps-dynamic-library"
       flag_group {
         flag: "/DEFAULTLIB:msvcrtd.lib"
       }
     }
-    requires: { feature: 'dbg'}
+    requires {
+      feature: "dbg"
+    }
   }
-
   feature {
-    name: 'dbg'
+    name: "dbg"
     flag_set {
-      action: 'c-compile'
-      action: 'c++-compile'
+      action: "c-compile"
+      action: "c++-compile"
       flag_group {
         flag: "/Od"
         flag: "/Z7"
       }
     }
     flag_set {
-      action: 'c++-link-executable'
-      action: 'c++-link-dynamic-library'
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
       action: "c++-link-nodeps-dynamic-library"
       flag_group {
         flag: "%{dbg_mode_debug}"
         flag: "/INCREMENTAL:NO"
       }
     }
-    implies: 'generate_pdb_file'
+    implies: "generate_pdb_file"
   }
-
   feature {
-    name: 'fastbuild'
+    name: "fastbuild"
     flag_set {
-      action: 'c-compile'
-      action: 'c++-compile'
+      action: "c-compile"
+      action: "c++-compile"
       flag_group {
         flag: "/Od"
         flag: "/Z7"
       }
     }
     flag_set {
-      action: 'c++-link-executable'
-      action: 'c++-link-dynamic-library'
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
       action: "c++-link-nodeps-dynamic-library"
       flag_group {
         flag: "%{fastbuild_mode_debug}"
         flag: "/INCREMENTAL:NO"
       }
     }
-    implies: 'generate_pdb_file'
+    implies: "generate_pdb_file"
   }
-
   feature {
-    name: 'opt'
+    name: "opt"
     flag_set {
-      action: 'c-compile'
-      action: 'c++-compile'
+      action: "c-compile"
+      action: "c++-compile"
       flag_group {
-        flag: "/O2" # Implies /Og /Oi /Ot /Oy /Ob2 /Gs /GF /Gy
+        flag: "/O2"
       }
     }
-    implies: 'frame_pointer'
+    implies: "frame_pointer"
   }
-
-  # Keep stack frames for debugging, even in opt mode.
-  # Must come after /O1, /O2 and /Ox.
   feature {
     name: "frame_pointer"
     flag_set {
@@ -896,231 +863,368 @@
       }
     }
   }
-
-  # Remove assert/DCHECKs in opt mode.
-  # You can have them back with --features=-disable_assertions.
   feature {
-    name: 'disable_assertions'
-    enabled: true
-    flag_set {
-      action: 'c-compile'
-      action: 'c++-compile'
-      with_feature: {
-        feature: 'opt'
-      }
-      flag_group {
-        flag: "/DNDEBUG"
-      }
-    }
-  }
-
-  feature {
-    name: "determinism"
-    enabled: true
+    name: "disable_assertions"
     flag_set {
       action: "c-compile"
       action: "c++-compile"
       flag_group {
-        # Make C++ compilation deterministic. Use linkstamping instead of these
-        # compiler symbols.
-        # TODO: detect clang on Windows and use "-Wno-builtin-macro-redefined"
-        flag: "/wd4117" # Trying to define or undefine a predefined macro
+        flag: "/DNDEBUG"
+      }
+      with_feature {
+        feature: "opt"
+      }
+    }
+    enabled: true
+  }
+  feature {
+    name: "determinism"
+    flag_set {
+      action: "c-compile"
+      action: "c++-compile"
+      flag_group {
+        flag: "/wd4117"
         flag: "-D__DATE__=\"redacted\""
         flag: "-D__TIMESTAMP__=\"redacted\""
         flag: "-D__TIME__=\"redacted\""
       }
     }
+    enabled: true
   }
-
   feature {
-    name: 'treat_warnings_as_errors'
+    name: "treat_warnings_as_errors"
     flag_set {
-      action: 'c-compile'
-      action: 'c++-compile'
+      action: "c-compile"
+      action: "c++-compile"
       flag_group {
         flag: "/WX"
       }
     }
   }
-
-  # Trade slower build time for smaller binary
   feature {
-    name: 'smaller_binary'
-    enabled: true
+    name: "smaller_binary"
     flag_set {
-      action: 'c-compile'
-      action: 'c++-compile'
-      with_feature: {
-        feature: 'opt'
-      }
+      action: "c-compile"
+      action: "c++-compile"
       flag_group {
-        flag: "/Gy" # Enable function-level linking (-ffunction-sections)
-        flag: "/Gw" # Optimize global data (-fdata-sections)
+        flag: "/Gy"
+        flag: "/Gw"
+      }
+      with_feature {
+        feature: "opt"
       }
     }
     flag_set {
-      action: 'c++-link-executable'
-      action: 'c++-link-dynamic-library',
-      action: 'c++-link-nodeps-dynamic-library'
-      with_feature: {
-        feature: 'opt'
-      }
-      flag_group {
-        flag: '/OPT:ICF' # Fold identical functions
-        flag: '/OPT:REF' # Eliminate unreferenced functions and data
-      }
-    }
-  }
-
-  # Suppress warnings that most users do not care
-  feature {
-    name: 'ignore_noisy_warnings'
-    enabled: true
-    flag_set {
-      action: 'c++-link-static-library'
-      flag_group {
-        # Suppress 'object file does not define any public symbols' warning
-        flag: '/ignore:4221'
-      }
-    }
-  }
-
-  feature {
-    name: 'user_compile_flags'
-    flag_set {
-      action: 'preprocess-assemble'
-      action: 'c-compile'
-      action: 'c++-compile'
-      action: 'c++-header-parsing'
-      action: 'c++-module-compile'
-      action: 'c++-module-codegen'
-      flag_group {
-        expand_if_all_available: 'user_compile_flags'
-        iterate_over: 'user_compile_flags'
-        flag: '%{user_compile_flags}'
-      }
-    }
-  }
-
-  feature {
-    name: 'sysroot'
-    flag_set {
-      action: 'assemble'
-      action: 'preprocess-assemble'
-      action: 'c-compile'
-      action: 'c++-compile'
-      action: 'c++-header-parsing'
-      action: 'c++-module-compile'
-      action: 'c++-module-codegen'
-      action: 'c++-link-executable'
-      action: 'c++-link-dynamic-library'
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
       action: "c++-link-nodeps-dynamic-library"
       flag_group {
-        expand_if_all_available: 'sysroot'
-        iterate_over: 'sysroot'
-        flag: '--sysroot=%{sysroot}'
+        flag: "/OPT:ICF"
+        flag: "/OPT:REF"
+      }
+      with_feature {
+        feature: "opt"
+      }
+    }
+    enabled: true
+  }
+  feature {
+    name: "ignore_noisy_warnings"
+    flag_set {
+      action: "c++-link-static-library"
+      flag_group {
+        flag: "/ignore:4221"
+      }
+    }
+    enabled: true
+  }
+  feature {
+    name: "user_compile_flags"
+    flag_set {
+      action: "preprocess-assemble"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      flag_group {
+        flag: "%{user_compile_flags}"
+        iterate_over: "user_compile_flags"
+        expand_if_all_available: "user_compile_flags"
       }
     }
   }
-
   feature {
-    name: 'unfiltered_compile_flags'
+    name: "sysroot"
     flag_set {
-      action: 'preprocess-assemble'
-      action: 'c-compile'
-      action: 'c++-compile'
-      action: 'c++-header-parsing'
-      action: 'c++-module-compile'
-      action: 'c++-module-codegen'
-      flag_group {
-        expand_if_all_available: 'unfiltered_compile_flags'
-        iterate_over: 'unfiltered_compile_flags'
-        flag: '%{unfiltered_compile_flags}'
-      }
-    }
-  }
-
-  feature {
-    name: 'compiler_output_flags'
-    flag_set {
-      action: 'assemble'
-      flag_group {
-        expand_if_all_available: 'output_file'
-        expand_if_none_available: 'output_assembly_file'
-        expand_if_none_available: 'output_preprocess_file'
-        flag: '/Fo%{output_file}'
-        flag: '/Zi'
-      }
-    }
-    flag_set {
-      action: 'preprocess-assemble'
-      action: 'c-compile'
-      action: 'c++-compile'
-      action: 'c++-header-parsing'
-      action: 'c++-module-compile'
-      action: 'c++-module-codegen'
-      flag_group {
-        expand_if_all_available: 'output_file'
-        expand_if_none_available: 'output_assembly_file'
-        expand_if_none_available: 'output_preprocess_file'
-        flag: '/Fo%{output_file}'
-      }
-      flag_group {
-        expand_if_all_available: 'output_file'
-        expand_if_all_available: 'output_assembly_file'
-        flag: '/Fa%{output_file}'
-      }
-      flag_group {
-        expand_if_all_available: 'output_file'
-        expand_if_all_available: 'output_preprocess_file'
-        flag: '/P'
-        flag: '/Fi%{output_file}'
-      }
-    }
-  }
-
-  feature {
-    name: 'compiler_input_flags'
-    flag_set {
-      action: 'assemble'
-      action: 'preprocess-assemble'
-      action: 'c-compile'
-      action: 'c++-compile'
-      action: 'c++-header-parsing'
-      action: 'c++-module-compile'
-      action: 'c++-module-codegen'
-      flag_group {
-        expand_if_all_available: 'source_file'
-        flag: '/c'
-        flag: '%{source_file}'
-      }
-    }
-  }
-
-  feature {
-    name : 'def_file',
-    flag_set {
-      action: 'c++-link-executable'
-      action: 'c++-link-dynamic-library'
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
       action: "c++-link-nodeps-dynamic-library"
       flag_group {
-        expand_if_all_available: 'def_file_path'
+        flag: "--sysroot=%{sysroot}"
+        iterate_over: "sysroot"
+        expand_if_all_available: "sysroot"
+      }
+    }
+  }
+  feature {
+    name: "unfiltered_compile_flags"
+    flag_set {
+      action: "preprocess-assemble"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      flag_group {
+        flag: "%{unfiltered_compile_flags}"
+        iterate_over: "unfiltered_compile_flags"
+        expand_if_all_available: "unfiltered_compile_flags"
+      }
+    }
+  }
+  feature {
+    name: "compiler_output_flags"
+    flag_set {
+      action: "assemble"
+      flag_group {
+        flag: "/Fo%{output_file}"
+        flag: "/Zi"
+        expand_if_all_available: "output_file"
+        expand_if_none_available: "output_assembly_file"
+        expand_if_none_available: "output_preprocess_file"
+      }
+    }
+    flag_set {
+      action: "preprocess-assemble"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      flag_group {
+        flag: "/Fo%{output_file}"
+        expand_if_all_available: "output_file"
+        expand_if_none_available: "output_assembly_file"
+        expand_if_none_available: "output_preprocess_file"
+      }
+      flag_group {
+        flag: "/Fa%{output_file}"
+        expand_if_all_available: "output_file"
+        expand_if_all_available: "output_assembly_file"
+      }
+      flag_group {
+        flag: "/P"
+        flag: "/Fi%{output_file}"
+        expand_if_all_available: "output_file"
+        expand_if_all_available: "output_preprocess_file"
+      }
+    }
+  }
+  feature {
+    name: "compiler_input_flags"
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      flag_group {
+        flag: "/c"
+        flag: "%{source_file}"
+        expand_if_all_available: "source_file"
+      }
+    }
+  }
+  feature {
+    name: "def_file"
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "c++-link-nodeps-dynamic-library"
+      flag_group {
         flag: "/DEF:%{def_file_path}"
-        # We can specify a different DLL name in DEF file, /ignore:4070 suppresses
-        # the warning message about DLL name doesn't match the default one.
-        # See https://msdn.microsoft.com/en-us/library/sfkk2fz7.aspx
         flag: "/ignore:4070"
+        expand_if_all_available: "def_file_path"
       }
     }
   }
-
   feature {
-    name: 'windows_export_all_symbols'
+    name: "windows_export_all_symbols"
   }
-
   feature {
-    name: 'no_windows_export_all_symbols'
+    name: "no_windows_export_all_symbols"
   }
-
-  linking_mode_flags { mode: DYNAMIC }
+  feature {
+    name: "supports_dynamic_linker"
+    enabled: true
+  }
+  feature {
+    name: "supports_interface_shared_libraries"
+    enabled: true
+  }
+  action_config {
+    config_name: "assemble"
+    action_name: "assemble"
+    tool {
+      tool_path: "%{msvc_ml_path}"
+    }
+    implies: "compiler_input_flags"
+    implies: "compiler_output_flags"
+    implies: "nologo"
+    implies: "msvc_env"
+    implies: "sysroot"
+  }
+  action_config {
+    config_name: "preprocess-assemble"
+    action_name: "preprocess-assemble"
+    tool {
+      tool_path: "%{msvc_ml_path}"
+    }
+    implies: "compiler_input_flags"
+    implies: "compiler_output_flags"
+    implies: "nologo"
+    implies: "msvc_env"
+    implies: "sysroot"
+  }
+  action_config {
+    config_name: "c-compile"
+    action_name: "c-compile"
+    tool {
+      tool_path: "%{msvc_cl_path}"
+    }
+    implies: "compiler_input_flags"
+    implies: "compiler_output_flags"
+    implies: "default_compile_flags"
+    implies: "nologo"
+    implies: "msvc_env"
+    implies: "parse_showincludes"
+    implies: "user_compile_flags"
+    implies: "sysroot"
+    implies: "unfiltered_compile_flags"
+  }
+  action_config {
+    config_name: "c++-compile"
+    action_name: "c++-compile"
+    tool {
+      tool_path: "%{msvc_cl_path}"
+    }
+    implies: "compiler_input_flags"
+    implies: "compiler_output_flags"
+    implies: "default_compile_flags"
+    implies: "nologo"
+    implies: "msvc_env"
+    implies: "parse_showincludes"
+    implies: "user_compile_flags"
+    implies: "sysroot"
+    implies: "unfiltered_compile_flags"
+  }
+  action_config {
+    config_name: "c++-link-executable"
+    action_name: "c++-link-executable"
+    tool {
+      tool_path: "%{msvc_link_path}"
+    }
+    implies: "nologo"
+    implies: "linkstamps"
+    implies: "output_execpath_flags"
+    implies: "input_param_flags"
+    implies: "user_link_flags"
+    implies: "default_link_flags"
+    implies: "linker_subsystem_flag"
+    implies: "linker_param_file"
+    implies: "msvc_env"
+    implies: "no_stripping"
+  }
+  action_config {
+    config_name: "c++-link-dynamic-library"
+    action_name: "c++-link-dynamic-library"
+    tool {
+      tool_path: "%{msvc_link_path}"
+    }
+    implies: "nologo"
+    implies: "shared_flag"
+    implies: "linkstamps"
+    implies: "output_execpath_flags"
+    implies: "input_param_flags"
+    implies: "user_link_flags"
+    implies: "default_link_flags"
+    implies: "linker_subsystem_flag"
+    implies: "linker_param_file"
+    implies: "msvc_env"
+    implies: "no_stripping"
+    implies: "has_configured_linker_path"
+    implies: "def_file"
+  }
+  action_config {
+    config_name: "c++-link-nodeps-dynamic-library"
+    action_name: "c++-link-nodeps-dynamic-library"
+    tool {
+      tool_path: "%{msvc_link_path}"
+    }
+    implies: "nologo"
+    implies: "shared_flag"
+    implies: "linkstamps"
+    implies: "output_execpath_flags"
+    implies: "input_param_flags"
+    implies: "user_link_flags"
+    implies: "default_link_flags"
+    implies: "linker_subsystem_flag"
+    implies: "linker_param_file"
+    implies: "msvc_env"
+    implies: "no_stripping"
+    implies: "has_configured_linker_path"
+    implies: "def_file"
+  }
+  action_config {
+    config_name: "c++-link-static-library"
+    action_name: "c++-link-static-library"
+    tool {
+      tool_path: "%{msvc_lib_path}"
+    }
+    implies: "nologo"
+    implies: "archiver_flags"
+    implies: "input_param_flags"
+    implies: "linker_param_file"
+    implies: "msvc_env"
+  }
+  artifact_name_pattern {
+    category_name: "object_file"
+    prefix: ""
+    extension: ".obj"
+  }
+  artifact_name_pattern {
+    category_name: "static_library"
+    prefix: ""
+    extension: ".lib"
+  }
+  artifact_name_pattern {
+    category_name: "alwayslink_static_library"
+    prefix: ""
+    extension: ".lo.lib"
+  }
+  artifact_name_pattern {
+    category_name: "executable"
+    prefix: ""
+    extension: ".exe"
+  }
+  artifact_name_pattern {
+    category_name: "dynamic_library"
+    prefix: ""
+    extension: ".dll"
+  }
+  artifact_name_pattern {
+    category_name: "interface_library"
+    prefix: ""
+    extension: ".if.lib"
+  }
 }
diff --git a/tools/cpp/lib_cc_configure.bzl b/tools/cpp/lib_cc_configure.bzl
index ebb0a05..3bce481 100644
--- a/tools/cpp/lib_cc_configure.bzl
+++ b/tools/cpp/lib_cc_configure.bzl
@@ -198,3 +198,7 @@
     """Returns True if CC_CONFIGURE_DEBUG is set to 1."""
     env = repository_ctx.os.environ
     return "CC_CONFIGURE_DEBUG" in env and env["CC_CONFIGURE_DEBUG"] == "1"
+
+def build_flags(flags):
+    """Convert `flags` to a string of flag fields."""
+    return "\n".join(["        flag: '" + flag + "'" for flag in flags])
diff --git a/tools/cpp/unix_cc_configure.bzl b/tools/cpp/unix_cc_configure.bzl
index 4ef6e01..e705e50 100644
--- a/tools/cpp/unix_cc_configure.bzl
+++ b/tools/cpp/unix_cc_configure.bzl
@@ -18,6 +18,7 @@
     "@bazel_tools//tools/cpp:lib_cc_configure.bzl",
     "auto_configure_fail",
     "auto_configure_warning",
+    "build_flags",
     "escape_string",
     "get_env_var",
     "resolve_labels",
@@ -25,6 +26,16 @@
     "which",
 )
 
+def _field(name, value):
+    """Returns properly indented top level crosstool field."""
+    if type(value) == "list":
+        return "\n".join(["  " + name + ": '" + v + "'" for v in value])
+    elif type(value) == "string":
+        return "  " + name + ": '" + value + "'"
+    else:
+        auto_configure_fail("Unexpected field type: " + type(value))
+        return ""
+
 def _uniq(iterable):
     """Remove duplicates from a list."""
 
@@ -61,23 +72,9 @@
     else:
         return "\"%s\"" % it
 
-def _build_crosstool(d, prefix = "  "):
-    """Convert `d` to a string version of a CROSSTOOL file content."""
-    lines = []
-    for k in d:
-        if type(d[k]) == "list":
-            for it in d[k]:
-                lines.append("%s%s: %s" % (prefix, k, _get_value(it)))
-        else:
-            lines.append("%s%s: %s" % (prefix, k, _get_value(d[k])))
-    return "\n".join(lines)
-
 def _build_tool_path(d):
     """Build the list of %-escaped tool_path for the CROSSTOOL file."""
-    lines = []
-    for k in d:
-        lines.append("  tool_path {name: \"%s\" path: \"%s\" }" % (k, escape_string(d[k])))
-    return "\n".join(lines)
+    return ["  tool_path { name: \"%s\" path: \"%s\" }" % (k, escape_string(d[k])) for k in d]
 
 def _find_tool(repository_ctx, tool, overriden_tools):
     """Find a tool for repository, taking overriden tools into account."""
@@ -218,159 +215,6 @@
         )
     return opt
 
-def _crosstool_content(repository_ctx, cc, cpu_value, darwin):
-    """Return the content for the CROSSTOOL file, in a dictionary."""
-    supports_gold_linker = _is_gold_supported(repository_ctx, cc)
-    cc_path = repository_ctx.path(cc)
-    if not str(cc_path).startswith(str(repository_ctx.path(".")) + "/"):
-        # cc is outside the repository, set -B
-        bin_search_flag = ["-B" + escape_string(str(cc_path.dirname))]
-    else:
-        # cc is inside the repository, don't set -B.
-        bin_search_flag = []
-
-    escaped_cxx_include_directories = _uniq(
-        get_escaped_cxx_inc_directories(repository_ctx, cc, "-xc") +
-        get_escaped_cxx_inc_directories(repository_ctx, cc, "-xc++") +
-        get_escaped_cxx_inc_directories(
-            repository_ctx,
-            cc,
-            "-xc",
-            _get_no_canonical_prefixes_opt(repository_ctx, cc),
-        ) +
-        get_escaped_cxx_inc_directories(
-            repository_ctx,
-            cc,
-            "-xc++",
-            _get_no_canonical_prefixes_opt(repository_ctx, cc),
-        ),
-    )
-    return {
-        "abi_version": escape_string(get_env_var(repository_ctx, "ABI_VERSION", "local", False)),
-        "abi_libc_version": escape_string(get_env_var(repository_ctx, "ABI_LIBC_VERSION", "local", False)),
-        "builtin_sysroot": "",
-        "compiler": escape_string(get_env_var(repository_ctx, "BAZEL_COMPILER", "compiler", False)),
-        "host_system_name": escape_string(get_env_var(repository_ctx, "BAZEL_HOST_SYSTEM", "local", False)),
-        "needsPic": True,
-        "supports_incremental_linker": False,
-        "supports_fission": False,
-        "supports_interface_shared_objects": False,
-        "supports_normalizing_ar": False,
-        "supports_start_end_lib": supports_gold_linker,
-        "target_libc": "macosx" if darwin else escape_string(get_env_var(repository_ctx, "BAZEL_TARGET_LIBC", "local", False)),
-        "target_cpu": escape_string(get_env_var(repository_ctx, "BAZEL_TARGET_CPU", cpu_value, False)),
-        "target_system_name": escape_string(get_env_var(repository_ctx, "BAZEL_TARGET_SYSTEM", "local", False)),
-        "cxx_flag": [
-            "-std=c++0x",
-        ] + _escaped_cplus_include_paths(repository_ctx),
-        "linker_flag": (
-            ["-fuse-ld=gold"] if supports_gold_linker else []
-        ) + _add_linker_option_if_supported(
-            repository_ctx,
-            cc,
-            "-Wl,-no-as-needed",
-            "-no-as-needed",
-        ) + _add_linker_option_if_supported(
-            repository_ctx,
-            cc,
-            "-Wl,-z,relro,-z,now",
-            "-z",
-        ) + (
-            [
-                "-undefined",
-                "dynamic_lookup",
-                "-headerpad_max_install_names",
-            ] if darwin else bin_search_flag + [
-                # Gold linker only? Can we enable this by default?
-                # "-Wl,--warn-execstack",
-                # "-Wl,--detect-odr-violations"
-            ] + _add_compiler_option_if_supported(
-                # Have gcc return the exit code from ld.
-                repository_ctx,
-                cc,
-                "-pass-exit-codes",
-            )
-        ) + split_escaped(
-            get_env_var(repository_ctx, "BAZEL_LINKOPTS", "-lstdc++:-lm", False),
-            ":",
-        ),
-        "cxx_builtin_include_directory": escaped_cxx_include_directories,
-        "objcopy_embed_flag": ["-I", "binary"],
-        "unfiltered_cxx_flag": _get_no_canonical_prefixes_opt(repository_ctx, cc) + [
-            # Make C++ compilation deterministic. Use linkstamping instead of these
-            # compiler symbols.
-            "-Wno-builtin-macro-redefined",
-            "-D__DATE__=\\\"redacted\\\"",
-            "-D__TIMESTAMP__=\\\"redacted\\\"",
-            "-D__TIME__=\\\"redacted\\\"",
-        ],
-        "compiler_flag": [
-            # Security hardening requires optimization.
-            # We need to undef it as some distributions now have it enabled by default.
-            "-U_FORTIFY_SOURCE",
-            "-fstack-protector",
-            # All warnings are enabled. Maybe enable -Werror as well?
-            "-Wall",
-            # Enable a few more warnings that aren't part of -Wall.
-        ] + ((
-            _add_compiler_option_if_supported(repository_ctx, cc, "-Wthread-safety") +
-            _add_compiler_option_if_supported(repository_ctx, cc, "-Wself-assign")
-        )) + (
-            # Disable problematic warnings.
-            _add_compiler_option_if_supported(repository_ctx, cc, "-Wunused-but-set-parameter") +
-            # has false positives
-            _add_compiler_option_if_supported(repository_ctx, cc, "-Wno-free-nonheap-object") +
-            # Enable coloring even if there's no attached terminal. Bazel removes the
-            # escape sequences if --nocolor is specified.
-            _add_compiler_option_if_supported(repository_ctx, cc, "-fcolor-diagnostics")
-        ) + [
-            # Keep stack frames for debugging, even in opt mode.
-            "-fno-omit-frame-pointer",
-        ],
-    }
-
-def _opt_content(repository_ctx, cc, darwin):
-    """Return the content of the opt specific section of the CROSSTOOL file."""
-    return {
-        "compiler_flag": [
-            # No debug symbols.
-            # Maybe we should enable https://gcc.gnu.org/wiki/DebugFission for opt or
-            # even generally? However, that can't happen here, as it requires special
-            # handling in Bazel.
-            "-g0",
-
-            # Conservative choice for -O
-            # -O3 can increase binary size and even slow down the resulting binaries.
-            # Profile first and / or use FDO if you need better performance than this.
-            "-O2",
-
-            # Security hardening on by default.
-            # Conservative choice; -D_FORTIFY_SOURCE=2 may be unsafe in some cases.
-            "-D_FORTIFY_SOURCE=1",
-
-            # Disable assertions
-            "-DNDEBUG",
-
-            # Removal of unused code and data at link time (can this increase binary size in some cases?).
-            "-ffunction-sections",
-            "-fdata-sections",
-        ],
-        "linker_flag": (
-            [] if darwin else _add_linker_option_if_supported(
-                repository_ctx,
-                cc,
-                "-Wl,--gc-sections",
-                "-gc-sections",
-            )
-        ),
-    }
-
-def _dbg_content():
-    """Return the content of the dbg specific section of the CROSSTOOL file."""
-
-    # Enable debug symbols
-    return {"compiler_flag": "-g"}
-
 def get_env(repository_ctx):
     """Convert the environment in a list of export if in Homebrew. Doesn't %-escape the result!"""
     env = repository_ctx.os.environ
@@ -412,25 +256,25 @@
     # generated code contains references to gcov symbols, and the dynamic linker
     # can't resolve them unless the library is linked against gcov.
     return """
-    feature {
-      name: 'coverage'
-      provides: 'profile'
-      flag_set {
-        action: 'preprocess-assemble'
-        action: 'c-compile'
-        action: 'c++-compile'
-        action: 'c++-header-parsing'
-        action: 'c++-module-compile'
-        """ + compile_flags + """
-      }
-      flag_set {
-        action: 'c++-link-dynamic-library'
-        action: 'c++-link-nodeps-dynamic-library'
-        action: 'c++-link-executable'
-        """ + link_flags + """
-      }
+  feature {
+    name: 'coverage'
+    provides: 'profile'
+    flag_set {
+      action: 'preprocess-assemble'
+      action: 'c-compile'
+      action: 'c++-compile'
+      action: 'c++-header-parsing'
+      action: 'c++-module-compile'
+      """ + compile_flags + """
     }
-  """
+    flag_set {
+      action: 'c++-link-dynamic-library'
+      action: 'c++-link-nodeps-dynamic-library'
+      action: 'c++-link-executable'
+      """ + link_flags + """
+    }
+  }
+"""
 
 def _find_generic(repository_ctx, name, env_name, overriden_tools, warn = False, silent = False):
     """Find a generic C++ toolchain tool. Doesn't %-escape the result."""
@@ -463,6 +307,9 @@
 def find_cc(repository_ctx, overriden_tools):
     return _find_generic(repository_ctx, "gcc", "CC", overriden_tools)
 
+def _feature(name, enabled):
+    return "  feature { name: '" + name + "' enabled: " + ("true" if enabled else "false") + " }"
+
 def configure_unix_toolchain(repository_ctx, cpu_value, overriden_tools):
     """Configure C++ toolchain on Unix platforms."""
     paths = resolve_labels(repository_ctx, [
@@ -491,9 +338,6 @@
         overriden_tools["ar"] = "/usr/bin/libtool"
 
     tool_paths = _get_tool_paths(repository_ctx, overriden_tools)
-    crosstool_content = _crosstool_content(repository_ctx, cc, cpu_value, darwin)
-    opt_content = _opt_content(repository_ctx, cc, darwin)
-    dbg_content = _dbg_content()
     cc_toolchain_identifier = get_env_var(repository_ctx, "CC_TOOLCHAIN_NAME", "local", False)
 
     repository_ctx.template(
@@ -525,6 +369,14 @@
         },
     )
 
+    supports_gold_linker = _is_gold_supported(repository_ctx, cc)
+    cc_path = repository_ctx.path(cc)
+    if not str(cc_path).startswith(str(repository_ctx.path(".")) + "/"):
+        # cc is outside the repository, set -B
+        bin_search_flag = ["-B" + escape_string(str(cc_path.dirname))]
+    else:
+        # cc is inside the repository, don't set -B.
+        bin_search_flag = []
     repository_ctx.template(
         "CROSSTOOL",
         paths["@bazel_tools//tools/cpp:CROSSTOOL.tpl"],
@@ -532,12 +384,146 @@
             "%{cpu}": escape_string(cpu_value),
             "%{default_toolchain_name}": escape_string(cc_toolchain_identifier),
             "%{toolchain_name}": escape_string(cc_toolchain_identifier),
-            "%{content}": _build_crosstool(crosstool_content) + "\n" +
-                          _build_tool_path(tool_paths),
-            "%{opt_content}": _build_crosstool(opt_content, "    "),
-            "%{dbg_content}": _build_crosstool(dbg_content, "    "),
-            "%{cxx_builtin_include_directory}": "",
-            "%{coverage}": _coverage_feature(repository_ctx, darwin),
+            "%{top_level_content}": "\n".join(_build_tool_path(tool_paths)) + "\n".join(
+                [
+                    _field("abi_version", escape_string(get_env_var(repository_ctx, "ABI_VERSION", "local", False))),
+                    _field("abi_version", escape_string(get_env_var(repository_ctx, "ABI_VERSION", "local", False))),
+                    _field("abi_libc_version", escape_string(get_env_var(repository_ctx, "ABI_LIBC_VERSION", "local", False))),
+                    _field("builtin_sysroot", ""),
+                    _field("compiler", escape_string(get_env_var(repository_ctx, "BAZEL_COMPILER", "compiler", False))),
+                    _field("host_system_name", escape_string(get_env_var(repository_ctx, "BAZEL_HOST_SYSTEM", "local", False))),
+                    _field("target_libc", "macosx" if darwin else escape_string(get_env_var(repository_ctx, "BAZEL_TARGET_LIBC", "local", False))),
+                    _field("target_cpu", escape_string(get_env_var(repository_ctx, "BAZEL_TARGET_CPU", cpu_value, False))),
+                    _field("target_system_name", escape_string(get_env_var(repository_ctx, "BAZEL_TARGET_SYSTEM", "local", False))),
+                    _field(
+                        "cxx_builtin_include_directory",
+                        _uniq(
+                            get_escaped_cxx_inc_directories(repository_ctx, cc, "-xc") +
+                            get_escaped_cxx_inc_directories(repository_ctx, cc, "-xc++") +
+                            get_escaped_cxx_inc_directories(
+                                repository_ctx,
+                                cc,
+                                "-xc",
+                                _get_no_canonical_prefixes_opt(repository_ctx, cc),
+                            ) +
+                            get_escaped_cxx_inc_directories(
+                                repository_ctx,
+                                cc,
+                                "-xc++",
+                                _get_no_canonical_prefixes_opt(repository_ctx, cc),
+                            ),
+                        ),
+                    ),
+                    _feature("supports_pic", True),
+                    _feature("supports_start_end_lib", True),
+                    _coverage_feature(repository_ctx, darwin),
+                ],
+            ),
+            "%{compile_content}": build_flags(
+                [
+                    # Security hardening requires optimization.
+                    # We need to undef it as some distributions now have it enabled by default.
+                    "-U_FORTIFY_SOURCE",
+                    "-fstack-protector",
+                    # All warnings are enabled. Maybe enable -Werror as well?
+                    "-Wall",
+                    # Enable a few more warnings that aren't part of -Wall.
+                ] + ((
+                    _add_compiler_option_if_supported(repository_ctx, cc, "-Wthread-safety") +
+                    _add_compiler_option_if_supported(repository_ctx, cc, "-Wself-assign")
+                )) + (
+                    # Disable problematic warnings.
+                    _add_compiler_option_if_supported(repository_ctx, cc, "-Wunused-but-set-parameter") +
+                    # has false positives
+                    _add_compiler_option_if_supported(repository_ctx, cc, "-Wno-free-nonheap-object") +
+                    # Enable coloring even if there's no attached terminal. Bazel removes the
+                    # escape sequences if --nocolor is specified.
+                    _add_compiler_option_if_supported(repository_ctx, cc, "-fcolor-diagnostics")
+                ) + [
+                    # Keep stack frames for debugging, even in opt mode.
+                    "-fno-omit-frame-pointer",
+                ],
+            ),
+            "%{cxx_content}": build_flags(
+                [
+                    "-std=c++0x",
+                ] + _escaped_cplus_include_paths(repository_ctx),
+            ),
+            "%{link_content}": build_flags((
+                ["-fuse-ld=gold"] if supports_gold_linker else []
+            ) + _add_linker_option_if_supported(
+                repository_ctx,
+                cc,
+                "-Wl,-no-as-needed",
+                "-no-as-needed",
+            ) + _add_linker_option_if_supported(
+                repository_ctx,
+                cc,
+                "-Wl,-z,relro,-z,now",
+                "-z",
+            ) + (
+                [
+                    "-undefined",
+                    "dynamic_lookup",
+                    "-headerpad_max_install_names",
+                ] if darwin else bin_search_flag + [
+                    # Gold linker only? Can we enable this by default?
+                    # "-Wl,--warn-execstack",
+                    # "-Wl,--detect-odr-violations"
+                ] + _add_compiler_option_if_supported(
+                    # Have gcc return the exit code from ld.
+                    repository_ctx,
+                    cc,
+                    "-pass-exit-codes",
+                )
+            ) + split_escaped(
+                get_env_var(repository_ctx, "BAZEL_LINKOPTS", "-lstdc++:-lm", False),
+                ":",
+            )),
+            "%{opt_compile_content}": build_flags(
+                [
+                    # No debug symbols.
+                    # Maybe we should enable https://gcc.gnu.org/wiki/DebugFission for opt or
+                    # even generally? However, that can't happen here, as it requires special
+                    # handling in Bazel.
+                    "-g0",
+
+                    # Conservative choice for -O
+                    # -O3 can increase binary size and even slow down the resulting binaries.
+                    # Profile first and / or use FDO if you need better performance than this.
+                    "-O2",
+
+                    # Security hardening on by default.
+                    # Conservative choice; -D_FORTIFY_SOURCE=2 may be unsafe in some cases.
+                    "-D_FORTIFY_SOURCE=1",
+
+                    # Disable assertions
+                    "-DNDEBUG",
+
+                    # Removal of unused code and data at link time (can this increase binary size in some cases?).
+                    "-ffunction-sections",
+                    "-fdata-sections",
+                ],
+            ),
+            "%{opt_link_content}": build_flags(
+                [] if darwin else _add_linker_option_if_supported(
+                    repository_ctx,
+                    cc,
+                    "-Wl,--gc-sections",
+                    "-gc-sections",
+                ),
+            ),
+            "%{unfiltered_content}": build_flags(
+                _get_no_canonical_prefixes_opt(repository_ctx, cc) + [
+                    # Make C++ compilation deterministic. Use linkstamping instead of these
+                    # compiler symbols.
+                    "-Wno-builtin-macro-redefined",
+                    "-D__DATE__=\\\"redacted\\\"",
+                    "-D__TIMESTAMP__=\\\"redacted\\\"",
+                    "-D__TIME__=\\\"redacted\\\"",
+                ],
+            ),
+            "%{dbg_compile_content}": build_flags(["-g"]),
             "%{msvc_env_tmp}": "",
             "%{msvc_env_path}": "",
             "%{msvc_env_include}": "",
@@ -546,9 +532,9 @@
             "%{msvc_ml_path}": "",
             "%{msvc_link_path}": "",
             "%{msvc_lib_path}": "",
-            "%{msys_x64_mingw_content}": "",
-            "%{dbg_mode_debug}": "",
-            "%{fastbuild_mode_debug}": "",
-            "%{compilation_mode_content}": "",
+            "%{msys_x64_mingw_top_level_content}": "",
+            "%{msys_x64_mingw_cxx_content}": "",
+            "%{msys_x64_mingw_link_content}": "",
+            "%{msvc_x64_top_level_content}": "",
         },
     )
diff --git a/tools/cpp/windows_cc_configure.bzl b/tools/cpp/windows_cc_configure.bzl
index c7d079e..4247839 100644
--- a/tools/cpp/windows_cc_configure.bzl
+++ b/tools/cpp/windows_cc_configure.bzl
@@ -18,6 +18,7 @@
     "@bazel_tools//tools/cpp:lib_cc_configure.bzl",
     "auto_configure_fail",
     "auto_configure_warning",
+    "build_flags",
     "escape_string",
     "execute",
     "get_env_var",
@@ -72,35 +73,31 @@
             '   tool_path { name: "objcopy" path: "%s" }\n' % tool_path["objcopy"] +
             '   tool_path { name: "objdump" path: "%s" }\n' % tool_path["objdump"] +
             '   tool_path { name: "strip" path: "%s" }\n' % tool_path["strip"] +
-            ((' cxx_builtin_include_directory: "%s/"\n' % tool_path_prefix) if msys_root else "") +
+            (('  cxx_builtin_include_directory: "%s/"\n' % tool_path_prefix) if msys_root else "") +
             '   artifact_name_pattern { category_name: "executable" prefix: "" extension: ".exe"}\n' +
-            '   cxx_flag: "-std=gnu++0x"\n' +
-            '   linker_flag: "-lstdc++"\n' +
-            '   objcopy_embed_flag: "-I"\n' +
-            '   objcopy_embed_flag: "binary"\n' +
             '   feature { name: "targets_windows" implies: "copy_dynamic_libraries_to_binary" enabled: true }\n' +
             '   feature { name: "copy_dynamic_libraries_to_binary" }\n' +
             "   feature {\n" +
-            '    name: "gcc_env"\n' +
-            "    enabled: true\n" +
-            "    env_set {\n" +
-            '      action: "c-compile"\n' +
-            '      action: "c++-compile"\n' +
-            '      action: "c++-module-compile"\n' +
-            '      action: "c++-module-codegen"\n' +
-            '      action: "c++-header-parsing"\n' +
-            '      action: "assemble"\n' +
-            '      action: "preprocess-assemble"\n' +
-            '      action: "c++-link-executable"\n' +
-            '      action: "c++-link-dynamic-library"\n' +
-            '      action: "c++-link-nodeps-dynamic-library"\n' +
-            '      action: "c++-link-static-library"\n' +
-            "      env_entry {\n" +
-            '        key: "PATH"\n' +
-            '        value: "%s"\n' % tool_bin_path +
-            "      }\n" +
-            "    }\n" +
-            "  }")
+            "     name: 'gcc_env'\n" +
+            "     enabled: true\n" +
+            "     env_set {\n" +
+            '       action: "c-compile"\n' +
+            '       action: "c++-compile"\n' +
+            '       action: "c++-module-compile"\n' +
+            '       action: "c++-module-codegen"\n' +
+            '       action: "c++-header-parsing"\n' +
+            '       action: "assemble"\n' +
+            '       action: "preprocess-assemble"\n' +
+            '       action: "c++-link-executable"\n' +
+            '       action: "c++-link-dynamic-library"\n' +
+            '       action: "c++-link-nodeps-dynamic-library"\n' +
+            '       action: "c++-link-static-library"\n' +
+            "       env_entry {\n" +
+            '         key: "PATH"\n' +
+            '         value: "%s"\n' % tool_bin_path +
+            "       }\n" +
+            "     }\n" +
+            "   }")
 
 def _get_system_root(repository_ctx):
     """Get System root path on Windows, default is C:\\\Windows. Doesn't %-escape the result."""
@@ -405,16 +402,20 @@
                 "%{msvc_ml_path}": "vc_installation_error.bat",
                 "%{msvc_link_path}": "vc_installation_error.bat",
                 "%{msvc_lib_path}": "vc_installation_error.bat",
+                "%{msys_x64_mingw_top_level_content}": _get_escaped_windows_msys_crosstool_content(repository_ctx, use_mingw = True),
+                "%{msys_x64_mingw_cxx_content}": build_flags(["-std=gnu++0x"]),
+                "%{msys_x64_mingw_link_content}": build_flags(["-lstdc++"]),
                 "%{dbg_mode_debug}": "/DEBUG",
                 "%{fastbuild_mode_debug}": "/DEBUG",
-                "%{compilation_mode_content}": "",
-                "%{content}": _get_escaped_windows_msys_crosstool_content(repository_ctx),
-                "%{msys_x64_mingw_content}": _get_escaped_windows_msys_crosstool_content(repository_ctx, use_mingw = True),
-                "%{opt_content}": "",
-                "%{dbg_content}": "",
-                "%{link_content}": "",
-                "%{cxx_builtin_include_directory}": "",
-                "%{coverage}": "",
+                "%{top_level_content}": _get_escaped_windows_msys_crosstool_content(repository_ctx),
+                "%{compile_content}": "",
+                "%{cxx_content}": build_flags(["-std=gnu++0x"]),
+                "%{link_content}": build_flags(["-lstdc++"]),
+                "%{opt_compile_content}": "",
+                "%{opt_link_content}": "",
+                "%{unfiltered_content}": "",
+                "%{dbg_compile_content}": "",
+                "%{msvc_x64_top_level_content}": "",
             },
         )
         return
@@ -478,12 +479,17 @@
             "%{msvc_lib_path}": lib_path,
             "%{dbg_mode_debug}": "/DEBUG:FULL" if support_debug_fastlink else "/DEBUG",
             "%{fastbuild_mode_debug}": "/DEBUG:FASTLINK" if support_debug_fastlink else "/DEBUG",
-            "%{content}": _get_escaped_windows_msys_crosstool_content(repository_ctx),
-            "%{msys_x64_mingw_content}": _get_escaped_windows_msys_crosstool_content(repository_ctx, use_mingw = True),
-            "%{opt_content}": "",
-            "%{dbg_content}": "",
-            "%{link_content}": "",
-            "%{cxx_builtin_include_directory}": "\n".join(escaped_cxx_include_directories),
-            "%{coverage}": "",
+            "%{top_level_content}": _get_escaped_windows_msys_crosstool_content(repository_ctx),
+            "%{msys_x64_mingw_top_level_content}": _get_escaped_windows_msys_crosstool_content(repository_ctx, use_mingw = True),
+            "%{msys_x64_mingw_cxx_content}": build_flags(["-std=gnu++0x"]),
+            "%{msys_x64_mingw_link_content}": build_flags(["-lstdc++"]),
+            "%{compile_content}": "",
+            "%{cxx_content}": build_flags(["-std=gnu++0x"]),
+            "%{link_content}": build_flags(["-lstdc++"]),
+            "%{opt_compile_content}": "",
+            "%{opt_link_content}": "",
+            "%{unfiltered_content}": "",
+            "%{dbg_compile_content}": "",
+            "%{msvc_x64_top_level_content}": "\n".join(escaped_cxx_include_directories),
         },
     )
diff --git a/tools/osx/crosstool/CROSSTOOL.tpl b/tools/osx/crosstool/CROSSTOOL.tpl
index 870e87d..58011d77 100644
--- a/tools/osx/crosstool/CROSSTOOL.tpl
+++ b/tools/osx/crosstool/CROSSTOOL.tpl
@@ -1,14 +1,7 @@
-
-# This file was auto-generated by a script maintained internally by
-# Google.
-
-
-
 major_version: "1"
 minor_version: "0"
 toolchain {
   toolchain_identifier: "darwin_x86_64"
-%{cxx_builtin_include_directory}
   host_system_name: "x86_64-apple-macosx"
   target_system_name: "x86_64-apple-macosx"
   target_cpu: "darwin_x86_64"
@@ -60,53 +53,12 @@
     name: "strip"
     path: "/usr/bin/strip"
   }
-  needsPic: false
-  compiler_flag: "-D_FORTIFY_SOURCE=1"
-  compiler_flag: "-fstack-protector"
-  compiler_flag: "-fcolor-diagnostics"
-  compiler_flag: "-Wall"
-  compiler_flag: "-Wthread-safety"
-  compiler_flag: "-Wself-assign"
-  compiler_flag: "-fno-omit-frame-pointer"
-  cxx_flag: "-std=c++11"
-  linker_flag: "-headerpad_max_install_names"
-  linker_flag: "-no-canonical-prefixes"
-  objcopy_embed_flag: "-I"
-  objcopy_embed_flag: "binary"
-  compilation_mode_flags {
-    mode: FASTBUILD
-    compiler_flag: "-O0"
-    compiler_flag: "-DDEBUG"
-  }
-  compilation_mode_flags {
-    mode: OPT
-    compiler_flag: "-g0"
-    compiler_flag: "-O2"
-    compiler_flag: "-D_FORTIFY_SOURCE=1"
-    compiler_flag: "-DNDEBUG"
-    compiler_flag: "-ffunction-sections"
-    compiler_flag: "-fdata-sections"
-  }
-  compilation_mode_flags {
-    mode: DBG
-    compiler_flag: "-g"
-  }
-  linking_mode_flags {
-    mode: DYNAMIC
-    linker_flag: "-undefined"
-    linker_flag: "dynamic_lookup"
-  }
   make_variable {
     name: "STACK_FRAME_UNLIMITED"
     value: "-Wframe-larger-than=100000000 -Wno-vla"
   }
+  %{cxx_builtin_include_directory}
   builtin_sysroot: ""
-  unfiltered_cxx_flag: "-no-canonical-prefixes"
-  unfiltered_cxx_flag: "-Wno-builtin-macro-redefined"
-  unfiltered_cxx_flag: "-D__DATE__=\"redacted\""
-  unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\""
-  unfiltered_cxx_flag: "-D__TIME__=\"redacted\""
-  default_python_version: "python2.7"
   feature {
     name: "fastbuild"
   }
@@ -149,23 +101,109 @@
     name: "only_doth_headers_in_module_maps"
   }
   feature {
-    name: "legacy_compile_flags"
+    name: "default_compile_flags"
     flag_set {
       action: "assemble"
       action: "preprocess-assemble"
+      action: "linkstamp-compile"
       action: "c-compile"
       action: "c++-compile"
       action: "c++-header-parsing"
       action: "c++-module-compile"
       action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
       action: "objc-compile"
       action: "objc++-compile"
       flag_group {
-        flag: "%{legacy_compile_flags}"
-        iterate_over: "legacy_compile_flags"
-        expand_if_all_available: "legacy_compile_flags"
+        flag: "-D_FORTIFY_SOURCE=1"
+        flag: "-fstack-protector"
+        flag: "-fcolor-diagnostics"
+        flag: "-Wall"
+        flag: "-Wthread-safety"
+        flag: "-Wself-assign"
+        flag: "-fno-omit-frame-pointer"
       }
     }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-O0"
+        flag: "-DDEBUG"
+      }
+      with_feature {
+        feature: "fastbuild"
+      }
+    }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-g0"
+        flag: "-O2"
+        flag: "-D_FORTIFY_SOURCE=1"
+        flag: "-DNDEBUG"
+        flag: "-ffunction-sections"
+        flag: "-fdata-sections"
+      }
+      with_feature {
+        feature: "opt"
+      }
+    }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-g"
+      }
+      with_feature {
+        feature: "dbg"
+      }
+    }
+    flag_set {
+      action: "linkstamp-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      flag_group {
+        flag: "-std=c++11"
+      }
+    }
+    enabled: true
   }
   feature {
     name: "debug_prefix_map_pwd_is_dot"
@@ -994,7 +1032,7 @@
     enabled: true
   }
   feature {
-    name: "legacy_link_flags"
+    name: "default_link_flags"
     flag_set {
       action: "c++-link-executable"
       action: "c++-link-dynamic-library"
@@ -1002,11 +1040,31 @@
       action: "objc-executable"
       action: "objc++-executable"
       flag_group {
-        flag: "%{legacy_link_flags}"
-        iterate_over: "legacy_link_flags"
-        expand_if_all_available: "legacy_link_flags"
+        flag: "-headerpad_max_install_names"
+        flag: "-no-canonical-prefixes"
       }
     }
+    flag_set {
+      action: "c++-link-nodeps-dynamic-library"
+      flag_group {
+        flag: "-undefined"
+        flag: "dynamic_lookup"
+      }
+    }
+    flag_set {
+      action: "c++-link-executable"
+      action: "c++-link-dynamic-library"
+      action: "objc-executable"
+      action: "objc++-executable"
+      flag_group {
+        flag: "-undefined"
+        flag: "dynamic_lookup"
+      }
+      with_feature {
+        feature: "dynamic_linking_mode"
+      }
+    }
+    enabled: true
   }
   feature {
     name: "version_min"
@@ -1109,12 +1167,12 @@
       action: "c++-module-compile"
       action: "c++-module-codegen"
       action: "linkstamp-compile"
-      action: "objc-compile"
-      action: "objc++-compile"
       flag_group {
-        flag: "%{unfiltered_compile_flags}"
-        iterate_over: "unfiltered_compile_flags"
-        expand_if_all_available: "unfiltered_compile_flags"
+        flag: "-no-canonical-prefixes"
+        flag: "-Wno-builtin-macro-redefined"
+        flag: "-D__DATE__=\"redacted\""
+        flag: "-D__TIMESTAMP__=\"redacted\""
+        flag: "-D__TIME__=\"redacted\""
       }
     }
   }
@@ -1185,6 +1243,24 @@
       }
     }
   }
+  feature {
+    name: "supports_dynamic_linker"
+    enabled: true
+  }
+  feature {
+    name: "objcopy_embed_flags"
+    flag_set {
+      action: "objcopy_embed_data"
+      flag_group {
+        flag: "-I"
+        flag: "binary"
+      }
+    }
+    enabled: true
+  }
+  feature {
+    name: "dynamic_linking_mode"
+  }
   action_config {
     config_name: "strip"
     action_name: "strip"
@@ -1219,7 +1295,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -1239,7 +1314,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -1259,7 +1333,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -1279,7 +1352,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -1299,7 +1371,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -1331,7 +1402,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -1362,7 +1432,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -1378,7 +1447,6 @@
     implies: "no_objc_arc"
     implies: "include_system_dirs"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -1398,7 +1466,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -1496,7 +1563,6 @@
     implies: "include_system_dirs"
     implies: "framework_paths"
     implies: "version_min"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "apple_env"
     implies: "apply_implicit_frameworks"
@@ -1568,7 +1634,6 @@
     implies: "include_system_dirs"
     implies: "framework_paths"
     implies: "version_min"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "apple_env"
     implies: "apply_implicit_frameworks"
@@ -1587,7 +1652,6 @@
     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"
@@ -1609,7 +1673,6 @@
     implies: "output_execpath_flags"
     implies: "runtime_root_flags"
     implies: "input_param_flags"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "linker_param_file"
     implies: "version_min"
@@ -1631,7 +1694,6 @@
     implies: "output_execpath_flags"
     implies: "runtime_root_flags"
     implies: "input_param_flags"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "linker_param_file"
     implies: "version_min"
@@ -1684,11 +1746,18 @@
     }
     implies: "apple_env"
   }
+  action_config {
+    config_name: "objcopy_embed_data"
+    action_name: "objcopy_embed_data"
+    tool {
+      tool_path: "/usr/bin/objcopy"
+    }
+    enabled: true
+  }
   cc_target_os: "apple"
 }
 toolchain {
   toolchain_identifier: "ios_x86_64"
-%{cxx_builtin_include_directory}
   host_system_name: "x86_64-apple-macosx"
   target_system_name: "x86_64-apple-ios"
   target_cpu: "ios_x86_64"
@@ -1740,52 +1809,12 @@
     name: "strip"
     path: "/usr/bin/strip"
   }
-  needsPic: false
-  compiler_flag: "-D_FORTIFY_SOURCE=1"
-  compiler_flag: "-fstack-protector"
-  compiler_flag: "-fcolor-diagnostics"
-  compiler_flag: "-Wall"
-  compiler_flag: "-Wthread-safety"
-  compiler_flag: "-Wself-assign"
-  compiler_flag: "-fno-omit-frame-pointer"
-  cxx_flag: "-std=c++11"
-  linker_flag: "-headerpad_max_install_names"
-  linker_flag: "-no-canonical-prefixes"
-  linker_flag: "-target"
-  linker_flag: "x86_64-apple-ios"
-  objcopy_embed_flag: "-I"
-  objcopy_embed_flag: "binary"
-  compilation_mode_flags {
-    mode: FASTBUILD
-    compiler_flag: "-O0"
-    compiler_flag: "-DDEBUG"
-  }
-  compilation_mode_flags {
-    mode: OPT
-    compiler_flag: "-g0"
-    compiler_flag: "-O2"
-    compiler_flag: "-D_FORTIFY_SOURCE=1"
-    compiler_flag: "-DNDEBUG"
-    compiler_flag: "-ffunction-sections"
-    compiler_flag: "-fdata-sections"
-  }
-  compilation_mode_flags {
-    mode: DBG
-    compiler_flag: "-g"
-  }
   make_variable {
     name: "STACK_FRAME_UNLIMITED"
     value: "-Wframe-larger-than=100000000 -Wno-vla"
   }
+  %{cxx_builtin_include_directory}
   builtin_sysroot: ""
-  unfiltered_cxx_flag: "-no-canonical-prefixes"
-  unfiltered_cxx_flag: "-Wno-builtin-macro-redefined"
-  unfiltered_cxx_flag: "-D__DATE__=\"redacted\""
-  unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\""
-  unfiltered_cxx_flag: "-D__TIME__=\"redacted\""
-  unfiltered_cxx_flag: "-target"
-  unfiltered_cxx_flag: "x86_64-apple-ios"
-  default_python_version: "python2.7"
   feature {
     name: "fastbuild"
   }
@@ -1828,23 +1857,109 @@
     name: "only_doth_headers_in_module_maps"
   }
   feature {
-    name: "legacy_compile_flags"
+    name: "default_compile_flags"
     flag_set {
       action: "assemble"
       action: "preprocess-assemble"
+      action: "linkstamp-compile"
       action: "c-compile"
       action: "c++-compile"
       action: "c++-header-parsing"
       action: "c++-module-compile"
       action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
       action: "objc-compile"
       action: "objc++-compile"
       flag_group {
-        flag: "%{legacy_compile_flags}"
-        iterate_over: "legacy_compile_flags"
-        expand_if_all_available: "legacy_compile_flags"
+        flag: "-D_FORTIFY_SOURCE=1"
+        flag: "-fstack-protector"
+        flag: "-fcolor-diagnostics"
+        flag: "-Wall"
+        flag: "-Wthread-safety"
+        flag: "-Wself-assign"
+        flag: "-fno-omit-frame-pointer"
       }
     }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-O0"
+        flag: "-DDEBUG"
+      }
+      with_feature {
+        feature: "fastbuild"
+      }
+    }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-g0"
+        flag: "-O2"
+        flag: "-D_FORTIFY_SOURCE=1"
+        flag: "-DNDEBUG"
+        flag: "-ffunction-sections"
+        flag: "-fdata-sections"
+      }
+      with_feature {
+        feature: "opt"
+      }
+    }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-g"
+      }
+      with_feature {
+        feature: "dbg"
+      }
+    }
+    flag_set {
+      action: "linkstamp-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      flag_group {
+        flag: "-std=c++11"
+      }
+    }
+    enabled: true
   }
   feature {
     name: "debug_prefix_map_pwd_is_dot"
@@ -2670,7 +2785,7 @@
     enabled: true
   }
   feature {
-    name: "legacy_link_flags"
+    name: "default_link_flags"
     flag_set {
       action: "c++-link-executable"
       action: "c++-link-dynamic-library"
@@ -2678,11 +2793,13 @@
       action: "objc-executable"
       action: "objc++-executable"
       flag_group {
-        flag: "%{legacy_link_flags}"
-        iterate_over: "legacy_link_flags"
-        expand_if_all_available: "legacy_link_flags"
+        flag: "-headerpad_max_install_names"
+        flag: "-no-canonical-prefixes"
+        flag: "-target"
+        flag: "x86_64-apple-ios"
       }
     }
+    enabled: true
   }
   feature {
     name: "version_min"
@@ -2787,12 +2904,14 @@
       action: "c++-module-compile"
       action: "c++-module-codegen"
       action: "linkstamp-compile"
-      action: "objc-compile"
-      action: "objc++-compile"
       flag_group {
-        flag: "%{unfiltered_compile_flags}"
-        iterate_over: "unfiltered_compile_flags"
-        expand_if_all_available: "unfiltered_compile_flags"
+        flag: "-no-canonical-prefixes"
+        flag: "-Wno-builtin-macro-redefined"
+        flag: "-D__DATE__=\"redacted\""
+        flag: "-D__TIMESTAMP__=\"redacted\""
+        flag: "-D__TIME__=\"redacted\""
+        flag: "-target"
+        flag: "x86_64-apple-ios"
       }
     }
   }
@@ -2863,6 +2982,17 @@
       }
     }
   }
+  feature {
+    name: "objcopy_embed_flags"
+    flag_set {
+      action: "objcopy_embed_data"
+      flag_group {
+        flag: "-I"
+        flag: "binary"
+      }
+    }
+    enabled: true
+  }
   action_config {
     config_name: "strip"
     action_name: "strip"
@@ -2897,7 +3027,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -2917,7 +3046,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -2937,7 +3065,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -2957,7 +3084,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -2977,7 +3103,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -3009,7 +3134,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -3041,7 +3165,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -3058,7 +3181,6 @@
     implies: "no_objc_arc"
     implies: "include_system_dirs"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -3078,7 +3200,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -3176,7 +3297,6 @@
     implies: "include_system_dirs"
     implies: "framework_paths"
     implies: "version_min"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "apple_env"
     implies: "apply_implicit_frameworks"
@@ -3248,7 +3368,6 @@
     implies: "include_system_dirs"
     implies: "framework_paths"
     implies: "version_min"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "apple_env"
     implies: "apply_implicit_frameworks"
@@ -3267,7 +3386,6 @@
     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"
@@ -3289,7 +3407,6 @@
     implies: "output_execpath_flags"
     implies: "runtime_root_flags"
     implies: "input_param_flags"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "linker_param_file"
     implies: "version_min"
@@ -3311,7 +3428,6 @@
     implies: "output_execpath_flags"
     implies: "runtime_root_flags"
     implies: "input_param_flags"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "linker_param_file"
     implies: "version_min"
@@ -3364,11 +3480,18 @@
     }
     implies: "apple_env"
   }
+  action_config {
+    config_name: "objcopy_embed_data"
+    action_name: "objcopy_embed_data"
+    tool {
+      tool_path: "/usr/bin/objcopy"
+    }
+    enabled: true
+  }
   cc_target_os: "apple"
 }
 toolchain {
   toolchain_identifier: "watchos_i386"
-%{cxx_builtin_include_directory}
   host_system_name: "x86_64-apple-macosx"
   target_system_name: "i386-apple-watchos"
   target_cpu: "watchos_i386"
@@ -3420,52 +3543,12 @@
     name: "strip"
     path: "/usr/bin/strip"
   }
-  needsPic: false
-  compiler_flag: "-D_FORTIFY_SOURCE=1"
-  compiler_flag: "-fstack-protector"
-  compiler_flag: "-fcolor-diagnostics"
-  compiler_flag: "-Wall"
-  compiler_flag: "-Wthread-safety"
-  compiler_flag: "-Wself-assign"
-  compiler_flag: "-fno-omit-frame-pointer"
-  cxx_flag: "-std=c++11"
-  linker_flag: "-headerpad_max_install_names"
-  linker_flag: "-no-canonical-prefixes"
-  linker_flag: "-target"
-  linker_flag: "i386-apple-watchos"
-  objcopy_embed_flag: "-I"
-  objcopy_embed_flag: "binary"
-  compilation_mode_flags {
-    mode: FASTBUILD
-    compiler_flag: "-O0"
-    compiler_flag: "-DDEBUG"
-  }
-  compilation_mode_flags {
-    mode: OPT
-    compiler_flag: "-g0"
-    compiler_flag: "-O2"
-    compiler_flag: "-D_FORTIFY_SOURCE=1"
-    compiler_flag: "-DNDEBUG"
-    compiler_flag: "-ffunction-sections"
-    compiler_flag: "-fdata-sections"
-  }
-  compilation_mode_flags {
-    mode: DBG
-    compiler_flag: "-g"
-  }
   make_variable {
     name: "STACK_FRAME_UNLIMITED"
     value: "-Wframe-larger-than=100000000 -Wno-vla"
   }
+  %{cxx_builtin_include_directory}
   builtin_sysroot: ""
-  unfiltered_cxx_flag: "-no-canonical-prefixes"
-  unfiltered_cxx_flag: "-Wno-builtin-macro-redefined"
-  unfiltered_cxx_flag: "-D__DATE__=\"redacted\""
-  unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\""
-  unfiltered_cxx_flag: "-D__TIME__=\"redacted\""
-  unfiltered_cxx_flag: "-target"
-  unfiltered_cxx_flag: "i386-apple-watchos"
-  default_python_version: "python2.7"
   feature {
     name: "fastbuild"
   }
@@ -3508,23 +3591,109 @@
     name: "only_doth_headers_in_module_maps"
   }
   feature {
-    name: "legacy_compile_flags"
+    name: "default_compile_flags"
     flag_set {
       action: "assemble"
       action: "preprocess-assemble"
+      action: "linkstamp-compile"
       action: "c-compile"
       action: "c++-compile"
       action: "c++-header-parsing"
       action: "c++-module-compile"
       action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
       action: "objc-compile"
       action: "objc++-compile"
       flag_group {
-        flag: "%{legacy_compile_flags}"
-        iterate_over: "legacy_compile_flags"
-        expand_if_all_available: "legacy_compile_flags"
+        flag: "-D_FORTIFY_SOURCE=1"
+        flag: "-fstack-protector"
+        flag: "-fcolor-diagnostics"
+        flag: "-Wall"
+        flag: "-Wthread-safety"
+        flag: "-Wself-assign"
+        flag: "-fno-omit-frame-pointer"
       }
     }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-O0"
+        flag: "-DDEBUG"
+      }
+      with_feature {
+        feature: "fastbuild"
+      }
+    }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-g0"
+        flag: "-O2"
+        flag: "-D_FORTIFY_SOURCE=1"
+        flag: "-DNDEBUG"
+        flag: "-ffunction-sections"
+        flag: "-fdata-sections"
+      }
+      with_feature {
+        feature: "opt"
+      }
+    }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-g"
+      }
+      with_feature {
+        feature: "dbg"
+      }
+    }
+    flag_set {
+      action: "linkstamp-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      flag_group {
+        flag: "-std=c++11"
+      }
+    }
+    enabled: true
   }
   feature {
     name: "debug_prefix_map_pwd_is_dot"
@@ -4352,7 +4521,7 @@
     enabled: true
   }
   feature {
-    name: "legacy_link_flags"
+    name: "default_link_flags"
     flag_set {
       action: "c++-link-executable"
       action: "c++-link-dynamic-library"
@@ -4360,11 +4529,13 @@
       action: "objc-executable"
       action: "objc++-executable"
       flag_group {
-        flag: "%{legacy_link_flags}"
-        iterate_over: "legacy_link_flags"
-        expand_if_all_available: "legacy_link_flags"
+        flag: "-headerpad_max_install_names"
+        flag: "-no-canonical-prefixes"
+        flag: "-target"
+        flag: "i386-apple-watchos"
       }
     }
+    enabled: true
   }
   feature {
     name: "version_min"
@@ -4469,12 +4640,14 @@
       action: "c++-module-compile"
       action: "c++-module-codegen"
       action: "linkstamp-compile"
-      action: "objc-compile"
-      action: "objc++-compile"
       flag_group {
-        flag: "%{unfiltered_compile_flags}"
-        iterate_over: "unfiltered_compile_flags"
-        expand_if_all_available: "unfiltered_compile_flags"
+        flag: "-no-canonical-prefixes"
+        flag: "-Wno-builtin-macro-redefined"
+        flag: "-D__DATE__=\"redacted\""
+        flag: "-D__TIMESTAMP__=\"redacted\""
+        flag: "-D__TIME__=\"redacted\""
+        flag: "-target"
+        flag: "i386-apple-watchos"
       }
     }
   }
@@ -4545,6 +4718,17 @@
       }
     }
   }
+  feature {
+    name: "objcopy_embed_flags"
+    flag_set {
+      action: "objcopy_embed_data"
+      flag_group {
+        flag: "-I"
+        flag: "binary"
+      }
+    }
+    enabled: true
+  }
   action_config {
     config_name: "strip"
     action_name: "strip"
@@ -4579,7 +4763,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -4599,7 +4782,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -4619,7 +4801,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -4639,7 +4820,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -4659,7 +4839,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -4691,7 +4870,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -4723,7 +4901,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -4740,7 +4917,6 @@
     implies: "no_objc_arc"
     implies: "include_system_dirs"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -4760,7 +4936,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -4858,7 +5033,6 @@
     implies: "include_system_dirs"
     implies: "framework_paths"
     implies: "version_min"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "apple_env"
     implies: "apply_implicit_frameworks"
@@ -4930,7 +5104,6 @@
     implies: "include_system_dirs"
     implies: "framework_paths"
     implies: "version_min"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "apple_env"
     implies: "apply_implicit_frameworks"
@@ -4949,7 +5122,6 @@
     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"
@@ -4971,7 +5143,6 @@
     implies: "output_execpath_flags"
     implies: "runtime_root_flags"
     implies: "input_param_flags"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "linker_param_file"
     implies: "version_min"
@@ -4993,7 +5164,6 @@
     implies: "output_execpath_flags"
     implies: "runtime_root_flags"
     implies: "input_param_flags"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "linker_param_file"
     implies: "version_min"
@@ -5046,11 +5216,18 @@
     }
     implies: "apple_env"
   }
+  action_config {
+    config_name: "objcopy_embed_data"
+    action_name: "objcopy_embed_data"
+    tool {
+      tool_path: "/usr/bin/objcopy"
+    }
+    enabled: true
+  }
   cc_target_os: "apple"
 }
 toolchain {
   toolchain_identifier: "watchos_x86_64"
-%{cxx_builtin_include_directory}
   host_system_name: "x86_64-apple-macosx"
   target_system_name: "x86_64-apple-watchos"
   target_cpu: "watchos_x86_64"
@@ -5102,47 +5279,11 @@
     name: "strip"
     path: "/usr/bin/strip"
   }
-  compiler_flag: "-D_FORTIFY_SOURCE=1"
-  compiler_flag: "-fstack-protector"
-  compiler_flag: "-fcolor-diagnostics"
-  compiler_flag: "-Wall"
-  compiler_flag: "-Wthread-safety"
-  compiler_flag: "-Wself-assign"
-  compiler_flag: "-fno-omit-frame-pointer"
-  cxx_flag: "-std=c++11"
-  linker_flag: "-headerpad_max_install_names"
-  linker_flag: "-no-canonical-prefixes"
-  objcopy_embed_flag: "-I"
-  objcopy_embed_flag: "binary"
-  compilation_mode_flags {
-    mode: FASTBUILD
-    compiler_flag: "-O0"
-    compiler_flag: "-DDEBUG"
-  }
-  compilation_mode_flags {
-    mode: OPT
-    compiler_flag: "-g0"
-    compiler_flag: "-O2"
-    compiler_flag: "-D_FORTIFY_SOURCE=1"
-    compiler_flag: "-DNDEBUG"
-    compiler_flag: "-ffunction-sections"
-    compiler_flag: "-fdata-sections"
-    compiler_flag: "-DNS_BLOCK_ASSERTIONS=1"
-  }
-  compilation_mode_flags {
-    mode: DBG
-    compiler_flag: "-g"
-  }
   make_variable {
     name: "STACK_FRAME_UNLIMITED"
     value: "-Wframe-larger-than=100000000 -Wno-vla"
   }
-  unfiltered_cxx_flag: "-no-canonical-prefixes"
-  unfiltered_cxx_flag: "-Wno-builtin-macro-redefined"
-  unfiltered_cxx_flag: "-D__DATE__=\"redacted\""
-  unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\""
-  unfiltered_cxx_flag: "-D__TIME__=\"redacted\""
-  default_python_version: "python2.7"
+  %{cxx_builtin_include_directory}
   feature {
     name: "fastbuild"
   }
@@ -5185,23 +5326,110 @@
     name: "only_doth_headers_in_module_maps"
   }
   feature {
-    name: "legacy_compile_flags"
+    name: "default_compile_flags"
     flag_set {
       action: "assemble"
       action: "preprocess-assemble"
+      action: "linkstamp-compile"
       action: "c-compile"
       action: "c++-compile"
       action: "c++-header-parsing"
       action: "c++-module-compile"
       action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
       action: "objc-compile"
       action: "objc++-compile"
       flag_group {
-        flag: "%{legacy_compile_flags}"
-        iterate_over: "legacy_compile_flags"
-        expand_if_all_available: "legacy_compile_flags"
+        flag: "-D_FORTIFY_SOURCE=1"
+        flag: "-fstack-protector"
+        flag: "-fcolor-diagnostics"
+        flag: "-Wall"
+        flag: "-Wthread-safety"
+        flag: "-Wself-assign"
+        flag: "-fno-omit-frame-pointer"
       }
     }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-O0"
+        flag: "-DDEBUG"
+      }
+      with_feature {
+        feature: "fastbuild"
+      }
+    }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-g0"
+        flag: "-O2"
+        flag: "-D_FORTIFY_SOURCE=1"
+        flag: "-DNDEBUG"
+        flag: "-ffunction-sections"
+        flag: "-fdata-sections"
+        flag: "-DNS_BLOCK_ASSERTIONS=1"
+      }
+      with_feature {
+        feature: "opt"
+      }
+    }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-g"
+      }
+      with_feature {
+        feature: "dbg"
+      }
+    }
+    flag_set {
+      action: "linkstamp-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      flag_group {
+        flag: "-std=c++11"
+      }
+    }
+    enabled: true
   }
   feature {
     name: "debug_prefix_map_pwd_is_dot"
@@ -6029,7 +6257,7 @@
     enabled: true
   }
   feature {
-    name: "legacy_link_flags"
+    name: "default_link_flags"
     flag_set {
       action: "c++-link-executable"
       action: "c++-link-dynamic-library"
@@ -6037,11 +6265,11 @@
       action: "objc-executable"
       action: "objc++-executable"
       flag_group {
-        flag: "%{legacy_link_flags}"
-        iterate_over: "legacy_link_flags"
-        expand_if_all_available: "legacy_link_flags"
+        flag: "-headerpad_max_install_names"
+        flag: "-no-canonical-prefixes"
       }
     }
+    enabled: true
   }
   feature {
     name: "version_min"
@@ -6146,12 +6374,12 @@
       action: "c++-module-compile"
       action: "c++-module-codegen"
       action: "linkstamp-compile"
-      action: "objc-compile"
-      action: "objc++-compile"
       flag_group {
-        flag: "%{unfiltered_compile_flags}"
-        iterate_over: "unfiltered_compile_flags"
-        expand_if_all_available: "unfiltered_compile_flags"
+        flag: "-no-canonical-prefixes"
+        flag: "-Wno-builtin-macro-redefined"
+        flag: "-D__DATE__=\"redacted\""
+        flag: "-D__TIMESTAMP__=\"redacted\""
+        flag: "-D__TIME__=\"redacted\""
       }
     }
   }
@@ -6222,6 +6450,17 @@
       }
     }
   }
+  feature {
+    name: "objcopy_embed_flags"
+    flag_set {
+      action: "objcopy_embed_data"
+      flag_group {
+        flag: "-I"
+        flag: "binary"
+      }
+    }
+    enabled: true
+  }
   action_config {
     config_name: "strip"
     action_name: "strip"
@@ -6256,7 +6495,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -6276,7 +6514,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -6296,7 +6533,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -6316,7 +6552,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -6336,7 +6571,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -6368,7 +6602,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -6400,7 +6633,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -6417,7 +6649,6 @@
     implies: "no_objc_arc"
     implies: "include_system_dirs"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -6437,7 +6668,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -6535,7 +6765,6 @@
     implies: "include_system_dirs"
     implies: "framework_paths"
     implies: "version_min"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "apple_env"
     implies: "apply_implicit_frameworks"
@@ -6607,7 +6836,6 @@
     implies: "include_system_dirs"
     implies: "framework_paths"
     implies: "version_min"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "apple_env"
     implies: "apply_implicit_frameworks"
@@ -6626,7 +6854,6 @@
     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"
@@ -6648,7 +6875,6 @@
     implies: "output_execpath_flags"
     implies: "runtime_root_flags"
     implies: "input_param_flags"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "linker_param_file"
     implies: "version_min"
@@ -6670,7 +6896,6 @@
     implies: "output_execpath_flags"
     implies: "runtime_root_flags"
     implies: "input_param_flags"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "linker_param_file"
     implies: "version_min"
@@ -6723,11 +6948,18 @@
     }
     implies: "apple_env"
   }
+  action_config {
+    config_name: "objcopy_embed_data"
+    action_name: "objcopy_embed_data"
+    tool {
+      tool_path: "/usr/bin/objcopy"
+    }
+    enabled: true
+  }
   cc_target_os: "apple"
 }
 toolchain {
   toolchain_identifier: "watchos_arm64_32"
-%{cxx_builtin_include_directory}
   host_system_name: "x86_64-apple-macosx"
   target_system_name: "arm64_32-apple-watchos"
   target_cpu: "watchos_arm64_32"
@@ -6779,47 +7011,11 @@
     name: "strip"
     path: "/usr/bin/strip"
   }
-  compiler_flag: "-D_FORTIFY_SOURCE=1"
-  compiler_flag: "-fstack-protector"
-  compiler_flag: "-fcolor-diagnostics"
-  compiler_flag: "-Wall"
-  compiler_flag: "-Wthread-safety"
-  compiler_flag: "-Wself-assign"
-  compiler_flag: "-fno-omit-frame-pointer"
-  cxx_flag: "-std=c++11"
-  linker_flag: "-headerpad_max_install_names"
-  linker_flag: "-no-canonical-prefixes"
-  objcopy_embed_flag: "-I"
-  objcopy_embed_flag: "binary"
-  compilation_mode_flags {
-    mode: FASTBUILD
-    compiler_flag: "-O0"
-    compiler_flag: "-DDEBUG"
-  }
-  compilation_mode_flags {
-    mode: OPT
-    compiler_flag: "-g0"
-    compiler_flag: "-O2"
-    compiler_flag: "-D_FORTIFY_SOURCE=1"
-    compiler_flag: "-DNDEBUG"
-    compiler_flag: "-ffunction-sections"
-    compiler_flag: "-fdata-sections"
-    compiler_flag: "-DNS_BLOCK_ASSERTIONS=1"
-  }
-  compilation_mode_flags {
-    mode: DBG
-    compiler_flag: "-g"
-  }
   make_variable {
     name: "STACK_FRAME_UNLIMITED"
     value: "-Wframe-larger-than=100000000 -Wno-vla"
   }
-  unfiltered_cxx_flag: "-no-canonical-prefixes"
-  unfiltered_cxx_flag: "-Wno-builtin-macro-redefined"
-  unfiltered_cxx_flag: "-D__DATE__=\"redacted\""
-  unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\""
-  unfiltered_cxx_flag: "-D__TIME__=\"redacted\""
-  default_python_version: "python2.7"
+  %{cxx_builtin_include_directory}
   feature {
     name: "fastbuild"
   }
@@ -6862,23 +7058,110 @@
     name: "only_doth_headers_in_module_maps"
   }
   feature {
-    name: "legacy_compile_flags"
+    name: "default_compile_flags"
     flag_set {
       action: "assemble"
       action: "preprocess-assemble"
+      action: "linkstamp-compile"
       action: "c-compile"
       action: "c++-compile"
       action: "c++-header-parsing"
       action: "c++-module-compile"
       action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
       action: "objc-compile"
       action: "objc++-compile"
       flag_group {
-        flag: "%{legacy_compile_flags}"
-        iterate_over: "legacy_compile_flags"
-        expand_if_all_available: "legacy_compile_flags"
+        flag: "-D_FORTIFY_SOURCE=1"
+        flag: "-fstack-protector"
+        flag: "-fcolor-diagnostics"
+        flag: "-Wall"
+        flag: "-Wthread-safety"
+        flag: "-Wself-assign"
+        flag: "-fno-omit-frame-pointer"
       }
     }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-O0"
+        flag: "-DDEBUG"
+      }
+      with_feature {
+        feature: "fastbuild"
+      }
+    }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-g0"
+        flag: "-O2"
+        flag: "-D_FORTIFY_SOURCE=1"
+        flag: "-DNDEBUG"
+        flag: "-ffunction-sections"
+        flag: "-fdata-sections"
+        flag: "-DNS_BLOCK_ASSERTIONS=1"
+      }
+      with_feature {
+        feature: "opt"
+      }
+    }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-g"
+      }
+      with_feature {
+        feature: "dbg"
+      }
+    }
+    flag_set {
+      action: "linkstamp-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      flag_group {
+        flag: "-std=c++11"
+      }
+    }
+    enabled: true
   }
   feature {
     name: "debug_prefix_map_pwd_is_dot"
@@ -7706,7 +7989,7 @@
     enabled: true
   }
   feature {
-    name: "legacy_link_flags"
+    name: "default_link_flags"
     flag_set {
       action: "c++-link-executable"
       action: "c++-link-dynamic-library"
@@ -7714,11 +7997,11 @@
       action: "objc-executable"
       action: "objc++-executable"
       flag_group {
-        flag: "%{legacy_link_flags}"
-        iterate_over: "legacy_link_flags"
-        expand_if_all_available: "legacy_link_flags"
+        flag: "-headerpad_max_install_names"
+        flag: "-no-canonical-prefixes"
       }
     }
+    enabled: true
   }
   feature {
     name: "version_min"
@@ -7813,12 +8096,12 @@
       action: "c++-module-compile"
       action: "c++-module-codegen"
       action: "linkstamp-compile"
-      action: "objc-compile"
-      action: "objc++-compile"
       flag_group {
-        flag: "%{unfiltered_compile_flags}"
-        iterate_over: "unfiltered_compile_flags"
-        expand_if_all_available: "unfiltered_compile_flags"
+        flag: "-no-canonical-prefixes"
+        flag: "-Wno-builtin-macro-redefined"
+        flag: "-D__DATE__=\"redacted\""
+        flag: "-D__TIMESTAMP__=\"redacted\""
+        flag: "-D__TIME__=\"redacted\""
       }
     }
   }
@@ -7889,6 +8172,17 @@
       }
     }
   }
+  feature {
+    name: "objcopy_embed_flags"
+    flag_set {
+      action: "objcopy_embed_data"
+      flag_group {
+        flag: "-I"
+        flag: "binary"
+      }
+    }
+    enabled: true
+  }
   action_config {
     config_name: "strip"
     action_name: "strip"
@@ -7923,7 +8217,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -7943,7 +8236,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -7963,7 +8255,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -7983,7 +8274,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -8003,7 +8293,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -8035,7 +8324,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -8066,7 +8354,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -8082,7 +8369,6 @@
     implies: "no_objc_arc"
     implies: "include_system_dirs"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -8102,7 +8388,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -8200,7 +8485,6 @@
     implies: "include_system_dirs"
     implies: "framework_paths"
     implies: "version_min"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "apple_env"
     implies: "apply_implicit_frameworks"
@@ -8272,7 +8556,6 @@
     implies: "include_system_dirs"
     implies: "framework_paths"
     implies: "version_min"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "apple_env"
     implies: "apply_implicit_frameworks"
@@ -8291,7 +8574,6 @@
     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"
@@ -8313,7 +8595,6 @@
     implies: "output_execpath_flags"
     implies: "runtime_root_flags"
     implies: "input_param_flags"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "linker_param_file"
     implies: "version_min"
@@ -8335,7 +8616,6 @@
     implies: "output_execpath_flags"
     implies: "runtime_root_flags"
     implies: "input_param_flags"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "linker_param_file"
     implies: "version_min"
@@ -8388,11 +8668,18 @@
     }
     implies: "apple_env"
   }
+  action_config {
+    config_name: "objcopy_embed_data"
+    action_name: "objcopy_embed_data"
+    tool {
+      tool_path: "/usr/bin/objcopy"
+    }
+    enabled: true
+  }
   cc_target_os: "apple"
 }
 toolchain {
   toolchain_identifier: "tvos_x86_64"
-%{cxx_builtin_include_directory}
   host_system_name: "x86_64-apple-macosx"
   target_system_name: "x86_64-apple-tvos"
   target_cpu: "tvos_x86_64"
@@ -8444,53 +8731,12 @@
     name: "strip"
     path: "/usr/bin/strip"
   }
-  needsPic: false
-  compiler_flag: "-D_FORTIFY_SOURCE=1"
-  compiler_flag: "-fstack-protector"
-  compiler_flag: "-fcolor-diagnostics"
-  compiler_flag: "-Wall"
-  compiler_flag: "-Wthread-safety"
-  compiler_flag: "-Wself-assign"
-  compiler_flag: "-fno-omit-frame-pointer"
-  cxx_flag: "-std=c++11"
-  linker_flag: "-headerpad_max_install_names"
-  linker_flag: "-no-canonical-prefixes"
-  linker_flag: "-target"
-  linker_flag: "x86_64-apple-tvos"
-  objcopy_embed_flag: "-I"
-  objcopy_embed_flag: "binary"
-  compilation_mode_flags {
-    mode: FASTBUILD
-    compiler_flag: "-O0"
-    compiler_flag: "-DDEBUG"
-  }
-  compilation_mode_flags {
-    mode: OPT
-    compiler_flag: "-g0"
-    compiler_flag: "-O2"
-    compiler_flag: "-D_FORTIFY_SOURCE=1"
-    compiler_flag: "-DNDEBUG"
-    compiler_flag: "-ffunction-sections"
-    compiler_flag: "-fdata-sections"
-    compiler_flag: "-DNS_BLOCK_ASSERTIONS=1"
-  }
-  compilation_mode_flags {
-    mode: DBG
-    compiler_flag: "-g"
-  }
   make_variable {
     name: "STACK_FRAME_UNLIMITED"
     value: "-Wframe-larger-than=100000000 -Wno-vla"
   }
+  %{cxx_builtin_include_directory}
   builtin_sysroot: ""
-  unfiltered_cxx_flag: "-no-canonical-prefixes"
-  unfiltered_cxx_flag: "-Wno-builtin-macro-redefined"
-  unfiltered_cxx_flag: "-D__DATE__=\"redacted\""
-  unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\""
-  unfiltered_cxx_flag: "-D__TIME__=\"redacted\""
-  unfiltered_cxx_flag: "-target"
-  unfiltered_cxx_flag: "x86_64-apple-tvos"
-  default_python_version: "python2.7"
   feature {
     name: "fastbuild"
   }
@@ -8533,23 +8779,110 @@
     name: "only_doth_headers_in_module_maps"
   }
   feature {
-    name: "legacy_compile_flags"
+    name: "default_compile_flags"
     flag_set {
       action: "assemble"
       action: "preprocess-assemble"
+      action: "linkstamp-compile"
       action: "c-compile"
       action: "c++-compile"
       action: "c++-header-parsing"
       action: "c++-module-compile"
       action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
       action: "objc-compile"
       action: "objc++-compile"
       flag_group {
-        flag: "%{legacy_compile_flags}"
-        iterate_over: "legacy_compile_flags"
-        expand_if_all_available: "legacy_compile_flags"
+        flag: "-D_FORTIFY_SOURCE=1"
+        flag: "-fstack-protector"
+        flag: "-fcolor-diagnostics"
+        flag: "-Wall"
+        flag: "-Wthread-safety"
+        flag: "-Wself-assign"
+        flag: "-fno-omit-frame-pointer"
       }
     }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-O0"
+        flag: "-DDEBUG"
+      }
+      with_feature {
+        feature: "fastbuild"
+      }
+    }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-g0"
+        flag: "-O2"
+        flag: "-D_FORTIFY_SOURCE=1"
+        flag: "-DNDEBUG"
+        flag: "-ffunction-sections"
+        flag: "-fdata-sections"
+        flag: "-DNS_BLOCK_ASSERTIONS=1"
+      }
+      with_feature {
+        feature: "opt"
+      }
+    }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-g"
+      }
+      with_feature {
+        feature: "dbg"
+      }
+    }
+    flag_set {
+      action: "linkstamp-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      flag_group {
+        flag: "-std=c++11"
+      }
+    }
+    enabled: true
   }
   feature {
     name: "debug_prefix_map_pwd_is_dot"
@@ -9375,7 +9708,7 @@
     enabled: true
   }
   feature {
-    name: "legacy_link_flags"
+    name: "default_link_flags"
     flag_set {
       action: "c++-link-executable"
       action: "c++-link-dynamic-library"
@@ -9383,11 +9716,13 @@
       action: "objc-executable"
       action: "objc++-executable"
       flag_group {
-        flag: "%{legacy_link_flags}"
-        iterate_over: "legacy_link_flags"
-        expand_if_all_available: "legacy_link_flags"
+        flag: "-headerpad_max_install_names"
+        flag: "-no-canonical-prefixes"
+        flag: "-target"
+        flag: "x86_64-apple-tvos"
       }
     }
+    enabled: true
   }
   feature {
     name: "version_min"
@@ -9513,12 +9848,14 @@
       action: "c++-module-compile"
       action: "c++-module-codegen"
       action: "linkstamp-compile"
-      action: "objc-compile"
-      action: "objc++-compile"
       flag_group {
-        flag: "%{unfiltered_compile_flags}"
-        iterate_over: "unfiltered_compile_flags"
-        expand_if_all_available: "unfiltered_compile_flags"
+        flag: "-no-canonical-prefixes"
+        flag: "-Wno-builtin-macro-redefined"
+        flag: "-D__DATE__=\"redacted\""
+        flag: "-D__TIMESTAMP__=\"redacted\""
+        flag: "-D__TIME__=\"redacted\""
+        flag: "-target"
+        flag: "x86_64-apple-tvos"
       }
     }
   }
@@ -9589,6 +9926,17 @@
       }
     }
   }
+  feature {
+    name: "objcopy_embed_flags"
+    flag_set {
+      action: "objcopy_embed_data"
+      flag_group {
+        flag: "-I"
+        flag: "binary"
+      }
+    }
+    enabled: true
+  }
   action_config {
     config_name: "strip"
     action_name: "strip"
@@ -9623,7 +9971,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -9644,7 +9991,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -9665,7 +10011,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -9685,7 +10030,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -9706,7 +10050,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -9739,7 +10082,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -9771,7 +10113,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -9788,7 +10129,6 @@
     implies: "no_objc_arc"
     implies: "include_system_dirs"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -9809,7 +10149,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -9908,7 +10247,6 @@
     implies: "include_system_dirs"
     implies: "framework_paths"
     implies: "version_min"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "apple_env"
     implies: "apply_implicit_frameworks"
@@ -9980,7 +10318,6 @@
     implies: "include_system_dirs"
     implies: "framework_paths"
     implies: "version_min"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "apple_env"
     implies: "apply_implicit_frameworks"
@@ -9999,7 +10336,6 @@
     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"
@@ -10022,7 +10358,6 @@
     implies: "output_execpath_flags"
     implies: "runtime_root_flags"
     implies: "input_param_flags"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "linker_param_file"
     implies: "version_min"
@@ -10045,7 +10380,6 @@
     implies: "output_execpath_flags"
     implies: "runtime_root_flags"
     implies: "input_param_flags"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "linker_param_file"
     implies: "version_min"
@@ -10099,11 +10433,18 @@
     }
     implies: "apple_env"
   }
+  action_config {
+    config_name: "objcopy_embed_data"
+    action_name: "objcopy_embed_data"
+    tool {
+      tool_path: "/usr/bin/objcopy"
+    }
+    enabled: true
+  }
   cc_target_os: "apple"
 }
 toolchain {
   toolchain_identifier: "ios_i386"
-%{cxx_builtin_include_directory}
   host_system_name: "x86_64-apple-macosx"
   target_system_name: "i386-apple-ios"
   target_cpu: "ios_i386"
@@ -10155,52 +10496,12 @@
     name: "strip"
     path: "/usr/bin/strip"
   }
-  needsPic: false
-  compiler_flag: "-D_FORTIFY_SOURCE=1"
-  compiler_flag: "-fstack-protector"
-  compiler_flag: "-fcolor-diagnostics"
-  compiler_flag: "-Wall"
-  compiler_flag: "-Wthread-safety"
-  compiler_flag: "-Wself-assign"
-  compiler_flag: "-fno-omit-frame-pointer"
-  cxx_flag: "-std=c++11"
-  linker_flag: "-headerpad_max_install_names"
-  linker_flag: "-no-canonical-prefixes"
-  linker_flag: "-target"
-  linker_flag: "i386-apple-ios"
-  objcopy_embed_flag: "-I"
-  objcopy_embed_flag: "binary"
-  compilation_mode_flags {
-    mode: FASTBUILD
-    compiler_flag: "-O0"
-    compiler_flag: "-DDEBUG"
-  }
-  compilation_mode_flags {
-    mode: OPT
-    compiler_flag: "-g0"
-    compiler_flag: "-O2"
-    compiler_flag: "-D_FORTIFY_SOURCE=1"
-    compiler_flag: "-DNDEBUG"
-    compiler_flag: "-ffunction-sections"
-    compiler_flag: "-fdata-sections"
-  }
-  compilation_mode_flags {
-    mode: DBG
-    compiler_flag: "-g"
-  }
   make_variable {
     name: "STACK_FRAME_UNLIMITED"
     value: "-Wframe-larger-than=100000000 -Wno-vla"
   }
+  %{cxx_builtin_include_directory}
   builtin_sysroot: ""
-  unfiltered_cxx_flag: "-no-canonical-prefixes"
-  unfiltered_cxx_flag: "-Wno-builtin-macro-redefined"
-  unfiltered_cxx_flag: "-D__DATE__=\"redacted\""
-  unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\""
-  unfiltered_cxx_flag: "-D__TIME__=\"redacted\""
-  unfiltered_cxx_flag: "-target"
-  unfiltered_cxx_flag: "i386-apple-ios"
-  default_python_version: "python2.7"
   feature {
     name: "fastbuild"
   }
@@ -10243,23 +10544,109 @@
     name: "only_doth_headers_in_module_maps"
   }
   feature {
-    name: "legacy_compile_flags"
+    name: "default_compile_flags"
     flag_set {
       action: "assemble"
       action: "preprocess-assemble"
+      action: "linkstamp-compile"
       action: "c-compile"
       action: "c++-compile"
       action: "c++-header-parsing"
       action: "c++-module-compile"
       action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
       action: "objc-compile"
       action: "objc++-compile"
       flag_group {
-        flag: "%{legacy_compile_flags}"
-        iterate_over: "legacy_compile_flags"
-        expand_if_all_available: "legacy_compile_flags"
+        flag: "-D_FORTIFY_SOURCE=1"
+        flag: "-fstack-protector"
+        flag: "-fcolor-diagnostics"
+        flag: "-Wall"
+        flag: "-Wthread-safety"
+        flag: "-Wself-assign"
+        flag: "-fno-omit-frame-pointer"
       }
     }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-O0"
+        flag: "-DDEBUG"
+      }
+      with_feature {
+        feature: "fastbuild"
+      }
+    }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-g0"
+        flag: "-O2"
+        flag: "-D_FORTIFY_SOURCE=1"
+        flag: "-DNDEBUG"
+        flag: "-ffunction-sections"
+        flag: "-fdata-sections"
+      }
+      with_feature {
+        feature: "opt"
+      }
+    }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-g"
+      }
+      with_feature {
+        feature: "dbg"
+      }
+    }
+    flag_set {
+      action: "linkstamp-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      flag_group {
+        flag: "-std=c++11"
+      }
+    }
+    enabled: true
   }
   feature {
     name: "debug_prefix_map_pwd_is_dot"
@@ -11085,7 +11472,7 @@
     enabled: true
   }
   feature {
-    name: "legacy_link_flags"
+    name: "default_link_flags"
     flag_set {
       action: "c++-link-executable"
       action: "c++-link-dynamic-library"
@@ -11093,11 +11480,13 @@
       action: "objc-executable"
       action: "objc++-executable"
       flag_group {
-        flag: "%{legacy_link_flags}"
-        iterate_over: "legacy_link_flags"
-        expand_if_all_available: "legacy_link_flags"
+        flag: "-headerpad_max_install_names"
+        flag: "-no-canonical-prefixes"
+        flag: "-target"
+        flag: "i386-apple-ios"
       }
     }
+    enabled: true
   }
   feature {
     name: "version_min"
@@ -11202,12 +11591,14 @@
       action: "c++-module-compile"
       action: "c++-module-codegen"
       action: "linkstamp-compile"
-      action: "objc-compile"
-      action: "objc++-compile"
       flag_group {
-        flag: "%{unfiltered_compile_flags}"
-        iterate_over: "unfiltered_compile_flags"
-        expand_if_all_available: "unfiltered_compile_flags"
+        flag: "-no-canonical-prefixes"
+        flag: "-Wno-builtin-macro-redefined"
+        flag: "-D__DATE__=\"redacted\""
+        flag: "-D__TIMESTAMP__=\"redacted\""
+        flag: "-D__TIME__=\"redacted\""
+        flag: "-target"
+        flag: "i386-apple-ios"
       }
     }
   }
@@ -11278,6 +11669,17 @@
       }
     }
   }
+  feature {
+    name: "objcopy_embed_flags"
+    flag_set {
+      action: "objcopy_embed_data"
+      flag_group {
+        flag: "-I"
+        flag: "binary"
+      }
+    }
+    enabled: true
+  }
   action_config {
     config_name: "strip"
     action_name: "strip"
@@ -11312,7 +11714,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -11332,7 +11733,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -11352,7 +11752,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -11372,7 +11771,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -11392,7 +11790,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -11424,7 +11821,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -11456,7 +11852,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -11473,7 +11868,6 @@
     implies: "no_objc_arc"
     implies: "include_system_dirs"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -11493,7 +11887,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -11591,7 +11984,6 @@
     implies: "include_system_dirs"
     implies: "framework_paths"
     implies: "version_min"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "apple_env"
     implies: "apply_implicit_frameworks"
@@ -11663,7 +12055,6 @@
     implies: "include_system_dirs"
     implies: "framework_paths"
     implies: "version_min"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "apple_env"
     implies: "apply_implicit_frameworks"
@@ -11682,7 +12073,6 @@
     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"
@@ -11704,7 +12094,6 @@
     implies: "output_execpath_flags"
     implies: "runtime_root_flags"
     implies: "input_param_flags"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "linker_param_file"
     implies: "version_min"
@@ -11726,7 +12115,6 @@
     implies: "output_execpath_flags"
     implies: "runtime_root_flags"
     implies: "input_param_flags"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "linker_param_file"
     implies: "version_min"
@@ -11779,11 +12167,18 @@
     }
     implies: "apple_env"
   }
+  action_config {
+    config_name: "objcopy_embed_data"
+    action_name: "objcopy_embed_data"
+    tool {
+      tool_path: "/usr/bin/objcopy"
+    }
+    enabled: true
+  }
   cc_target_os: "apple"
 }
 toolchain {
   toolchain_identifier: "ios_armv7"
-%{cxx_builtin_include_directory}
   host_system_name: "x86_64-apple-macosx"
   target_system_name: "armv7-apple-ios"
   target_cpu: "ios_armv7"
@@ -11835,52 +12230,12 @@
     name: "strip"
     path: "/usr/bin/strip"
   }
-  needsPic: false
-  compiler_flag: "-D_FORTIFY_SOURCE=1"
-  compiler_flag: "-fstack-protector"
-  compiler_flag: "-fcolor-diagnostics"
-  compiler_flag: "-Wall"
-  compiler_flag: "-Wthread-safety"
-  compiler_flag: "-Wself-assign"
-  compiler_flag: "-fno-omit-frame-pointer"
-  cxx_flag: "-std=c++11"
-  linker_flag: "-headerpad_max_install_names"
-  linker_flag: "-no-canonical-prefixes"
-  linker_flag: "-target"
-  linker_flag: "armv7-apple-ios"
-  objcopy_embed_flag: "-I"
-  objcopy_embed_flag: "binary"
-  compilation_mode_flags {
-    mode: FASTBUILD
-    compiler_flag: "-O0"
-    compiler_flag: "-DDEBUG"
-  }
-  compilation_mode_flags {
-    mode: OPT
-    compiler_flag: "-g0"
-    compiler_flag: "-O2"
-    compiler_flag: "-D_FORTIFY_SOURCE=1"
-    compiler_flag: "-DNDEBUG"
-    compiler_flag: "-ffunction-sections"
-    compiler_flag: "-fdata-sections"
-  }
-  compilation_mode_flags {
-    mode: DBG
-    compiler_flag: "-g"
-  }
   make_variable {
     name: "STACK_FRAME_UNLIMITED"
     value: "-Wframe-larger-than=100000000 -Wno-vla"
   }
+  %{cxx_builtin_include_directory}
   builtin_sysroot: ""
-  unfiltered_cxx_flag: "-no-canonical-prefixes"
-  unfiltered_cxx_flag: "-Wno-builtin-macro-redefined"
-  unfiltered_cxx_flag: "-D__DATE__=\"redacted\""
-  unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\""
-  unfiltered_cxx_flag: "-D__TIME__=\"redacted\""
-  unfiltered_cxx_flag: "-target"
-  unfiltered_cxx_flag: "armv7-apple-ios"
-  default_python_version: "python2.7"
   feature {
     name: "fastbuild"
   }
@@ -11923,23 +12278,109 @@
     name: "only_doth_headers_in_module_maps"
   }
   feature {
-    name: "legacy_compile_flags"
+    name: "default_compile_flags"
     flag_set {
       action: "assemble"
       action: "preprocess-assemble"
+      action: "linkstamp-compile"
       action: "c-compile"
       action: "c++-compile"
       action: "c++-header-parsing"
       action: "c++-module-compile"
       action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
       action: "objc-compile"
       action: "objc++-compile"
       flag_group {
-        flag: "%{legacy_compile_flags}"
-        iterate_over: "legacy_compile_flags"
-        expand_if_all_available: "legacy_compile_flags"
+        flag: "-D_FORTIFY_SOURCE=1"
+        flag: "-fstack-protector"
+        flag: "-fcolor-diagnostics"
+        flag: "-Wall"
+        flag: "-Wthread-safety"
+        flag: "-Wself-assign"
+        flag: "-fno-omit-frame-pointer"
       }
     }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-O0"
+        flag: "-DDEBUG"
+      }
+      with_feature {
+        feature: "fastbuild"
+      }
+    }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-g0"
+        flag: "-O2"
+        flag: "-D_FORTIFY_SOURCE=1"
+        flag: "-DNDEBUG"
+        flag: "-ffunction-sections"
+        flag: "-fdata-sections"
+      }
+      with_feature {
+        feature: "opt"
+      }
+    }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-g"
+      }
+      with_feature {
+        feature: "dbg"
+      }
+    }
+    flag_set {
+      action: "linkstamp-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      flag_group {
+        flag: "-std=c++11"
+      }
+    }
+    enabled: true
   }
   feature {
     name: "debug_prefix_map_pwd_is_dot"
@@ -12765,7 +13206,7 @@
     enabled: true
   }
   feature {
-    name: "legacy_link_flags"
+    name: "default_link_flags"
     flag_set {
       action: "c++-link-executable"
       action: "c++-link-dynamic-library"
@@ -12773,11 +13214,13 @@
       action: "objc-executable"
       action: "objc++-executable"
       flag_group {
-        flag: "%{legacy_link_flags}"
-        iterate_over: "legacy_link_flags"
-        expand_if_all_available: "legacy_link_flags"
+        flag: "-headerpad_max_install_names"
+        flag: "-no-canonical-prefixes"
+        flag: "-target"
+        flag: "armv7-apple-ios"
       }
     }
+    enabled: true
   }
   feature {
     name: "version_min"
@@ -12872,12 +13315,14 @@
       action: "c++-module-compile"
       action: "c++-module-codegen"
       action: "linkstamp-compile"
-      action: "objc-compile"
-      action: "objc++-compile"
       flag_group {
-        flag: "%{unfiltered_compile_flags}"
-        iterate_over: "unfiltered_compile_flags"
-        expand_if_all_available: "unfiltered_compile_flags"
+        flag: "-no-canonical-prefixes"
+        flag: "-Wno-builtin-macro-redefined"
+        flag: "-D__DATE__=\"redacted\""
+        flag: "-D__TIMESTAMP__=\"redacted\""
+        flag: "-D__TIME__=\"redacted\""
+        flag: "-target"
+        flag: "armv7-apple-ios"
       }
     }
   }
@@ -12948,6 +13393,17 @@
       }
     }
   }
+  feature {
+    name: "objcopy_embed_flags"
+    flag_set {
+      action: "objcopy_embed_data"
+      flag_group {
+        flag: "-I"
+        flag: "binary"
+      }
+    }
+    enabled: true
+  }
   action_config {
     config_name: "strip"
     action_name: "strip"
@@ -12982,7 +13438,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -13002,7 +13457,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -13022,7 +13476,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -13042,7 +13495,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -13062,7 +13514,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -13094,7 +13545,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -13125,7 +13575,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -13141,7 +13590,6 @@
     implies: "no_objc_arc"
     implies: "include_system_dirs"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -13161,7 +13609,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -13259,7 +13706,6 @@
     implies: "include_system_dirs"
     implies: "framework_paths"
     implies: "version_min"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "apple_env"
     implies: "apply_implicit_frameworks"
@@ -13331,7 +13777,6 @@
     implies: "include_system_dirs"
     implies: "framework_paths"
     implies: "version_min"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "apple_env"
     implies: "apply_implicit_frameworks"
@@ -13350,7 +13795,6 @@
     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"
@@ -13372,7 +13816,6 @@
     implies: "output_execpath_flags"
     implies: "runtime_root_flags"
     implies: "input_param_flags"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "linker_param_file"
     implies: "version_min"
@@ -13394,7 +13837,6 @@
     implies: "output_execpath_flags"
     implies: "runtime_root_flags"
     implies: "input_param_flags"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "linker_param_file"
     implies: "version_min"
@@ -13447,11 +13889,18 @@
     }
     implies: "apple_env"
   }
+  action_config {
+    config_name: "objcopy_embed_data"
+    action_name: "objcopy_embed_data"
+    tool {
+      tool_path: "/usr/bin/objcopy"
+    }
+    enabled: true
+  }
   cc_target_os: "apple"
 }
 toolchain {
   toolchain_identifier: "watchos_armv7k"
-%{cxx_builtin_include_directory}
   host_system_name: "x86_64-apple-macosx"
   target_system_name: "armv7-apple-watchos"
   target_cpu: "watchos_armv7k"
@@ -13503,52 +13952,12 @@
     name: "strip"
     path: "/usr/bin/strip"
   }
-  needsPic: false
-  compiler_flag: "-D_FORTIFY_SOURCE=1"
-  compiler_flag: "-fstack-protector"
-  compiler_flag: "-fcolor-diagnostics"
-  compiler_flag: "-Wall"
-  compiler_flag: "-Wthread-safety"
-  compiler_flag: "-Wself-assign"
-  compiler_flag: "-fno-omit-frame-pointer"
-  cxx_flag: "-std=c++11"
-  linker_flag: "-headerpad_max_install_names"
-  linker_flag: "-no-canonical-prefixes"
-  linker_flag: "-target"
-  linker_flag: "armv7-apple-watchos"
-  objcopy_embed_flag: "-I"
-  objcopy_embed_flag: "binary"
-  compilation_mode_flags {
-    mode: FASTBUILD
-    compiler_flag: "-O0"
-    compiler_flag: "-DDEBUG"
-  }
-  compilation_mode_flags {
-    mode: OPT
-    compiler_flag: "-g0"
-    compiler_flag: "-O2"
-    compiler_flag: "-D_FORTIFY_SOURCE=1"
-    compiler_flag: "-DNDEBUG"
-    compiler_flag: "-ffunction-sections"
-    compiler_flag: "-fdata-sections"
-  }
-  compilation_mode_flags {
-    mode: DBG
-    compiler_flag: "-g"
-  }
   make_variable {
     name: "STACK_FRAME_UNLIMITED"
     value: "-Wframe-larger-than=100000000 -Wno-vla"
   }
+  %{cxx_builtin_include_directory}
   builtin_sysroot: ""
-  unfiltered_cxx_flag: "-no-canonical-prefixes"
-  unfiltered_cxx_flag: "-Wno-builtin-macro-redefined"
-  unfiltered_cxx_flag: "-D__DATE__=\"redacted\""
-  unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\""
-  unfiltered_cxx_flag: "-D__TIME__=\"redacted\""
-  unfiltered_cxx_flag: "-target"
-  unfiltered_cxx_flag: "armv7k-apple-watchos"
-  default_python_version: "python2.7"
   feature {
     name: "fastbuild"
   }
@@ -13591,23 +14000,109 @@
     name: "only_doth_headers_in_module_maps"
   }
   feature {
-    name: "legacy_compile_flags"
+    name: "default_compile_flags"
     flag_set {
       action: "assemble"
       action: "preprocess-assemble"
+      action: "linkstamp-compile"
       action: "c-compile"
       action: "c++-compile"
       action: "c++-header-parsing"
       action: "c++-module-compile"
       action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
       action: "objc-compile"
       action: "objc++-compile"
       flag_group {
-        flag: "%{legacy_compile_flags}"
-        iterate_over: "legacy_compile_flags"
-        expand_if_all_available: "legacy_compile_flags"
+        flag: "-D_FORTIFY_SOURCE=1"
+        flag: "-fstack-protector"
+        flag: "-fcolor-diagnostics"
+        flag: "-Wall"
+        flag: "-Wthread-safety"
+        flag: "-Wself-assign"
+        flag: "-fno-omit-frame-pointer"
       }
     }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-O0"
+        flag: "-DDEBUG"
+      }
+      with_feature {
+        feature: "fastbuild"
+      }
+    }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-g0"
+        flag: "-O2"
+        flag: "-D_FORTIFY_SOURCE=1"
+        flag: "-DNDEBUG"
+        flag: "-ffunction-sections"
+        flag: "-fdata-sections"
+      }
+      with_feature {
+        feature: "opt"
+      }
+    }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-g"
+      }
+      with_feature {
+        feature: "dbg"
+      }
+    }
+    flag_set {
+      action: "linkstamp-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      flag_group {
+        flag: "-std=c++11"
+      }
+    }
+    enabled: true
   }
   feature {
     name: "debug_prefix_map_pwd_is_dot"
@@ -14435,7 +14930,7 @@
     enabled: true
   }
   feature {
-    name: "legacy_link_flags"
+    name: "default_link_flags"
     flag_set {
       action: "c++-link-executable"
       action: "c++-link-dynamic-library"
@@ -14443,11 +14938,13 @@
       action: "objc-executable"
       action: "objc++-executable"
       flag_group {
-        flag: "%{legacy_link_flags}"
-        iterate_over: "legacy_link_flags"
-        expand_if_all_available: "legacy_link_flags"
+        flag: "-headerpad_max_install_names"
+        flag: "-no-canonical-prefixes"
+        flag: "-target"
+        flag: "armv7-apple-watchos"
       }
     }
+    enabled: true
   }
   feature {
     name: "version_min"
@@ -14542,12 +15039,14 @@
       action: "c++-module-compile"
       action: "c++-module-codegen"
       action: "linkstamp-compile"
-      action: "objc-compile"
-      action: "objc++-compile"
       flag_group {
-        flag: "%{unfiltered_compile_flags}"
-        iterate_over: "unfiltered_compile_flags"
-        expand_if_all_available: "unfiltered_compile_flags"
+        flag: "-no-canonical-prefixes"
+        flag: "-Wno-builtin-macro-redefined"
+        flag: "-D__DATE__=\"redacted\""
+        flag: "-D__TIMESTAMP__=\"redacted\""
+        flag: "-D__TIME__=\"redacted\""
+        flag: "-target"
+        flag: "armv7k-apple-watchos"
       }
     }
   }
@@ -14618,6 +15117,17 @@
       }
     }
   }
+  feature {
+    name: "objcopy_embed_flags"
+    flag_set {
+      action: "objcopy_embed_data"
+      flag_group {
+        flag: "-I"
+        flag: "binary"
+      }
+    }
+    enabled: true
+  }
   action_config {
     config_name: "strip"
     action_name: "strip"
@@ -14652,7 +15162,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -14672,7 +15181,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -14692,7 +15200,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -14712,7 +15219,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -14732,7 +15238,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -14764,7 +15269,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -14795,7 +15299,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -14811,7 +15314,6 @@
     implies: "no_objc_arc"
     implies: "include_system_dirs"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -14831,7 +15333,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -14929,7 +15430,6 @@
     implies: "include_system_dirs"
     implies: "framework_paths"
     implies: "version_min"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "apple_env"
     implies: "apply_implicit_frameworks"
@@ -15001,7 +15501,6 @@
     implies: "include_system_dirs"
     implies: "framework_paths"
     implies: "version_min"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "apple_env"
     implies: "apply_implicit_frameworks"
@@ -15020,7 +15519,6 @@
     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"
@@ -15042,7 +15540,6 @@
     implies: "output_execpath_flags"
     implies: "runtime_root_flags"
     implies: "input_param_flags"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "linker_param_file"
     implies: "version_min"
@@ -15064,7 +15561,6 @@
     implies: "output_execpath_flags"
     implies: "runtime_root_flags"
     implies: "input_param_flags"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "linker_param_file"
     implies: "version_min"
@@ -15117,11 +15613,18 @@
     }
     implies: "apple_env"
   }
+  action_config {
+    config_name: "objcopy_embed_data"
+    action_name: "objcopy_embed_data"
+    tool {
+      tool_path: "/usr/bin/objcopy"
+    }
+    enabled: true
+  }
   cc_target_os: "apple"
 }
 toolchain {
   toolchain_identifier: "tvos_arm64"
-%{cxx_builtin_include_directory}
   host_system_name: "x86_64-apple-macosx"
   target_system_name: "arm64-apple-tvos"
   target_cpu: "tvos_arm64"
@@ -15173,53 +15676,12 @@
     name: "strip"
     path: "/usr/bin/strip"
   }
-  needsPic: false
-  compiler_flag: "-D_FORTIFY_SOURCE=1"
-  compiler_flag: "-fstack-protector"
-  compiler_flag: "-fcolor-diagnostics"
-  compiler_flag: "-Wall"
-  compiler_flag: "-Wthread-safety"
-  compiler_flag: "-Wself-assign"
-  compiler_flag: "-fno-omit-frame-pointer"
-  cxx_flag: "-std=c++11"
-  linker_flag: "-headerpad_max_install_names"
-  linker_flag: "-no-canonical-prefixes"
-  linker_flag: "-target"
-  linker_flag: "arm64-apple-tvos"
-  objcopy_embed_flag: "-I"
-  objcopy_embed_flag: "binary"
-  compilation_mode_flags {
-    mode: FASTBUILD
-    compiler_flag: "-O0"
-    compiler_flag: "-DDEBUG"
-  }
-  compilation_mode_flags {
-    mode: OPT
-    compiler_flag: "-g0"
-    compiler_flag: "-O2"
-    compiler_flag: "-D_FORTIFY_SOURCE=1"
-    compiler_flag: "-DNDEBUG"
-    compiler_flag: "-ffunction-sections"
-    compiler_flag: "-fdata-sections"
-    compiler_flag: "-DNS_BLOCK_ASSERTIONS=1"
-  }
-  compilation_mode_flags {
-    mode: DBG
-    compiler_flag: "-g"
-  }
   make_variable {
     name: "STACK_FRAME_UNLIMITED"
     value: "-Wframe-larger-than=100000000 -Wno-vla"
   }
+  %{cxx_builtin_include_directory}
   builtin_sysroot: ""
-  unfiltered_cxx_flag: "-no-canonical-prefixes"
-  unfiltered_cxx_flag: "-Wno-builtin-macro-redefined"
-  unfiltered_cxx_flag: "-D__DATE__=\"redacted\""
-  unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\""
-  unfiltered_cxx_flag: "-D__TIME__=\"redacted\""
-  unfiltered_cxx_flag: "-target"
-  unfiltered_cxx_flag: "arm64-apple-tvos"
-  default_python_version: "python2.7"
   feature {
     name: "fastbuild"
   }
@@ -15262,23 +15724,110 @@
     name: "only_doth_headers_in_module_maps"
   }
   feature {
-    name: "legacy_compile_flags"
+    name: "default_compile_flags"
     flag_set {
       action: "assemble"
       action: "preprocess-assemble"
+      action: "linkstamp-compile"
       action: "c-compile"
       action: "c++-compile"
       action: "c++-header-parsing"
       action: "c++-module-compile"
       action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
       action: "objc-compile"
       action: "objc++-compile"
       flag_group {
-        flag: "%{legacy_compile_flags}"
-        iterate_over: "legacy_compile_flags"
-        expand_if_all_available: "legacy_compile_flags"
+        flag: "-D_FORTIFY_SOURCE=1"
+        flag: "-fstack-protector"
+        flag: "-fcolor-diagnostics"
+        flag: "-Wall"
+        flag: "-Wthread-safety"
+        flag: "-Wself-assign"
+        flag: "-fno-omit-frame-pointer"
       }
     }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-O0"
+        flag: "-DDEBUG"
+      }
+      with_feature {
+        feature: "fastbuild"
+      }
+    }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-g0"
+        flag: "-O2"
+        flag: "-D_FORTIFY_SOURCE=1"
+        flag: "-DNDEBUG"
+        flag: "-ffunction-sections"
+        flag: "-fdata-sections"
+        flag: "-DNS_BLOCK_ASSERTIONS=1"
+      }
+      with_feature {
+        feature: "opt"
+      }
+    }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-g"
+      }
+      with_feature {
+        feature: "dbg"
+      }
+    }
+    flag_set {
+      action: "linkstamp-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      flag_group {
+        flag: "-std=c++11"
+      }
+    }
+    enabled: true
   }
   feature {
     name: "debug_prefix_map_pwd_is_dot"
@@ -16104,7 +16653,7 @@
     enabled: true
   }
   feature {
-    name: "legacy_link_flags"
+    name: "default_link_flags"
     flag_set {
       action: "c++-link-executable"
       action: "c++-link-dynamic-library"
@@ -16112,11 +16661,13 @@
       action: "objc-executable"
       action: "objc++-executable"
       flag_group {
-        flag: "%{legacy_link_flags}"
-        iterate_over: "legacy_link_flags"
-        expand_if_all_available: "legacy_link_flags"
+        flag: "-headerpad_max_install_names"
+        flag: "-no-canonical-prefixes"
+        flag: "-target"
+        flag: "arm64-apple-tvos"
       }
     }
+    enabled: true
   }
   feature {
     name: "version_min"
@@ -16232,12 +16783,14 @@
       action: "c++-module-compile"
       action: "c++-module-codegen"
       action: "linkstamp-compile"
-      action: "objc-compile"
-      action: "objc++-compile"
       flag_group {
-        flag: "%{unfiltered_compile_flags}"
-        iterate_over: "unfiltered_compile_flags"
-        expand_if_all_available: "unfiltered_compile_flags"
+        flag: "-no-canonical-prefixes"
+        flag: "-Wno-builtin-macro-redefined"
+        flag: "-D__DATE__=\"redacted\""
+        flag: "-D__TIMESTAMP__=\"redacted\""
+        flag: "-D__TIME__=\"redacted\""
+        flag: "-target"
+        flag: "arm64-apple-tvos"
       }
     }
   }
@@ -16308,6 +16861,17 @@
       }
     }
   }
+  feature {
+    name: "objcopy_embed_flags"
+    flag_set {
+      action: "objcopy_embed_data"
+      flag_group {
+        flag: "-I"
+        flag: "binary"
+      }
+    }
+    enabled: true
+  }
   action_config {
     config_name: "strip"
     action_name: "strip"
@@ -16342,7 +16906,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -16363,7 +16926,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -16384,7 +16946,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -16404,7 +16965,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -16425,7 +16985,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -16458,7 +17017,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -16489,7 +17047,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -16505,7 +17062,6 @@
     implies: "no_objc_arc"
     implies: "include_system_dirs"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -16526,7 +17082,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -16625,7 +17180,6 @@
     implies: "include_system_dirs"
     implies: "framework_paths"
     implies: "version_min"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "apple_env"
     implies: "apply_implicit_frameworks"
@@ -16697,7 +17251,6 @@
     implies: "include_system_dirs"
     implies: "framework_paths"
     implies: "version_min"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "apple_env"
     implies: "apply_implicit_frameworks"
@@ -16716,7 +17269,6 @@
     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"
@@ -16739,7 +17291,6 @@
     implies: "output_execpath_flags"
     implies: "runtime_root_flags"
     implies: "input_param_flags"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "linker_param_file"
     implies: "version_min"
@@ -16762,7 +17313,6 @@
     implies: "output_execpath_flags"
     implies: "runtime_root_flags"
     implies: "input_param_flags"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "linker_param_file"
     implies: "version_min"
@@ -16816,11 +17366,18 @@
     }
     implies: "apple_env"
   }
+  action_config {
+    config_name: "objcopy_embed_data"
+    action_name: "objcopy_embed_data"
+    tool {
+      tool_path: "/usr/bin/objcopy"
+    }
+    enabled: true
+  }
   cc_target_os: "apple"
 }
 toolchain {
   toolchain_identifier: "ios_arm64"
-%{cxx_builtin_include_directory}
   host_system_name: "x86_64-apple-macosx"
   target_system_name: "arm64-apple-ios"
   target_cpu: "ios_arm64"
@@ -16872,52 +17429,12 @@
     name: "strip"
     path: "/usr/bin/strip"
   }
-  needsPic: false
-  compiler_flag: "-D_FORTIFY_SOURCE=1"
-  compiler_flag: "-fstack-protector"
-  compiler_flag: "-fcolor-diagnostics"
-  compiler_flag: "-Wall"
-  compiler_flag: "-Wthread-safety"
-  compiler_flag: "-Wself-assign"
-  compiler_flag: "-fno-omit-frame-pointer"
-  cxx_flag: "-std=c++11"
-  linker_flag: "-headerpad_max_install_names"
-  linker_flag: "-no-canonical-prefixes"
-  linker_flag: "-target"
-  linker_flag: "arm64-apple-ios"
-  objcopy_embed_flag: "-I"
-  objcopy_embed_flag: "binary"
-  compilation_mode_flags {
-    mode: FASTBUILD
-    compiler_flag: "-O0"
-    compiler_flag: "-DDEBUG"
-  }
-  compilation_mode_flags {
-    mode: OPT
-    compiler_flag: "-g0"
-    compiler_flag: "-O2"
-    compiler_flag: "-D_FORTIFY_SOURCE=1"
-    compiler_flag: "-DNDEBUG"
-    compiler_flag: "-ffunction-sections"
-    compiler_flag: "-fdata-sections"
-  }
-  compilation_mode_flags {
-    mode: DBG
-    compiler_flag: "-g"
-  }
   make_variable {
     name: "STACK_FRAME_UNLIMITED"
     value: "-Wframe-larger-than=100000000 -Wno-vla"
   }
+  %{cxx_builtin_include_directory}
   builtin_sysroot: ""
-  unfiltered_cxx_flag: "-no-canonical-prefixes"
-  unfiltered_cxx_flag: "-Wno-builtin-macro-redefined"
-  unfiltered_cxx_flag: "-D__DATE__=\"redacted\""
-  unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\""
-  unfiltered_cxx_flag: "-D__TIME__=\"redacted\""
-  unfiltered_cxx_flag: "-target"
-  unfiltered_cxx_flag: "arm64-apple-ios"
-  default_python_version: "python2.7"
   feature {
     name: "fastbuild"
   }
@@ -16960,23 +17477,109 @@
     name: "only_doth_headers_in_module_maps"
   }
   feature {
-    name: "legacy_compile_flags"
+    name: "default_compile_flags"
     flag_set {
       action: "assemble"
       action: "preprocess-assemble"
+      action: "linkstamp-compile"
       action: "c-compile"
       action: "c++-compile"
       action: "c++-header-parsing"
       action: "c++-module-compile"
       action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
       action: "objc-compile"
       action: "objc++-compile"
       flag_group {
-        flag: "%{legacy_compile_flags}"
-        iterate_over: "legacy_compile_flags"
-        expand_if_all_available: "legacy_compile_flags"
+        flag: "-D_FORTIFY_SOURCE=1"
+        flag: "-fstack-protector"
+        flag: "-fcolor-diagnostics"
+        flag: "-Wall"
+        flag: "-Wthread-safety"
+        flag: "-Wself-assign"
+        flag: "-fno-omit-frame-pointer"
       }
     }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-O0"
+        flag: "-DDEBUG"
+      }
+      with_feature {
+        feature: "fastbuild"
+      }
+    }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-g0"
+        flag: "-O2"
+        flag: "-D_FORTIFY_SOURCE=1"
+        flag: "-DNDEBUG"
+        flag: "-ffunction-sections"
+        flag: "-fdata-sections"
+      }
+      with_feature {
+        feature: "opt"
+      }
+    }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-g"
+      }
+      with_feature {
+        feature: "dbg"
+      }
+    }
+    flag_set {
+      action: "linkstamp-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      flag_group {
+        flag: "-std=c++11"
+      }
+    }
+    enabled: true
   }
   feature {
     name: "debug_prefix_map_pwd_is_dot"
@@ -17802,7 +18405,7 @@
     enabled: true
   }
   feature {
-    name: "legacy_link_flags"
+    name: "default_link_flags"
     flag_set {
       action: "c++-link-executable"
       action: "c++-link-dynamic-library"
@@ -17810,11 +18413,13 @@
       action: "objc-executable"
       action: "objc++-executable"
       flag_group {
-        flag: "%{legacy_link_flags}"
-        iterate_over: "legacy_link_flags"
-        expand_if_all_available: "legacy_link_flags"
+        flag: "-headerpad_max_install_names"
+        flag: "-no-canonical-prefixes"
+        flag: "-target"
+        flag: "arm64-apple-ios"
       }
     }
+    enabled: true
   }
   feature {
     name: "version_min"
@@ -17909,12 +18514,14 @@
       action: "c++-module-compile"
       action: "c++-module-codegen"
       action: "linkstamp-compile"
-      action: "objc-compile"
-      action: "objc++-compile"
       flag_group {
-        flag: "%{unfiltered_compile_flags}"
-        iterate_over: "unfiltered_compile_flags"
-        expand_if_all_available: "unfiltered_compile_flags"
+        flag: "-no-canonical-prefixes"
+        flag: "-Wno-builtin-macro-redefined"
+        flag: "-D__DATE__=\"redacted\""
+        flag: "-D__TIMESTAMP__=\"redacted\""
+        flag: "-D__TIME__=\"redacted\""
+        flag: "-target"
+        flag: "arm64-apple-ios"
       }
     }
   }
@@ -17985,6 +18592,17 @@
       }
     }
   }
+  feature {
+    name: "objcopy_embed_flags"
+    flag_set {
+      action: "objcopy_embed_data"
+      flag_group {
+        flag: "-I"
+        flag: "binary"
+      }
+    }
+    enabled: true
+  }
   action_config {
     config_name: "strip"
     action_name: "strip"
@@ -18019,7 +18637,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -18039,7 +18656,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -18059,7 +18675,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -18079,7 +18694,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -18099,7 +18713,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -18131,7 +18744,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -18162,7 +18774,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -18178,7 +18789,6 @@
     implies: "no_objc_arc"
     implies: "include_system_dirs"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -18198,7 +18808,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -18296,7 +18905,6 @@
     implies: "include_system_dirs"
     implies: "framework_paths"
     implies: "version_min"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "apple_env"
     implies: "apply_implicit_frameworks"
@@ -18368,7 +18976,6 @@
     implies: "include_system_dirs"
     implies: "framework_paths"
     implies: "version_min"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "apple_env"
     implies: "apply_implicit_frameworks"
@@ -18387,7 +18994,6 @@
     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"
@@ -18409,7 +19015,6 @@
     implies: "output_execpath_flags"
     implies: "runtime_root_flags"
     implies: "input_param_flags"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "linker_param_file"
     implies: "version_min"
@@ -18431,7 +19036,6 @@
     implies: "output_execpath_flags"
     implies: "runtime_root_flags"
     implies: "input_param_flags"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "linker_param_file"
     implies: "version_min"
@@ -18484,11 +19088,18 @@
     }
     implies: "apple_env"
   }
+  action_config {
+    config_name: "objcopy_embed_data"
+    action_name: "objcopy_embed_data"
+    tool {
+      tool_path: "/usr/bin/objcopy"
+    }
+    enabled: true
+  }
   cc_target_os: "apple"
 }
 toolchain {
   toolchain_identifier: "stub_armeabi-v7a"
-%{cxx_builtin_include_directory}
   host_system_name: "armeabi-v7a"
   target_system_name: "armeabi-v7a"
   target_cpu: "armeabi-v7a"
@@ -18540,52 +19151,12 @@
     name: "strip"
     path: "/bin/false"
   }
-  needsPic: true
-  compiler_flag: "-D_FORTIFY_SOURCE=1"
-  compiler_flag: "-fstack-protector"
-  compiler_flag: "-fcolor-diagnostics"
-  compiler_flag: "-Wall"
-  compiler_flag: "-Wthread-safety"
-  compiler_flag: "-Wself-assign"
-  compiler_flag: "-fno-omit-frame-pointer"
-  cxx_flag: "-std=c++11"
-  linker_flag: "-headerpad_max_install_names"
-  linker_flag: "-no-canonical-prefixes"
-  objcopy_embed_flag: "-I"
-  objcopy_embed_flag: "binary"
-  compilation_mode_flags {
-    mode: FASTBUILD
-    compiler_flag: "-O0"
-    compiler_flag: "-DDEBUG"
-  }
-  compilation_mode_flags {
-    mode: OPT
-    compiler_flag: "-g0"
-    compiler_flag: "-O2"
-    compiler_flag: "-D_FORTIFY_SOURCE=1"
-    compiler_flag: "-DNDEBUG"
-    compiler_flag: "-ffunction-sections"
-    compiler_flag: "-fdata-sections"
-    compiler_flag: "-DNS_BLOCK_ASSERTIONS=1"
-  }
-  compilation_mode_flags {
-    mode: DBG
-    compiler_flag: "-g"
-  }
   make_variable {
     name: "STACK_FRAME_UNLIMITED"
     value: "-Wframe-larger-than=100000000 -Wno-vla"
   }
+  %{cxx_builtin_include_directory}
   builtin_sysroot: ""
-  unfiltered_cxx_flag: "-no-canonical-prefixes"
-  unfiltered_cxx_flag: "-Wno-builtin-macro-redefined"
-  unfiltered_cxx_flag: "-D__DATE__=\"redacted\""
-  unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\""
-  unfiltered_cxx_flag: "-D__TIME__=\"redacted\""
-  supports_start_end_lib: false
-  default_python_version: "python2.7"
-  supports_interface_shared_objects: false
-  supports_fission: false
   feature {
     name: "fastbuild"
   }
@@ -18628,23 +19199,110 @@
     name: "only_doth_headers_in_module_maps"
   }
   feature {
-    name: "legacy_compile_flags"
+    name: "default_compile_flags"
     flag_set {
       action: "assemble"
       action: "preprocess-assemble"
+      action: "linkstamp-compile"
       action: "c-compile"
       action: "c++-compile"
       action: "c++-header-parsing"
       action: "c++-module-compile"
       action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
       action: "objc-compile"
       action: "objc++-compile"
       flag_group {
-        flag: "%{legacy_compile_flags}"
-        iterate_over: "legacy_compile_flags"
-        expand_if_all_available: "legacy_compile_flags"
+        flag: "-D_FORTIFY_SOURCE=1"
+        flag: "-fstack-protector"
+        flag: "-fcolor-diagnostics"
+        flag: "-Wall"
+        flag: "-Wthread-safety"
+        flag: "-Wself-assign"
+        flag: "-fno-omit-frame-pointer"
       }
     }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-O0"
+        flag: "-DDEBUG"
+      }
+      with_feature {
+        feature: "fastbuild"
+      }
+    }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-g0"
+        flag: "-O2"
+        flag: "-D_FORTIFY_SOURCE=1"
+        flag: "-DNDEBUG"
+        flag: "-ffunction-sections"
+        flag: "-fdata-sections"
+        flag: "-DNS_BLOCK_ASSERTIONS=1"
+      }
+      with_feature {
+        feature: "opt"
+      }
+    }
+    flag_set {
+      action: "assemble"
+      action: "preprocess-assemble"
+      action: "linkstamp-compile"
+      action: "c-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      action: "objc-compile"
+      action: "objc++-compile"
+      flag_group {
+        flag: "-g"
+      }
+      with_feature {
+        feature: "dbg"
+      }
+    }
+    flag_set {
+      action: "linkstamp-compile"
+      action: "c++-compile"
+      action: "c++-header-parsing"
+      action: "c++-module-compile"
+      action: "c++-module-codegen"
+      action: "lto-backend"
+      action: "clif-match"
+      flag_group {
+        flag: "-std=c++11"
+      }
+    }
+    enabled: true
   }
   feature {
     name: "debug_prefix_map_pwd_is_dot"
@@ -19470,7 +20128,7 @@
     enabled: true
   }
   feature {
-    name: "legacy_link_flags"
+    name: "default_link_flags"
     flag_set {
       action: "c++-link-executable"
       action: "c++-link-dynamic-library"
@@ -19478,11 +20136,11 @@
       action: "objc-executable"
       action: "objc++-executable"
       flag_group {
-        flag: "%{legacy_link_flags}"
-        iterate_over: "legacy_link_flags"
-        expand_if_all_available: "legacy_link_flags"
+        flag: "-headerpad_max_install_names"
+        flag: "-no-canonical-prefixes"
       }
     }
+    enabled: true
   }
   feature {
     name: "version_min"
@@ -19577,12 +20235,12 @@
       action: "c++-module-compile"
       action: "c++-module-codegen"
       action: "linkstamp-compile"
-      action: "objc-compile"
-      action: "objc++-compile"
       flag_group {
-        flag: "%{unfiltered_compile_flags}"
-        iterate_over: "unfiltered_compile_flags"
-        expand_if_all_available: "unfiltered_compile_flags"
+        flag: "-no-canonical-prefixes"
+        flag: "-Wno-builtin-macro-redefined"
+        flag: "-D__DATE__=\"redacted\""
+        flag: "-D__TIMESTAMP__=\"redacted\""
+        flag: "-D__TIME__=\"redacted\""
       }
     }
   }
@@ -19653,6 +20311,21 @@
       }
     }
   }
+  feature {
+    name: "supports_pic"
+    enabled: true
+  }
+  feature {
+    name: "objcopy_embed_flags"
+    flag_set {
+      action: "objcopy_embed_data"
+      flag_group {
+        flag: "-I"
+        flag: "binary"
+      }
+    }
+    enabled: true
+  }
   action_config {
     config_name: "strip"
     action_name: "strip"
@@ -19687,7 +20360,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -19707,7 +20379,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -19727,7 +20398,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -19747,7 +20417,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -19767,7 +20436,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -19799,7 +20467,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -19830,7 +20497,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -19846,7 +20512,6 @@
     implies: "no_objc_arc"
     implies: "include_system_dirs"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -19866,7 +20531,6 @@
     implies: "objc_arc"
     implies: "no_objc_arc"
     implies: "apple_env"
-    implies: "legacy_compile_flags"
     implies: "user_compile_flags"
     implies: "sysroot"
     implies: "unfiltered_compile_flags"
@@ -19964,7 +20628,6 @@
     implies: "include_system_dirs"
     implies: "framework_paths"
     implies: "version_min"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "apple_env"
     implies: "apply_implicit_frameworks"
@@ -20036,7 +20699,6 @@
     implies: "include_system_dirs"
     implies: "framework_paths"
     implies: "version_min"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "apple_env"
     implies: "apply_implicit_frameworks"
@@ -20055,7 +20717,6 @@
     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"
@@ -20077,7 +20738,6 @@
     implies: "output_execpath_flags"
     implies: "runtime_root_flags"
     implies: "input_param_flags"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "linker_param_file"
     implies: "version_min"
@@ -20099,7 +20759,6 @@
     implies: "output_execpath_flags"
     implies: "runtime_root_flags"
     implies: "input_param_flags"
-    implies: "legacy_link_flags"
     implies: "strip_debug_symbols"
     implies: "linker_param_file"
     implies: "version_min"
@@ -20152,5 +20811,13 @@
     }
     implies: "apple_env"
   }
+  action_config {
+    config_name: "objcopy_embed_data"
+    action_name: "objcopy_embed_data"
+    tool {
+      tool_path: "/bin/false"
+    }
+    enabled: true
+  }
   cc_target_os: "apple"
 }