Loading

fdsdk-bazel

  1. bash-4.4# ls
  2. BUILD  WORKSPACE  bazel-bin  bazel-genfiles  bazel-out  bazel-testlogs  bazel-toolchain-hello  compilers  hello.cc
  3. bash-4.4# ./bazel-bin/
  4. _objs/                   hello-2.params           hello.runfiles_manifest
  5. hello                    hello.runfiles/
  6. bash-4.4# ./bazel-bin/hello
  7. Hello! sqrt(time) = 39462
  8. bash-4.4# /tmp/bazel/
  9. c00136a9b579d7236ab021320907fac3/ d41d8cd98f00b204e9800998ecf8427e/
  10. cache/                            install/
  11. bash-4.4# ls
  12. BUILD  WORKSPACE  bazel-bin  bazel-genfiles  bazel-out  bazel-testlogs  bazel-toolchain-hello  compilers  hello.cc
  13. bash-4.4# ls bazel-out
  14. _tmp  k8-fastbuild  stable-status.txt  volatile-status.txt
  15. bash-4.4# cd bazel-toolchain-hello
  16. bash-4.4# ls
  17. BUILD  WORKSPACE  bazel-out  compilers  external  hello.cc
  18. bash-4.4# cd external/
  19. bazel_tools/     local_config_cc/
  20. bash-4.4# cd external/local_config_cc/
  21. bash-4.4# ls
  22. BUILD  WORKSPACE  cc_toolchain_config.bzl  cc_wrapper.sh  dummy_toolchain.bzl  tools
  23. bash-4.4# vim BUILD
  24. bash: vim: command not found
  25. bash-4.4# cat BUILD
  26. # Copyright 2016 The Bazel Authors. All rights reserved.
  27. #
  28. # Licensed under the Apache License, Version 2.0 (the "License");
  29. # you may not use this file except in compliance with the License.
  30. # You may obtain a copy of the License at
  31. #
  32. #    http://www.apache.org/licenses/LICENSE-2.0
  33. #
  34. # Unless required by applicable law or agreed to in writing, software
  35. # distributed under the License is distributed on an "AS IS" BASIS,
  36. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  37. # See the License for the specific language governing permissions and
  38. # limitations under the License.
  39.  
  40. # This becomes the BUILD file for @local_config_cc// under non-FreeBSD unixes.
  41.  
  42. package(default_visibility = ["//visibility:public"])
  43.  
  44. load(":cc_toolchain_config.bzl", "cc_toolchain_config")
  45.  
  46. licenses(["notice"])  # Apache 2.0
  47.  
  48. cc_library(
  49.     name = "malloc",
  50. )
  51.  
  52. filegroup(
  53.     name = "empty",
  54.     srcs = [],
  55. )
  56.  
  57. filegroup(
  58.     name = "cc_wrapper",
  59.     srcs = ["cc_wrapper.sh"],
  60. )
  61.  
  62. filegroup(
  63.     name = "compiler_deps",
  64.     srcs = glob(["extra_tools/**"]) + [":empty"],
  65. )
  66.  
  67. # This is the entry point for --crosstool_top.  Toolchains are found
  68. # by lopping off the name of --crosstool_top and searching for
  69. # the "${CPU}" entry in the toolchains attribute.
  70. cc_toolchain_suite(
  71.     name = "toolchain",
  72.     toolchains = {
  73.         "k8|compiler": ":cc-compiler-k8",
  74.         "k8": ":cc-compiler-k8",
  75.         "armeabi-v7a|compiler": ":cc-compiler-armeabi-v7a",
  76.         "armeabi-v7a": ":cc-compiler-armeabi-v7a",
  77.     },
  78. )
  79.  
  80. cc_toolchain(
  81.     name = "cc-compiler-k8",
  82.     toolchain_identifier = "local",
  83.     toolchain_config = ":local",
  84.     all_files = ":compiler_deps",
  85.     ar_files = ":empty",
  86.     as_files = ":empty",
  87.     compiler_files = ":compiler_deps",
  88.     dwp_files = ":empty",
  89.     linker_files = ":compiler_deps",
  90.     objcopy_files = ":empty",
  91.     strip_files = ":empty",
  92.     supports_param_files = 1,
  93. )
  94.  
  95. cc_toolchain_config(
  96.     name = "local",
  97.     cpu = "k8",
  98.     compiler = "compiler",
  99. )
  100.  
  101. toolchain(
  102.     name = "cc-toolchain-k8",
  103.     exec_compatible_with = [
  104.         # TODO(katre): add autodiscovered constraints for host CPU and OS.
  105.     ],
  106.     target_compatible_with = [
  107.         # TODO(katre): add autodiscovered constraints for host CPU and OS.
  108.     ],
  109.     toolchain = ":cc-compiler-k8",
  110.     toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
  111. )
  112.  
  113. # Android tooling requires a default toolchain for the armeabi-v7a cpu.
  114. cc_toolchain(
  115.     name = "cc-compiler-armeabi-v7a",
  116.     toolchain_identifier = "stub_armeabi-v7a",
  117.     toolchain_config = ":stub_armeabi-v7a",
  118.     all_files = ":empty",
  119.     ar_files = ":empty",
  120.     as_files = ":empty",
  121.     compiler_files = ":empty",
  122.     dwp_files = ":empty",
  123.     linker_files = ":empty",
  124.     objcopy_files = ":empty",
  125.     strip_files = ":empty",
  126.     supports_param_files = 1,
  127. )
  128.  
  129. cc_toolchain_config(
  130.     name = "stub_armeabi-v7a",
  131.     cpu = "armeabi-v7a",
  132.     compiler = "compiler",
  133. )
  134.  
  135. toolchain(
  136.     name = "cc-toolchain-armeabi-v7a",
  137.     exec_compatible_with = [
  138.         # TODO(katre): add autodiscovered constraints for host CPU and OS.
  139.     ],
  140.     target_compatible_with = [
  141.         "@bazel_tools//platforms:arm",
  142.         "@bazel_tools//platforms:android",
  143.     ],
  144.     toolchain = ":cc-compiler-armabi-v7a",
  145.     toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
  146. )
  147. bash-4.4# nano
  148. bash: nano: command not found
  149. bash-4.4# vi
  150. bash: vi: command not found
  151. bash-4.4# ls
  152. BUILD  WORKSPACE  cc_toolchain_config.bzl  cc_wrapper.sh  dummy_toolchain.bzl  tools
  153. bash-4.4# cat cc_toolchain_config.bzl | less
  154. bash: less: command not found
  155. bash-4.4# cat cc_toolchain_config.bzl
  156. # Copyright 2019 The Bazel Authors. All rights reserved.
  157. #
  158. # Licensed under the Apache License, Version 2.0 (the "License");
  159. # you may not use this file except in compliance with the License.
  160. # You may obtain a copy of the License at
  161. #
  162. #    http://www.apache.org/licenses/LICENSE-2.0
  163. #
  164. # Unless required by applicable law or agreed to in writing, software
  165. # distributed under the License is distributed on an "AS IS" BASIS,
  166. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  167. # See the License for the specific language governing permissions and
  168. # limitations under the License.
  169.  
  170. """A Starlark cc_toolchain configuration rule"""
  171. load("@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl",
  172.      "action_config",
  173.      "artifact_name_pattern",
  174.      "env_entry",
  175.      "env_set",
  176.      "feature",
  177.      "feature_set",
  178.      "flag_group",
  179.      "flag_set",
  180.      "make_variable",
  181.      "tool",
  182.      "tool_path",
  183.      "variable_with_value",
  184.      "with_feature_set",
  185.      )
  186. load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "ACTION_NAMES")
  187.  
  188.  
  189. all_compile_actions = [
  190.     ACTION_NAMES.c_compile,
  191.     ACTION_NAMES.cpp_compile,
  192.     ACTION_NAMES.linkstamp_compile,
  193.     ACTION_NAMES.assemble,
  194.     ACTION_NAMES.preprocess_assemble,
  195.     ACTION_NAMES.cpp_header_parsing,
  196.     ACTION_NAMES.cpp_module_compile,
  197.     ACTION_NAMES.cpp_module_codegen,
  198.     ACTION_NAMES.clif_match,
  199.     ACTION_NAMES.lto_backend,
  200. ]
  201.  
  202. all_cpp_compile_actions = [
  203.     ACTION_NAMES.cpp_compile,
  204.     ACTION_NAMES.linkstamp_compile,
  205.     ACTION_NAMES.cpp_header_parsing,
  206.     ACTION_NAMES.cpp_module_compile,
  207.     ACTION_NAMES.cpp_module_codegen,
  208.     ACTION_NAMES.clif_match,
  209. ]
  210.  
  211. preprocessor_compile_actions = [
  212.     ACTION_NAMES.c_compile,
  213.     ACTION_NAMES.cpp_compile,
  214.     ACTION_NAMES.linkstamp_compile,
  215.     ACTION_NAMES.preprocess_assemble,
  216.     ACTION_NAMES.cpp_header_parsing,
  217.     ACTION_NAMES.cpp_module_compile,
  218.     ACTION_NAMES.clif_match,
  219. ]
  220.  
  221. codegen_compile_actions = [
  222.     ACTION_NAMES.c_compile,
  223.     ACTION_NAMES.cpp_compile,
  224.     ACTION_NAMES.linkstamp_compile,
  225.     ACTION_NAMES.assemble,
  226.     ACTION_NAMES.preprocess_assemble,
  227.     ACTION_NAMES.cpp_module_codegen,
  228.     ACTION_NAMES.lto_backend,
  229. ]
  230.  
  231. all_link_actions = [
  232.     ACTION_NAMES.cpp_link_executable,
  233.     ACTION_NAMES.cpp_link_dynamic_library,
  234.     ACTION_NAMES.cpp_link_nodeps_dynamic_library,
  235. ]
  236.  
  237. def _windows_msvc_impl(ctx):
  238.     toolchain_identifier = "msvc_x64"
  239.     host_system_name = "local"
  240.     target_system_name = "local"
  241.     target_cpu = "x64_windows"
  242.     target_libc = "msvcrt"
  243.     compiler = "msvc-cl"
  244.     abi_version = "local"
  245.     abi_libc_version = "local"
  246.     cc_target_os = None
  247.     builtin_sysroot = None
  248.  
  249.     cxx_builtin_include_directories = [
  250. "/usr/lib/gcc/x86_64-unknown-linux-gnu/8.3.0/include",
  251.     "/usr/lib/gcc/x86_64-unknown-linux-gnu/8.3.0/include-fixed",
  252.     "/usr/include",
  253.     "/usr/include/c++/8.3.0",
  254.     "/usr/include/c++/8.3.0/x86_64-unknown-linux-gnu",
  255.     "/usr/include/c++/8.3.0/backward"
  256.     ]
  257.  
  258.     cpp_link_nodeps_dynamic_library_action = action_config(
  259.         action_name = ACTION_NAMES.cpp_link_nodeps_dynamic_library,
  260.         implies = [
  261.             "nologo",
  262.             "shared_flag",
  263.             "linkstamps",
  264.             "output_execpath_flags",
  265.             "input_param_flags",
  266.             "user_link_flags",
  267.             "default_link_flags",
  268.             "linker_subsystem_flag",
  269.             "linker_param_file",
  270.             "msvc_env",
  271.             "no_stripping",
  272.             "has_configured_linker_path",
  273.             "def_file",
  274.         ],
  275.         tools = [tool(path = "")],
  276.     )
  277.  
  278.     cpp_link_static_library_action = action_config(
  279.         action_name = ACTION_NAMES.cpp_link_static_library,
  280.         implies = [
  281.             "nologo",
  282.             "archiver_flags",
  283.             "input_param_flags",
  284.             "linker_param_file",
  285.             "msvc_env",
  286.         ],
  287.         tools = [tool(path = "")],
  288.     )
  289.  
  290.     assemble_action = action_config(
  291.         action_name = ACTION_NAMES.assemble,
  292.         implies = [
  293.             "compiler_input_flags",
  294.             "compiler_output_flags",
  295.             "nologo",
  296.             "msvc_env",
  297.             "sysroot",
  298.         ],
  299.         tools = [tool(path = "")],
  300.     )
  301.  
  302.     preprocess_assemble_action = action_config(
  303.         action_name = ACTION_NAMES.preprocess_assemble,
  304.         implies = [
  305.             "compiler_input_flags",
  306.             "compiler_output_flags",
  307.             "nologo",
  308.             "msvc_env",
  309.             "sysroot",
  310.         ],
  311.         tools = [tool(path = "")],
  312.     )
  313.  
  314.     c_compile_action = action_config(
  315.         action_name = ACTION_NAMES.c_compile,
  316.         implies = [
  317.             "compiler_input_flags",
  318.             "compiler_output_flags",
  319.             "default_compile_flags",
  320.             "nologo",
  321.             "msvc_env",
  322.             "parse_showincludes",
  323.             "user_compile_flags",
  324.             "sysroot",
  325.             "unfiltered_compile_flags",
  326.         ],
  327.         tools = [tool(path = "")],
  328.     )
  329.  
  330.     cpp_compile_action = action_config(
  331.         action_name = ACTION_NAMES.cpp_compile,
  332.         implies = [
  333.             "compiler_input_flags",
  334.             "compiler_output_flags",
  335.             "default_compile_flags",
  336.             "nologo",
  337.             "msvc_env",
  338.             "parse_showincludes",
  339.             "user_compile_flags",
  340.             "sysroot",
  341.             "unfiltered_compile_flags",
  342.         ],
  343.         tools = [tool(path = "")],
  344.     )
  345.  
  346.     cpp_link_executable_action = action_config(
  347.         action_name = ACTION_NAMES.cpp_link_executable,
  348.         implies = [
  349.             "nologo",
  350.             "linkstamps",
  351.             "output_execpath_flags",
  352.             "input_param_flags",
  353.             "user_link_flags",
  354.             "default_link_flags",
  355.             "linker_subsystem_flag",
  356.             "linker_param_file",
  357.             "msvc_env",
  358.             "no_stripping",
  359.         ],
  360.         tools = [tool(path = "")],
  361.     )
  362.  
  363.     cpp_link_dynamic_library_action = action_config(
  364.         action_name = ACTION_NAMES.cpp_link_dynamic_library,
  365.         implies = [
  366.             "nologo",
  367.             "shared_flag",
  368.             "linkstamps",
  369.             "output_execpath_flags",
  370.             "input_param_flags",
  371.             "user_link_flags",
  372.             "default_link_flags",
  373.             "linker_subsystem_flag",
  374.             "linker_param_file",
  375.             "msvc_env",
  376.             "no_stripping",
  377.             "has_configured_linker_path",
  378.             "def_file",
  379.         ],
  380.         tools = [tool(path = "")],
  381.     )
  382.  
  383.     action_configs = [
  384.         assemble_action,
  385.         preprocess_assemble_action,
  386.         c_compile_action,
  387.         cpp_compile_action,
  388.         cpp_link_executable_action,
  389.         cpp_link_dynamic_library_action,
  390.         cpp_link_nodeps_dynamic_library_action,
  391.         cpp_link_static_library_action,
  392.     ]
  393.  
  394.     msvc_link_env_feature = feature(
  395.         name = "msvc_link_env",
  396.         env_sets = [
  397.             env_set(
  398.                 actions = all_link_actions +
  399.                           [ACTION_NAMES.cpp_link_static_library],
  400.                 env_entries = [env_entry(key = "LIB", value = "")],
  401.             ),
  402.         ],
  403.     )
  404.  
  405.     shared_flag_feature = feature(
  406.         name = "shared_flag",
  407.         flag_sets = [
  408.             flag_set(
  409.                 actions = [
  410.                     ACTION_NAMES.cpp_link_dynamic_library,
  411.                     ACTION_NAMES.cpp_link_nodeps_dynamic_library,
  412.                 ],
  413.                 flag_groups = [flag_group(flags = ["/DLL"])],
  414.             ),
  415.         ],
  416.     )
  417.  
  418.     determinism_feature = feature(
  419.         name = "determinism",
  420.         enabled = True,
  421.         flag_sets = [
  422.             flag_set(
  423.                 actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile],
  424.                 flag_groups = [
  425.                     flag_group(
  426.                         flags = [
  427.                             "/wd4117",
  428.                             "-D__DATE__=\"redacted\"",
  429.                             "-D__TIMESTAMP__=\"redacted\"",
  430.                             "-D__TIME__=\"redacted\"",
  431.                         ],
  432.                     ),
  433.                 ],
  434.             ),
  435.         ],
  436.     )
  437.  
  438.     sysroot_feature = feature(
  439.         name = "sysroot",
  440.         flag_sets = [
  441.             flag_set(
  442.                 actions = [
  443.                     ACTION_NAMES.assemble,
  444.                     ACTION_NAMES.preprocess_assemble,
  445.                     ACTION_NAMES.c_compile,
  446.                     ACTION_NAMES.cpp_compile,
  447.                     ACTION_NAMES.cpp_header_parsing,
  448.                     ACTION_NAMES.cpp_module_compile,
  449.                     ACTION_NAMES.cpp_module_codegen,
  450.                     ACTION_NAMES.cpp_link_executable,
  451.                     ACTION_NAMES.cpp_link_dynamic_library,
  452.                     ACTION_NAMES.cpp_link_nodeps_dynamic_library,
  453.                 ],
  454.                 flag_groups = [
  455.                     flag_group(
  456.                         flags = ["--sysroot=%{sysroot}"],
  457.                         iterate_over = "sysroot",
  458.                         expand_if_available = "sysroot",
  459.                     ),
  460.                 ],
  461.             ),
  462.         ],
  463.     )
  464.  
  465.     unfiltered_compile_flags_feature = feature(
  466.         name = "unfiltered_compile_flags",
  467.         flag_sets = [
  468.             flag_set(
  469.                 actions = [
  470.                     ACTION_NAMES.preprocess_assemble,
  471.                     ACTION_NAMES.c_compile,
  472.                     ACTION_NAMES.cpp_compile,
  473.                     ACTION_NAMES.cpp_header_parsing,
  474.                     ACTION_NAMES.cpp_module_compile,
  475.                     ACTION_NAMES.cpp_module_codegen,
  476.                 ],
  477.                 flag_groups = [
  478.                     flag_group(
  479.                         flags = ["%{unfiltered_compile_flags}"],
  480.                         iterate_over = "unfiltered_compile_flags",
  481.                         expand_if_available = "unfiltered_compile_flags",
  482.                     ),
  483.                 ],
  484.             ),
  485.         ],
  486.     )
  487.  
  488.     compiler_param_file_feature = feature(
  489.         name = "compiler_param_file",
  490.     )
  491.  
  492.     copy_dynamic_libraries_to_binary_feature = feature(name = "copy_dynamic_libraries_to_binary")
  493.  
  494.     input_param_flags_feature = feature(
  495.         name = "input_param_flags",
  496.         flag_sets = [
  497.             flag_set(
  498.                 actions = [
  499.                     ACTION_NAMES.cpp_link_dynamic_library,
  500.                     ACTION_NAMES.cpp_link_nodeps_dynamic_library,
  501.                 ],
  502.                 flag_groups = [
  503.                     flag_group(
  504.                         flags = ["/IMPLIB:%{interface_library_output_path}"],
  505.                         expand_if_available = "interface_library_output_path",
  506.                     ),
  507.                 ],
  508.             ),
  509.             flag_set(
  510.                 actions = all_link_actions,
  511.                 flag_groups = [
  512.                     flag_group(
  513.                         flags = ["%{libopts}"],
  514.                         iterate_over = "libopts",
  515.                         expand_if_available = "libopts",
  516.                     ),
  517.                 ],
  518.             ),
  519.             flag_set(
  520.                 actions = all_link_actions +
  521.                           [ACTION_NAMES.cpp_link_static_library],
  522.                 flag_groups = [
  523.                     flag_group(
  524.                         iterate_over = "libraries_to_link",
  525.                         flag_groups = [
  526.                             flag_group(
  527.                                 iterate_over = "libraries_to_link.object_files",
  528.                                 flag_groups = [flag_group(flags = ["%{libraries_to_link.object_files}"])],
  529.                                 expand_if_equal = variable_with_value(
  530.                                     name = "libraries_to_link.type",
  531.                                     value = "object_file_group",
  532.                                 ),
  533.                             ),
  534.                             flag_group(
  535.                                 flag_groups = [flag_group(flags = ["%{libraries_to_link.name}"])],
  536.                                 expand_if_equal = variable_with_value(
  537.                                     name = "libraries_to_link.type",
  538.                                     value = "object_file",
  539.                                 ),
  540.                             ),
  541.                             flag_group(
  542.                                 flag_groups = [flag_group(flags = ["%{libraries_to_link.name}"])],
  543.                                 expand_if_equal = variable_with_value(
  544.                                     name = "libraries_to_link.type",
  545.                                     value = "interface_library",
  546.                                 ),
  547.                             ),
  548.                             flag_group(
  549.                                 flag_groups = [
  550.                                   flag_group(
  551.                                       flags = ["%{libraries_to_link.name}"],
  552.                                       expand_if_false = "libraries_to_link.is_whole_archive",
  553.                                   ),
  554.                                   flag_group(
  555.                                       flags = ["/WHOLEARCHIVE:%{libraries_to_link.name}"],
  556.                                       expand_if_true = "libraries_to_link.is_whole_archive",
  557.                                   ),
  558.                                 ],
  559.                                 expand_if_equal = variable_with_value(
  560.                                     name = "libraries_to_link.type",
  561.                                     value = "static_library",
  562.                                 ),
  563.                             ),
  564.                         ],
  565.                         expand_if_available = "libraries_to_link",
  566.                     ),
  567.                 ],
  568.             ),
  569.         ],
  570.     )
  571.  
  572.     fastbuild_feature = feature(
  573.         name = "fastbuild",
  574.         flag_sets = [
  575.             flag_set(
  576.                 actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile],
  577.                 flag_groups = [flag_group(flags = ["/Od", "/Z7"])],
  578.             ),
  579.             flag_set(
  580.                 actions = all_link_actions,
  581.                 flag_groups = [
  582.                     flag_group(
  583.                         flags = ["", "/INCREMENTAL:NO"],
  584.                     ),
  585.                 ],
  586.             ),
  587.         ],
  588.         implies = ["generate_pdb_file"],
  589.     )
  590.  
  591.     user_compile_flags_feature = feature(
  592.         name = "user_compile_flags",
  593.         flag_sets = [
  594.             flag_set(
  595.                 actions = [
  596.                     ACTION_NAMES.preprocess_assemble,
  597.                     ACTION_NAMES.c_compile,
  598.                     ACTION_NAMES.cpp_compile,
  599.                     ACTION_NAMES.cpp_header_parsing,
  600.                     ACTION_NAMES.cpp_module_compile,
  601.                     ACTION_NAMES.cpp_module_codegen,
  602.                 ],
  603.                 flag_groups = [
  604.                     flag_group(
  605.                         flags = ["%{user_compile_flags}"],
  606.                         iterate_over = "user_compile_flags",
  607.                         expand_if_available = "user_compile_flags",
  608.                     ),
  609.                 ],
  610.             ),
  611.         ],
  612.     )
  613.  
  614.     archiver_flags_feature = feature(
  615.         name = "archiver_flags",
  616.         flag_sets = [
  617.             flag_set(
  618.                 actions = [ACTION_NAMES.cpp_link_static_library],
  619.                 flag_groups = [
  620.                     flag_group(
  621.                         flags = ["/OUT:%{output_execpath}"],
  622.                         expand_if_available = "output_execpath",
  623.                     ),
  624.                     flag_group(
  625.                         flags = ["/MACHINE:X64"]
  626.                     ),
  627.                 ],
  628.             ),
  629.         ],
  630.     )
  631.  
  632.     default_link_flags_feature = feature(
  633.         name = "default_link_flags",
  634.         enabled = True,
  635.         flag_sets = [
  636.             flag_set(
  637.                 actions = all_link_actions,
  638.                 flag_groups = [flag_group(flags = ["/MACHINE:X64"])],
  639.             ),
  640.          ],
  641.     )
  642.  
  643.     static_link_msvcrt_feature = feature(name = "static_link_msvcrt")
  644.  
  645.     dynamic_link_msvcrt_debug_feature = feature(
  646.         name = "dynamic_link_msvcrt_debug",
  647.         flag_sets = [
  648.             flag_set(
  649.                 actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile],
  650.                 flag_groups = [flag_group(flags = ["/MDd"])],
  651.             ),
  652.             flag_set(
  653.                 actions = all_link_actions,
  654.                 flag_groups = [flag_group(flags = ["/DEFAULTLIB:msvcrtd.lib"])],
  655.             ),
  656.         ],
  657.         requires = [feature_set(features = ["dbg"])],
  658.     )
  659.  
  660.     dbg_feature = feature(
  661.         name = "dbg",
  662.         flag_sets = [
  663.             flag_set(
  664.                 actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile],
  665.                 flag_groups = [flag_group(flags = ["/Od", "/Z7"])],
  666.             ),
  667.             flag_set(
  668.                 actions = all_link_actions,
  669.                 flag_groups = [
  670.                   flag_group(
  671.                       flags = ["", "/INCREMENTAL:NO"],
  672.                   ),
  673.                 ],
  674.             ),
  675.         ],
  676.         implies = ["generate_pdb_file"],
  677.     )
  678.  
  679.     opt_feature = feature(
  680.         name = "opt",
  681.         flag_sets = [
  682.             flag_set(
  683.                 actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile],
  684.                 flag_groups = [flag_group(flags = ["/O2"])],
  685.             ),
  686.         ],
  687.         implies = ["frame_pointer"],
  688.     )
  689.  
  690.     supports_interface_shared_libraries_feature = feature(
  691.         name = "supports_interface_shared_libraries",
  692.         enabled = True,
  693.     )
  694.  
  695.     user_link_flags_feature = feature(
  696.         name = "user_link_flags",
  697.         flag_sets = [
  698.             flag_set(
  699.                 actions = all_link_actions,
  700.                 flag_groups = [
  701.                     flag_group(
  702.                         flags = ["%{user_link_flags}"],
  703.                         iterate_over = "user_link_flags",
  704.                         expand_if_available = "user_link_flags",
  705.                     ),
  706.                 ],
  707.             ),
  708.         ],
  709.     )
  710.  
  711.     default_compile_flags_feature = feature(
  712.         name = "default_compile_flags",
  713.         enabled = True,
  714.         flag_sets = [
  715.             flag_set(
  716.                 actions = [
  717.                     ACTION_NAMES.assemble,
  718.                     ACTION_NAMES.preprocess_assemble,
  719.                     ACTION_NAMES.linkstamp_compile,
  720.                     ACTION_NAMES.c_compile,
  721.                     ACTION_NAMES.cpp_compile,
  722.                     ACTION_NAMES.cpp_header_parsing,
  723.                     ACTION_NAMES.cpp_module_compile,
  724.                     ACTION_NAMES.cpp_module_codegen,
  725.                     ACTION_NAMES.lto_backend,
  726.                     ACTION_NAMES.clif_match,
  727.                 ],
  728.                 flag_groups = [
  729.                     flag_group(
  730.                         flags = [
  731.                             "/DCOMPILER_MSVC",
  732.                             "/DNOMINMAX",
  733.                             "/D_WIN32_WINNT=0x0601",
  734.                             "/D_CRT_SECURE_NO_DEPRECATE",
  735.                             "/D_CRT_SECURE_NO_WARNINGS",
  736.                             "/bigobj",
  737.                             "/Zm500",
  738.                             "/EHsc",
  739.                             "/wd4351",
  740.                             "/wd4291",
  741.                             "/wd4250",
  742.                             "/wd4996",
  743.                         ],
  744.                     ),
  745.                 ],
  746.             ),
  747.         ],
  748.     )
  749.  
  750.     msvc_compile_env_feature = feature(
  751.         name = "msvc_compile_env",
  752.         env_sets = [
  753.             env_set(
  754.                 actions = [
  755.                     ACTION_NAMES.c_compile,
  756.                     ACTION_NAMES.cpp_compile,
  757.                     ACTION_NAMES.cpp_module_compile,
  758.                     ACTION_NAMES.cpp_module_codegen,
  759.                     ACTION_NAMES.cpp_header_parsing,
  760.                     ACTION_NAMES.assemble,
  761.                     ACTION_NAMES.preprocess_assemble,
  762.                 ],
  763.                 env_entries = [env_entry(key = "INCLUDE", value = "")],
  764.             ),
  765.         ],
  766.     )
  767.  
  768.     preprocessor_defines_feature = feature(
  769.         name = "preprocessor_defines",
  770.         enabled = True,
  771.         flag_sets = [
  772.             flag_set(
  773.                 actions = [
  774.                     ACTION_NAMES.assemble,
  775.                     ACTION_NAMES.preprocess_assemble,
  776.                     ACTION_NAMES.c_compile,
  777.                     ACTION_NAMES.cpp_compile,
  778.                     ACTION_NAMES.cpp_header_parsing,
  779.                     ACTION_NAMES.cpp_module_compile,
  780.                 ],
  781.                 flag_groups = [
  782.                     flag_group(
  783.                         flags = ["/D%{preprocessor_defines}"],
  784.                         iterate_over = "preprocessor_defines",
  785.                     ),
  786.                 ],
  787.             ),
  788.         ],
  789.     )
  790.  
  791.     generate_pdb_file_feature = feature(
  792.         name = "generate_pdb_file",
  793.         requires = [
  794.             feature_set(features = ["dbg"]),
  795.             feature_set(features = ["fastbuild"]),
  796.         ],
  797.     )
  798.  
  799.     output_execpath_flags_feature = feature(
  800.         name = "output_execpath_flags",
  801.         flag_sets = [
  802.             flag_set(
  803.                 actions = all_link_actions,
  804.                 flag_groups = [
  805.                     flag_group(
  806.                         flags = ["/OUT:%{output_execpath}"],
  807.                         expand_if_available = "output_execpath",
  808.                     ),
  809.                 ],
  810.             ),
  811.         ],
  812.     )
  813.  
  814.     dynamic_link_msvcrt_no_debug_feature = feature(
  815.         name = "dynamic_link_msvcrt_no_debug",
  816.         flag_sets = [
  817.             flag_set(
  818.                 actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile],
  819.                 flag_groups = [flag_group(flags = ["/MD"])],
  820.             ),
  821.             flag_set(
  822.                 actions = all_link_actions,
  823.                 flag_groups = [flag_group(flags = ["/DEFAULTLIB:msvcrt.lib"])],
  824.             ),
  825.           ],
  826.           requires = [
  827.               feature_set(features = ["fastbuild"]),
  828.               feature_set(features = ["opt"]),
  829.           ],
  830.     )
  831.  
  832.     disable_assertions_feature = feature(
  833.         name = "disable_assertions",
  834.         enabled = True,
  835.         flag_sets = [
  836.             flag_set(
  837.                 actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile],
  838.                 flag_groups = [flag_group(flags = ["/DNDEBUG"])],
  839.                 with_features = [with_feature_set(features = ["opt"])],
  840.             ),
  841.         ],
  842.     )
  843.  
  844.     has_configured_linker_path_feature = feature(name = "has_configured_linker_path")
  845.  
  846.     supports_dynamic_linker_feature = feature(name = "supports_dynamic_linker", enabled = True)
  847.  
  848.     no_stripping_feature = feature(name = "no_stripping")
  849.  
  850.     linker_param_file_feature = feature(
  851.         name = "linker_param_file",
  852.         flag_sets = [
  853.             flag_set(
  854.                 actions = all_link_actions +
  855.                           [ACTION_NAMES.cpp_link_static_library],
  856.                 flag_groups = [
  857.                     flag_group(
  858.                         flags = ["@%{linker_param_file}"],
  859.                         expand_if_available = "linker_param_file",
  860.                     ),
  861.                 ],
  862.             ),
  863.         ],
  864.     )
  865.  
  866.     ignore_noisy_warnings_feature = feature(
  867.         name = "ignore_noisy_warnings",
  868.         enabled = True,
  869.         flag_sets = [
  870.             flag_set(
  871.                 actions = [ACTION_NAMES.cpp_link_static_library],
  872.                 flag_groups = [flag_group(flags = ["/ignore:4221"])],
  873.             ),
  874.         ],
  875.     )
  876.  
  877.     no_legacy_features_feature = feature(name = "no_legacy_features")
  878.  
  879.     parse_showincludes_feature = feature(
  880.         name = "parse_showincludes",
  881.         flag_sets = [
  882.             flag_set(
  883.                 actions = [
  884.                     ACTION_NAMES.preprocess_assemble,
  885.                     ACTION_NAMES.c_compile,
  886.                     ACTION_NAMES.cpp_compile,
  887.                     ACTION_NAMES.cpp_module_compile,
  888.                     ACTION_NAMES.cpp_header_parsing,
  889.                 ],
  890.                 flag_groups = [flag_group(flags = ["/showIncludes"])],
  891.             ),
  892.         ],
  893.     )
  894.  
  895.     static_link_msvcrt_no_debug_feature = feature(
  896.         name = "static_link_msvcrt_no_debug",
  897.         flag_sets = [
  898.             flag_set(
  899.                 actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile],
  900.                 flag_groups = [flag_group(flags = ["/MT"])],
  901.             ),
  902.             flag_set(
  903.                 actions = all_link_actions,
  904.                 flag_groups = [flag_group(flags = ["/DEFAULTLIB:libcmt.lib"])],
  905.             ),
  906.         ],
  907.         requires = [
  908.             feature_set(features = ["fastbuild"]),
  909.             feature_set(features = ["opt"]),
  910.         ],
  911.     )
  912.  
  913.     treat_warnings_as_errors_feature = feature(
  914.         name = "treat_warnings_as_errors",
  915.         flag_sets = [
  916.             flag_set(
  917.                 actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile],
  918.                 flag_groups = [flag_group(flags = ["/WX"])],
  919.             ),
  920.         ],
  921.     )
  922.  
  923.     windows_export_all_symbols_feature = feature(name = "windows_export_all_symbols")
  924.  
  925.     no_windows_export_all_symbols_feature = feature(name = "no_windows_export_all_symbols")
  926.  
  927.     include_paths_feature = feature(
  928.         name = "include_paths",
  929.         enabled = True,
  930.         flag_sets = [
  931.             flag_set(
  932.                 actions = [
  933.                     ACTION_NAMES.assemble,
  934.                     ACTION_NAMES.preprocess_assemble,
  935.                     ACTION_NAMES.c_compile,
  936.                     ACTION_NAMES.cpp_compile,
  937.                     ACTION_NAMES.cpp_header_parsing,
  938.                     ACTION_NAMES.cpp_module_compile,
  939.                 ],
  940.                 flag_groups = [
  941.                     flag_group(
  942.                         flags = ["/I%{quote_include_paths}"],
  943.                         iterate_over = "quote_include_paths",
  944.                     ),
  945.                     flag_group(
  946.                         flags = ["/I%{include_paths}"],
  947.                         iterate_over = "include_paths",
  948.                     ),
  949.                     flag_group(
  950.                         flags = ["/I%{system_include_paths}"],
  951.                         iterate_over = "system_include_paths",
  952.                     ),
  953.                 ],
  954.             ),
  955.         ],
  956.     )
  957.  
  958.     linkstamps_feature = feature(
  959.         name = "linkstamps",
  960.         flag_sets = [
  961.             flag_set(
  962.                 actions = all_link_actions,
  963.                 flag_groups = [
  964.                     flag_group(
  965.                         flags = ["%{linkstamp_paths}"],
  966.                         iterate_over = "linkstamp_paths",
  967.                         expand_if_available = "linkstamp_paths",
  968.                     ),
  969.                 ],
  970.             ),
  971.         ],
  972.     )
  973.  
  974.     targets_windows_feature = feature(
  975.         name = "targets_windows",
  976.         enabled = True,
  977.         implies = ["copy_dynamic_libraries_to_binary"],
  978.     )
  979.  
  980.     linker_subsystem_flag_feature = feature(
  981.         name = "linker_subsystem_flag",
  982.         flag_sets = [
  983.             flag_set(
  984.                 actions = all_link_actions,
  985.                 flag_groups = [flag_group(flags = ["/SUBSYSTEM:CONSOLE"])],
  986.             ),
  987.         ],
  988.     )
  989.  
  990.     static_link_msvcrt_debug_feature = feature(
  991.         name = "static_link_msvcrt_debug",
  992.         flag_sets = [
  993.             flag_set(
  994.                 actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile],
  995.                 flag_groups = [flag_group(flags = ["/MTd"])],
  996.             ),
  997.             flag_set(
  998.                 actions = all_link_actions,
  999.                 flag_groups = [flag_group(flags = ["/DEFAULTLIB:libcmtd.lib"])],
  1000.             ),
  1001.         ],
  1002.         requires = [feature_set(features = ["dbg"])],
  1003.     )
  1004.  
  1005.     frame_pointer_feature = feature(
  1006.         name = "frame_pointer",
  1007.         flag_sets = [
  1008.             flag_set(
  1009.                 actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile],
  1010.                 flag_groups = [flag_group(flags = ["/Oy-"])],
  1011.             ),
  1012.         ],
  1013.     )
  1014.  
  1015.     compiler_output_flags_feature = feature(
  1016.         name = "compiler_output_flags",
  1017.         flag_sets = [
  1018.             flag_set(
  1019.                 actions = [ACTION_NAMES.assemble],
  1020.                 flag_groups = [
  1021.                   flag_group(
  1022.                       flag_groups = [
  1023.                           flag_group(
  1024.                               flags = ["/Fo%{output_file}", "/Zi"],
  1025.                               expand_if_available = "output_file",
  1026.                               expand_if_not_available = "output_assembly_file",
  1027.                           ),
  1028.                       ],
  1029.                       expand_if_not_available = "output_preprocess_file",
  1030.                   ),
  1031.                 ],
  1032.             ),
  1033.             flag_set(
  1034.                 actions = [
  1035.                     ACTION_NAMES.preprocess_assemble,
  1036.                     ACTION_NAMES.c_compile,
  1037.                     ACTION_NAMES.cpp_compile,
  1038.                     ACTION_NAMES.cpp_header_parsing,
  1039.                     ACTION_NAMES.cpp_module_compile,
  1040.                     ACTION_NAMES.cpp_module_codegen,
  1041.                 ],
  1042.                 flag_groups = [
  1043.                     flag_group(
  1044.                         flag_groups = [
  1045.                             flag_group(
  1046.                                 flags = ["/Fo%{output_file}"],
  1047.                                 expand_if_not_available = "output_preprocess_file",
  1048.                             ),
  1049.                         ],
  1050.                         expand_if_available = "output_file",
  1051.                         expand_if_not_available = "output_assembly_file",
  1052.                     ),
  1053.                     flag_group(
  1054.                         flag_groups = [
  1055.                             flag_group(
  1056.                                 flags = ["/Fa%{output_file}"],
  1057.                                 expand_if_available = "output_assembly_file",
  1058.                             ),
  1059.                         ],
  1060.                         expand_if_available = "output_file",
  1061.                     ),
  1062.                     flag_group(
  1063.                         flag_groups = [
  1064.                             flag_group(
  1065.                                 flags = ["/P", "/Fi%{output_file}"],
  1066.                                 expand_if_available = "output_preprocess_file",
  1067.                             ),
  1068.                         ],
  1069.                         expand_if_available = "output_file",
  1070.                     ),
  1071.                 ],
  1072.             ),
  1073.         ],
  1074.     )
  1075.  
  1076.     nologo_feature = feature(
  1077.         name = "nologo",
  1078.         flag_sets = [
  1079.             flag_set(
  1080.                 actions = [
  1081.                     ACTION_NAMES.c_compile,
  1082.                     ACTION_NAMES.cpp_compile,
  1083.                     ACTION_NAMES.cpp_module_compile,
  1084.                     ACTION_NAMES.cpp_module_codegen,
  1085.                     ACTION_NAMES.cpp_header_parsing,
  1086.                     ACTION_NAMES.assemble,
  1087.                     ACTION_NAMES.preprocess_assemble,
  1088.                     ACTION_NAMES.cpp_link_executable,
  1089.                     ACTION_NAMES.cpp_link_dynamic_library,
  1090.                     ACTION_NAMES.cpp_link_nodeps_dynamic_library,
  1091.                     ACTION_NAMES.cpp_link_static_library,
  1092.                 ],
  1093.                 flag_groups = [flag_group(flags = ["/nologo"])],
  1094.             ),
  1095.         ],
  1096.     )
  1097.  
  1098.     smaller_binary_feature = feature(
  1099.         name = "smaller_binary",
  1100.         enabled = True,
  1101.         flag_sets = [
  1102.             flag_set(
  1103.                 actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile],
  1104.                 flag_groups = [flag_group(flags = ["/Gy", "/Gw"])],
  1105.                 with_features = [with_feature_set(features = ["opt"])],
  1106.             ),
  1107.             flag_set(
  1108.                 actions = all_link_actions,
  1109.                 flag_groups = [flag_group(flags = ["/OPT:ICF", "/OPT:REF"])],
  1110.                 with_features = [with_feature_set(features = ["opt"])],
  1111.             ),
  1112.         ],
  1113.     )
  1114.  
  1115.     compiler_input_flags_feature = feature(
  1116.         name = "compiler_input_flags",
  1117.         flag_sets = [
  1118.             flag_set(
  1119.                 actions = [
  1120.                     ACTION_NAMES.assemble,
  1121.                     ACTION_NAMES.preprocess_assemble,
  1122.                     ACTION_NAMES.c_compile,
  1123.                     ACTION_NAMES.cpp_compile,
  1124.                     ACTION_NAMES.cpp_header_parsing,
  1125.                     ACTION_NAMES.cpp_module_compile,
  1126.                     ACTION_NAMES.cpp_module_codegen,
  1127.                 ],
  1128.                 flag_groups = [
  1129.                     flag_group(
  1130.                         flags = ["/c", "%{source_file}"],
  1131.                         expand_if_available = "source_file",
  1132.                     ),
  1133.                 ],
  1134.             ),
  1135.         ],
  1136.     )
  1137.  
  1138.     def_file_feature = feature(
  1139.         name = "def_file",
  1140.         flag_sets = [
  1141.             flag_set(
  1142.                 actions = all_link_actions,
  1143.                 flag_groups = [
  1144.                     flag_group(
  1145.                         flags = ["/DEF:%{def_file_path}", "/ignore:4070"],
  1146.                         expand_if_available = "def_file_path",
  1147.                     ),
  1148.                 ],
  1149.             ),
  1150.         ],
  1151.     )
  1152.  
  1153.     msvc_env_feature = feature(
  1154.         name = "msvc_env",
  1155.         env_sets = [
  1156.             env_set(
  1157.                 actions = [
  1158.                     ACTION_NAMES.c_compile,
  1159.                     ACTION_NAMES.cpp_compile,
  1160.                     ACTION_NAMES.cpp_module_compile,
  1161.                     ACTION_NAMES.cpp_module_codegen,
  1162.                     ACTION_NAMES.cpp_header_parsing,
  1163.                     ACTION_NAMES.assemble,
  1164.                     ACTION_NAMES.preprocess_assemble,
  1165.                     ACTION_NAMES.cpp_link_executable,
  1166.                     ACTION_NAMES.cpp_link_dynamic_library,
  1167.                     ACTION_NAMES.cpp_link_nodeps_dynamic_library,
  1168.                     ACTION_NAMES.cpp_link_static_library,
  1169.                 ],
  1170.                 env_entries = [
  1171.                     env_entry(key = "PATH", value = ""),
  1172.                     env_entry(key = "TMP", value = ""),
  1173.                     env_entry(key = "TEMP", value = ""),
  1174.                 ],
  1175.             ),
  1176.         ],
  1177.         implies = ["msvc_compile_env", "msvc_link_env"],
  1178.     )
  1179.  
  1180.     features = [
  1181.         no_legacy_features_feature,
  1182.         nologo_feature,
  1183.         has_configured_linker_path_feature,
  1184.         no_stripping_feature,
  1185.         targets_windows_feature,
  1186.         copy_dynamic_libraries_to_binary_feature,
  1187.         default_compile_flags_feature,
  1188.         msvc_env_feature,
  1189.         msvc_compile_env_feature,
  1190.         msvc_link_env_feature,
  1191.         include_paths_feature,
  1192.         preprocessor_defines_feature,
  1193.         parse_showincludes_feature,
  1194.         generate_pdb_file_feature,
  1195.         shared_flag_feature,
  1196.         linkstamps_feature,
  1197.         output_execpath_flags_feature,
  1198.         archiver_flags_feature,
  1199.         input_param_flags_feature,
  1200.         linker_subsystem_flag_feature,
  1201.         user_link_flags_feature,
  1202.         default_link_flags_feature,
  1203.         linker_param_file_feature,
  1204.         static_link_msvcrt_feature,
  1205.         static_link_msvcrt_no_debug_feature,
  1206.         dynamic_link_msvcrt_no_debug_feature,
  1207.         static_link_msvcrt_debug_feature,
  1208.         dynamic_link_msvcrt_debug_feature,
  1209.         dbg_feature,
  1210.         fastbuild_feature,
  1211.         opt_feature,
  1212.         frame_pointer_feature,
  1213.         disable_assertions_feature,
  1214.         determinism_feature,
  1215.         treat_warnings_as_errors_feature,
  1216.         smaller_binary_feature,
  1217.         ignore_noisy_warnings_feature,
  1218.         user_compile_flags_feature,
  1219.         sysroot_feature,
  1220.         unfiltered_compile_flags_feature,
  1221.         compiler_param_file_feature,
  1222.         compiler_output_flags_feature,
  1223.         compiler_input_flags_feature,
  1224.         def_file_feature,
  1225.         windows_export_all_symbols_feature,
  1226.         no_windows_export_all_symbols_feature,
  1227.         supports_dynamic_linker_feature,
  1228.         supports_interface_shared_libraries_feature,
  1229.     ]
  1230.  
  1231.     artifact_name_patterns = [
  1232.         artifact_name_pattern(
  1233.             category_name = "object_file",
  1234.             prefix = "",
  1235.             extension = ".obj",
  1236.         ),
  1237.         artifact_name_pattern(
  1238.             category_name = "static_library",
  1239.             prefix = "",
  1240.             extension = ".lib",
  1241.         ),
  1242.         artifact_name_pattern(
  1243.             category_name = "alwayslink_static_library",
  1244.             prefix = "",
  1245.             extension = ".lo.lib",
  1246.         ),
  1247.         artifact_name_pattern(
  1248.             category_name = "executable",
  1249.             prefix = "",
  1250.             extension = ".exe",
  1251.         ),
  1252.         artifact_name_pattern(
  1253.             category_name = "dynamic_library",
  1254.             prefix = "",
  1255.             extension = ".dll",
  1256.         ),
  1257.         artifact_name_pattern(
  1258.             category_name = "interface_library",
  1259.             prefix = "",
  1260.             extension = ".if.lib",
  1261.         ),
  1262.     ]
  1263.  
  1264.     make_variables = []
  1265.  
  1266.     tool_paths = [
  1267.         tool_path(name = "ar", path = ""),
  1268.         tool_path(name = "ml", path = ""),
  1269.         tool_path(name = "cpp", path = ""),
  1270.         tool_path(name = "gcc", path = ""),
  1271.         tool_path(name = "gcov", path = "wrapper/bin/msvc_nop.bat"),
  1272.         tool_path(name = "ld", path = ""),
  1273.         tool_path(name = "nm", path = "wrapper/bin/msvc_nop.bat"),
  1274.         tool_path(
  1275.             name = "objcopy",
  1276.             path = "wrapper/bin/msvc_nop.bat",
  1277.         ),
  1278.         tool_path(
  1279.             name = "objdump",
  1280.             path = "wrapper/bin/msvc_nop.bat",
  1281.         ),
  1282.         tool_path(
  1283.             name = "strip",
  1284.             path = "wrapper/bin/msvc_nop.bat",
  1285.         ),
  1286.     ]
  1287.  
  1288.     return cc_common.create_cc_toolchain_config_info(
  1289.         ctx = ctx,
  1290.         features = features,
  1291.         action_configs = action_configs,
  1292.         artifact_name_patterns = artifact_name_patterns,
  1293.         cxx_builtin_include_directories = cxx_builtin_include_directories,
  1294.         toolchain_identifier = toolchain_identifier,
  1295.         host_system_name = host_system_name,
  1296.         target_system_name = target_system_name,
  1297.         target_cpu = target_cpu,
  1298.         target_libc = target_libc,
  1299.         compiler = compiler,
  1300.         abi_version = abi_version,
  1301.         abi_libc_version = abi_libc_version,
  1302.         tool_paths = tool_paths,
  1303.         make_variables = make_variables,
  1304.         builtin_sysroot = builtin_sysroot,
  1305.         cc_target_os = None,
  1306.     )
  1307.  
  1308. def _windows_msys_mingw_impl(ctx):
  1309.     toolchain_identifier = "msys_x64_mingw"
  1310.     host_system_name = "local"
  1311.     target_system_name = "local"
  1312.     target_cpu = "x64_windows"
  1313.     target_libc = "mingw"
  1314.     compiler = "mingw-gcc"
  1315.     abi_version = "local"
  1316.     abi_libc_version = "local"
  1317.     cc_target_os = None
  1318.     builtin_sysroot = None
  1319.     action_configs = []
  1320.  
  1321.     targets_windows_feature = feature(
  1322.         name = "targets_windows",
  1323.         implies = ["copy_dynamic_libraries_to_binary"],
  1324.         enabled = True,
  1325.     )
  1326.  
  1327.     copy_dynamic_libraries_to_binary_feature = feature(name= "copy_dynamic_libraries_to_binary")
  1328.  
  1329.     gcc_env_feature = feature(
  1330.         name = "gcc_env",
  1331.         enabled = True,
  1332.         env_sets = [
  1333.             env_set (
  1334.                 actions = [
  1335.                     ACTION_NAMES.c_compile,
  1336.                     ACTION_NAMES.cpp_compile,
  1337.                     ACTION_NAMES.cpp_module_compile,
  1338.                     ACTION_NAMES.cpp_module_codegen,
  1339.                     ACTION_NAMES.cpp_header_parsing,
  1340.                     ACTION_NAMES.assemble,
  1341.                     ACTION_NAMES.preprocess_assemble,
  1342.                     ACTION_NAMES.cpp_link_executable,
  1343.                     ACTION_NAMES.cpp_link_dynamic_library,
  1344.                     ACTION_NAMES.cpp_link_nodeps_dynamic_library,
  1345.                     ACTION_NAMES.cpp_link_static_library,
  1346.                 ],
  1347.                 env_entries = [
  1348.                     env_entry(key = "PATH", value = "NOT_USED")
  1349.                 ],
  1350.             ),
  1351.         ],
  1352.     )
  1353.  
  1354.     msys_mingw_flags = [
  1355.  
  1356.     ]
  1357.     msys_mingw_link_flags = [
  1358.  
  1359.     ]
  1360.  
  1361.     default_compile_flags_feature = feature(
  1362.         name = "default_compile_flags",
  1363.         enabled = True,
  1364.         flag_sets = [
  1365.             flag_set(
  1366.                 actions = [
  1367.                     ACTION_NAMES.assemble,
  1368.                     ACTION_NAMES.preprocess_assemble,
  1369.                     ACTION_NAMES.linkstamp_compile,
  1370.                     ACTION_NAMES.c_compile,
  1371.                     ACTION_NAMES.cpp_compile,
  1372.                     ACTION_NAMES.cpp_header_parsing,
  1373.                     ACTION_NAMES.cpp_module_compile,
  1374.                     ACTION_NAMES.cpp_module_codegen,
  1375.                     ACTION_NAMES.lto_backend,
  1376.                     ACTION_NAMES.clif_match,
  1377.                 ],
  1378.             ),
  1379.             flag_set(
  1380.                 actions = [
  1381.                     ACTION_NAMES.linkstamp_compile,
  1382.                     ACTION_NAMES.cpp_compile,
  1383.                     ACTION_NAMES.cpp_header_parsing,
  1384.                     ACTION_NAMES.cpp_module_compile,
  1385.                     ACTION_NAMES.cpp_module_codegen,
  1386.                     ACTION_NAMES.lto_backend,
  1387.                     ACTION_NAMES.clif_match,
  1388.                 ],
  1389.                 flag_groups = ([flag_group(flags = msys_mingw_flags)] if msys_mingw_flags else []),
  1390.             ),
  1391.         ],
  1392.     )
  1393.  
  1394.     compiler_param_file_feature = feature(
  1395.         name = "compiler_param_file",
  1396.     )
  1397.  
  1398.     default_link_flags_feature = feature(
  1399.         name = "default_link_flags",
  1400.         enabled = True,
  1401.         flag_sets = [
  1402.             flag_set(
  1403.                 actions = all_link_actions,
  1404.                 flag_groups = ([flag_group(flags = msys_mingw_link_flags)] if msys_mingw_link_flags else []),
  1405.             ),
  1406.         ],
  1407.     )
  1408.  
  1409.     supports_dynamic_linker_feature = feature(name = "supports_dynamic_linker", enabled = True)
  1410.  
  1411.     features = [
  1412.         targets_windows_feature,
  1413.         copy_dynamic_libraries_to_binary_feature,
  1414.         gcc_env_feature,
  1415.         default_compile_flags_feature,
  1416.         compiler_param_file_feature,
  1417.         default_link_flags_feature,
  1418.         supports_dynamic_linker_feature,
  1419.     ]
  1420.  
  1421.     cxx_builtin_include_directories = [
  1422.  
  1423.     ]
  1424.  
  1425.     artifact_name_patterns = [
  1426.         artifact_name_pattern(
  1427.             category_name = "executable",
  1428.             prefix = "",
  1429.             extension = ".exe",
  1430.         ),
  1431.     ]
  1432.  
  1433.     make_variables = []
  1434.     tool_paths = [
  1435.  
  1436.     ]
  1437.  
  1438.     return cc_common.create_cc_toolchain_config_info(
  1439.         ctx = ctx,
  1440.         features = features,
  1441.         action_configs = action_configs,
  1442.         artifact_name_patterns = artifact_name_patterns,
  1443.         cxx_builtin_include_directories = cxx_builtin_include_directories,
  1444.         toolchain_identifier = toolchain_identifier,
  1445.         host_system_name = host_system_name,
  1446.         target_system_name = target_system_name,
  1447.         target_cpu = target_cpu,
  1448.         target_libc = target_libc,
  1449.         compiler = compiler,
  1450.         abi_version = abi_version,
  1451.         abi_libc_version = abi_libc_version,
  1452.         tool_paths = tool_paths,
  1453.         make_variables = make_variables,
  1454.         builtin_sysroot = builtin_sysroot,
  1455.         cc_target_os = cc_target_os)
  1456.  
  1457.  
  1458. def _armeabi_impl(ctx):
  1459.     toolchain_identifier = "stub_armeabi-v7a"
  1460.     host_system_name = "armeabi-v7a"
  1461.     target_system_name = "armeabi-v7a"
  1462.     target_cpu = "armeabi-v7a"
  1463.     target_libc = "armeabi-v7a"
  1464.     compiler = "compiler"
  1465.     abi_version = "armeabi-v7a"
  1466.     abi_libc_version = "armeabi-v7a"
  1467.     cc_target_os = None
  1468.     builtin_sysroot = None
  1469.     action_configs = []
  1470.  
  1471.     supports_pic_feature = feature(name = "supports_pic", enabled = True)
  1472.     supports_dynamic_linker_feature = feature(name = "supports_dynamic_linker", enabled = True)
  1473.     features = [supports_dynamic_linker_feature, supports_pic_feature]
  1474.  
  1475.     cxx_builtin_include_directories = []
  1476.     artifact_name_patterns = []
  1477.     make_variables = []
  1478.  
  1479.     tool_paths = [
  1480.         tool_path(name = "ar", path = "/bin/false"),
  1481.         tool_path(name = "compat-ld", path = "/bin/false"),
  1482.         tool_path(name = "cpp", path = "/bin/false"),
  1483.         tool_path(name = "dwp", path = "/bin/false"),
  1484.         tool_path(name = "gcc", path = "/bin/false"),
  1485.         tool_path(name = "gcov", path = "/bin/false"),
  1486.         tool_path(name = "ld", path = "/bin/false"),
  1487.         tool_path(name = "nm", path = "/bin/false"),
  1488.         tool_path(name = "objcopy", path = "/bin/false"),
  1489.         tool_path(name = "objdump", path = "/bin/false"),
  1490.         tool_path(name = "strip", path = "/bin/false"),
  1491.     ]
  1492.  
  1493.     return cc_common.create_cc_toolchain_config_info(
  1494.         ctx = ctx,
  1495.         features = features,
  1496.         action_configs = action_configs,
  1497.         artifact_name_patterns = artifact_name_patterns,
  1498.         cxx_builtin_include_directories = cxx_builtin_include_directories,
  1499.         toolchain_identifier = toolchain_identifier,
  1500.         host_system_name = host_system_name,
  1501.         target_system_name = target_system_name,
  1502.         target_cpu = target_cpu,
  1503.         target_libc = target_libc,
  1504.         compiler = compiler,
  1505.         abi_version = abi_version,
  1506.         abi_libc_version = abi_libc_version,
  1507.         tool_paths = tool_paths,
  1508.         make_variables = make_variables,
  1509.         builtin_sysroot = builtin_sysroot,
  1510.         cc_target_os = cc_target_os
  1511.     )
  1512.  
  1513. def _impl(ctx):
  1514.     if ctx.attr.cpu == "armeabi-v7a":
  1515.         return _armeabi_impl(ctx)
  1516.     elif ctx.attr.cpu == "x64_windows" and ctx.attr.compiler == "msvc-cl":
  1517.         return _windows_msvc_impl(ctx)
  1518.     elif ctx.attr.cpu == "x64_windows" and ctx.attr.compiler == "mingw-gcc":
  1519.         return _windows_msys_mingw_impl(ctx)
  1520.  
  1521.     tool_paths = [
  1522.         tool_path ( name= "ar", path= "/usr/sbin/ar" ),
  1523.         tool_path ( name= "ld", path= "/usr/sbin/ld" ),
  1524.         tool_path ( name= "cpp", path= "/usr/sbin/cpp" ),
  1525.         tool_path ( name= "gcc", path= "/usr/sbin/gcc" ),
  1526.         tool_path ( name= "dwp", path= "/usr/sbin/dwp" ),
  1527.         tool_path ( name= "gcov", path= "/usr/sbin/gcov" ),
  1528.         tool_path ( name= "nm", path= "/usr/sbin/nm" ),
  1529.         tool_path ( name= "objcopy", path= "/usr/sbin/objcopy" ),
  1530.         tool_path ( name= "objdump", path= "/usr/sbin/objdump" ),
  1531.         tool_path ( name= "strip", path= "/usr/sbin/strip" ),
  1532.     ]
  1533.  
  1534.     cxx_builtin_include_directories = [
  1535. "/usr/lib/gcc/x86_64-unknown-linux-gnu/8.3.0/include",
  1536.     "/usr/lib/gcc/x86_64-unknown-linux-gnu/8.3.0/include-fixed",
  1537.     "/usr/include",
  1538.     "/usr/include/c++/8.3.0",
  1539.     "/usr/include/c++/8.3.0/x86_64-unknown-linux-gnu",
  1540.     "/usr/include/c++/8.3.0/backward"
  1541.     ]
  1542.  
  1543.     action_configs = []
  1544.  
  1545.     compile_flags = [
  1546.         "-U_FORTIFY_SOURCE",
  1547.     "-fstack-protector",
  1548.     "-Wall",
  1549.     "-Wunused-but-set-parameter",
  1550.     "-Wno-free-nonheap-object",
  1551.     "-fno-omit-frame-pointer"
  1552.     ]
  1553.  
  1554.     dbg_compile_flags = [
  1555.         "-g"
  1556.     ]
  1557.  
  1558.     opt_compile_flags = [
  1559.         "-g0",
  1560.     "-O2",
  1561.     "-D_FORTIFY_SOURCE=1",
  1562.     "-DNDEBUG",
  1563.     "-ffunction-sections",
  1564.     "-fdata-sections"
  1565.     ]
  1566.  
  1567.     cxx_flags = [
  1568.         "-std=c++0x"
  1569.     ]
  1570.  
  1571.     link_flags = [
  1572.         "-fuse-ld=gold",
  1573.     "-Wl,-no-as-needed",
  1574.     "-Wl,-z,relro,-z,now",
  1575.     "-B/usr/sbin",
  1576.     "-pass-exit-codes",
  1577.     "-lstdc++",
  1578.     "-lm"
  1579.     ]
  1580.  
  1581.     opt_link_flags = [
  1582.         "-Wl,--gc-sections"
  1583.     ]
  1584.  
  1585.     unfiltered_compile_flags = [
  1586.         "-fno-canonical-system-headers",
  1587.     "-Wno-builtin-macro-redefined",
  1588.     "-D__DATE__=\"redacted\"",
  1589.     "-D__TIMESTAMP__=\"redacted\"",
  1590.     "-D__TIME__=\"redacted\""
  1591.     ]
  1592.  
  1593.     targets_windows_feature = feature(
  1594.         name = "targets_windows",
  1595.         implies = ["copy_dynamic_libraries_to_binary"],
  1596.         enabled = True,
  1597.     )
  1598.  
  1599.     copy_dynamic_libraries_to_binary_feature = feature(name= "copy_dynamic_libraries_to_binary")
  1600.  
  1601.     gcc_env_feature = feature(
  1602.         name = "gcc_env",
  1603.         enabled = True,
  1604.         env_sets = [
  1605.             env_set (
  1606.                 actions = [
  1607.                     ACTION_NAMES.c_compile,
  1608.                     ACTION_NAMES.cpp_compile,
  1609.                     ACTION_NAMES.cpp_module_compile,
  1610.                     ACTION_NAMES.cpp_module_codegen,
  1611.                     ACTION_NAMES.cpp_header_parsing,
  1612.                     ACTION_NAMES.assemble,
  1613.                     ACTION_NAMES.preprocess_assemble,
  1614.                     ACTION_NAMES.cpp_link_executable,
  1615.                     ACTION_NAMES.cpp_link_dynamic_library,
  1616.                     ACTION_NAMES.cpp_link_nodeps_dynamic_library,
  1617.                     ACTION_NAMES.cpp_link_static_library,
  1618.                 ],
  1619.                 env_entries = [
  1620.                     env_entry(key = "PATH", value = "NOT_USED")
  1621.                 ],
  1622.             ),
  1623.         ],
  1624.     )
  1625.  
  1626.     windows_features = [
  1627.         targets_windows_feature,
  1628.         copy_dynamic_libraries_to_binary_feature,
  1629.         gcc_env_feature,
  1630.     ]
  1631.  
  1632.  
  1633.     coverage_feature = feature (
  1634.         name = "coverage",
  1635.         provides = ["profile"],
  1636.         flag_sets = [
  1637.             flag_set(
  1638.                 actions = [
  1639.                     ACTION_NAMES.preprocess_assemble,
  1640.                     ACTION_NAMES.c_compile,
  1641.                     ACTION_NAMES.cpp_compile,
  1642.                     ACTION_NAMES.cpp_header_parsing,
  1643.                     ACTION_NAMES.cpp_module_compile,
  1644.                 ],
  1645.                 flag_groups = [
  1646.                     flag_group (flags = ["--coverage"]),
  1647.                 ],
  1648.             ),
  1649.             flag_set (
  1650.                 actions = [
  1651.                     ACTION_NAMES.cpp_link_dynamic_library,
  1652.                     ACTION_NAMES.cpp_link_nodeps_dynamic_library,
  1653.                     ACTION_NAMES.cpp_link_executable,
  1654.                 ],
  1655.                 flag_groups = [
  1656.                     flag_group (flags = ["--coverage"]),
  1657.                 ],
  1658.             ),
  1659.         ],
  1660.     )
  1661.  
  1662.  
  1663.     supports_pic_feature = feature(
  1664.         name = "supports_pic",
  1665.         enabled = True,
  1666.     )
  1667.     supports_start_end_lib_feature = feature(
  1668.         name = "supports_start_end_lib",
  1669.         enabled = True,
  1670.     )
  1671.  
  1672.     default_compile_flags_feature = feature(
  1673.         name = "default_compile_flags",
  1674.         enabled = True,
  1675.         flag_sets = [
  1676.             flag_set(
  1677.                 actions = [
  1678.                     ACTION_NAMES.assemble,
  1679.                     ACTION_NAMES.preprocess_assemble,
  1680.                     ACTION_NAMES.linkstamp_compile,
  1681.                     ACTION_NAMES.c_compile,
  1682.                     ACTION_NAMES.cpp_compile,
  1683.                     ACTION_NAMES.cpp_header_parsing,
  1684.                     ACTION_NAMES.cpp_module_compile,
  1685.                     ACTION_NAMES.cpp_module_codegen,
  1686.                     ACTION_NAMES.lto_backend,
  1687.                     ACTION_NAMES.clif_match,
  1688.                 ],
  1689.                 flag_groups = ([flag_group(flags = compile_flags)] if compile_flags else []),
  1690.             ),
  1691.             flag_set(
  1692.                 actions = [
  1693.                     ACTION_NAMES.assemble,
  1694.                     ACTION_NAMES.preprocess_assemble,
  1695.                     ACTION_NAMES.linkstamp_compile,
  1696.                     ACTION_NAMES.c_compile,
  1697.                     ACTION_NAMES.cpp_compile,
  1698.                     ACTION_NAMES.cpp_header_parsing,
  1699.                     ACTION_NAMES.cpp_module_compile,
  1700.                     ACTION_NAMES.cpp_module_codegen,
  1701.                     ACTION_NAMES.lto_backend,
  1702.                     ACTION_NAMES.clif_match,
  1703.                 ],
  1704.                 flag_groups = ([flag_group(flags = dbg_compile_flags)] if dbg_compile_flags else []),
  1705.                 with_features = [with_feature_set(features = ["dbg"])],
  1706.             ),
  1707.             flag_set(
  1708.                 actions = [
  1709.                     ACTION_NAMES.assemble,
  1710.                     ACTION_NAMES.preprocess_assemble,
  1711.                     ACTION_NAMES.linkstamp_compile,
  1712.                     ACTION_NAMES.c_compile,
  1713.                     ACTION_NAMES.cpp_compile,
  1714.                     ACTION_NAMES.cpp_header_parsing,
  1715.                     ACTION_NAMES.cpp_module_compile,
  1716.                     ACTION_NAMES.cpp_module_codegen,
  1717.                     ACTION_NAMES.lto_backend,
  1718.                     ACTION_NAMES.clif_match,
  1719.                 ],
  1720.                 flag_groups = ([flag_group(flags = opt_compile_flags)] if opt_compile_flags else []),
  1721.                 with_features = [with_feature_set(features = ["opt"])],
  1722.             ),
  1723.             flag_set(
  1724.                 actions = [
  1725.                     ACTION_NAMES.linkstamp_compile,
  1726.                     ACTION_NAMES.cpp_compile,
  1727.                     ACTION_NAMES.cpp_header_parsing,
  1728.                     ACTION_NAMES.cpp_module_compile,
  1729.                     ACTION_NAMES.cpp_module_codegen,
  1730.                     ACTION_NAMES.lto_backend,
  1731.                     ACTION_NAMES.clif_match,
  1732.                 ],
  1733.                 flag_groups = ([flag_group(flags = cxx_flags)] if cxx_flags else []),
  1734.             ),
  1735.         ],
  1736.     )
  1737.  
  1738.     default_link_flags_feature = feature(
  1739.         name = "default_link_flags",
  1740.         enabled = True,
  1741.         flag_sets = [
  1742.             flag_set(
  1743.                 actions = all_link_actions,
  1744.                 flag_groups = ([flag_group(flags = link_flags)] if link_flags else []),
  1745.             ),
  1746.             flag_set(
  1747.                 actions = all_link_actions,
  1748.                 flag_groups = ([flag_group(flags = opt_link_flags)] if opt_link_flags else []),
  1749.                 with_features = [with_feature_set(features = ["opt"])],
  1750.             ),
  1751.         ],
  1752.     )
  1753.  
  1754.     dbg_feature = feature(name = "dbg")
  1755.  
  1756.     opt_feature = feature(name = "opt")
  1757.  
  1758.     sysroot_feature = feature(
  1759.         name = "sysroot",
  1760.         enabled = True,
  1761.         flag_sets = [
  1762.             flag_set(
  1763.                 actions = [
  1764.                   ACTION_NAMES.preprocess_assemble,
  1765.                   ACTION_NAMES.linkstamp_compile,
  1766.                   ACTION_NAMES.c_compile,
  1767.                   ACTION_NAMES.cpp_compile,
  1768.                   ACTION_NAMES.cpp_header_parsing,
  1769.                   ACTION_NAMES.cpp_module_compile,
  1770.                   ACTION_NAMES.cpp_module_codegen,
  1771.                   ACTION_NAMES.lto_backend,
  1772.                   ACTION_NAMES.clif_match,
  1773.                   ACTION_NAMES.cpp_link_executable,
  1774.                   ACTION_NAMES.cpp_link_dynamic_library,
  1775.                   ACTION_NAMES.cpp_link_nodeps_dynamic_library,
  1776.                 ],
  1777.                 flag_groups = [
  1778.                   flag_group(
  1779.                       flags = ["--sysroot=%{sysroot}"],
  1780.                       expand_if_available = "sysroot",
  1781.                   ),
  1782.                 ],
  1783.             ),
  1784.         ],
  1785.     )
  1786.  
  1787.     fdo_optimize_feature = feature(
  1788.         name = "fdo_optimize",
  1789.         flag_sets = [
  1790.             flag_set(
  1791.                 actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile],
  1792.                 flag_groups = [
  1793.                   flag_group(
  1794.                       flags = [
  1795.                         "-fprofile-use=%{fdo_profile_path}",
  1796.                         "-fprofile-correction",
  1797.                       ],
  1798.                       expand_if_available = "fdo_profile_path",
  1799.                   ),
  1800.                 ],
  1801.             ),
  1802.         ],
  1803.         provides = ["profile"],
  1804.     )
  1805.  
  1806.     supports_dynamic_linker_feature = feature(name = "supports_dynamic_linker", enabled = True)
  1807.  
  1808.     user_compile_flags_feature = feature(
  1809.         name = "user_compile_flags",
  1810.         enabled = True,
  1811.         flag_sets = [
  1812.             flag_set(
  1813.                 actions = [
  1814.                   ACTION_NAMES.assemble,
  1815.                   ACTION_NAMES.preprocess_assemble,
  1816.                   ACTION_NAMES.linkstamp_compile,
  1817.                   ACTION_NAMES.c_compile,
  1818.                   ACTION_NAMES.cpp_compile,
  1819.                   ACTION_NAMES.cpp_header_parsing,
  1820.                   ACTION_NAMES.cpp_module_compile,
  1821.                   ACTION_NAMES.cpp_module_codegen,
  1822.                   ACTION_NAMES.lto_backend,
  1823.                   ACTION_NAMES.clif_match,
  1824.                 ],
  1825.                 flag_groups = [
  1826.                   flag_group(
  1827.                       flags = ["%{user_compile_flags}"],
  1828.                       iterate_over = "user_compile_flags",
  1829.                       expand_if_available = "user_compile_flags",
  1830.                   ),
  1831.                 ],
  1832.             ),
  1833.           ],
  1834.     )
  1835.  
  1836.     unfiltered_compile_flags_feature = feature(
  1837.         name = "unfiltered_compile_flags",
  1838.         enabled = True,
  1839.         flag_sets = [
  1840.             flag_set(
  1841.                 actions = [
  1842.                   ACTION_NAMES.assemble,
  1843.                   ACTION_NAMES.preprocess_assemble,
  1844.                   ACTION_NAMES.linkstamp_compile,
  1845.                   ACTION_NAMES.c_compile,
  1846.                   ACTION_NAMES.cpp_compile,
  1847.                   ACTION_NAMES.cpp_header_parsing,
  1848.                   ACTION_NAMES.cpp_module_compile,
  1849.                   ACTION_NAMES.cpp_module_codegen,
  1850.                   ACTION_NAMES.lto_backend,
  1851.                   ACTION_NAMES.clif_match,
  1852.                 ],
  1853.                 flag_groups = ([flag_group(flags = unfiltered_compile_flags)] if unfiltered_compile_flags else []),
  1854.             ),
  1855.         ],
  1856.     )
  1857.  
  1858.     features = [
  1859.         supports_pic_feature,
  1860.         supports_start_end_lib_feature,
  1861.         coverage_feature,
  1862.         default_compile_flags_feature,
  1863.         default_link_flags_feature,
  1864.         fdo_optimize_feature,
  1865.         supports_dynamic_linker_feature,
  1866.         dbg_feature,
  1867.         opt_feature,
  1868.         user_compile_flags_feature,
  1869.         sysroot_feature,
  1870.         unfiltered_compile_flags_feature,
  1871.     ]
  1872.  
  1873.     artifact_name_patterns = [
  1874.  
  1875.     ]
  1876.  
  1877.     make_variables = []
  1878.  
  1879.     return cc_common.create_cc_toolchain_config_info(
  1880.         ctx = ctx,
  1881.         features = features,
  1882.         action_configs = action_configs,
  1883.         artifact_name_patterns = artifact_name_patterns,
  1884.         cxx_builtin_include_directories = cxx_builtin_include_directories,
  1885.         toolchain_identifier = "local",
  1886.         host_system_name = "local",
  1887.         target_system_name = "local",
  1888.         target_cpu = "k8",
  1889.         target_libc = "local",
  1890.         compiler = "compiler",
  1891.         abi_version = "local",
  1892.         abi_libc_version = "local",
  1893.         tool_paths = tool_paths,
  1894.         make_variables = make_variables,
  1895.         builtin_sysroot = "",
  1896.         cc_target_os = None,
  1897.     )
  1898.  
  1899. cc_toolchain_config = rule(
  1900.     implementation = _impl,
  1901.     attrs = {
  1902.         "cpu" : attr.string(mandatory = True),
  1903.         "compiler": attr.string(),
  1904.     },
  1905.     provides = [CcToolchainConfigInfo],
  1906. )
  1907. bash-4.4#