chore: import upstream snapshot with attribution
cffconvert / validate (push) Has been skipped
License Check / license-check (push) Failing after 2s

This commit is contained in:
wehub-resource-sync
2026-07-13 12:14:16 +08:00
commit 8a852e4b4e
36502 changed files with 9277225 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
# Description:
# TensorFlow is a computational framework, primarily for use in machine
# learning applications.
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
package(
# copybara:uncomment default_applicable_licenses = ["//tensorflow:license"],
licenses = ["notice"],
)
sh_binary(
name = "parallel_gpu_execute",
srcs = ["parallel_gpu_execute.sh"],
)
filegroup(
name = "all_files",
srcs = glob(
["**/*"],
exclude = [
"**/METADATA",
"**/OWNERS",
],
),
visibility = ["//visibility:private"],
)
+83
View File
@@ -0,0 +1,83 @@
#!/usr/bin/env bash
# Copyright 2016 The TensorFlow 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.
# ==============================================================================
#
#
# A script to run multiple GPU tests in parallel controlled with an environment
# variable.
#
# Required environment variables:
# TF_GPU_COUNT = Number of GPUs available.
TF_GPU_COUNT=${TF_GPU_COUNT:-4}
TF_TESTS_PER_GPU=${TF_TESTS_PER_GPU:-8}
# This function is used below in rlocation to check that a path is absolute
function is_absolute {
[[ "$1" = /* ]] || [[ "$1" =~ ^[a-zA-Z]:[/\\].* ]]
}
export TF_PER_DEVICE_MEMORY_LIMIT_MB=${TF_PER_DEVICE_MEMORY_LIMIT_MB:-2048}
# *******************************************************************
# This section of the script is needed to
# make things work on windows under msys.
# *******************************************************************
RUNFILES_MANIFEST_FILE="${TEST_SRCDIR}/MANIFEST"
function rlocation() {
if is_absolute "$1" ; then
# If the file path is already fully specified, simply return it.
echo "$1"
elif [[ -e "$TEST_SRCDIR/$1" ]]; then
# If the file exists in the $TEST_SRCDIR then just use it.
echo "$TEST_SRCDIR/$1"
elif [[ -e "$RUNFILES_MANIFEST_FILE" ]]; then
# If a runfiles manifest file exists then use it.
echo "$(grep "^$1 " "$RUNFILES_MANIFEST_FILE" | sed 's/[^ ]* //')"
fi
}
TEST_BINARY="$(rlocation $TEST_WORKSPACE/${1#./})"
shift
# *******************************************************************
mkdir -p /var/lock
# Try to acquire any of the TF_GPU_COUNT * TF_TESTS_PER_GPU
# slots to run a test at.
#
# Prefer to allocate 1 test per GPU over 4 tests on 1 GPU.
# So, we iterate over TF_TESTS_PER_GPU first.
for j in `seq 0 $((TF_TESTS_PER_GPU-1))`; do
for i in `seq 0 $((TF_GPU_COUNT-1))`; do
exec {lock_fd}>/var/lock/gpulock${i}_${j} || exit 1
if flock -n "$lock_fd";
then
(
# This export only works within the brackets, so it is isolated to one
# single command.
export CUDA_VISIBLE_DEVICES=$i
export HIP_VISIBLE_DEVICES=$i
echo "Running test $TEST_BINARY $* on GPU $CUDA_VISIBLE_DEVICES"
"$TEST_BINARY" $@
)
return_code=$?
flock -u "$lock_fd"
exit $return_code
fi
done
done
echo "Cannot find a free GPU to run the test $* on, exiting with failure..."
exit 1
+14
View File
@@ -0,0 +1,14 @@
# Description:
# Tools for filtering DEF file for TensorFlow on Windows
#
# On Windows, we use a DEF file generated by Bazel to export
# symbols from the tensorflow dynamic library(_pywrap_tensorflow.dll).
# The maximum number of symbols that can be exported per DLL is 64K,
# so we have to filter some useless symbols through this python script.
package(default_visibility = ["//visibility:public"])
filegroup(
name = "symbols_pybind",
srcs = ["symbols_pybind.txt"],
)
+20
View File
@@ -0,0 +1,20 @@
# Description:
# Tools for filtering DEF file for TensorFlow on Windows
#
# On Windows, we use a DEF file generated by Bazel to export
# symbols from the tensorflow dynamic library(_pywrap_tensorflow.dll).
# The maximum number of symbols that can be exported per DLL is 64K,
# so we have to filter some useless symbols through this python script.
package(default_visibility = ["//visibility:public"])
py_binary(
name = "def_file_filter",
srcs = ["def_file_filter.py"],
srcs_version = "PY3",
)
filegroup(
name = "symbols_pybind",
srcs = ["symbols_pybind.txt"],
)
@@ -0,0 +1,368 @@
# Copyright 2017 The TensorFlow 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.
# ==============================================================================
"""def_file_filter.py - tool to filter a windows def file.
The def file can be used to export symbols from the tensorflow dll to enable
tf.load_library().
Because the linker allows only 64K symbols to be exported per dll
we filter the symbols down to the essentials. The regular expressions
we use for this are specific to tensorflow.
TODO: this works fine but there is an issue with exporting
'const char * const' and importing it from a user_ops. The problem is
on the importing end and using __declspec(dllimport) works around it.
"""
import argparse
import io
import os
import re
import subprocess
import sys
import tempfile
# External tools we use that come with visual studio sdk
UNDNAME = "%{undname_bin_path}"
DUMPBIN_CMD = "\"{}\" /SYMBOLS".format("%{dumpbin_bin_path}")
# Exclude if matched
EXCLUDE_RE = re.compile(r"RTTI|deleting destructor|::internal::")
# Include if matched before exclude
INCLUDEPRE_RE = re.compile(r"absl::lts_[0-9]+::base_internal::ThrowStdOutOfRange|" # for _pywrap_tfe
r"absl::lts_[0-9]+::str_format_internal::FormatArgImpl|" # for _pywrap_tfe
r"absl::lts_[0-9]+::ByChar|" # for _pywrap_tfe
r"absl::lts_[0-9]+::numbers_internal::FastIntToBuffer|" # for _pywrap_tfe
r"absl::lts_[0-9]+::StrCat|" # for _pywrap_tfe
r"absl::lts_[0-9]+::StrAppend|" # for _pywrap_tfe
r"absl::lts_[0-9]+::hash_internal|" # for _pywrap_tfcompile
r"absl::lts_[0-9]+::container_internal|" # for _pywrap_tfcompile
r"absl::lts_[0-9]+::Status::raw_code|" # for absl::Status
r"absl::lts_[0-9]+::Status::code|" # for absl::Status
r"absl::lts_[0-9]+::Status::UnrefNonInlined|" # for absl::Status
r"absl::lts_[0-9]+::Status::Status|" # for absl::Status
r"absl::lts_[0-9]+::Status::ForEachPayload|" # for absl::Status
r"absl::lts_[0-9]+::internal_statusor::Helper::Crash|" # for absl::StatusOr
r"absl::lts_[0-9]+::internal_statusor::Helper::HandleInvalidStatusCtorArg|"
r"absl::lts_[0-9]+::internal_statusor::ThrowBadStatusOrAccess|"
r"absl::lts_[0-9]+::StatusBuilder::|" # for absl::StatusBuilder
r"absl::lts_[0-9]+::Cord|" # for tensorflow::Status
r"absl::lts_[0-9]+::Cord::DestroyCordSlow|" # for tensorflow::Status
r"absl::lts_[0-9]+::cord_internal::CordzInfo::MaybeTrackCordImpl|" # tensorflow::Status usage of absl::Cord
r"google::protobuf::internal::ExplicitlyConstructed|"
r"google::protobuf::internal::ArenaImpl::AllocateAligned|" # for contrib/data/_prefetching_ops
r"google::protobuf::internal::ArenaImpl::AddCleanup|" # for contrib/data/_prefetching_ops
r"google::protobuf::internal::LogMessage|" # for contrib/data/_prefetching_ops
r"google::protobuf::Arena::OnArenaAllocation|" # for contrib/data/_prefetching_ops
r"google::protobuf::MessageLite::SerializeAsString|" # for pywrap_saved_model
r"google::protobuf::MessageLite::ParseFromString|" # for pywrap_saved_model
r"absl::Mutex::ReaderLock|" # for //tensorflow/contrib/rnn:python/ops/_gru_ops.so and more ops
r"absl::Mutex::ReaderUnlock|" # for //tensorflow/contrib/rnn:python/ops/_gru_ops.so and more ops
r"tensorflow::internal::LogMessage|"
r"tensorflow::internal::LogString|"
r"tensorflow::internal::CheckOpMessageBuilder|"
r"tensorflow::internal::MakeCheckOpValueString|"
r"tensorflow::internal::PickUnusedPortOrDie|"
r"tensorflow::internal::ValidateDevice|"
r"tsl::internal::LogMessage|"
r"tsl::internal::LogString|"
r"tsl::internal::CheckOpMessageBuilder|"
r"tsl::internal::MakeCheckOpValueString|"
r"tsl::internal::PickUnusedPortOrDie|"
r"tsl::internal::ValidateDevice|"
r"tsl::ops::internal::Enter|"
r"tsl::strings::internal::AppendPieces|"
r"tsl::strings::internal::CatPieces|"
r"tensorflow::io::internal::JoinPathImpl")
# Include if matched after exclude
INCLUDE_RE = re.compile(r"^(TF_\w*)$|"
r"^(TFE_\w*)$|"
r"tensorflow::|"
r"toco::|"
r"tsl::|"
r"functor::|"
r"tf_git_version|"
r"tf_compiler_version|"
r"tf_cxx11_abi_flag|"
r"tf_monolithic_build|"
r"perftools::gputools")
# We want to identify data members explicitly in the DEF file, so that no one
# can implicitly link against the DLL if they use one of the variables exported
# from the DLL and the header they use does not decorate the symbol with
# __declspec(dllimport). It is easier to detect what a data symbol does
# NOT look like, so doing it with the below regex.
DATA_EXCLUDE_RE = re.compile(r"[)(]|"
r"vftable|"
r"vbtable|"
r"vcall|"
r"RTTI|"
r"protobuf::internal::ExplicitlyConstructed")
def get_args():
"""Parse command line.
Examples:
(usecases in //tensorflow/python:pywrap_tensorflow_filtered_def_file)
--symbols $(location //tensorflow/tools/def_file_filter:symbols_pybind)
--lib_paths_file $(location :pybind_symbol_target_libs_file)
"""
filename_list = lambda x: x.split(";")
parser = argparse.ArgumentParser()
parser.add_argument("--input", type=filename_list,
help="paths to input def file",
required=True)
parser.add_argument("--output", help="output deffile", required=True)
parser.add_argument("--target", help="name of the target")
parser.add_argument("--symbols", help="file that lists symbols to be exported.")
parser.add_argument("--lib_paths_file", help="file that lists cc_library targets for pybind")
args = parser.parse_args()
return args
def get_symbols(path_to_lib, re_filter):
"""Get a list of symbols to be exported.
Args:
path_to_lib: String that is path (execpath) to target .lib file.
re_filter: String that is regex filter for filtering symbols from .lib.
"""
try:
full_output = subprocess.check_output(
"{} {}".format(DUMPBIN_CMD, path_to_lib),
stderr=subprocess.STDOUT, shell=True)
except subprocess.CalledProcessError as e:
print("Getting symbol list using dumpbin failed with code %d:" % (
e.returncode))
print("\t\tFailing command: %s" % (e.cmd))
print("\t\tOutput: %s" % (e.output))
print("\t\tError details: %s" % (e))
raise e
# Convert to normal string from bytes type.
full_output = full_output.decode()
# Split and filter the list
sym_split = [x for x in full_output.split("\r\n")
if "External" in x]
# Example symbol line:
# 954 00000000 SECT2BD notype () External | ?IsSequence@swig@tensorflow@@YA_NPEAU_object@@@Z (bool __cdecl tensorflow::swig::IsSequence(struct _object *))
# Anomaly symbol line:
# 00B 00000000 SECT4 notype External | _tsl_numpy_api.
sym_filtered = []
re_filter_comp = re.compile(r"{}".format(re_filter))
# Filter out symbol from the split line (`sym_split` in the for loop below).
sym_line_filter = r".*\s+\| (.*) \(.*"
sym_line_filter_anomaly = r".*\s+\| (.*)"
for sym_line in sym_split:
if re_filter_comp.search(sym_line):
try:
sym = re.match(sym_line_filter, sym_line).groups()[0]
except AttributeError:
try:
sym = re.match(sym_line_filter_anomaly, sym_line).groups()[0]
except:
raise RuntimeError("Unable to find the following symbol:[%s]" % sym_line)
sym_filtered.append(sym)
return sym_filtered
def get_pybind_export_symbols(symbols_file, lib_paths_file):
"""Returns a list of symbols to be exported from the target libs.
Args:
symbols_file: String that is the path to symbols_pybind.txt.
lib_paths_file: String that is the path to txt file that lists
cc_library target execpaths for exporting symbols.
"""
# A cc_library target name must begin its own line, and it must begin with
# `//tensorflow`. It can then optionally have some number of directories, and
# it must end with a target name directly preceded by either a slash or a
# colon. A directory or target name is any combination of letters, numbers,
# underscores, and dashes.
# Examples of possible headers:
# `[//tensorflow/core/util/tensor_bundle]`
# `[//tensorflow/python:safe_ptr]`
# `[//tensorflow:target_name_v2_25]`
# `[//tensorflow/-/24/util_:port-5]`
section_header_filter = r"^\[\/\/(\w+(\/[\w-]+)*(:|\/)[\w-]+)\]"
# Create a dict of target libs and their symbols to be exported and populate
# it. (key = cc_library target, value = list of symbols) that we need to
# export.
symbols = {}
with open(symbols_file, "r") as f:
curr_lib = ""
for line in f:
line = line.strip()
section_header = re.match(section_header_filter, line)
if section_header:
curr_lib = section_header.groups()[0]
symbols[curr_lib] = []
elif not line:
pass
else:
# If not a section header and not an empty line, then it's a symbol
# line. e.g. `tensorflow::swig::IsSequence`
symbols[curr_lib].append(line)
lib_paths = []
with open(lib_paths_file, "r") as f:
lib_paths = [line.strip() for line in f]
# All symbols to be exported.
symbols_all = []
for lib in lib_paths:
if lib:
for cc_lib in symbols: # keys in symbols = cc_library target name
if cc_lib.count(":") == 1:
formatted_cc_lib = cc_lib.replace(":", "/")
elif cc_lib.count(":") == 0:
formatted_cc_lib = cc_lib
else:
raise ValueError(f"Detected wrong format for symbols header in"
"`symbols_pybind.txt`. Header must have 0 or 1 "
"colon (e.g. `[//third_party/tensorflow/python:safe_ptr]`"
"or `[tensorflow/core/util/tensor_bundle]`) but "
"detected: {cc_lib}")
path_to_lib = formatted_cc_lib.split("/")
# `path_to_lib` is a bazel out path, which means the actual path string
# we get here differs from the package path listed in
# `win_lib_files_for_exported_symbols` and `symbols_pybind.txt`.
# For example, the target `tensorflow/core:op_gen_lib` in
# `win_lib_files_for_exported_symbols` generates the bazel library path
# `bazel-out/x64_windows-opt/bin/tensorflow/core/framework/op_gen_lib.lib`
lib_and_cc_lib_match = True
for p in path_to_lib:
if p not in lib:
lib_and_cc_lib_match = False
break
if lib_and_cc_lib_match:
symbols_all.extend(get_symbols(lib, "|".join(symbols[cc_lib])))
return symbols_all
def main():
"""main."""
args = get_args()
# Get symbols that need to be exported from specific libraries for pybind.
symbols_pybind = []
if args.symbols and args.lib_paths_file:
symbols_pybind = get_pybind_export_symbols(args.symbols, args.lib_paths_file)
# Pipe dumpbin to extract all linkable symbols from libs.
# Good symbols are collected in candidates and also written to
# a temp file.
candidates = []
tmpfile = tempfile.NamedTemporaryFile(mode="w", delete=False)
for def_file_path in args.input:
def_file = open(def_file_path, 'r')
for line in def_file:
cols = line.split()
sym = cols[0]
tmpfile.file.write(sym + "\n")
candidates.append(sym)
tmpfile.file.close()
# Run the symbols through undname to get their undecorated name
# so we can filter on something readable.
with open(args.output, "w") as def_fp:
# track dupes
taken = set()
# Header for the def file.
if args.target:
def_fp.write("LIBRARY " + args.target + "\n")
def_fp.write("EXPORTS\n")
def_fp.write("\t ??1OpDef@tensorflow@@UEAA@XZ\n")
# Write additional symbols:
def_fp.write("\t ??0SessionOptions@tensorflow@@QEAA@XZ\n")
def_fp.write("\t ?NewSession@tensorflow@@YAPEAVSession@1@AEBUSessionOptions@1@@Z\n")
def_fp.write("\t ??1SavedModelBundleInterface@tensorflow@@UEAA@XZ\n")
def_fp.write("\t ?MaybeSavedModelDirectory@tensorflow@@YA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z\n")
def_fp.write("\t ??_7HistogramProto@tensorflow@@6B@\n")
def_fp.write("\t ??_7ConfigProto@tensorflow@@6B@\n") # for _pywrap_tfe
def_fp.write("\t ??_7CoordinatedTask@tensorflow@@6B@\n") # for _pywrap_tfe
def_fp.write("\t ?InternalSwap@CoordinatedTask@tensorflow@@AEAAXPEAV12@@Z\n") # for _pywrap_tfe
def_fp.write("\t ?kSeed@MixingHashState@hash_internal@lts_20230802@absl@@0QEBXEB\n") # for _pywrap_tfcompile
def_fp.write("\t ?kEmptyGroup@container_internal@lts_20230802@absl@@3QBW4ctrl_t@123@B\n") # for _pywrap_tfcompile
def_fp.write("\t ??_7GraphDef@tensorflow@@6B@\n")
def_fp.write("\t ??_7DeviceProperties@tensorflow@@6B@\n")
def_fp.write("\t ??_7MetaGraphDef@tensorflow@@6B@\n")
def_fp.write("\t ??_7SavedModel@tensorflow@@6B@\n")
def_fp.write("\t ?Set@ArenaStringPtr@internal@protobuf@google@@QEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEAVArena@34@@Z\n") # _pywrap_tfe
def_fp.write("\t ??1CoordinatedTask@tensorflow@@UEAA@XZ\n") # for _pywrap_tfe
def_fp.write("\t ?CopyFrom@CoordinatedTask@tensorflow@@QEAAXAEBV12@@Z\n") # for _pywrap_tfe
def_fp.write("\t ??0CoordinatedTask@tensorflow@@IEAA@PEAVArena@protobuf@google@@_N@Z\n") # for _pywrap_tfe
def_fp.write("\t ??0LogMessageFatal@log_internal@lts_20230802@absl@@QEAA@PEBDH@Z\n") # for _pywrap_tfe
def_fp.write("\t ??1LogMessageFatal@log_internal@lts_20230802@absl@@QEAA@XZ\n") # for _pywrap_tfe
def_fp.write("\t ??$CopyToEncodedBuffer@$0A@@LogMessage@log_internal@lts_20230802@absl@@AEAAXV?$basic_string_view@DU?$char_traits@D@std@@@std@@@Z\n") # for _pywrap_tfe
def_fp.write("\t ?MaybeTrackCordImpl@CordzInfo@cord_internal@lts_20230802@absl@@CAXAEAVInlineData@234@AEBV5234@W4MethodIdentifier@CordzUpdateTracker@234@@Z\n") # for tensorflow::Status usage of absl::Cord
def_fp.write("\t ??1Mutex@lts_20230802@absl@@QEAA@XZ\n") # for _pywrap_tfe
# Each symbols returned by undname matches the same position in candidates.
# We compare on undname but use the decorated name from candidates.
dupes = 0
proc = subprocess.Popen([UNDNAME, tmpfile.name], stdout=subprocess.PIPE)
for idx, line in enumerate(io.TextIOWrapper(proc.stdout, encoding="utf-8")):
decorated = candidates[idx]
if decorated in taken:
# Symbol is already in output, done.
dupes += 1
continue
if not INCLUDEPRE_RE.search(line):
if EXCLUDE_RE.search(line):
continue
if not INCLUDE_RE.search(line):
continue
if "deleting destructor" in line:
# Some of the symbols convered by INCLUDEPRE_RE export deleting
# destructor symbols, which is a bad idea.
# So we filter out such symbols here.
continue
if DATA_EXCLUDE_RE.search(line):
def_fp.write("\t" + decorated + "\n")
else:
def_fp.write("\t" + decorated + " DATA\n")
taken.add(decorated)
for sym in symbols_pybind:
def_fp.write("\t{}\n".format(sym))
taken.add(sym)
def_fp.close()
exit_code = proc.wait()
if exit_code != 0:
print("{} failed, exit={}".format(UNDNAME, exit_code))
return exit_code
os.unlink(tmpfile.name)
print("symbols={}, taken={}, dupes={}"
.format(len(candidates), len(taken), dupes))
return 0
if __name__ == "__main__":
sys.exit(main())
@@ -0,0 +1,71 @@
"""Repository rule for def file filter autoconfiguration.
This repository reuses Bazel's VC detect mechanism to find undname.exe,
which is a tool used in def_file_filter.py.
def_file_filter.py is for filtering the DEF file for TensorFlow on Windows.
On Windows, we use a DEF file generated by Bazel to export symbols from the
tensorflow dynamic library(_pywrap_tensorflow.dll). The maximum number of
symbols that can be exported per DLL is 64K, so we have to filter some useless
symbols through this python script.
`def_file_filter_config` depends on the following environment variables:
* `BAZEL_VC`
* `BAZEL_VS`
* `VS90COMNTOOLS`
* `VS100COMNTOOLS`
* `VS110COMNTOOLS`
* `VS120COMNTOOLS`
* `VS140COMNTOOLS`
"""
load("@rules_cc//cc/private/toolchain:windows_cc_configure.bzl", "find_msvc_tool", "find_vc_path") # buildifier: disable=bzl-visibility
def auto_configure_fail(msg):
"""Output failure message when def file filter configuration fails."""
red = "\033[0;31m"
no_color = "\033[0m"
fail("\n%sDef File Filter Configuration Error:%s %s\n" % (red, no_color, msg))
def _def_file_filter_configure_impl(repository_ctx):
if repository_ctx.os.name.lower().find("windows") == -1:
repository_ctx.symlink(Label("//tools/def_file_filter:BUILD.tpl"), "BUILD")
repository_ctx.file("def_file_filter.py", "")
return
vc_path = find_vc_path(repository_ctx)
if vc_path == None:
auto_configure_fail("Visual C++ build tools not found on your machine")
undname = find_msvc_tool(repository_ctx, vc_path, "undname.exe")
if undname == None:
auto_configure_fail("Couldn't find undname.exe under %s, please check your VC installation and set BAZEL_VC environment variable correctly." % vc_path)
undname_bin_path = undname.replace("\\", "\\\\")
dumpbin = find_msvc_tool(repository_ctx, vc_path, "dumpbin.exe")
if dumpbin == None:
auto_configure_fail("Couldn't find dumpbin.exe under %s, please check your VC installation and set BAZEL_VC environment variable correctly." % vc_path)
dumpbin_bin_path = dumpbin.replace("\\", "\\\\")
repository_ctx.template(
"def_file_filter.py",
Label("//tools/def_file_filter:def_file_filter.py.tpl"),
{
"%{undname_bin_path}": undname_bin_path,
"%{dumpbin_bin_path}": dumpbin_bin_path,
},
)
repository_ctx.symlink(Label("//tools/def_file_filter:BUILD.tpl"), "BUILD")
def_file_filter_configure = repository_rule(
implementation = _def_file_filter_configure_impl,
environ = [
"BAZEL_VC",
"BAZEL_VC_FULL_VERSION",
"BAZEL_VS",
"VS90COMNTOOLS",
"VS100COMNTOOLS",
"VS110COMNTOOLS",
"VS120COMNTOOLS",
"VS140COMNTOOLS",
],
)
+618
View File
@@ -0,0 +1,618 @@
[//tensorflow/python/util:cpp_python_util] # util tfe
tensorflow::swig::IsNested
tensorflow::swig::IsNestedOrComposite
tensorflow::swig::IsCompositeTensor
tensorflow::swig::IsTypeSpec
tensorflow::swig::IsNamedtuple
tensorflow::swig::IsMapping
tensorflow::swig::IsMutableMapping
tensorflow::swig::IsMappingView
tensorflow::swig::IsAttrs
tensorflow::swig::IsTensor
tensorflow::swig::IsResourceVariable
tensorflow::swig::IsVariable
tensorflow::swig::SameNamedtuples
tensorflow::swig::AssertSameStructure
tensorflow::swig::Flatten
tensorflow::swig::IsNestedForData
tensorflow::swig::FlattenForData
tensorflow::swig::AssertSameStructureForData
tensorflow::swig::RegisterPyObject
tensorflow::swig::RegisterType
tensorflow::swig::IsEagerTensorSlow
tensorflow::swig::GetRegisteredPyObject
tensorflow::swig::IsTensorProtocol
tensorflow::swig::IsCoreTypeValue
[//tensorflow/python/util:cpp_nest] # nest
tensorflow::FlattenDictItems
[//tensorflow/core/util:port] # util_port
tensorflow::IsGoogleCudaEnabled
tensorflow::IsBuiltWithROCm
tensorflow::IsBuiltWithNvcc
tensorflow::IsAArch32Available
tensorflow::IsAArch64Available
tensorflow::IsPowerPCAvailable
tensorflow::IsSystemZAvailable
tensorflow::IsX86Available
tensorflow::GpuSupportsHalfMatMulAndConv
tensorflow::IsMklEnabled
[//tensorflow/compiler/tf2xla:tf2xla_opset] # tf2xla_opset
tensorflow::GetRegisteredXlaOpsForDevice
[//external/xla/xla/stream_executor:stream_executor_pimpl] # stat_summarizer
stream_executor::StreamExecutor::EnablePeerAccessTo
stream_executor::StreamExecutor::CanEnablePeerAccessTo
[//tensorflow/core/profiler/internal:print_model_analysis] # tfprof
tensorflow::tfprof::NewProfiler
tensorflow::tfprof::DeleteProfiler
tensorflow::tfprof::AddStep
tensorflow::tfprof::WriteProfile
tensorflow::tfprof::ProfilerFromFile
tensorflow::tfprof::Profile
tensorflow::tfprof::PrintModelAnalysis
tensorflow::tfprof::SerializeToString
[//tensorflow/core/grappler/graph_analyzer:graph_analyzer_tool] # graph_analyze
tensorflow::grappler::graph_analyzer::GraphAnalyzerTool
[//external/xla/xla/tsl/python/lib/core:ml_dtypes_lib] # bfloat16, float8
tsl::ml_dtypes::RegisterTypes
tsl::ml_dtypes::GetBfloat16Dtype
tsl::ml_dtypes::GetFloat8E4m3b11fnuzDtype
tsl::ml_dtypes::GetFloat8E4m3fnDtype
tsl::ml_dtypes::GetFloat8E5m2Dtype
tsl::ml_dtypes::GetBfloat16TypeNum
tsl::ml_dtypes::GetFloat8E4m3b11fnuzTypeNum
tsl::ml_dtypes::GetFloat8E4m3fnTypeNum
tsl::ml_dtypes::GetFloat8E5m2TypeNum
[//tensorflow/python:py_func_lib] # py_func
tensorflow::InitializePyTrampoline
[//tensorflow/core:framework_internal_impl] # op_def_registry, dtypes
tensorflow::BaseType
tensorflow::DataTypeString
tensorflow::DataTypeIsComplex
tensorflow::DataTypeIsFloating
tensorflow::DataTypeIsInteger
tensorflow::DataTypeIsQuantized
tensorflow::DataTypeIsUnsigned
tensorflow::DataTypeSize
tensorflow::OpRegistry::Global
tensorflow::OpRegistry::LookUpOpDef
tensorflow::RemoveNonDeprecationDescriptionsFromOpDef
[//tensorflow/core:lib_internal_impl] # device_lib
tensorflow::Status::code
tensorflow::Status::error_message
tensorflow::Status::ok()
[//tensorflow/core/common_runtime:device_factory] # device_lib, tfe, tf_session
tensorflow::DeviceFactory::AddDevices
tensorflow::DeviceFactory::ListAllPhysicalDevices
tensorflow::DeviceFactory::GetAnyDeviceDetails
[//tensorflow/core/common_runtime:session_options] # device_lib, tfe, tf_session
tensorflow::SessionOptions::SessionOptions
[//tensorflow/core/common_runtime:quantize_training] # quantize_training
tensorflow::DoQuantizeTrainingOnSerializedGraphDef
[//tensorflow/core/common_runtime:session_state] # tf_session
tensorflow::SessionState::kTensorHandleResourceTypeName
[//tensorflow/core/data/service:dispatcher_client] # dispatcher_client
tensorflow::data::DataServiceDispatcherClient::EnsureInitialized
tensorflow::data::DataServiceDispatcherClient::GetDataServiceMetadata
tensorflow::data::DataServiceDispatcherClient::GetSnapshotSplit
tensorflow::data::DataServiceDispatcherClient::Initialize
[//tensorflow/core/data/service:grpc_util] # grpc_util
tensorflow::data::grpc_util::Retry
[//tensorflow/core/data/service:server_lib] # server_lib
tensorflow::data::GrpcDataServerBase::Join
tensorflow::data::GrpcDataServerBase::Start
tensorflow::data::GrpcDataServerBase::Stop
tensorflow::data::GrpcDataServerBase::BoundPort
tensorflow::data::DispatchGrpcDataServer::NumWorkers
tensorflow::data::DispatchGrpcDataServer::SnapshotStreams
tensorflow::data::WorkerGrpcDataServer::NumTasks
tensorflow::data::WorkerGrpcDataServer::SnapshotTaskProgresses
tensorflow::data::NewDispatchServer
tensorflow::data::NewWorkerServer
[//tensorflow/python:py_exception_registry] # py_exception_registry
tensorflow::PyExceptionRegistry::Init
tensorflow::PyExceptionRegistry::Lookup
[//tensorflow/python:kernel_registry] # kernel_registry
tensorflow::swig::TryFindKernelClass
[//tensorflow/lite/toco/python:toco_python_api] # toco_python_api
toco::TocoConvert
toco::MlirQuantizeModel
toco::MlirSparsifyModel
toco::RegisterCustomOpdefs
toco::RetrieveCollectedErrors
toco::FlatBufferFileToMlir
[//tensorflow/tools/graph_transforms:transform_graph_lib] # transform_graph
tensorflow::graph_transforms::TransformGraph
tensorflow::graph_transforms::ParseTransformParameters
[//tensorflow/c:checkpoint_reader] # py_checkpoint_reader
tensorflow::checkpoint::CheckpointReader
tensorflow::checkpoint::CheckpointReader::Init
tensorflow::checkpoint::CheckpointReader::DebugString
tensorflow::checkpoint::CheckpointReader::GetVariableToShapeMap
tensorflow::checkpoint::CheckpointReader::GetVariableToDataTypeMap
tensorflow::checkpoint::CheckpointReader::GetTensor
tensorflow::checkpoint::CheckpointReader::HasTensor
[//tensorflow/core/util/tensor_bundle] # py_checkpoint_reader
tensorflow::BundleReader::BundleReader
tensorflow::BundleReader::~BundleReader
[//tensorflow/python:ndarray_tensor] # py_checkpoint_reader
tensorflow::TensorToNdarray
[//tensorflow/python:safe_pyobject_ptr] # py_checkpoint_reader
tensorflow::detail::PyDecrefDeleter
tensorflow::make_safe
[//tensorflow/python/framework:python_op_gen] # python_op_gen
tensorflow::GetPythonWrappers
[//tensorflow/python/eager:pywrap_tfe_lib] # tfe
tensorflow::TFE_TensorHandleCache
tensorflow::TFE_TensorHandleCache::Clear
EagerTensor_CheckExact
EagerTensorFromHandle
EagerTensor_Handle
TFE_Py_ExecuteCancelable
TFE_Py_RegisterExceptionClass
TFE_Py_RegisterVSpace
TFE_Py_RegisterFallbackExceptionClass
TFE_Py_RegisterGradientFunction
TFE_Py_RegisterJVPFunction
TFE_GetPythonString
TFE_Py_UID
TFE_DeleteContextCapsule
TFE_Py_InitEagerTensor
TFE_Py_SetEagerTensorProfiler
TFE_Py_TapeSetNew
TFE_Py_TapeSetRemove
TFE_Py_TapeSetAdd
TFE_Py_TapeSetIsEmpty
TFE_Py_TapeSetShouldRecordBackprop
TFE_Py_TapeSetPossibleGradientTypes
TFE_Py_TapeWatch
TFE_Py_TapeSetDeleteTrace
TFE_Py_TapeSetStopOnThread
TFE_Py_TapeSetRestartOnThread
TFE_Py_TapeSetIsStopped
TFE_Py_TapeSetRecordOperation
TFE_Py_TapeSetRecordOperationBackprop
TFE_Py_TapeSetRecordOperationForwardprop
TFE_Py_TapeVariableAccessed
TFE_Py_TapeWatchVariable
TFE_Py_TapeGradient
TFE_Py_FastPathExecute_C
TFE_Py_RecordGradient
TFE_Py_TapeWatchedVariables
TFE_Py_VariableWatcherNew
TFE_Py_VariableWatcherRemove
TFE_Py_VariableWatcherVariableAccessed
TFE_Py_VariableWatcherWatchedVariables
TFE_Py_ForwardAccumulatorNew
TFE_Py_ForwardAccumulatorSetAdd
TFE_Py_ForwardAccumulatorSetRemove
TFE_Py_ForwardAccumulatorWatch
TFE_Py_ForwardAccumulatorJVP
TFE_Py_ForwardAccumulatorPushState
TFE_Py_ForwardAccumulatorPopState
TFE_Py_PackJVPs
TFE_Py_TensorShapeSlice
TFE_Py_TensorShapeOnDevice
TFE_Py_EnableInteractivePythonLogging
TFE_Py_SetEagerContext
TFE_Py_SetCEagerContext
tensorflow::MakeEagerContextThreadLocalData
tensorflow::GetEagerContextThreadLocalData
tensorflow::DestroyEagerContextThreadLocalData
tensorflow::MaybeRaiseExceptionFromTFStatus
tensorflow::ConvertToEagerTensor
[//tensorflow/core/common_runtime/eager:eager_executor] # tfe
tensorflow::EagerExecutor::~EagerExecutor
tensorflow::EagerContext::WaitForAndCloseRemoteContexts
[//tensorflow/c:tf_status_helper] # tfe
tsl::Set_TF_Status_from_Status
[//tensorflow/c:safe_ptr] # tfe
tensorflow::detail::TFBufferDeleter
tensorflow::detail::TFETensorHandleDeleter
tensorflow::detail::TFStatusDeleter
tensorflow::detail::TFTensorDeleter
tensorflow::make_safe
[//tensorflow/core/common_runtime/eager:context] # tfe
tensorflow::EagerContext::WaitForAndCloseRemoteContexts
tensorflow::SetCEagerContext
tensorflow::GetCEagerContext
[//tensorflow/compiler/mlir/python:mlir] # mlir
tensorflow::ExperimentalRunPassPipeline
tensorflow::ExperimentalConvertSavedModelV1ToMlirLite
tensorflow::ExperimentalConvertSavedModelV1ToMlir
tensorflow::ExperimentalConvertSavedModelToMlir
tensorflow::ExperimentalWriteBytecode
tensorflow::ExperimentalTFLiteToTosaBytecode
tensorflow::ImportGraphDef
tensorflow::ImportFunction
[//tensorflow/compiler/mlir/lite/python:converter_python_api] # converter_python_api
tflite::Convert
tflite::MlirQuantizeModel
tflite::MlirSparsifyModel
tflite::RegisterCustomOpdefs
tflite::RetrieveCollectedErrors
tflite::FlatBufferFileToMlir
[//tensorflow/core:op_gen_lib] # tf_session
tensorflow::ApiDefMap::~ApiDefMap
[//tensorflow/core/framework:attr_value_proto_cc_impl] # tf_text
tensorflow::AttrValue::`vftable'
[//tensorflow/core/framework:op_def_proto_cc_impl] # tf_text
tensorflow::OpDef::`vftable'
[//tensorflow/lite/kernels/shim:shape] # tf_text
tflite::shim::Shape::AddDims
tflite::shim::Shape::Compatible
tflite::shim::Shape::Dim
tflite::shim::Shape::ToString
[//tensorflow/lite/kernels/shim:tf_op_shim] # tf_text
tflite::shim::FromAbslStatus
tflite::shim::TfInitContext::GetAttr
tflite::shim::TfInitContext::TfInitContext
tflite::shim::TfInvokeContext::GetInput
tflite::shim::TfInvokeContext::GetOutput
tflite::shim::TfInvokeContext::NumInputs
tflite::shim::TfInvokeContext::NumOutputs
tflite::shim::TfInvokeContext::TfInvokeContext
tflite::shim::TfShapeInferenceContext::GetAttr
tflite::shim::TfShapeInferenceContext::GetInputShape
tflite::shim::TfShapeInferenceContext::NumOutputs
tflite::shim::TfShapeInferenceContext::SetInputShape
tflite::shim::TfShapeInferenceContext::SetOutputShape
tflite::shim::TfShapeInferenceContext::TfShapeInferenceContext
[//tensorflow/core/common_runtime:graph_constructor] # tf_session
tensorflow::ShapeRefiner::~ShapeRefiner
[//tensorflow/c:python_api] # tf_session
tensorflow::AddControlInput
tensorflow::SetAttr
tensorflow::ClearAttr
tensorflow::SetFullType
tensorflow::SetRequestedDevice
tensorflow::UpdateEdge
tensorflow::RemoveAllControlInputs
tensorflow::SetRequireShapeInferenceFns
tensorflow::ExtendSession
tensorflow::GetHandleShapeAndType
tensorflow::SetHandleShapeAndType
tensorflow::AddWhileInputHack
tensorflow::RecordMutation
tensorflow::Graph::IsControlEdge
[//external/xla/xla/tsl/python/lib/core:numpy] # tf_session
tsl::ImportNumpy
_tsl_numpy_api
[//tensorflow/python/client:tf_session_helper] # tf_session
tensorflow::TF_NewSessionRef
tensorflow::TF_SessionMakeCallable
tensorflow::TF_SessionRunCallable
tensorflow::TF_SessionReleaseCallable
tensorflow::TF_Reset_wrapper
tensorflow::EqualGraphDefWrapper
tensorflow::EqualAttrValueWrapper
tensorflow::TF_GraphGetTensorShapeHelper
tensorflow::TF_SessionRun_wrapper
tensorflow::TF_SessionPRunSetup_wrapper
tensorflow::TF_SessionPRun_wrapper
tensorflow::GetOperationInputs
tensorflow::TF_OperationGetControlInputs_wrapper
tensorflow::TF_OperationGetControlOutputs_wrapper
tensorflow::TF_OperationOutputConsumers_wrapper
tensorflow::TF_GraphToFunction_wrapper
tensorflow::TF_GraphSetOutputHandleShapesAndTypes_wrapper
tensorflow::TF_CreatePlaceholders
tensorflow::TF_GraphSetTensorShape_wrapper
tensorflow::TF_ImportGraphDefResultsMissingUnusedInputMappings_wrapper
tensorflow::TF_TryEvaluateConstant_wrapper
[//tensorflow/core/grappler:grappler_item] # tf_item
tensorflow::grappler::GrapplerItem::MainOpsFanin
tensorflow::grappler::GrapplerItem::EnqueueOpsFanin
[//tensorflow/core/grappler/costs:graph_properties] # tf_item
tensorflow::grappler::GraphProperties::InferStatically
tensorflow::grappler::GraphProperties::GetOutputProperties
[//tensorflow/core/grappler:grappler_item_builder] # tf_item
tensorflow::grappler::GrapplerItemFromMetaGraphDef
[//tensorflow/core/grappler/utils:topological_sort] # tf_item
tensorflow::grappler::TopologicalSort
[//tensorflow/core/grappler/clusters:utils] # tf_cluster tf_optimizer
tensorflow::grappler::GetDeviceInfo
[//tensorflow/core/grappler/costs:utils] # tf_optimizer tf_cluster
tensorflow::grappler::CostGraphToOpPerformanceData
tensorflow::grappler::GetDeviceInfo
[//tensorflow/core/grappler/optimizers:meta_optimizer] # tf_optimizer
tensorflow::grappler::MetaOptimizer::MetaOptimizer
tensorflow::grappler::MetaOptimizer::Optimize
tensorflow::grappler::MetaOptimizer::PrintResult
[//tensorflow/core/grappler/clusters:cluster] # tf_cluster
tensorflow::grappler::Cluster::AllowSoftPlacement
tensorflow::grappler::Cluster::SetNumWarmupSteps
tensorflow::grappler::Cluster::DisableDetailedStats
tensorflow::grappler::Cluster::DetailedStatsEnabled
[//tensorflow/core/grappler/clusters:single_machine] # tf_cluster
tensorflow::grappler::SingleMachine::SingleMachine
[//tensorflow/core/grappler/costs:op_level_cost_estimator] # tf_cluster
tensorflow::grappler::OpLevelCostEstimator::OpLevelCostEstimator
tensorflow::grappler::OpLevelCostEstimator::PredictCosts
tensorflow::grappler::OpLevelCostEstimator::GetDeviceInfo
[//tensorflow/core/grappler/clusters:virtual_cluster] # tf_cluster
tensorflow::grappler::VirtualCluster::VirtualCluster
[//tensorflow/core/grappler/costs:graph_memory] # tf_cluster
tensorflow::grappler::GraphMemory::InferStatically
tensorflow::grappler::GraphMemory::InferDynamically
[//tensorflow/core/grappler/costs:measuring_cost_estimator] # tf_cluster
tensorflow::grappler::MeasuringCostEstimator::MeasuringCostEstimator
tensorflow::grappler::MeasuringCostEstimator::Initialize
tensorflow::grappler::MeasuringCostEstimator::PredictCosts
[//tensorflow/core/grappler:devices] # tf_cluster
tensorflow::grappler::GetNumAvailableGPUs
tensorflow::grappler::GetNumAvailableLogicalCPUCores
[//tensorflow/core/profiler/internal:traceme_recorder_impl] # profiler
tensorflow::profiler::TraceMeRecorder::Record
[//external/xla/tsl/profiler/lib:profiler_session_impl] # profiler
tsl::ProfilerSession::Create
tsl::ProfilerSession::CollectData
tsl::ProfilerSession::Status
tsl::ProfilerSession::~ProfilerSession
[//external/xla/xla/tsl/profiler/rpc:profiler_server_impl] # profiler
tsl::profiler::ProfilerServer::StartProfilerServer
tsl::profiler::ProfilerServer::~ProfilerServer
[//tensorflow/core/profiler/rpc/client:profiler_client_impl] # profiler
tensorflow::profiler::ProfileGrpc
tensorflow::profiler::NewSessionGrpc
tensorflow::profiler::MonitorGrpc
tensorflow::profiler::RemoteProfilerSession::Create
tensorflow::profiler::RemoteProfilerSession::GetServiceAddress
tensorflow::profiler::RemoteProfilerSession::WaitForCompletion
tensorflow::profiler::RemoteProfilerSession::~RemoteProfilerSession
[//external/xla/xla/tsl/profiler/rpc/client:profiler_client_impl] # profiler
tsl::profiler::ProfileGrpc
tsl::profiler::NewSessionGrpc
tsl::profiler::MonitorGrpc
tsl::profiler::RemoteProfilerSession::Create
tsl::profiler::RemoteProfilerSession::GetServiceAddress
tsl::profiler::RemoteProfilerSession::WaitForCompletion
tsl::profiler::RemoteProfilerSession::~RemoteProfilerSession
[//external/xla/xla/tsl/concurrency:async_value] # tfcompile
tsl::AsyncValue::CreateTypeInfoAndReturnTypeIdImpl
tsl::AsyncValue::TypeInfo
tsl::internal::ConcreteAsyncValue
tsl::DummyValueForErrorAsyncValue
tsl::internal::ConcreteAsyncValue
[//external/xla/xla:status_macros] # tfcompile
xla::status_macros::MakeErrorStream::Impl::Impl
xla::status_macros::MakeErrorStream::Impl::~Impl
xla::status_macros::MakeErrorStream::Impl::GetStatus
xla::status_macros::MakeErrorStream::CheckNotDone
xla::status_macros::MakeErrorStream::add_ret_check_failure
[//external/xla/xla/hlo/ir:hlo] # tfcompile
xla::DfsHloVisitorBase::SetVisited
xla::DfsHloVisitorBase<class xla::HloInstruction.*>::SetVisited
xla::HloComputation::Accept
xla::HloComputation::AcceptOrdered
xla::HloComputation::CollectUnreachableRoots
xla::HloInstruction::ToString
xla::HloInstruction::Accept
xla::HloInstruction::Visit
[//tensorflow/compiler/aot:tfcompile_lib] # tfcompile
tensorflow::tfcompile::Main
[//tensorflow/python:model_analyzer_lib] # model_analyzer
tensorflow::grappler::ModelAnalyzer::GenerateReport
tensorflow::grappler::ModelAnalyzer::ModelAnalyzer
[//tensorflow/core/grappler/costs:analytical_cost_estimator] # cost_analyzer
tensorflow::grappler::AnalyticalCostEstimator::Initialize
tensorflow::grappler::AnalyticalCostEstimator::PredictCosts
[//tensorflow/python:cost_analyzer_lib] # cost_analyzer
tensorflow::grappler::CostAnalyzer::CostAnalyzer
tensorflow::grappler::CostAnalyzer::GenerateReport
[//tensorflow/cc/saved_model:metrics_impl] # SavedModel and Checkpoint metrics
tensorflow::metrics::SavedModelWrite
tensorflow::metrics::SavedModelRead
tensorflow::metrics::SavedModelWriteApi
tensorflow::metrics::SavedModelReadApi
tensorflow::metrics::SavedModelWriteFingerprint
tensorflow::metrics::SavedModelReadFingerprint
tensorflow::metrics::SavedModelWritePath
tensorflow::metrics::SavedModelReadPath
tensorflow::metrics::SavedModelWritePathAndSingleprint
tensorflow::metrics::SavedModelReadPathAndSingleprint
tensorflow::metrics::MakeFingerprintJson
tensorflow::metrics::MakeSavedModelPathAndSingleprint
tensorflow::metrics::ParseSavedModelPathAndSingleprint
tensorflow::metrics::SavedModelFoundFingerprintOnLoad
tensorflow::metrics::CheckpointReadDuration
tensorflow::metrics::CheckpointWriteDuration
tensorflow::metrics::AsyncCheckpointWriteDuration
tensorflow::metrics::TrainingTimeSaved
tensorflow::metrics::CheckpointSize
tensorflow::metrics::ShardingCallbackDuration
tensorflow::metrics::NumCheckpointShardsWritten
tensorflow::metrics::ShardingCallbackDescription
[//tensorflow/cc/saved_model:fingerprinting_impl] # SavedModel Fingerprinting
tensorflow::saved_model::fingerprinting::CreateFingerprintDef
tensorflow::saved_model::fingerprinting::ReadSavedModelFingerprint
tensorflow::saved_model::fingerprinting::Singleprint
[//tensorflow/compiler/jit:flags] # tfe
tensorflow::IsXlaEnabled
tensorflow::GetMlirCommonFlags
tensorflow::GetXlaDeviceFlags
tensorflow::ResetJitCompilerFlags
[//external/tsl/tsl/platform:tensor_float_32_utils] # tensor_float_32
tsl::enable_tensor_float_32_execution
tsl::tensor_float_32_execution_enabled
[//tensorflow/core/util:determinism] # determinism
tensorflow::OpDeterminismRequired
tensorflow::EnableOpDeterminism
[//tensorflow/compiler/jit:get_compiler_ir] # tfe
tensorflow::GetCompilerIr
[//tensorflow/core/common_runtime/eager:tensor_handle] # tfe
tensorflow::TensorHandle::Tensor
[//tensorflow/python:python_api_dispatcher] # python_api_dispatcher
tensorflow::py_dispatch::PythonAPIDispatcher
tensorflow::py_dispatch::PySignatureChecker
tensorflow::py_dispatch::PyTypeChecker::MatchType
tensorflow::py_dispatch::PyInstanceChecker::PyInstanceChecker
tensorflow::py_dispatch::PyInstanceChecker::Check
tensorflow::py_dispatch::PyInstanceChecker::cost
tensorflow::py_dispatch::PyInstanceChecker::DebugString
tensorflow::py_dispatch::PyListChecker::PyListChecker
tensorflow::py_dispatch::PyListChecker::Check
tensorflow::py_dispatch::PyListChecker::cost
tensorflow::py_dispatch::PyListChecker::DebugString
tensorflow::py_dispatch::PyUnionChecker::PyUnionChecker
tensorflow::py_dispatch::PyUnionChecker::Check
tensorflow::py_dispatch::PyUnionChecker::cost
tensorflow::py_dispatch::PyUnionChecker::DebugString
tensorflow::py_dispatch::RegisterDispatchableType
[//tensorflow/python:python_tensor_converter] # python_tensor_converter
tensorflow::PythonTensorConverter
[//tensorflow/python:python_api_info] # python_api_info
tensorflow::PythonAPIInfo
[//tensorflow/python:python_api_parameter_converter] # python_api_parameter_converter
tensorflow::ConvertPythonAPIParameters
tensorflow::CopyPythonAPITensorLists
tensorflow::GetPythonAPIMaxIndex
[//tensorflow/core/platform:statusor] # tfe
tensorflow::internal_statusor::Helper::Crash
[//tensorflow/core/platform:cpu_feature_guard] # cpu_feature_guard
tensorflow::port::InfoAboutUnusedCPUFeatures
[//tensorflow/core/function:runtime_client_cc] # runtime_client
tensorflow::core::function::GlobalEagerContext
tensorflow::core::function::GlobalPythonEagerContext
tensorflow::core::function::Runtime::CreateFunction
tensorflow::core::function::Runtime::GetFunctionProto
[//tensorflow/core/config:flag_defs] # flags_api
tensorflow::flags::Global
tensorflow::flags::Flags::GetExportedFlag
[//tensorflow/core/config:flags] # flags_api
tensorflow::config::Flag::value
tensorflow::config::Flag::reset
[//tensorflow/python/framework:op_def_util_cc] # op_def_util
tensorflow::AttributeTypeFromName
tensorflow::AttrValueToPyObject
tensorflow::ConvertPyObjectToAttributeType
tensorflow::DataTypeToPyObject
tensorflow::Safe_PyObjectPtr
[//tensorflow/compiler/mlir/quantization/tensorflow/python:quantize_model_cc] # quantization
tensorflow::quantization::QuantizeQatModel
tensorflow::quantization::QuantizePtqModelPreCalibration
tensorflow::quantization::QuantizePtqModelPostCalibration
tensorflow::quantization::QuantizeStaticRangePtq
tensorflow::quantization::QuantizeDynamicRangePtq
tensorflow::quantization::QuantizeWeightOnly
[//tensorflow/compiler/mlir/tensorflow_to_stablehlo/python:pywrap_tensorflow_to_stablehlo_lib_impl] # tensorflow_to_stablehlo
mlir::tensorflow_to_stablehlo::pywrap::PywrapSavedModelToStablehlo
mlir::tensorflow_to_stablehlo::pywrap::PywrapTfModuleToStablehlo
[//tensorflow/dtensor/cc:dtensor_device_cc] # DTensor
tensorflow::dtensor::AllocateDTensorDevice
tensorflow::dtensor::AddMesh
tensorflow::dtensor::ExperimentalSetDefaultLayout
tensorflow::dtensor::ExperimentalClearDefaultLayout
tensorflow::dtensor::ExperimentalSetDefaultMesh
tensorflow::dtensor::ExperimentalClearDefaultMesh
tensorflow::dtensor::SetTPUCoreIDs
tensorflow::dtensor::ClearTPUCoreIDs
tensorflow::dtensor::TPUCoreIDsToLocations
tensorflow::dtensor::TPUCoreLocationsToIDs
tensorflow::dtensor::Pack
tensorflow::dtensor::Unpack
tensorflow::dtensor::FetchLayout
tensorflow::dtensor::IsDTensor
tensorflow::dtensor::SparsePack
tensorflow::dtensor::IsSparseDTensor
tensorflow::dtensor::GetStats
tensorflow::dtensor::SetIteratorElementLayouts
[//tensorflow/dtensor/cc:tensor_layout] # DTensor
tensorflow::dtensor::Mesh
tensorflow::dtensor::Layout
tensorflow::dtensor::Layout::LayoutType
[//tensorflow/core/tpu/kernels:sparse_core_layout] #SparseCoreLayoutStacker
tensorflow::tpu::SparseCoreLayoutStacker::AddTable
tensorflow::tpu::SparseCoreLayoutStacker::SparseCoreLayoutStacker
tensorflow::tpu::SparseCoreLayoutStacker::AddTable
tensorflow::tpu::SparseCoreLayoutStacker::GetLayouts
+75
View File
@@ -0,0 +1,75 @@
load("//tools/toolchains/remote_config:containers.bzl", "container_digests")
licenses(["restricted"])
package(default_visibility = ["//visibility:public"])
# Remote build platforms.
# Each of the platform rules here provide a platform definition that is bound to a docker image.
# The result of the starlark configuration is checked into
# //third_party/toolchains/preconfig.
# Built with //tensorflow/tools/ci_build/Dockerfile.rbe.cpu.
platform(
name = "rbe_ubuntu16.04",
constraint_values = [
"@platforms//cpu:x86_64",
"@platforms//os:linux",
],
exec_properties = {
"container-image": "docker://gcr.io/tensorflow-testing/nosla-ubuntu16.04@%s" % container_digests["ubuntu16.04"],
"Pool": "default",
},
)
# Built with //tensorflow/tools/ci_build/Dockerfile.rbe.cpu-centos6.
platform(
name = "rbe_centos6",
constraint_values = [
"@platforms//cpu:x86_64",
"@platforms//os:linux",
],
exec_properties = {
"container-image": "docker://gcr.io/tensorflow-testing/nosla-centos6@%s" % container_digests["centos6"],
"Pool": "default",
},
)
# Built with //tensorflow/tools/ci_build/Dockerfile.rbe.cuda10.0-cudnn7-ubuntu14.04.
platform(
name = "rbe_cuda10.0-cudnn7-ubuntu14.04",
constraint_values = [
"@platforms//cpu:x86_64",
"@platforms//os:linux",
],
exec_properties = {
"container-image": "docker://gcr.io/tensorflow-testing/nosla-cuda10.0-cudnn7-ubuntu14.04@%s" % container_digests["cuda10.0-cudnn7-ubuntu14.04"],
"Pool": "default",
},
)
# Built with //tensorflow/tools/ci_build/Dockerfile.rbe.cuda10.0-cudnn7-centos6.
platform(
name = "rbe_cuda10.0-cudnn7-centos6",
constraint_values = [
"@platforms//cpu:x86_64",
"@platforms//os:linux",
],
exec_properties = {
"container-image": "docker://gcr.io/tensorflow-testing/nosla-cuda10.0-cudnn7-centos6@%s" % container_digests["cuda10.0-cudnn7-centos6"],
"Pool": "default",
},
)
# Built with //tensorflow/tools/ci_build/Dockerfile.rbe.ubuntu16.04-manylinux2010.
platform(
name = "rbe_ubuntu16.04-manylinux2010",
constraint_values = [
"@platforms//cpu:x86_64",
"@platforms//os:linux",
],
exec_properties = {
"container-image": "docker://gcr.io/tensorflow-testing/nosla-ubuntu16.04-manylinux2010@%s" % container_digests["ubuntu16.04-manylinux2010"],
"Pool": "default",
},
)
+35
View File
@@ -0,0 +1,35 @@
licenses(["restricted"])
package(default_visibility = ["//visibility:public"])
platform(
name = "x86",
constraint_values = [
"@platforms//os:android",
"@platforms//cpu:x86_32",
],
)
platform(
name = "x86_64",
constraint_values = [
"@platforms//os:android",
"@platforms//cpu:x86_64",
],
)
platform(
name = "armeabi-v7a",
constraint_values = [
"@platforms//os:android",
"@platforms//cpu:armv7",
],
)
platform(
name = "arm64-v8a",
constraint_values = [
"@platforms//cpu:arm64",
"@platforms//os:android",
],
)
+12
View File
@@ -0,0 +1,12 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
def bazel_toolchains_archive():
http_archive(
name = "bazel_toolchains",
sha256 = "77c2c3c562907a1114afde7b358bf3d5cc23dc61b3f2fd619bf167af0c9582a3",
strip_prefix = "bazel-toolchains-dfc67056200b674accd08d8f9a21e328098c07e2",
urls = [
"http://mirror.tensorflow.org/github.com/bazelbuild/bazel-toolchains/archive/dfc67056200b674accd08d8f9a21e328098c07e2.tar.gz",
"https://github.com/bazelbuild/bazel-toolchains/archive/dfc67056200b674accd08d8f9a21e328098c07e2.tar.gz",
],
)
+1
View File
@@ -0,0 +1 @@
package(default_visibility = ["//visibility:public"])
+583
View File
@@ -0,0 +1,583 @@
major_version: "v1"
minor_version: "llvm:6.0.0"
default_target_cpu: "k8"
default_toolchain {
cpu: "k8"
toolchain_identifier: "k8-clang-6.0-cxx-4.8-linux-gnu"
}
toolchain {
compiler: "clang6" # bazel build --compiler=clang6
target_cpu: "k8" # bazel build --cpu=k8
target_libc: "GLIBC_2.19" # bazel build --glibc=GLIBC_2.19
abi_libc_version: "2.19"
abi_version: "gcc-4.8-cxx11"
builtin_sysroot: ""
cc_target_os: "linux-gnu"
default_python_version: "python2.7"
dynamic_runtimes_filegroup: "dynamic-runtime-libs-k8"
host_system_name: "x86_64-unknown-linux-gnu"
needsPic: true
static_runtimes_filegroup: "static-runtime-libs-k8"
supports_embedded_runtimes: true
supports_fission: true
supports_gold_linker: true
supports_incremental_linker: true
supports_interface_shared_objects: true
supports_normalizing_ar: true
supports_start_end_lib: true
supports_thin_archives: true
target_system_name: "x86_64-unknown-linux-gnu"
toolchain_identifier: "k8-clang-6.0-cxx-4.8-linux-gnu"
tool_path { name: "ar" path: "%package(@local_config_clang6//clang6)%/llvm/bin/llvm-ar" }
tool_path { name: "as" path: "%package(@local_config_clang6//clang6)%/llvm/bin/llvm-as" }
tool_path { name: "compat-ld" path: "%package(@local_config_clang6//clang6)%/llvm/bin/ld.lld" }
tool_path { name: "cpp" path: "%package(@local_config_clang6//clang6)%/llvm/bin/llvm-cpp" }
tool_path { name: "dwp" path: "%package(@local_config_clang6//clang6)%/llvm/bin/llvm-dwp" }
tool_path { name: "gcc" path: "%package(@local_config_clang6//clang6)%/llvm/bin/clang" }
tool_path { name: "gcov" path: "%package(@local_config_clang6//clang6)%/llvm/bin/llvm-cov" }
tool_path { name: "ld" path: "%package(@local_config_clang6//clang6)%/llvm/bin/ld.lld" }
tool_path { name: "llvm-profdata" path: "%package(@local_config_clang6//clang6)%/llvm/bin/llvm-profdata" }
tool_path { name: "nm" path: "%package(@local_config_clang6//clang6)%/llvm/bin/llvm-nm" }
tool_path { name: "objcopy" path: "%package(@local_config_clang6//clang6)%/llvm/bin/llvm-objcopy" }
tool_path { name: "objdump" path: "%package(@local_config_clang6//clang6)%/sbin/objdump" }
tool_path { name: "strip" path: "%package(@local_config_clang6//clang6)%/sbin/strip" }
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\""
objcopy_embed_flag: "-I"
objcopy_embed_flag: "binary"
# This action_config makes features flags propagate
# to CC_FLAGS for genrules, and eventually skylark.
action_config {
action_name: "cc-flags-make-variable"
config_name: "cc-flags-make-variable"
}
# 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"
# TODO(b/151234342): Clean up the following options.
# This adds a little bit more durability to our Clang build.
#
# Folks who do maintenance work on TF Bazel Clang should consider
# commenting out these lines, while doing that work, to gain a better
# understanding of what the intersection of support looks like between GCC
# and Clang. Please note that Bazel does not support -Xclang-only.
compiler_flag: "-Wno-unknown-warning-option"
compiler_flag: "-Wno-unused-command-line-argument"
compiler_flag: "-Wno-ignored-optimization-argument"
#### Common compiler options. ####
compiler_flag: "-D_REENTRANT"
compiler_flag: "-D__STDC_FORMAT_MACROS"
compiler_flag: "-DSUPPRESS_USE_FILE_OFFSET64"
compiler_flag: "-Wall"
compiler_flag: "-Wformat-security"
compiler_flag: "-Wframe-larger-than=16384"
compiler_flag: "-Wno-char-subscripts"
compiler_flag: "-Wno-error=deprecated-declarations"
compiler_flag: "-Wno-uninitialized"
compiler_flag: "-Wno-sign-compare"
compiler_flag: "-Wno-strict-overflow"
compiler_flag: "-Wno-unused-function"
compiler_flag: "-fdiagnostics-show-option"
compiler_flag: "-fmessage-length=0"
compiler_flag: "-fno-exceptions"
compiler_flag: "-fno-omit-frame-pointer"
compiler_flag: "-fno-strict-aliasing"
compiler_flag: "-fno-use-init-array"
compiler_flag: "-funsigned-char"
compiler_flag: "-gmlt"
cxx_flag: "-Wno-deprecated"
cxx_flag: "-Wno-invalid-offsetof" # Needed for protobuf code (2017-11-07)
cxx_flag: "-fshow-overloads=best"
compiler_flag: "-Wthread-safety-analysis"
# Python extensions unfortunately make this go wild.
compiler_flag: "-Wno-writable-strings"
# GCC's warning produces too many false positives:
cxx_flag: "-Woverloaded-virtual"
cxx_flag: "-Wnon-virtual-dtor"
# 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"
# Disable some broken warnings from Clang.
compiler_flag: "-Wno-ambiguous-member-template"
compiler_flag: "-Wno-pointer-sign"
# These warnings have a low signal to noise ratio.
compiler_flag: "-Wno-reserved-user-defined-literal"
compiler_flag: "-Wno-return-type-c-linkage"
compiler_flag: "-Wno-invalid-source-encoding"
# Per default we switch off any layering related warnings.
compiler_flag: "-Wno-private-header"
# Clang-specific warnings that we explicitly enable for TensorFlow. Some of
# these aren't on by default, or under -Wall, or are subsets of warnings
# turned off above.
compiler_flag: "-Wfloat-overflow-conversion"
compiler_flag: "-Wfloat-zero-conversion"
compiler_flag: "-Wfor-loop-analysis"
compiler_flag: "-Wgnu-redeclared-enum"
compiler_flag: "-Winfinite-recursion"
compiler_flag: "-Wliteral-conversion"
compiler_flag: "-Wself-assign"
compiler_flag: "-Wstring-conversion"
compiler_flag: "-Wtautological-overlap-compare"
compiler_flag: "-Wunused-comparison"
compiler_flag: "-Wvla"
cxx_flag: "-Wdeprecated-increment-bool"
# Clang code-generation flags for performance optimization.
compiler_flag: "-faligned-allocation"
compiler_flag: "-fnew-alignment=8"
# Clang defaults to C99 while GCC defaults to C89. GCC plugins are written in
# C89 and don't have a BUILD rule we could add a copts flag to.
gcc_plugin_compiler_flag: "-std=gnu89"
compilation_mode_flags {
mode: FASTBUILD
}
compilation_mode_flags {
mode: DBG
compiler_flag: "-g"
}
compilation_mode_flags {
mode: OPT
compiler_flag: "-g0"
compiler_flag: "-fdebug-types-section"
compiler_flag: "-DNDEBUG"
compiler_flag: "-fno-split-dwarf-inlining"
compiler_flag: "-Os"
compiler_flag: "-fexperimental-new-pass-manager"
compiler_flag: "-fdebug-info-for-profiling"
compiler_flag: "-ffunction-sections"
compiler_flag: "-fdata-sections"
linker_flag: "-Wl,--gc-sections"
linker_flag: "-Wl,-z,relro,-z,now"
}
# Features indicating whether this is a host compile or not. Exactly one of
# these will be implicitly provided by bazel.
feature { name: "host" }
feature { name: "nonhost" }
# Features indicating which compiler will be used for code generation.
feature {
name: "llvm_codegen"
provides: "codegen"
enabled: true
}
# Features for compilation modes. Exactly one of these will be implicitly
# provided by bazel.
feature { name: "fastbuild" }
feature { name: "dbg" }
feature { name: "opt" }
# Features controlling the C++ language mode.
feature {
name: "c++11"
provides: "c++std"
flag_set {
action: "c++-compile"
action: "c++-header-parsing"
action: "c++-header-preprocessing"
action: "c++-module-compile"
action: "linkstamp-compile"
flag_group {
flag: "-nostdinc++"
flag: "-std=c++11"
flag: "-Wc++14-extensions"
flag: "-Wc++2a-extensions"
flag: "-Wno-binary-literal"
}
}
}
feature {
name: "c++14"
provides: "c++std"
flag_set {
action: "c++-compile"
action: "c++-header-parsing"
action: "c++-header-preprocessing"
action: "c++-module-compile"
action: "linkstamp-compile"
flag_group {
flag: "-nostdinc++"
flag: "-std=c++14"
flag: "-Wc++11-compat"
flag: "-Wno-c++11-compat-binary-literal"
flag: "-Wc++2a-extensions"
}
}
}
feature {
name: "c++17"
provides: "c++std"
flag_set {
action: "c++-compile"
action: "c++-header-parsing"
action: "c++-header-preprocessing"
action: "c++-module-compile"
action: "linkstamp-compile"
flag_group {
flag: "-nostdinc++"
flag: "-std=c++17"
flag: "-Wc++11-compat"
flag: "-Wno-c++11-compat-binary-literal"
flag: "-Wc++2a-extensions"
}
}
}
feature {
name: "c++2a"
provides: "c++std"
flag_set {
action: "c++-compile"
action: "c++-header-parsing"
action: "c++-header-preprocessing"
action: "c++-module-compile"
action: "linkstamp-compile"
flag_group {
flag: "-nostdinc++"
flag: "-std=c++2a"
flag: "-Wc++11-compat"
flag: "-Wno-c++11-compat-binary-literal"
}
}
}
feature {
name: "c++default"
enabled: true
flag_set {
# Provide the c++11 flags if no standard is selected
with_feature {
not_feature: "c++11"
not_feature: "c++14"
not_feature: "c++17"
not_feature: "c++2a"
}
action: "c++-compile"
action: "c++-header-parsing"
action: "c++-header-preprocessing"
action: "c++-module-compile"
action: "linkstamp-compile"
flag_group {
flag: "-nostdinc++"
flag: "-std=c++11"
flag: "-Wc++14-extensions"
flag: "-Wc++2a-extensions"
flag: "-Wno-binary-literal"
}
}
}
feature {
name: "use_compiler_rt"
requires { feature: "llvm_codegen" }
# TODO(saugustine): At the moment, "use_compiler_rt" also
# requires "linking_mode_flags { mode: FULLY_STATIC" ... },
# but that isn't a feature. We should probably convert it.
flag_set {
action: "c++-link"
action: "c++-link-interface-dynamic-library"
action: "c++-link-dynamic-library"
action: "c++-link-executable"
# "link" is a misnomer for these actions. They are really just
# invocations of ar.
#action: "c++-link-pic-static-library"
#action: "c++-link-static-library"
#action: "c++-link-alwayslink-static-library"
#action: "c++-link-pic-static-library"
#action: "c++-link-alwayslink-pic-static-library"
flag_group {
flag: "-rtlib=compiler-rt"
flag: "-lunwind"
}
}
}
feature {
name: "pie"
flag_set {
action: "assemble"
action: "preprocess-assemble"
action: "c-compile"
action: "c++-compile"
action: "c++-header-parsing"
action: "c++-header-preprocessing"
action: "c++-module-compile"
action: "c++-module-codegen"
action: "cc-flags-make-variable"
action: "lto-backend"
action: "linkstamp-compile"
flag_group {
flag: "-mpie-copy-relocations"
flag: "-fPIE"
}
}
flag_set {
action: "cc-flags-make-variable"
action: "c++-link-executable"
flag_group {
flag: "-pie"
}
}
}
# Pic must appear after pie, because pic may need to override pie, and bazel
# turns it on selectively. These don't interact with other options.
#
# TODO: In practice, normal vs pic vs pie is a ternary mode. We should
# implement it that way. This will require changes to bazel, which only
# calculates whether or not pic is needed, not pie.
#
# NOTE: Bazel might make this all a moot point.
feature {
name: "pic"
flag_set {
action: "assemble"
action: "preprocess-assemble"
action: "c-compile"
action: "c++-compile"
action: "c++-module-codegen"
action: "c++-module-compile"
action: "linkstamp-compile"
expand_if_all_available: "pic"
flag_group {
flag: "-fPIC"
}
}
}
feature {
name: "gold"
enabled: true
flag_set {
action: "c++-link-executable"
action: "c++-link-dynamic-library"
action: "c++-link-interface-dynamic-library"
flag_group {
expand_if_none_available: "lto"
flag: "-fuse-ld=gold"
}
}
}
# This is great if you want linking TensorFlow to take ten minutes.
feature {
name: "lto"
requires { feature: "nonhost" }
flag_set {
action: "c-compile"
action: "c++-compile"
flag_group {
flag: "-flto=thin"
}
}
flag_set {
action: "c++-link-executable"
action: "c++-link-dynamic-library"
action: "c++-link-interface-dynamic-library"
flag_group {
flag: "-flto=thin"
}
}
}
feature {
name: "parse_headers"
flag_set {
action: "c++-header-parsing"
flag_group {
flag: "-xc++-header"
flag: "-fsyntax-only"
}
}
}
feature {
name: "preprocess_headers"
flag_set {
action: "c++-header-preprocessing"
flag_group {
flag: "-xc++"
flag: "-E"
}
}
}
feature {
name: "per_object_debug_info"
flag_set {
action: "c-compile"
action: "c++-compile"
action: "c++-module-codegen"
action: "assemble"
action: "preprocess-assemble"
action: "lto-backend"
flag_group {
flag: "-gsplit-dwarf"
flag: "-ggnu-pubnames"
}
}
flag_set {
action: "c++-link-executable"
action: "c++-link-dynamic-library"
action: "c++-link-interface-dynamic-library"
flag_group {
expand_if_all_available: "is_using_fission"
flag: "-Wl,--gdb-index"
}
}
}
feature {
name: "xray"
requires {
feature: "llvm_codegen"
feature: "nonhost"
}
flag_set {
action: "c-compile"
action: "c++-compile"
action: "c++-header-parsing"
action: "c++-header-preprocessing"
action: "c++-module-compile"
action: "c++-link-interface-dynamic-library"
action: "c++-link-dynamic-library"
action: "c++-link-executable"
flag_group {
flag: "-fxray-instrument"
}
}
}
feature {
name: "minimal_ubsan"
requires { feature: "llvm_codegen" }
flag_set {
action: "c-compile"
action: "c++-compile"
action: "c++-header-parsing"
action: "c++-header-preprocessing"
action: "c++-module-compile"
action: "c++-module-codegen"
flag_group {
flag: "-fsanitize=return,returns-nonnull-attribute,vla-bound,unreachable,float-cast-overflow"
flag: "-fsanitize-trap=all"
flag: "-DUNDEFINED_BEHAVIOR_SANITIZER"
}
}
}
feature {
name: "minimal_ubsan_enabled_by_default"
requires {
feature: "llvm_codegen"
feature: "fastbuild"
}
enabled: true
implies: "minimal_ubsan"
}
cxx_builtin_include_directory: "%package(@local_config_clang6//clang6)%/llvm/lib/clang/6.0.0/include"
cxx_builtin_include_directory: "/usr/include"
unfiltered_cxx_flag: "-cxx-isystem"
unfiltered_cxx_flag: "/usr/include/c++/4.8"
unfiltered_cxx_flag: "-cxx-isystem"
unfiltered_cxx_flag: "/usr/include/x86_64-linux-gnu/c++/4.8"
unfiltered_cxx_flag: "-isystem"
unfiltered_cxx_flag: "%package(@local_config_clang6//clang6)%/llvm/lib/clang/6.0.0/include"
unfiltered_cxx_flag: "-isystem"
unfiltered_cxx_flag: "/usr/include/x86_64-linux-gnu"
unfiltered_cxx_flag: "-isystem"
unfiltered_cxx_flag: "/usr/include"
linker_flag: "-Wl,--build-id=md5"
linker_flag: "-Wl,--fatal-warnings"
linker_flag: "-Wl,--hash-style=gnu"
linker_flag: "-no-canonical-prefixes"
linker_flag: "--target=x86_64-unknown-linux-gnu"
linker_flag: "-L/usr/lib/gcc/x86_64-linux-gnu/4.8"
# This is the minimum x86 architecture TensorFlow supports.
compiler_flag: "-m64"
# These are for Linux.
ld_embed_flag: "-melf_x86_64"
linker_flag: "-Wl,--eh-frame-hdr"
linker_flag: "-Wl,-z,max-page-size=0x1000"
# Google never uses the stack like a heap, e.g. alloca(), because tcmalloc
# and jemalloc are so fast. However copts=["$(STACK_FRAME_UNLIMITED)"] can be
# specified when that can't be the case.
make_variable {
name: "STACK_FRAME_UNLIMITED"
value: "-Wframe-larger-than=100000000 -Wno-vla"
}
# These flags are for folks who build C/C++ code inside genrules.
make_variable {
name: "CC_FLAGS"
value: "-no-canonical-prefixes --target=x86_64-unknown-linux-gnu -fno-omit-frame-pointer -fno-tree-vrp -msse3"
}
feature {
name: "copts"
flag_set {
expand_if_all_available: "copts"
action: "assemble"
action: "preprocess-assemble"
action: "c-compile"
action: "c++-compile"
action: "c++-header-parsing"
action: "c++-header-preprocessing"
action: "c++-module-compile"
action: "c++-module-codegen"
action: "lto-backend"
flag_group {
iterate_over: "copts"
flag: "%{copts}"
}
}
}
# Please do not statically link libstdc++. This would probably lead to a lot
# of bloat since OpKernels need to use linkstatic=1 because b/27630669 and
# it could cause memory leaks since Python uses dlopen() on our libraries:
# https://stackoverflow.com/a/35015415
linker_flag: "-lstdc++"
linker_flag: "-lm"
linker_flag: "-lpthread"
linker_flag: "-l:/lib/x86_64-linux-gnu/libc-2.19.so"
}
+103
View File
@@ -0,0 +1,103 @@
# TensorFlow Bazel Clang
This is a specialized toolchain that uses an old Debian with a new Clang that
can cross compile to any x86_64 microarchitecture. It's intended to build Linux
binaries that only require the following ABIs:
- GLIBC_2.18
- CXXABI_1.3.7 (GCC 4.8.3)
- GCC_4.2.0
Which are available on at least the following Linux platforms:
- Ubuntu 14+
- CentOS 7+
- Debian 8+
- SuSE 13.2+
- Mint 17.3+
- Manjaro 0.8.11
# System Install
On Debian 8 (Jessie) Clang 6.0 can be installed as follows:
```sh
cat >>/etc/apt/sources.list <<'EOF'
deb http://apt.llvm.org/jessie/ llvm-toolchain-jessie main
deb-src http://apt.llvm.org/jessie/ llvm-toolchain-jessie main
EOF
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
apt-key fingerprint |& grep '6084 F3CF 814B 57C1 CF12 EFD5 15CF 4D18 AF4F 7421'
apt-get update
apt-get install clang lld
```
# Bazel Configuration
This toolchain can compile TensorFlow in 2m30s on a 96-core Skylake GCE VM if
the following `.bazelrc` settings are added:
```
startup --host_jvm_args=-Xmx30G
startup --host_jvm_args=-Xms30G
startup --host_jvm_args=-XX:MaxNewSize=3g
startup --host_jvm_args=-XX:-UseAdaptiveSizePolicy
startup --host_jvm_args=-XX:+UseConcMarkSweepGC
startup --host_jvm_args=-XX:TargetSurvivorRatio=70
startup --host_jvm_args=-XX:SurvivorRatio=6
startup --host_jvm_args=-XX:+UseCMSInitiatingOccupancyOnly
startup --host_jvm_args=-XX:CMSFullGCsBeforeCompaction=1
startup --host_jvm_args=-XX:CMSInitiatingOccupancyFraction=75
build --jobs=100
build --local_resources=200000,100,100
build --crosstool_top=@local_config_clang6//clang6
build --noexperimental_check_output_files
build --nostamp
build --config=opt
build --noexperimental_check_output_files
build --copt=-march=native
build --host_copt=-march=native
```
# x86_64 Microarchitectures
## Intel CPU Line
- 2003 P6 M SSE SSE2
- 2004 prescott SSE3 SSSE3 (-march=prescott)
- 2006 core X64 SSE4.1 (only on 45nm variety) (-march=core2)
- 2008 nehalem SSE4.2 VT-x VT-d (-march=nehalem)
- 2010 westmere CLMUL AES (-march=westmere)
- 2012 sandybridge AVX TXT (-march=sandybridge)
- 2012 ivybridge F16C MOVBE (-march=ivybridge)
- 2013 haswell AVX2 TSX BMI2 FMA (-march=haswell)
- 2014 broadwell RDSEED ADCX PREFETCHW (-march=broadwell - works on trusty
gcc4.9)
- 2015 skylake SGX ADX MPX
AVX-512[xeon-only](-march=skylake / -march=skylake-avx512 - needs gcc7)
- 2018 cannonlake AVX-512 SHA (-march=cannonlake - needs clang5)
## Intel Low Power CPU Line
- 2013 silvermont SSE4.1 SSE4.2 VT-x (-march=silvermont)
- 2016 goldmont SHA (-march=goldmont - needs clang5)
## AMD CPU Line
- 2003 k8 SSE SSE2 (-march=k8)
- 2005 k8 (Venus) SSE3 (-march=k8-sse3)
- 2008 barcelona SSE4a?! (-march=barcelona)
- 2011 bulldozer SSE4.1 SSE4.2 CLMUL AVX AES FMA4?! (-march=bdver1)
- 2011 piledriver FMA (-march=bdver2)
- 2015 excavator AVX2 BMI2 MOVBE (-march=bdver4)
## Google Compute Engine Supported CPUs
- 2012 sandybridge 2.6gHz -march=sandybridge
- 2012 ivybridge 2.5gHz -march=ivybridge
- 2013 haswell 2.3gHz -march=haswell
- 2014 broadwell 2.2gHz -march=broadwell
- 2015 skylake 2.0gHz -march=skylake-avx512
See: <https://cloud.google.com/compute/docs/cpu-platforms>
+160
View File
@@ -0,0 +1,160 @@
package(default_visibility = ["//visibility:public"])
# Please note that the output of these tools is unencumbered.
licenses(["restricted"]) # NCSA, GPLv3 (e.g. gold)
filegroup(
name = "ar",
srcs = ["llvm/bin/llvm-ar"],
output_licenses = ["unencumbered"],
)
filegroup(
name = "as",
srcs = ["llvm/bin/llvm-as"],
output_licenses = ["unencumbered"],
)
filegroup(
name = "cpp",
srcs = ["llvm/bin/llvm-cpp"],
output_licenses = ["unencumbered"],
)
filegroup(
name = "dwp",
srcs = ["llvm/bin/llvm-dwp"],
output_licenses = ["unencumbered"],
)
filegroup(
name = "gcc",
srcs = ["llvm/bin/clang"],
output_licenses = ["unencumbered"],
)
filegroup(
name = "gcov",
srcs = ["llvm/bin/llvm-cov"],
output_licenses = ["unencumbered"],
)
filegroup(
name = "ld",
srcs = ["llvm/bin/ld.lld"],
output_licenses = ["unencumbered"],
)
filegroup(
name = "nm",
srcs = ["llvm/bin/llvm-nm"],
output_licenses = ["unencumbered"],
)
filegroup(
name = "objcopy",
srcs = ["llvm/bin/llvm-objcopy"],
output_licenses = ["unencumbered"],
)
filegroup(
name = "objdump",
srcs = ["llvm/bin/llvm-objdump"],
output_licenses = ["unencumbered"],
)
filegroup(
name = "profdata",
srcs = ["llvm/bin/llvm-profdata"],
output_licenses = ["unencumbered"],
)
filegroup(
name = "strip",
srcs = ["sbin/strip"],
output_licenses = ["unencumbered"],
)
filegroup(
name = "xray",
srcs = ["llvm/bin/llvm-xray"],
output_licenses = ["unencumbered"],
)
filegroup(
name = "includes",
srcs = glob(["llvm/lib/clang/6.0.0/include/**"]),
output_licenses = ["unencumbered"],
)
filegroup(
name = "libraries",
srcs = glob([
"lib/*.*",
"lib/clang/6.0.0/lib/linux/*.*",
]),
output_licenses = ["unencumbered"],
)
filegroup(
name = "compiler_files",
srcs = [
":as",
":gcc",
":includes",
],
output_licenses = ["unencumbered"],
)
filegroup(
name = "linker_files",
srcs = [
":ar",
":ld",
":libraries",
],
output_licenses = ["unencumbered"],
)
filegroup(
name = "all_files",
srcs = [
":compiler_files",
":dwp",
":gcov",
":linker_files",
":nm",
":objcopy",
":objdump",
":profdata",
":strip",
":xray",
],
output_licenses = ["unencumbered"],
)
filegroup(
name = "empty",
srcs = [], # bazel crashes without this
output_licenses = ["unencumbered"],
)
cc_toolchain_suite(
name = "clang6",
toolchains = {
"k8|clang6": ":clang6-k8",
},
)
cc_toolchain(
name = "clang6-k8",
all_files = ":all_files",
compiler_files = ":compiler_files",
cpu = "k8",
dwp_files = ":dwp",
linker_files = ":linker_files",
objcopy_files = ":objcopy",
output_licenses = ["unencumbered"],
strip_files = ":strip",
supports_param_files = 1,
)
+37
View File
@@ -0,0 +1,37 @@
"""Repository rule for Debian 8 Jessie Clang-6.0 portable Linux builds."""
def _clang6_configure(ctx):
# TODO(jart): It'd probably be better to use Bazel's struct.to_proto()
# method to generate a gigantic CROSSTOOL file that allows
# Clang to support everything.
ctx.symlink(
ctx.os.environ.get(
"TF_LLVM_PATH",
"/usr/lib/llvm-6.0",
),
"clang6/llvm",
)
ctx.symlink(
ctx.os.environ.get("STRIP", "/usr/bin/strip"),
"clang6/sbin/strip",
)
ctx.symlink(
ctx.os.environ.get("OBJDUMP", "/usr/bin/objdump"),
"clang6/sbin/objdump",
)
ctx.symlink(ctx.attr._build, "clang6/BUILD")
ctx.template("clang6/CROSSTOOL", ctx.attr._crosstool, {
"%package(@local_config_clang6//clang6)%": str(ctx.path("clang6")),
})
clang6_configure = repository_rule(
implementation = _clang6_configure,
attrs = {
"_build": attr.label(
default = str(Label("//tools/toolchains/clang6:clang.BUILD")),
),
"_crosstool": attr.label(
default = str(Label("//tools/toolchains/clang6:CROSSTOOL.tpl")),
),
},
)
+21
View File
@@ -0,0 +1,21 @@
# AARCH64 toolchain
Toolchain for performing TensorFlow AARCH64 builds such as used in Github
Actions ARM_CI and ARM_CD.
Maintainer: @elfringham (Linaro LDCG)
********************************************************************************
This repository contains a toolchain for use with the specially constructed
Docker containers that match those created by SIG Build for x86 architecture
builds, but modified for AARCH64 builds.
These Docker containers have been constructed to perform builds of TensorFlow
that are compatible with manylinux2014 requirements but in an environment that
has the C++11 Dual ABI enabled.
The Docker containers are available from
[Docker Hub](https://hub.docker.com/r/linaro/tensorflow-arm64-build/tags) The
source Dockerfiles are available from
[Linaro git](https://git.linaro.org/ci/dockerfiles.git/tree/tensorflow-arm64-build)
@@ -0,0 +1,317 @@
"""Repository rule for aarch64 docker container
"""
load(
"//third_party/remote_config:common.bzl",
"err_out",
"get_host_environ",
"raw_exec",
"which",
)
_GCC_HOST_COMPILER_PATH = "GCC_HOST_COMPILER_PATH"
_GCC_HOST_COMPILER_PREFIX = "GCC_HOST_COMPILER_PREFIX"
_TF_SYSROOT = "TF_SYSROOT"
def to_list_of_strings(elements):
"""Convert the list of ["a", "b", "c"] into '"a", "b", "c"'.
This is to be used to put a list of strings into the bzl file templates
so it gets interpreted as list of strings in Starlark.
Args:
elements: list of string elements
Returns:
single string of elements wrapped in quotes separated by a comma."""
quoted_strings = ["\"" + element + "\"" for element in elements]
return ", ".join(quoted_strings)
def verify_build_defines(params):
"""Verify all variables that crosstool/BUILD.tpl expects are substituted.
Args:
params: dict of variables that will be passed to the BUILD.tpl template.
"""
missing = []
for param in [
"cxx_builtin_include_directories",
"extra_no_canonical_prefixes_flags",
"host_compiler_path",
"host_compiler_prefix",
"host_compiler_warnings",
"linker_bin_path",
"compiler_deps",
"unfiltered_compile_flags",
]:
if ("%{" + param + "}") not in params:
missing.append(param)
if missing:
auto_configure_fail(
"BUILD.tpl template is missing these variables: " +
str(missing) +
".\nWe only got: " +
str(params) +
".",
)
# TODO(dzc): Once these functions have been factored out of Bazel's
# cc_configure.bzl, load them from @bazel_tools instead.
# BEGIN cc_configure common functions.
def find_cc(repository_ctx):
"""Find the C++ compiler."""
if _use_clang(repository_ctx):
target_cc_name = "clang"
cc_path_envvar = "CLANG_COMPILER_PATH"
else:
target_cc_name = "gcc"
cc_path_envvar = _GCC_HOST_COMPILER_PATH
cc_name = target_cc_name
cc_name_from_env = get_host_environ(repository_ctx, cc_path_envvar)
if cc_name_from_env:
cc_name = cc_name_from_env
if cc_name.startswith("/"):
# Absolute path, maybe we should make this supported by our which function.
return cc_name
cc = which(repository_ctx, cc_name)
if cc == None:
fail(("Cannot find {}, either correct your path or set the {}" +
" environment variable").format(target_cc_name, cc_path_envvar))
return cc
_INC_DIR_MARKER_BEGIN = "#include <...>"
def _normalize_include_path(repository_ctx, path):
"""Normalizes include paths before writing them to the crosstool.
If path points inside the 'crosstool' folder of the repository, a relative
path is returned.
If path points outside the 'crosstool' folder, an absolute path is returned.
"""
path = str(repository_ctx.path(path))
crosstool_folder = str(repository_ctx.path(".").get_child("crosstool"))
if path.startswith(crosstool_folder):
# We drop the path to "$REPO/crosstool" and a trailing path separator.
return path[len(crosstool_folder) + 1:]
return path
def _get_cxx_inc_directories_impl(repository_ctx, cc, lang_is_cpp, tf_sysroot):
"""Compute the list of default C or C++ include directories."""
if lang_is_cpp:
lang = "c++"
else:
lang = "c"
sysroot = []
if tf_sysroot:
sysroot += ["--sysroot", tf_sysroot]
result = raw_exec(repository_ctx, [cc, "-E", "-x" + lang, "-", "-v"] +
sysroot)
stderr = err_out(result)
index1 = stderr.find(_INC_DIR_MARKER_BEGIN)
if index1 == -1:
return []
index1 = stderr.find("\n", index1)
if index1 == -1:
return []
index2 = stderr.rfind("\n ")
if index2 == -1 or index2 < index1:
return []
index2 = stderr.find("\n", index2 + 1)
if index2 == -1:
inc_dirs = stderr[index1 + 1:]
else:
inc_dirs = stderr[index1 + 1:index2].strip()
return [
_normalize_include_path(repository_ctx, p.strip())
for p in inc_dirs.split("\n")
]
def get_cxx_inc_directories(repository_ctx, cc, tf_sysroot):
"""Compute the list of default C and C++ include directories."""
# For some reason `clang -xc` sometimes returns include paths that are
# different from the ones from `clang -xc++`. (Symlink and a dir)
# So we run the compiler with both `-xc` and `-xc++` and merge resulting lists
includes_cpp = _get_cxx_inc_directories_impl(
repository_ctx,
cc,
True,
tf_sysroot,
)
includes_c = _get_cxx_inc_directories_impl(
repository_ctx,
cc,
False,
tf_sysroot,
)
return includes_cpp + [
inc
for inc in includes_c
if inc not in includes_cpp
]
def auto_configure_fail(msg):
"""Output failure message when aarch64 gcc configuration fails."""
red = "\033[0;31m"
no_color = "\033[0m"
fail("\n%sAARCH64 gcc Configuration Error:%s %s\n" % (red, no_color, msg))
# END cc_configure common functions (see TODO above).
def _use_clang(repository_ctx):
return get_host_environ(repository_ctx, "CC_TOOLCHAIN_NAME") == "linux_llvm_aarch64"
def _tf_sysroot(repository_ctx):
return get_host_environ(repository_ctx, _TF_SYSROOT, "")
def _tpl_path(repository_ctx, filename):
return repository_ctx.path(Label("//tools/toolchains/cpus/aarch64/%s.tpl" % filename))
def _create_local_aarch64_repository(repository_ctx):
"""Creates the repository containing files set up to build with gcc."""
# Resolve all labels before doing any real work. Resolving causes the
# function to be restarted with all previous state being lost. This
# can easily lead to a O(n^2) runtime in the number of labels.
# See https://github.com/tensorflow/tensorflow/commit/62bd3534525a036f07d9851b3199d68212904778
tpl_paths = {filename: _tpl_path(repository_ctx, filename) for filename in [
"crosstool:BUILD",
"crosstool:cc_toolchain_config.bzl",
]}
tf_sysroot = _tf_sysroot(repository_ctx)
cc = find_cc(repository_ctx)
cc_fullpath = cc
host_compiler_includes = get_cxx_inc_directories(
repository_ctx,
cc_fullpath,
tf_sysroot,
)
aarch64_defines = {}
aarch64_defines["%{builtin_sysroot}"] = tf_sysroot
aarch64_defines["%{compiler}"] = "gcc"
host_compiler_prefix = get_host_environ(repository_ctx, _GCC_HOST_COMPILER_PREFIX)
if not host_compiler_prefix:
host_compiler_prefix = "/usr/bin"
aarch64_defines["%{host_compiler_prefix}"] = host_compiler_prefix
aarch64_defines["%{linker_bin_path}"] = host_compiler_prefix
aarch64_defines["%{host_compiler_path}"] = str(cc)
aarch64_defines["%{host_compiler_warnings}"] = ""
aarch64_defines["%{cxx_builtin_include_directories}"] = to_list_of_strings(host_compiler_includes)
aarch64_defines["%{compiler_deps}"] = ":aarch64_gcc_pieces"
aarch64_defines["%{extra_no_canonical_prefixes_flags}"] = "\"-fno-canonical-system-headers\""
aarch64_defines["%{unfiltered_compile_flags}"] = ""
verify_build_defines(aarch64_defines)
# Only expand template variables in the BUILD file
repository_ctx.template(
"crosstool/BUILD",
tpl_paths["crosstool:BUILD"],
aarch64_defines,
)
# No templating of cc_toolchain_config - use attributes and templatize the
# BUILD file.
repository_ctx.template(
"crosstool/cc_toolchain_config.bzl",
tpl_paths["crosstool:cc_toolchain_config.bzl"],
{},
)
def _create_local_aarch64_clang_repository(repository_ctx):
"""Creates the repository containing files set up to build with clang."""
# Resolve all labels before doing any real work. Resolving causes the
# function to be restarted with all previous state being lost. This
# can easily lead to a O(n^2) runtime in the number of labels.
# See https://github.com/tensorflow/tensorflow/commit/62bd3534525a036f07d9851b3199d68212904778
tpl_paths = {filename: _tpl_path(repository_ctx, filename) for filename in [
"crosstool:BUILD",
"crosstool:cc_toolchain_config.bzl",
]}
tf_sysroot = _tf_sysroot(repository_ctx)
cc = find_cc(repository_ctx)
cc_fullpath = cc
host_compiler_includes = get_cxx_inc_directories(
repository_ctx,
cc_fullpath,
tf_sysroot,
)
aarch64_clang_defines = {}
aarch64_clang_defines["%{builtin_sysroot}"] = tf_sysroot
aarch64_clang_defines["%{compiler}"] = "clang"
host_compiler_prefix = get_host_environ(repository_ctx, _GCC_HOST_COMPILER_PREFIX)
if not host_compiler_prefix:
host_compiler_prefix = "/usr/bin"
aarch64_clang_defines["%{host_compiler_prefix}"] = host_compiler_prefix
aarch64_clang_defines["%{linker_bin_path}"] = host_compiler_prefix
aarch64_clang_defines["%{host_compiler_path}"] = str(cc)
aarch64_clang_defines["%{host_compiler_warnings}"] = """
# Some parts of the codebase set -Werror and hit this warning, so
# switch it off for now.
"-Wno-invalid-partial-specialization"
"""
aarch64_clang_defines["%{cxx_builtin_include_directories}"] = to_list_of_strings(host_compiler_includes)
aarch64_clang_defines["%{compiler_deps}"] = ":empty"
aarch64_clang_defines["%{extra_no_canonical_prefixes_flags}"] = ""
aarch64_clang_defines["%{unfiltered_compile_flags}"] = ""
verify_build_defines(aarch64_clang_defines)
# Only expand template variables in the BUILD file
repository_ctx.template(
"crosstool/BUILD",
tpl_paths["crosstool:BUILD"],
aarch64_clang_defines,
)
# No templating of cc_toolchain_config - use attributes and templatize the
# BUILD file.
repository_ctx.template(
"crosstool/cc_toolchain_config.bzl",
tpl_paths["crosstool:cc_toolchain_config.bzl"],
{},
)
def _clang_autoconf_impl(repository_ctx):
if _use_clang(repository_ctx):
_create_local_aarch64_clang_repository(repository_ctx)
else:
_create_local_aarch64_repository(repository_ctx)
_ENVIRONS = [
"CC_TOOLCHAIN_NAME",
"CLANG_COMPILER_PATH",
_GCC_HOST_COMPILER_PATH,
_GCC_HOST_COMPILER_PREFIX,
"TMP",
"TMPDIR",
]
remote_aarch64_configure = repository_rule(
implementation = _clang_autoconf_impl,
environ = _ENVIRONS,
remotable = True,
attrs = {
"environ": attr.string_dict(),
},
)
@@ -0,0 +1,76 @@
"""Configurations of AARCH64 builds used with Docker container."""
load("//third_party/remote_config:remote_platform_configure.bzl", "remote_platform_configure")
load("//tools/toolchains:cpus/aarch64/aarch64.bzl", "remote_aarch64_configure")
def ml2014_tf_aarch64_configs(name_container_map, env):
for name, container in name_container_map.items():
exec_properties = {
"container-image": container,
"Pool": "default",
}
remote_aarch64_configure(
name = "%s_config_aarch64" % name,
environ = env,
exec_properties = exec_properties,
)
remote_platform_configure(
name = "%s_config_aarch64_platform" % name,
platform = "linux",
platform_exec_properties = exec_properties,
)
def aarch64_compiler_configure():
ml2014_tf_aarch64_configs(
name_container_map = {
"ml2014_aarch64": "docker://localhost/tensorflow-build-aarch64",
"ml2014_aarch64-python3.10": "docker://localhost/tensorflow-build-aarch64:latest-python3.10",
"ml2014_aarch64-python3.11": "docker://localhost/tensorflow-build-aarch64:latest-python3.11",
},
env = {
"ABI_LIBC_VERSION": "glibc_2.17",
"ABI_VERSION": "gcc",
"BAZEL_COMPILER": "/dt10/usr/bin/gcc",
"BAZEL_HOST_SYSTEM": "aarch64-unknown-linux-gnu",
"BAZEL_TARGET_CPU": "generic",
"BAZEL_TARGET_LIBC": "glibc_2.17",
"BAZEL_TARGET_SYSTEM": "aarch64-unknown-linux-gnu",
"CC": "/dt10/usr/bin/gcc",
"CC_TOOLCHAIN_NAME": "linux_gnu_aarch64",
"CLEAR_CACHE": "1",
"GCC_HOST_COMPILER_PATH": "/dt10/usr/bin/gcc",
"GCC_HOST_COMPILER_PREFIX": "/usr/bin",
"HOST_CXX_COMPILER": "/dt10/usr/bin/gcc",
"HOST_C_COMPILER": "/dt10/usr/bin/gcc",
"TF_ENABLE_XLA": "1",
"TF_SYSROOT": "/dt10",
},
)
ml2014_tf_aarch64_configs(
name_container_map = {
"ml2014_clang_aarch64": "docker://localhost/tensorflow-build-aarch64",
"ml2014_clang_aarch64-python3.10": "docker://localhost/tensorflow-build-aarch64:latest-python3.10",
"ml2014_clang_aarch64-python3.11": "docker://localhost/tensorflow-build-aarch64:latest-python3.11",
"ml2014_clang_aarch64-python3.12": "docker://localhost/tensorflow-build-aarch64:latest-python3.12",
},
env = {
"ABI_LIBC_VERSION": "glibc_2.17",
"ABI_VERSION": "gcc",
"BAZEL_COMPILER": "/usr/lib/llvm-18/bin/clang",
"BAZEL_HOST_SYSTEM": "aarch64-unknown-linux-gnu",
"BAZEL_TARGET_CPU": "generic",
"BAZEL_TARGET_LIBC": "glibc_2.17",
"BAZEL_TARGET_SYSTEM": "aarch64-unknown-linux-gnu",
"CC": "/usr/lib/llvm-18/bin/clang",
"CC_TOOLCHAIN_NAME": "linux_llvm_aarch64",
"CLEAR_CACHE": "1",
"CLANG_COMPILER_PATH": "/usr/lib/llvm-18/bin/clang",
"HOST_CXX_COMPILER": "/usr/lib/llvm-18/bin/clang",
"HOST_C_COMPILER": "/usr/lib/llvm-18/bin/clang",
"TF_ENABLE_XLA": "1",
"TF_SYSROOT": "/dt10",
},
)
@@ -0,0 +1 @@
# copybara:uncomment package(default_applicable_licenses = ["//tensorflow:license"])
@@ -0,0 +1,78 @@
# This file is expanded from a template by aarch64_configure.bzl
# Update aarch64_configure.bzl#verify_build_defines when adding new variables.
load(":cc_toolchain_config.bzl", "cc_toolchain_config")
licenses(["restricted"])
package(default_visibility = ["//visibility:public"])
toolchain(
name = "toolchain-linux-aarch64",
exec_compatible_with = [
"@bazel_tools//platforms:linux",
"@bazel_tools//platforms:aarch64",
],
target_compatible_with = [
"@bazel_tools//platforms:linux",
"@bazel_tools//platforms:aarch64",
],
toolchain = ":cc-compiler-local-aarch64",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
cc_toolchain_suite(
name = "toolchain",
toolchains = {
"local|compiler": ":cc-compiler-local-aarch64",
"aarch64": ":cc-compiler-local-aarch64",
},
)
cc_toolchain(
name = "cc-compiler-local-aarch64",
all_files = "%{compiler_deps}",
compiler_files = "%{compiler_deps}",
ar_files = "%{compiler_deps}",
as_files = "%{compiler_deps}",
dwp_files = ":empty",
linker_files = "%{compiler_deps}",
objcopy_files = ":empty",
strip_files = ":empty",
# To support linker flags that need to go to the start of command line
# we need the toolchain to support parameter files. Parameter files are
# last on the command line and contain all shared libraries to link, so all
# regular options will be left of them.
supports_param_files = 1,
toolchain_identifier = "local_linux_aarch64",
toolchain_config = ":cc-compiler-local-aarch64-config",
)
cc_toolchain_config(
name = "cc-compiler-local-aarch64-config",
cpu = "local",
builtin_include_directories = [%{cxx_builtin_include_directories}],
extra_no_canonical_prefixes_flags = [%{extra_no_canonical_prefixes_flags}],
host_compiler_path = "%{host_compiler_path}",
host_compiler_prefix = "%{host_compiler_prefix}",
host_compiler_warnings = [%{host_compiler_warnings}],
host_unfiltered_compile_flags = [%{unfiltered_compile_flags}],
linker_bin_path = "%{linker_bin_path}",
builtin_sysroot = "%{builtin_sysroot}",
compiler = "%{compiler}",
)
filegroup(
name = "empty",
srcs = [],
)
filegroup(
name = "aarch64_gcc_pieces",
srcs = glob([
"usr/aarch64-linux-gnu/**",
"usr/libexec/**",
"usr/lib/gcc/aarch64-unknown-linux-gnu/**",
"usr/include/**",
]),
)
@@ -0,0 +1,639 @@
"""cc_toolchain_config rule for configuring AARCH64 toolchains on Linux."""
load(
"@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl",
"action_config",
"artifact_name_pattern",
"env_entry",
"env_set",
"feature",
"feature_set",
"flag_group",
"flag_set",
"tool",
"tool_path",
"variable_with_value",
"with_feature_set",
)
load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "ACTION_NAMES")
def all_assembly_actions():
return [
ACTION_NAMES.assemble,
ACTION_NAMES.preprocess_assemble,
]
def all_compile_actions():
return [
ACTION_NAMES.assemble,
ACTION_NAMES.c_compile,
ACTION_NAMES.cpp_compile,
ACTION_NAMES.cpp_header_parsing,
ACTION_NAMES.cpp_module_codegen,
ACTION_NAMES.cpp_module_compile,
ACTION_NAMES.linkstamp_compile,
ACTION_NAMES.preprocess_assemble,
]
def all_c_compile_actions():
return [
ACTION_NAMES.c_compile,
]
def all_cpp_compile_actions():
return [
ACTION_NAMES.cpp_compile,
ACTION_NAMES.cpp_header_parsing,
ACTION_NAMES.cpp_module_codegen,
ACTION_NAMES.cpp_module_compile,
ACTION_NAMES.linkstamp_compile,
]
def all_preprocessed_actions():
return [
ACTION_NAMES.c_compile,
ACTION_NAMES.cpp_compile,
ACTION_NAMES.cpp_header_parsing,
ACTION_NAMES.cpp_module_codegen,
ACTION_NAMES.cpp_module_compile,
ACTION_NAMES.linkstamp_compile,
ACTION_NAMES.preprocess_assemble,
]
def all_link_actions():
return [
ACTION_NAMES.cpp_link_executable,
ACTION_NAMES.cpp_link_dynamic_library,
ACTION_NAMES.cpp_link_nodeps_dynamic_library,
]
def all_executable_link_actions():
return [
ACTION_NAMES.cpp_link_executable,
]
def all_shared_library_link_actions():
return [
ACTION_NAMES.cpp_link_dynamic_library,
ACTION_NAMES.cpp_link_nodeps_dynamic_library,
]
def all_archive_actions():
return [ACTION_NAMES.cpp_link_static_library]
def all_strip_actions():
return [ACTION_NAMES.strip]
def _library_to_link(flag_prefix, value, iterate = None):
return flag_group(
flags = [
"{}%{{libraries_to_link.{}}}".format(
flag_prefix,
iterate if iterate else "name",
),
],
iterate_over = ("libraries_to_link." + iterate if iterate else None),
expand_if_equal = variable_with_value(
name = "libraries_to_link.type",
value = value,
),
)
def _surround_static_library(prefix, suffix):
return [
flag_group(
flags = [prefix, "%{libraries_to_link.name}", suffix],
expand_if_true = "libraries_to_link.is_whole_archive",
),
flag_group(
flags = ["%{libraries_to_link.name}"],
expand_if_false = "libraries_to_link.is_whole_archive",
),
]
def _prefix_static_library(prefix):
return [
flag_group(
flags = ["%{libraries_to_link.name}"],
expand_if_false = "libraries_to_link.is_whole_archive",
),
flag_group(
flags = [prefix + "%{libraries_to_link.name}"],
expand_if_true = "libraries_to_link.is_whole_archive",
),
]
def _static_library_to_link(alwayslink_prefix, alwayslink_suffix = None):
if alwayslink_suffix:
flag_groups = _surround_static_library(alwayslink_prefix, alwayslink_suffix)
else:
flag_groups = _prefix_static_library(alwayslink_prefix)
return flag_group(
flag_groups = flag_groups,
expand_if_equal = variable_with_value(
name = "libraries_to_link.type",
value = "static_library",
),
)
def _iterate_flag_group(iterate_over, flags = [], flag_groups = []):
return flag_group(
iterate_over = iterate_over,
expand_if_available = iterate_over,
flag_groups = flag_groups,
flags = flags,
)
def _libraries_to_link_group(flavour):
if flavour == "linux":
return _iterate_flag_group(
iterate_over = "libraries_to_link",
flag_groups = [
flag_group(
flags = ["-Wl,--start-lib"],
expand_if_equal = variable_with_value(
name = "libraries_to_link.type",
value = "object_file_group",
),
),
_library_to_link("", "object_file_group", "object_files"),
flag_group(
flags = ["-Wl,--end-lib"],
expand_if_equal = variable_with_value(
name = "libraries_to_link.type",
value = "object_file_group",
),
),
_library_to_link("", "object_file"),
_library_to_link("", "interface_library"),
_static_library_to_link("-Wl,-whole-archive", "-Wl,-no-whole-archive"),
_library_to_link("-l", "dynamic_library"),
_library_to_link("-l:", "versioned_dynamic_library"),
],
)
elif flavour == "darwin":
return _iterate_flag_group(
iterate_over = "libraries_to_link",
flag_groups = [
_library_to_link("", "object_file_group", "object_files"),
_library_to_link("", "object_file"),
_library_to_link("", "interface_library"),
_static_library_to_link("-Wl,-force_load,"),
_library_to_link("-l", "dynamic_library"),
_library_to_link("-l:", "versioned_dynamic_library"),
],
)
elif flavour == "msvc":
return _iterate_flag_group(
iterate_over = "libraries_to_link",
flag_groups = [
_library_to_link("", "object_file_group", "object_files"),
_library_to_link("", "object_file"),
_library_to_link("", "interface_library"),
_static_library_to_link("/WHOLEARCHIVE:"),
],
)
def _action_configs_with_tool(path, actions):
return [
action_config(
action_name = name,
enabled = True,
tools = [tool(path = path)],
)
for name in actions
]
def _action_configs(assembly_path, c_compiler_path, cc_compiler_path, archiver_path, linker_path, strip_path):
return _action_configs_with_tool(
assembly_path,
all_assembly_actions(),
) + _action_configs_with_tool(
c_compiler_path,
all_c_compile_actions(),
) + _action_configs_with_tool(
cc_compiler_path,
all_cpp_compile_actions(),
) + _action_configs_with_tool(
archiver_path,
all_archive_actions(),
) + _action_configs_with_tool(
linker_path,
all_link_actions(),
) + _action_configs_with_tool(
strip_path,
all_strip_actions(),
)
def _tool_paths(cpu, ctx):
if cpu in ["local", "darwin"]:
return [
tool_path(name = "gcc", path = ctx.attr.host_compiler_path),
tool_path(name = "ar", path = ctx.attr.host_compiler_prefix + (
"/ar" if cpu == "local" else "/libtool"
)),
tool_path(name = "compat-ld", path = ctx.attr.host_compiler_prefix + "/ld"),
tool_path(name = "cpp", path = ctx.attr.host_compiler_prefix + "/cpp"),
tool_path(name = "dwp", path = ctx.attr.host_compiler_prefix + "/dwp"),
tool_path(name = "gcov", path = ctx.attr.host_compiler_prefix + "/gcov"),
tool_path(name = "ld", path = ctx.attr.host_compiler_prefix + "/ld"),
tool_path(name = "nm", path = ctx.attr.host_compiler_prefix + "/nm"),
tool_path(name = "objcopy", path = ctx.attr.host_compiler_prefix + "/objcopy"),
tool_path(name = "objdump", path = ctx.attr.host_compiler_prefix + "/objdump"),
tool_path(name = "strip", path = ctx.attr.host_compiler_prefix + "/strip"),
]
else:
fail("Unreachable")
def _sysroot_group():
return flag_group(
flags = ["--sysroot=%{sysroot}"],
expand_if_available = "sysroot",
)
def _no_canonical_prefixes_group(extra_flags):
return flag_group(
flags = [
"-no-canonical-prefixes",
] + extra_flags,
)
def _nologo():
return flag_group(flags = ["/nologo"])
def _features(cpu, compiler, ctx):
if cpu in ["local", "darwin"]:
return [
feature(name = "no_legacy_features"),
feature(
name = "all_compile_flags",
enabled = True,
flag_sets = [
flag_set(
actions = all_compile_actions(),
flag_groups = [
flag_group(
flags = ["-MD", "-MF", "%{dependency_file}"],
expand_if_available = "dependency_file",
),
flag_group(
flags = ["-gsplit-dwarf"],
expand_if_available = "per_object_debug_info_file",
),
],
),
flag_set(
actions = all_preprocessed_actions(),
flag_groups = [
flag_group(
flags = ["-frandom-seed=%{output_file}"],
expand_if_available = "output_file",
),
_iterate_flag_group(
flags = ["-D%{preprocessor_defines}"],
iterate_over = "preprocessor_defines",
),
_iterate_flag_group(
flags = ["-include", "%{includes}"],
iterate_over = "includes",
),
_iterate_flag_group(
flags = ["-iquote", "%{quote_include_paths}"],
iterate_over = "quote_include_paths",
),
_iterate_flag_group(
flags = ["-I%{include_paths}"],
iterate_over = "include_paths",
),
_iterate_flag_group(
flags = ["-isystem", "%{system_include_paths}"],
iterate_over = "system_include_paths",
),
_iterate_flag_group(
flags = ["-F", "%{framework_include_paths}"],
iterate_over = "framework_include_paths",
),
],
),
flag_set(
actions = all_cpp_compile_actions(),
flag_groups = [
flag_group(flags = [
"-fmerge-all-constants",
]),
] if compiler == "clang" else [],
),
flag_set(
actions = all_compile_actions(),
flag_groups = [
flag_group(
flags = [
"-Wno-builtin-macro-redefined",
"-D__DATE__=\"redacted\"",
"-D__TIMESTAMP__=\"redacted\"",
"-D__TIME__=\"redacted\"",
],
),
flag_group(
flags = ["-fPIC"],
expand_if_available = "pic",
),
flag_group(
flags = ["-fPIE"],
expand_if_not_available = "pic",
),
flag_group(
flags = [
"-U_FORTIFY_SOURCE",
"-D_FORTIFY_SOURCE=1",
"-fstack-protector",
"-Wall",
] + ctx.attr.host_compiler_warnings + [
"-fno-omit-frame-pointer",
],
),
_no_canonical_prefixes_group(
ctx.attr.extra_no_canonical_prefixes_flags,
),
],
),
flag_set(
actions = all_compile_actions(),
flag_groups = [flag_group(flags = ["-DNDEBUG"])],
with_features = [with_feature_set(features = ["disable-assertions"])],
),
flag_set(
actions = all_compile_actions(),
flag_groups = [
flag_group(
flags = [
"-g0",
"-O2",
"-ffunction-sections",
"-fdata-sections",
],
),
],
with_features = [with_feature_set(features = ["opt"])],
),
flag_set(
actions = all_compile_actions(),
flag_groups = [flag_group(flags = ["-g"])],
with_features = [with_feature_set(features = ["dbg"])],
),
] + [
flag_set(
actions = all_compile_actions(),
flag_groups = [
_iterate_flag_group(
flags = ["%{user_compile_flags}"],
iterate_over = "user_compile_flags",
),
_sysroot_group(),
flag_group(
expand_if_available = "source_file",
flags = ["-c", "%{source_file}"],
),
flag_group(
expand_if_available = "output_assembly_file",
flags = ["-S"],
),
flag_group(
expand_if_available = "output_preprocess_file",
flags = ["-E"],
),
flag_group(
expand_if_available = "output_file",
flags = ["-o", "%{output_file}"],
),
],
),
],
),
feature(
name = "all_archive_flags",
enabled = True,
flag_sets = [
flag_set(
actions = all_archive_actions(),
flag_groups = [
flag_group(
expand_if_available = "linker_param_file",
flags = ["@%{linker_param_file}"],
),
flag_group(flags = ["rcsD"]),
flag_group(
flags = ["%{output_execpath}"],
expand_if_available = "output_execpath",
),
flag_group(
iterate_over = "libraries_to_link",
flag_groups = [
flag_group(
flags = ["%{libraries_to_link.name}"],
expand_if_equal = variable_with_value(
name = "libraries_to_link.type",
value = "object_file",
),
),
flag_group(
flags = ["%{libraries_to_link.object_files}"],
iterate_over = "libraries_to_link.object_files",
expand_if_equal = variable_with_value(
name = "libraries_to_link.type",
value = "object_file_group",
),
),
],
expand_if_available = "libraries_to_link",
),
],
),
],
),
feature(
name = "all_link_flags",
enabled = True,
flag_sets = [
flag_set(
actions = all_shared_library_link_actions(),
flag_groups = [flag_group(flags = ["-shared"])],
),
flag_set(
actions = all_link_actions(),
flag_groups = ([
flag_group(flags = ["-Wl,-no-as-needed"])
] if cpu == "local" else []) + ([
flag_group(flags = ["-B" + ctx.attr.linker_bin_path])
] if ctx.attr.linker_bin_path else []) + [
flag_group(
flags = ["@%{linker_param_file}"],
expand_if_available = "linker_param_file",
),
_iterate_flag_group(
flags = ["%{linkstamp_paths}"],
iterate_over = "linkstamp_paths",
),
flag_group(
flags = ["-o", "%{output_execpath}"],
expand_if_available = "output_execpath",
),
_iterate_flag_group(
flags = ["-L%{library_search_directories}"],
iterate_over = "library_search_directories",
),
_iterate_flag_group(
iterate_over = "runtime_library_search_directories",
flags = [
"-Wl,-rpath,$ORIGIN/%{runtime_library_search_directories}",
] if cpu == "local" else [
"-Wl,-rpath,@loader_path/%{runtime_library_search_directories}",
],
),
_libraries_to_link_group("darwin" if cpu == "darwin" else "linux"),
_iterate_flag_group(
flags = ["%{user_link_flags}"],
iterate_over = "user_link_flags",
),
flag_group(
flags = ["-Wl,--gdb-index"],
expand_if_available = "is_using_fission",
),
flag_group(
flags = ["-Wl,-S"],
expand_if_available = "strip_debug_symbols",
),
flag_group(flags = ["-lc++" if cpu == "darwin" else "-lstdc++"]),
_no_canonical_prefixes_group(
ctx.attr.extra_no_canonical_prefixes_flags,
),
],
),
flag_set(
actions = all_executable_link_actions(),
flag_groups = [flag_group(flags = ["-pie"])],
),
] + ([
flag_set(
actions = all_link_actions(),
flag_groups = [flag_group(flags = [
"-Wl,-z,relro,-z,now",
])],
),
] if cpu == "local" else []) + ([
flag_set(
actions = all_link_actions(),
flag_groups = [
flag_group(flags = ["-Wl,--gc-sections"]),
flag_group(
flags = ["-Wl,--build-id=md5", "-Wl,--hash-style=gnu"],
),
],
),
] if cpu == "local" else []) + ([
flag_set(
actions = all_link_actions(),
flag_groups = [flag_group(flags = ["-undefined", "dynamic_lookup"])],
),
] if cpu == "darwin" else []) + [
flag_set(
actions = all_link_actions(),
flag_groups = [
_sysroot_group(),
],
),
],
),
feature(name = "disable-assertions"),
feature(
name = "opt",
implies = ["disable-assertions"],
),
feature(name = "fastbuild"),
feature(name = "dbg"),
feature(name = "supports_dynamic_linker", enabled = True),
feature(name = "pic", enabled = True),
feature(name = "supports_pic", enabled = True),
feature(name = "has_configured_linker_path", enabled = True),
]
else:
fail("Unreachable")
def _impl(ctx):
cpu = ctx.attr.cpu
compiler = ctx.attr.compiler
if (cpu == "darwin"):
toolchain_identifier = "local_darwin"
target_cpu = "darwin"
target_libc = "macosx"
compiler = "compiler"
action_configs = _action_configs(
assembly_path = ctx.attr.host_compiler_path,
c_compiler_path = ctx.attr.host_compiler_path,
cc_compiler_path = ctx.attr.host_compiler_path,
archiver_path = ctx.attr.host_compiler_prefix + "/libtool",
linker_path = ctx.attr.host_compiler_path,
strip_path = ctx.attr.host_compiler_prefix + "/strip",
)
artifact_name_patterns = []
elif (cpu == "local"):
toolchain_identifier = "local_linux"
target_cpu = "local"
target_libc = "local"
action_configs = _action_configs(
assembly_path = ctx.attr.host_compiler_path,
c_compiler_path = ctx.attr.host_compiler_path,
cc_compiler_path = ctx.attr.host_compiler_path,
archiver_path = ctx.attr.host_compiler_prefix + "/ar",
linker_path = ctx.attr.host_compiler_path,
strip_path = ctx.attr.host_compiler_prefix + "/strip",
)
artifact_name_patterns = []
else:
fail("Unreachable")
out = ctx.actions.declare_file(ctx.label.name)
ctx.actions.write(out, "Fake executable")
return [
cc_common.create_cc_toolchain_config_info(
ctx = ctx,
features = _features(cpu, compiler, ctx),
action_configs = action_configs,
artifact_name_patterns = artifact_name_patterns,
cxx_builtin_include_directories = ctx.attr.builtin_include_directories,
toolchain_identifier = toolchain_identifier,
host_system_name = "local",
target_system_name = "local",
target_cpu = target_cpu,
target_libc = target_libc,
compiler = compiler,
abi_version = "local",
abi_libc_version = "local",
tool_paths = _tool_paths(cpu, ctx),
make_variables = [],
builtin_sysroot = ctx.attr.builtin_sysroot,
cc_target_os = None,
),
DefaultInfo(
executable = out,
),
]
cc_toolchain_config = rule(
implementation = _impl,
attrs = {
"cpu": attr.string(mandatory = True, values = ["darwin", "local"]),
"compiler": attr.string(values = ["clang", "gcc", "unknown"], default = "gcc"),
"builtin_include_directories": attr.string_list(),
"extra_no_canonical_prefixes_flags": attr.string_list(),
"host_compiler_path": attr.string(),
"host_compiler_prefix": attr.string(),
"host_compiler_warnings": attr.string_list(),
"host_unfiltered_compile_flags": attr.string_list(),
"linker_bin_path": attr.string(),
"builtin_sysroot": attr.string(),
},
provides = [CcToolchainConfigInfo],
executable = True,
)
@@ -0,0 +1,41 @@
"""Repository rule for arm compiler autoconfiguration."""
def _tpl(repository_ctx, tpl, substitutions = {}, out = None):
if not out:
out = tpl
repository_ctx.template(
out,
Label("//tools/toolchains/cpus/arm:%s.tpl" % tpl),
substitutions,
)
def _arm_compiler_configure_impl(repository_ctx):
# We need to find a cross-compilation include directory for Python, so look
# for an environment variable. Be warned, this crosstool template is only
# regenerated on the first run of Bazel, so if you change the variable after
# it may not be reflected in later builds. Doing a shutdown and clean of Bazel
# doesn't fix this, you'll need to delete the generated file at something like:
# external/local_config_arm_compiler/CROSSTOOL in your Bazel install.
if "CROSSTOOL_PYTHON_INCLUDE_PATH" in repository_ctx.os.environ:
python_include_path = repository_ctx.os.environ["CROSSTOOL_PYTHON_INCLUDE_PATH"]
else:
python_include_path = "/usr/include/python2.7"
_tpl(repository_ctx, "cc_config.bzl", {
"%{ARM_COMPILER_PATH}%": str(repository_ctx.path(
repository_ctx.attr.remote_config_repo_arm,
)),
"%{AARCH64_COMPILER_PATH}%": str(repository_ctx.path(
repository_ctx.attr.remote_config_repo_aarch64,
)),
"%{PYTHON_INCLUDE_PATH}%": python_include_path,
})
repository_ctx.symlink(Label(repository_ctx.attr.build_file), "BUILD")
arm_compiler_configure = repository_rule(
implementation = _arm_compiler_configure_impl,
attrs = {
"remote_config_repo_arm": attr.string(mandatory = False, default = ""),
"remote_config_repo_aarch64": attr.string(mandatory = False, default = ""),
"build_file": attr.string(),
},
)
@@ -0,0 +1,845 @@
load("@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl",
"action_config",
"artifact_name_pattern",
"env_entry",
"env_set",
"feature",
"feature_set",
"flag_group",
"flag_set",
"make_variable",
"tool",
"tool_path",
"variable_with_value",
"with_feature_set",
)
load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "ACTION_NAMES")
def _impl(ctx):
if (ctx.attr.cpu == "armeabi"):
toolchain_identifier = "arm-linux-gnueabihf"
elif (ctx.attr.cpu == "aarch64"):
toolchain_identifier = "aarch64-linux-gnu"
elif (ctx.attr.cpu == "local"):
toolchain_identifier = "local_linux"
else:
fail("Unreachable")
if (ctx.attr.cpu == "armeabi"):
host_system_name = "armeabi"
elif (ctx.attr.cpu == "aarch64"):
host_system_name = "aarch64"
elif (ctx.attr.cpu == "local"):
host_system_name = "local"
else:
fail("Unreachable")
if (ctx.attr.cpu == "armeabi"):
target_system_name = "armeabi"
elif (ctx.attr.cpu == "aarch64"):
target_system_name = "aarch64"
elif (ctx.attr.cpu == "local"):
target_system_name = "local"
else:
fail("Unreachable")
if (ctx.attr.cpu == "armeabi"):
target_cpu = "armeabi"
elif (ctx.attr.cpu == "aarch64"):
target_cpu = "aarch64"
elif (ctx.attr.cpu == "local"):
target_cpu = "local"
else:
fail("Unreachable")
if (ctx.attr.cpu == "armeabi"):
target_libc = "armeabi"
elif (ctx.attr.cpu == "aarch64"):
target_libc = "aarch64"
elif (ctx.attr.cpu == "local"):
target_libc = "local"
else:
fail("Unreachable")
compiler = "compiler"
if (ctx.attr.cpu == "armeabi"):
abi_version = "armeabi"
elif (ctx.attr.cpu == "aarch64"):
abi_version = "aarch64"
elif (ctx.attr.cpu == "local"):
abi_version = "local"
else:
fail("Unreachable")
if (ctx.attr.cpu == "armeabi"):
abi_libc_version = "armeabi"
elif (ctx.attr.cpu == "aarch64"):
abi_libc_version = "aarch64"
elif (ctx.attr.cpu == "local"):
abi_libc_version = "local"
else:
fail("Unreachable")
cc_target_os = None
builtin_sysroot = None
all_compile_actions = [
ACTION_NAMES.c_compile,
ACTION_NAMES.cpp_compile,
ACTION_NAMES.linkstamp_compile,
ACTION_NAMES.assemble,
ACTION_NAMES.preprocess_assemble,
ACTION_NAMES.cpp_header_parsing,
ACTION_NAMES.cpp_module_compile,
ACTION_NAMES.cpp_module_codegen,
ACTION_NAMES.clif_match,
ACTION_NAMES.lto_backend,
]
all_cpp_compile_actions = [
ACTION_NAMES.cpp_compile,
ACTION_NAMES.linkstamp_compile,
ACTION_NAMES.cpp_header_parsing,
ACTION_NAMES.cpp_module_compile,
ACTION_NAMES.cpp_module_codegen,
ACTION_NAMES.clif_match,
]
preprocessor_compile_actions = [
ACTION_NAMES.c_compile,
ACTION_NAMES.cpp_compile,
ACTION_NAMES.linkstamp_compile,
ACTION_NAMES.preprocess_assemble,
ACTION_NAMES.cpp_header_parsing,
ACTION_NAMES.cpp_module_compile,
ACTION_NAMES.clif_match,
]
codegen_compile_actions = [
ACTION_NAMES.c_compile,
ACTION_NAMES.cpp_compile,
ACTION_NAMES.linkstamp_compile,
ACTION_NAMES.assemble,
ACTION_NAMES.preprocess_assemble,
ACTION_NAMES.cpp_module_codegen,
ACTION_NAMES.lto_backend,
]
all_link_actions = [
ACTION_NAMES.cpp_link_executable,
ACTION_NAMES.cpp_link_dynamic_library,
ACTION_NAMES.cpp_link_nodeps_dynamic_library,
]
objcopy_embed_data_action = action_config(
action_name = "objcopy_embed_data",
enabled = True,
tools = [tool(path = "/usr/bin/objcopy")],
)
if (ctx.attr.cpu == "armeabi"):
action_configs = []
elif (ctx.attr.cpu == "aarch64"):
action_configs = []
elif (ctx.attr.cpu == "local"):
action_configs = [objcopy_embed_data_action]
else:
fail("Unreachable")
opt_feature = feature(name = "opt")
dbg_feature = feature(name = "dbg")
sysroot_feature = feature(
name = "sysroot",
enabled = True,
flag_sets = [
flag_set(
actions = [
ACTION_NAMES.preprocess_assemble,
ACTION_NAMES.linkstamp_compile,
ACTION_NAMES.c_compile,
ACTION_NAMES.cpp_compile,
ACTION_NAMES.cpp_header_parsing,
ACTION_NAMES.cpp_module_compile,
ACTION_NAMES.cpp_module_codegen,
ACTION_NAMES.lto_backend,
ACTION_NAMES.clif_match,
ACTION_NAMES.cpp_link_executable,
ACTION_NAMES.cpp_link_dynamic_library,
ACTION_NAMES.cpp_link_nodeps_dynamic_library,
],
flag_groups = [
flag_group(
flags = ["--sysroot=%{sysroot}"],
expand_if_available = "sysroot",
),
],
),
],
)
if (ctx.attr.cpu == "armeabi" or ctx.attr.cpu == "aarch64"):
unfiltered_compile_flags_feature = feature(
name = "unfiltered_compile_flags",
enabled = True,
flag_sets = [
flag_set(
actions = [
ACTION_NAMES.assemble,
ACTION_NAMES.preprocess_assemble,
ACTION_NAMES.linkstamp_compile,
ACTION_NAMES.c_compile,
ACTION_NAMES.cpp_compile,
ACTION_NAMES.cpp_header_parsing,
ACTION_NAMES.cpp_module_compile,
ACTION_NAMES.cpp_module_codegen,
ACTION_NAMES.lto_backend,
ACTION_NAMES.clif_match,
],
flag_groups = [
flag_group(
flags = [
"-Wno-builtin-macro-redefined",
"-D__DATE__=\"redacted\"",
"-D__TIMESTAMP__=\"redacted\"",
"-D__TIME__=\"redacted\"",
"-no-canonical-prefixes",
"-fno-canonical-system-headers",
],
),
],
),
],
)
elif (ctx.attr.cpu == "local"):
unfiltered_compile_flags_feature = feature(
name = "unfiltered_compile_flags",
enabled = True,
flag_sets = [
flag_set(
actions = [
ACTION_NAMES.assemble,
ACTION_NAMES.preprocess_assemble,
ACTION_NAMES.linkstamp_compile,
ACTION_NAMES.c_compile,
ACTION_NAMES.cpp_compile,
ACTION_NAMES.cpp_header_parsing,
ACTION_NAMES.cpp_module_compile,
ACTION_NAMES.cpp_module_codegen,
ACTION_NAMES.lto_backend,
ACTION_NAMES.clif_match,
],
flag_groups = [
flag_group(
flags = [
"-no-canonical-prefixes",
"-fno-canonical-system-headers",
"-Wno-builtin-macro-redefined",
"-D__DATE__=\"redacted\"",
"-D__TIMESTAMP__=\"redacted\"",
"-D__TIME__=\"redacted\"",
],
),
],
),
],
)
else:
unfiltered_compile_flags_feature = None
objcopy_embed_flags_feature = feature(
name = "objcopy_embed_flags",
enabled = True,
flag_sets = [
flag_set(
actions = ["objcopy_embed_data"],
flag_groups = [flag_group(flags = ["-I", "binary"])],
),
],
)
if (ctx.attr.cpu == "armeabi"):
default_compile_flags_feature = feature(
name = "default_compile_flags",
enabled = True,
flag_sets = [
flag_set(
actions = [
ACTION_NAMES.assemble,
ACTION_NAMES.preprocess_assemble,
ACTION_NAMES.linkstamp_compile,
ACTION_NAMES.c_compile,
ACTION_NAMES.cpp_compile,
ACTION_NAMES.cpp_header_parsing,
ACTION_NAMES.cpp_module_compile,
ACTION_NAMES.cpp_module_codegen,
ACTION_NAMES.lto_backend,
ACTION_NAMES.clif_match,
],
flag_groups = [
flag_group(
flags = [
"-U_FORTIFY_SOURCE",
"-D_FORTIFY_SOURCE=1",
"-fstack-protector",
"-DRASPBERRY_PI",
],
),
],
),
flag_set(
actions = [
ACTION_NAMES.assemble,
ACTION_NAMES.preprocess_assemble,
ACTION_NAMES.linkstamp_compile,
ACTION_NAMES.c_compile,
ACTION_NAMES.cpp_compile,
ACTION_NAMES.cpp_header_parsing,
ACTION_NAMES.cpp_module_compile,
ACTION_NAMES.cpp_module_codegen,
ACTION_NAMES.lto_backend,
ACTION_NAMES.clif_match,
],
flag_groups = [flag_group(flags = ["-g"])],
with_features = [with_feature_set(features = ["dbg"])],
),
flag_set(
actions = [
ACTION_NAMES.assemble,
ACTION_NAMES.preprocess_assemble,
ACTION_NAMES.linkstamp_compile,
ACTION_NAMES.c_compile,
ACTION_NAMES.cpp_compile,
ACTION_NAMES.cpp_header_parsing,
ACTION_NAMES.cpp_module_compile,
ACTION_NAMES.cpp_module_codegen,
ACTION_NAMES.lto_backend,
ACTION_NAMES.clif_match,
],
flag_groups = [
flag_group(
flags = [
"-g0",
"-O2",
"-DNDEBUG",
"-ffunction-sections",
"-fdata-sections",
],
),
],
with_features = [with_feature_set(features = ["opt"])],
),
flag_set(
actions = [
ACTION_NAMES.linkstamp_compile,
ACTION_NAMES.cpp_compile,
ACTION_NAMES.cpp_header_parsing,
ACTION_NAMES.cpp_module_compile,
ACTION_NAMES.cpp_module_codegen,
ACTION_NAMES.lto_backend,
ACTION_NAMES.clif_match,
],
flag_groups = [
flag_group(
flags = [
"-std=c++11",
"-isystem",
"%{ARM_COMPILER_PATH}%/lib/gcc/arm-rpi-linux-gnueabihf/6.5.0/include",
"-isystem",
"%{ARM_COMPILER_PATH}%/lib/gcc/arm-rpi-linux-gnueabihf/6.5.0/include-fixed",
"-isystem",
"%{ARM_COMPILER_PATH}%/arm-rpi-linux-gnueabihf/include/c++/6.5.0/",
"-isystem",
"%{ARM_COMPILER_PATH}%/arm-rpi-linux-gnueabihf/sysroot/usr/include/",
"-isystem",
"%{PYTHON_INCLUDE_PATH}%",
"-isystem",
"/usr/include/",
],
),
],
),
],
)
elif (ctx.attr.cpu == "aarch64"):
default_compile_flags_feature = feature(
name = "default_compile_flags",
enabled = True,
flag_sets = [
flag_set(
actions = [
ACTION_NAMES.assemble,
ACTION_NAMES.preprocess_assemble,
ACTION_NAMES.linkstamp_compile,
ACTION_NAMES.c_compile,
ACTION_NAMES.cpp_compile,
ACTION_NAMES.cpp_header_parsing,
ACTION_NAMES.cpp_module_compile,
ACTION_NAMES.cpp_module_codegen,
ACTION_NAMES.lto_backend,
ACTION_NAMES.clif_match,
],
flag_groups = [
flag_group(
flags = [
"-U_FORTIFY_SOURCE",
"-D_FORTIFY_SOURCE=1",
"-fstack-protector",
"-DRASPBERRY_PI",
],
),
],
),
flag_set(
actions = [
ACTION_NAMES.assemble,
ACTION_NAMES.preprocess_assemble,
ACTION_NAMES.linkstamp_compile,
ACTION_NAMES.c_compile,
ACTION_NAMES.cpp_compile,
ACTION_NAMES.cpp_header_parsing,
ACTION_NAMES.cpp_module_compile,
ACTION_NAMES.cpp_module_codegen,
ACTION_NAMES.lto_backend,
ACTION_NAMES.clif_match,
],
flag_groups = [flag_group(flags = ["-g"])],
with_features = [with_feature_set(features = ["dbg"])],
),
flag_set(
actions = [
ACTION_NAMES.assemble,
ACTION_NAMES.preprocess_assemble,
ACTION_NAMES.linkstamp_compile,
ACTION_NAMES.c_compile,
ACTION_NAMES.cpp_compile,
ACTION_NAMES.cpp_header_parsing,
ACTION_NAMES.cpp_module_compile,
ACTION_NAMES.cpp_module_codegen,
ACTION_NAMES.lto_backend,
ACTION_NAMES.clif_match,
],
flag_groups = [
flag_group(
flags = [
"-g0",
"-O2",
"-DNDEBUG",
"-ffunction-sections",
"-fdata-sections",
],
),
],
with_features = [with_feature_set(features = ["opt"])],
),
flag_set(
actions = [
ACTION_NAMES.linkstamp_compile,
ACTION_NAMES.cpp_compile,
ACTION_NAMES.cpp_header_parsing,
ACTION_NAMES.cpp_module_compile,
ACTION_NAMES.cpp_module_codegen,
ACTION_NAMES.lto_backend,
ACTION_NAMES.clif_match,
],
flag_groups = [
flag_group(
flags = [
"-std=c++11",
"-isystem",
"%{AARCH64_COMPILER_PATH}%/aarch64-none-linux-gnu/include/c++/9.2.1/",
"-isystem",
"%{AARCH64_COMPILER_PATH}%/lib/gcc/aarch64-none-linux-gnu/9.2.1/include",
"-isystem",
"%{AARCH64_COMPILER_PATH}%/lib/gcc/aarch64-none-linux-gnu/9.2.1/include-fixed",
"-isystem",
"%{AARCH64_COMPILER_PATH}%/aarch64-none-linux-gnu/libc/usr/include/",
"-isystem",
"%{PYTHON_INCLUDE_PATH}%",
"-isystem",
"/usr/include/",
],
),
],
),
],
)
elif (ctx.attr.cpu == "local"):
default_compile_flags_feature = feature(
name = "default_compile_flags",
enabled = True,
flag_sets = [
flag_set(
actions = [
ACTION_NAMES.assemble,
ACTION_NAMES.preprocess_assemble,
ACTION_NAMES.linkstamp_compile,
ACTION_NAMES.c_compile,
ACTION_NAMES.cpp_compile,
ACTION_NAMES.cpp_header_parsing,
ACTION_NAMES.cpp_module_compile,
ACTION_NAMES.cpp_module_codegen,
ACTION_NAMES.lto_backend,
ACTION_NAMES.clif_match,
],
flag_groups = [
flag_group(
flags = [
"-U_FORTIFY_SOURCE",
"-D_FORTIFY_SOURCE=1",
"-fstack-protector",
"-Wall",
"-Wunused-but-set-parameter",
"-Wno-free-nonheap-object",
"-fno-omit-frame-pointer",
],
),
],
),
flag_set(
actions = [
ACTION_NAMES.assemble,
ACTION_NAMES.preprocess_assemble,
ACTION_NAMES.linkstamp_compile,
ACTION_NAMES.c_compile,
ACTION_NAMES.cpp_compile,
ACTION_NAMES.cpp_header_parsing,
ACTION_NAMES.cpp_module_compile,
ACTION_NAMES.cpp_module_codegen,
ACTION_NAMES.lto_backend,
ACTION_NAMES.clif_match,
],
flag_groups = [flag_group(flags = ["-g"])],
with_features = [with_feature_set(features = ["dbg"])],
),
flag_set(
actions = [
ACTION_NAMES.assemble,
ACTION_NAMES.preprocess_assemble,
ACTION_NAMES.linkstamp_compile,
ACTION_NAMES.c_compile,
ACTION_NAMES.cpp_compile,
ACTION_NAMES.cpp_header_parsing,
ACTION_NAMES.cpp_module_compile,
ACTION_NAMES.cpp_module_codegen,
ACTION_NAMES.lto_backend,
ACTION_NAMES.clif_match,
],
flag_groups = [
flag_group(
flags = [
"-g0",
"-O2",
"-DNDEBUG",
"-ffunction-sections",
"-fdata-sections",
],
),
],
with_features = [with_feature_set(features = ["opt"])],
),
flag_set(
actions = [
ACTION_NAMES.linkstamp_compile,
ACTION_NAMES.cpp_compile,
ACTION_NAMES.cpp_header_parsing,
ACTION_NAMES.cpp_module_compile,
ACTION_NAMES.cpp_module_codegen,
ACTION_NAMES.lto_backend,
ACTION_NAMES.clif_match,
],
flag_groups = [flag_group(flags = ["-std=c++0x"])],
),
],
)
else:
default_compile_flags_feature = None
if (ctx.attr.cpu == "local"):
default_link_flags_feature = feature(
name = "default_link_flags",
enabled = True,
flag_sets = [
flag_set(
actions = all_link_actions,
flag_groups = [
flag_group(
flags = [
"-lstdc++",
"-B/usr/bin/",
"-Wl,-z,relro,-z,now",
"-no-canonical-prefixes",
"-pass-exit-codes",
"-Wl,--build-id=md5",
"-Wl,--hash-style=gnu",
],
),
],
),
flag_set(
actions = all_link_actions,
flag_groups = [flag_group(flags = ["-Wl,--gc-sections"])],
with_features = [with_feature_set(features = ["opt"])],
),
],
)
elif (ctx.attr.cpu == "armeabi" or ctx.attr.cpu == "aarch64"):
default_link_flags_feature = feature(
name = "default_link_flags",
enabled = True,
flag_sets = [
flag_set(
actions = all_link_actions,
flag_groups = [
flag_group(
flags = [
"-lstdc++",
"-Wl,-z,relro,-z,now",
"-no-canonical-prefixes",
"-pass-exit-codes",
"-Wl,--build-id=md5",
"-Wl,--hash-style=gnu",
],
),
],
),
flag_set(
actions = all_link_actions,
flag_groups = [flag_group(flags = ["-Wl,--gc-sections"])],
with_features = [with_feature_set(features = ["opt"])],
),
],
)
else:
default_link_flags_feature = None
supports_dynamic_linker_feature = feature(name = "supports_dynamic_linker", enabled = True)
supports_pic_feature = feature(name = "supports_pic", enabled = True)
user_compile_flags_feature = feature(
name = "user_compile_flags",
enabled = True,
flag_sets = [
flag_set(
actions = [
ACTION_NAMES.assemble,
ACTION_NAMES.preprocess_assemble,
ACTION_NAMES.linkstamp_compile,
ACTION_NAMES.c_compile,
ACTION_NAMES.cpp_compile,
ACTION_NAMES.cpp_header_parsing,
ACTION_NAMES.cpp_module_compile,
ACTION_NAMES.cpp_module_codegen,
ACTION_NAMES.lto_backend,
ACTION_NAMES.clif_match,
],
flag_groups = [
flag_group(
flags = ["%{user_compile_flags}"],
iterate_over = "user_compile_flags",
expand_if_available = "user_compile_flags",
),
],
),
],
)
if (ctx.attr.cpu == "local"):
features = [
default_compile_flags_feature,
default_link_flags_feature,
supports_dynamic_linker_feature,
supports_pic_feature,
objcopy_embed_flags_feature,
opt_feature,
dbg_feature,
user_compile_flags_feature,
sysroot_feature,
unfiltered_compile_flags_feature,
]
elif (ctx.attr.cpu == "armeabi" or ctx.attr.cpu == "aarch64"):
features = [
default_compile_flags_feature,
default_link_flags_feature,
supports_dynamic_linker_feature,
supports_pic_feature,
opt_feature,
dbg_feature,
user_compile_flags_feature,
sysroot_feature,
unfiltered_compile_flags_feature,
]
else:
fail("Unreachable")
if (ctx.attr.cpu == "armeabi"):
cxx_builtin_include_directories = [
"%{ARM_COMPILER_PATH}%/lib/gcc/arm-rpi-linux-gnueabihf/6.5.0/include",
"%{ARM_COMPILER_PATH}%/lib/gcc/arm-rpi-linux-gnueabihf/6.5.0/include-fixed",
"%{ARM_COMPILER_PATH}%/arm-rpi-linux-gnueabihf/sysroot/usr/include/",
"%{ARM_COMPILER_PATH}%/arm-rpi-linux-gnueabihf/include/c++/6.5.0/",
"/usr/include",
"/tmp/openblas_install/include/",
]
elif (ctx.attr.cpu == "aarch64"):
cxx_builtin_include_directories = [
"%{AARCH64_COMPILER_PATH}%/aarch64-none-linux-gnu/include/c++/9.2.1/",
"%{AARCH64_COMPILER_PATH}%/lib/gcc/aarch64-none-linux-gnu/9.2.1/include",
"%{AARCH64_COMPILER_PATH}%/lib/gcc/aarch64-none-linux-gnu/9.2.1/include-fixed",
"%{AARCH64_COMPILER_PATH}%/aarch64-none-linux-gnu/libc/usr/include/",
"/usr/include",
"/tmp/openblas_install/include/",
]
elif (ctx.attr.cpu == "local"):
cxx_builtin_include_directories = ["/usr/lib/gcc/", "/usr/local/include", "/usr/include"]
else:
fail("Unreachable")
artifact_name_patterns = []
make_variables = []
if (ctx.attr.cpu == "armeabi"):
tool_paths = [
tool_path(
name = "ar",
path = "%{ARM_COMPILER_PATH}%/bin/arm-rpi-linux-gnueabihf-ar",
),
tool_path(name = "compat-ld", path = "/bin/false"),
tool_path(
name = "cpp",
path = "%{ARM_COMPILER_PATH}%/bin/arm-rpi-linux-gnueabihf-cpp",
),
tool_path(
name = "dwp",
path = "%{ARM_COMPILER_PATH}%/bin/arm-rpi-linux-gnueabihf-dwp",
),
tool_path(
name = "gcc",
path = "%{ARM_COMPILER_PATH}%/bin/arm-rpi-linux-gnueabihf-gcc",
),
tool_path(
name = "gcov",
path = "%{ARM_COMPILER_PATH}%/bin/arm-rpi-linux-gnueabihf-gcov",
),
tool_path(
name = "ld",
path = "%{ARM_COMPILER_PATH}%/bin/arm-rpi-linux-gnueabihf-ld",
),
tool_path(
name = "nm",
path = "%{ARM_COMPILER_PATH}%/bin/arm-rpi-linux-gnueabihf-nm",
),
tool_path(
name = "objcopy",
path = "%{ARM_COMPILER_PATH}%/bin/arm-rpi-linux-gnueabihf-objcopy",
),
tool_path(
name = "objdump",
path = "%{ARM_COMPILER_PATH}%/bin/arm-rpi-linux-gnueabihf-objdump",
),
tool_path(
name = "strip",
path = "%{ARM_COMPILER_PATH}%/bin/arm-rpi-linux-gnueabihf-strip",
),
]
elif (ctx.attr.cpu == "aarch64"):
tool_paths = [
tool_path(
name = "ar",
path = "%{AARCH64_COMPILER_PATH}%/bin/aarch64-none-linux-gnu-ar",
),
tool_path(name = "compat-ld", path = "/bin/false"),
tool_path(
name = "cpp",
path = "%{AARCH64_COMPILER_PATH}%/bin/aarch64-none-linux-gnu-cpp",
),
tool_path(
name = "dwp",
path = "%{AARCH64_COMPILER_PATH}%/bin/aarch64-none-linux-gnu-dwp",
),
tool_path(
name = "gcc",
path = "%{AARCH64_COMPILER_PATH}%/bin/aarch64-none-linux-gnu-gcc",
),
tool_path(
name = "gcov",
path = "%{AARCH64_COMPILER_PATH}%/bin/aarch64-none-linux-gnu-gcov",
),
tool_path(
name = "ld",
path = "%{AARCH64_COMPILER_PATH}%/bin/aarch64-none-linux-gnu-ld",
),
tool_path(
name = "nm",
path = "%{AARCH64_COMPILER_PATH}%/bin/aarch64-none-linux-gnu-nm",
),
tool_path(
name = "objcopy",
path = "%{AARCH64_COMPILER_PATH}%/bin/aarch64-none-linux-gnu-objcopy",
),
tool_path(
name = "objdump",
path = "%{AARCH64_COMPILER_PATH}%/bin/aarch64-none-linux-gnu-objdump",
),
tool_path(
name = "strip",
path = "%{AARCH64_COMPILER_PATH}%/bin/aarch64-none-linux-gnu-strip",
),
]
elif (ctx.attr.cpu == "local"):
tool_paths = [
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"),
]
else:
fail("Unreachable")
out = ctx.actions.declare_file(ctx.label.name)
ctx.actions.write(out, "Fake executable")
return [
cc_common.create_cc_toolchain_config_info(
ctx = ctx,
features = features,
action_configs = action_configs,
artifact_name_patterns = artifact_name_patterns,
cxx_builtin_include_directories = cxx_builtin_include_directories,
toolchain_identifier = toolchain_identifier,
host_system_name = host_system_name,
target_system_name = target_system_name,
target_cpu = target_cpu,
target_libc = target_libc,
compiler = compiler,
abi_version = abi_version,
abi_libc_version = abi_libc_version,
tool_paths = tool_paths,
make_variables = make_variables,
builtin_sysroot = builtin_sysroot,
cc_target_os = cc_target_os
),
DefaultInfo(
executable = out,
),
]
cc_toolchain_config = rule(
implementation = _impl,
attrs = {
"cpu": attr.string(mandatory=True, values=["armeabi", "aarch64", "local"]),
},
provides = [CcToolchainConfigInfo],
executable = True,
)
@@ -0,0 +1,75 @@
# Repository initialized in tensorflow/workspace2.bzl
load(":cc_config.bzl", "cc_toolchain_config")
package(default_visibility = ["//visibility:public"])
# The following line is only here to make this project import into IDEs that embed
# a Bazel toolchain.
licenses(["notice"])
cc_toolchain_suite(
name = "toolchain",
toolchains = {
"local|compiler": ":cc-compiler-local",
"aarch64": ":cc-compiler-aarch64",
"k8": ":cc-compiler-local",
"piii": ":cc-compiler-local",
"arm": ":cc-compiler-local",
"s390x": ":cc-compiler-local",
},
)
filegroup(
name = "empty",
srcs = [],
)
filegroup(
name = "arm_linux_all_files",
srcs = [
"@arm_compiler//:compiler_pieces",
],
)
filegroup(
name = "aarch64_linux_all_files",
srcs = [
"@aarch64_compiler//:aarch64_compiler_pieces",
],
)
cc_toolchain_config(
name = "local_config",
cpu = "local",
)
cc_toolchain(
name = "cc-compiler-local",
all_files = ":empty",
compiler_files = ":empty",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":local_config",
toolchain_identifier = "local_linux",
)
cc_toolchain_config(
name = "aarch64_config",
cpu = "aarch64",
)
cc_toolchain(
name = "cc-compiler-aarch64",
all_files = ":aarch64_linux_all_files",
compiler_files = ":aarch64_linux_all_files",
dwp_files = ":empty",
linker_files = ":aarch64_linux_all_files",
objcopy_files = "aarch64_linux_all_files",
strip_files = "aarch64_linux_all_files",
supports_param_files = 1,
toolchain_config = ":aarch64_config",
toolchain_identifier = "aarch64-linux-gnu",
)
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+323
View File
@@ -0,0 +1,323 @@
"""Toolchain configs for cross-compiling TensorFlow"""
load(":cc_toolchain_config.bzl", "cc_toolchain_config")
package(default_visibility = ["//visibility:public"])
licenses(["restricted"])
cc_toolchain_suite(
name = "cross_compile_toolchain_suite",
toolchains = {
"aarch64": ":linux_aarch64_cc_toolchain",
"k8": ":linux_x86_cc_toolchain",
"darwin": ":macos_x86_cc_toolchain",
},
)
filegroup(name = "empty")
# We define a wraper ("cc_wrapper.sh") around the compiler to replace all paths
# in the binary (bazel-out/.../path/to/original/library.so) by the paths
# relative to the binary. Without it, we run into "Library not loaded" error
# when trying run cross-compiled tests, see b/300002682.
filegroup(
name = "cc_wrapper_and_macos_sysroot",
srcs = ["cc_wrapper.sh"] + glob(["MacOSX.sdk/**"]),
)
cc_toolchain(
name = "linux_x86_cc_toolchain",
all_files = ":empty",
compiler_files = ":empty",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":linux_x86_toolchain_config",
toolchain_identifier = "linux_x86_toolchain",
)
cc_toolchain_config(
name = "linux_x86_toolchain_config",
abi_libc_version = "local",
abi_version = "local",
builtin_sysroot = "/dt9",
compile_flags = [
"--target=x86_64-unknown-linux-gnu",
"-fstack-protector",
"-Wall",
"-Wthread-safety",
"-Wself-assign",
"-Wunused-but-set-parameter",
"-Wno-free-nonheap-object",
"-fcolor-diagnostics",
"-fno-omit-frame-pointer",
"-mavx",
],
compiler = "clang",
coverage_compile_flags = ["--coverage"],
coverage_link_flags = ["--coverage"],
cpu = "k8",
cxx_builtin_include_directories = [
"/dt9/",
"/usr/lib/llvm-18/include/",
"/usr/lib/llvm-18/lib/clang/18/include",
],
dbg_compile_flags = ["-g"],
host_system_name = "linux",
link_flags = [
"--target=x86_64-unknown-linux-gnu",
"-fuse-ld=lld",
"--ld-path=/usr/lib/llvm-18/bin/ld.lld",
"-Wl,--undefined-version",
],
link_libs = [
"-lstdc++",
"-lm",
],
opt_compile_flags = [
"-g0",
"-O2",
"-D_FORTIFY_SOURCE=1",
"-DNDEBUG",
"-ffunction-sections",
"-fdata-sections",
],
opt_link_flags = ["-Wl,--gc-sections"],
supports_start_end_lib = True,
target_libc = "",
target_system_name = "x86_64-unknown-linux-gnu",
tool_paths = {
"gcc": "/usr/lib/llvm-18/bin/clang",
"ld": "/usr/lib/llvm-18/bin/ld.lld",
"ar": "/usr/lib/llvm-18/bin/llvm-ar",
"cpp": "/usr/lib/llvm-18/bin/clang++",
"llvm-cov": "/usr/lib/llvm-18/bin/llvm-cov",
"nm": "/usr/lib/llvm-18/bin/llvm-nm",
"objdump": "/usr/lib/llvm-18/bin/llvm-objdump",
"strip": "/usr/lib/llvm-18/bin/llvm-strip",
},
toolchain_identifier = "linux_x86_toolchain",
unfiltered_compile_flags = [
"-no-canonical-prefixes",
"-Wno-builtin-macro-redefined",
"-D__DATE__=\"redacted\"",
"-D__TIMESTAMP__=\"redacted\"",
"-D__TIME__=\"redacted\"",
"-Wno-unused-command-line-argument",
"-Wno-gnu-offsetof-extensions",
],
)
cc_toolchain(
name = "linux_aarch64_cc_toolchain",
all_files = ":empty",
compiler_files = ":empty",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":linux_aarch64_toolchain_config",
toolchain_identifier = "linux_aarch64_toolchain",
)
cc_toolchain_config(
name = "linux_aarch64_toolchain_config",
abi_libc_version = "local",
abi_version = "local",
builtin_sysroot = "/dt10/",
compile_flags = [
"--target=aarch64-unknown-linux-gnu",
"-fstack-protector",
"-Wall",
"-Wthread-safety",
"-Wself-assign",
"-Wunused-but-set-parameter",
"-Wno-free-nonheap-object",
"-fcolor-diagnostics",
"-fno-omit-frame-pointer",
"-mtune=generic",
"-march=armv8-a",
],
compiler = "clang",
coverage_compile_flags = ["--coverage"],
coverage_link_flags = ["--coverage"],
cpu = "aarch64",
cxx_builtin_include_directories = [
"/dt10/",
"/usr/lib/llvm-18/include/",
"/usr/lib/llvm-18/lib/clang/18/include",
],
dbg_compile_flags = ["-g"],
host_system_name = "linux",
link_flags = [
"--target=aarch64-unknown-linux-gnu",
"-fuse-ld=lld",
"--ld-path=/usr/lib/llvm-18/bin/ld.lld",
"-Wl,--undefined-version",
],
link_libs = [
"-lstdc++",
"-lm",
],
opt_compile_flags = [
"-g0",
"-O2",
"-D_FORTIFY_SOURCE=1",
"-DNDEBUG",
"-ffunction-sections",
"-fdata-sections",
],
opt_link_flags = ["-Wl,--gc-sections"],
supports_start_end_lib = True,
target_libc = "",
target_system_name = "aarch64-unknown-linux-gnu",
tool_paths = {
"gcc": "/usr/lib/llvm-18/bin/clang",
"ld": "/usr/lib/llvm-18/bin/ld.lld",
"ar": "/usr/lib/llvm-18/bin/llvm-ar",
"cpp": "/usr/lib/llvm-18/bin/clang++",
"llvm-cov": "/usr/lib/llvm-18/bin/llvm-cov",
"nm": "/usr/lib/llvm-18/bin/llvm-nm",
"objdump": "/usr/lib/llvm-18/bin/llvm-objdump",
"strip": "/usr/lib/llvm-18/bin/llvm-strip",
},
toolchain_identifier = "linux_aarch64_toolchain",
unfiltered_compile_flags = [
"-no-canonical-prefixes",
"-Wno-builtin-macro-redefined",
"-D__DATE__=\"redacted\"",
"-D__TIMESTAMP__=\"redacted\"",
"-D__TIME__=\"redacted\"",
"-Wno-unused-command-line-argument",
"-Wno-gnu-offsetof-extensions",
],
)
cc_toolchain(
name = "macos_x86_cc_toolchain",
all_files = ":cc_wrapper_and_macos_sysroot",
compiler_files = ":cc_wrapper_and_macos_sysroot",
dwp_files = ":empty",
linker_files = ":cc_wrapper_and_macos_sysroot",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":macos_x86_toolchain_config",
toolchain_identifier = "macos_x86_toolchain",
)
cc_toolchain_config(
name = "macos_x86_toolchain_config",
abi_libc_version = "darwin_x86_64",
abi_version = "darwin_x86_64",
builtin_sysroot = "tools/toolchains/cross_compile/cc/MacOSX.sdk",
compile_flags = [
"--target=x86_64-apple-darwin",
"-fstack-protector",
"-Wall",
"-Wthread-safety",
"-Wself-assign",
"-Wunused-but-set-parameter",
"-Wno-free-nonheap-object",
"-fcolor-diagnostics",
"-fno-omit-frame-pointer",
"-DOS_MACOSX",
"-DGRPC_BAZEL_BUILD",
"-stdlib=libc++",
"-mavx",
# Target Catalina as the minimum supported OS
"-mmacos-version-min=10.15",
],
compiler = "clang",
coverage_compile_flags = ["--coverage"],
coverage_link_flags = ["--coverage"],
cpu = "darwin",
cxx_builtin_include_directories = [
"%sysroot%/usr/include",
"/usr/lib/llvm-18/include/",
"/usr/lib/llvm-18/lib/clang/18/include",
"%sysroot%/System/Library/Frameworks/Security.framework/Headers",
"%sysroot%/System/Library/Frameworks/CoreFoundation.framework/Headers",
"%sysroot%/System/Library/Frameworks/SystemConfiguration.framework/Headers",
],
dbg_compile_flags = ["-g"],
host_system_name = "linux",
link_flags = [
"--target=x86_64-apple-darwin",
"-lSystem",
"-fuse-ld=lld",
"--ld-path=/usr/lib/llvm-18/bin/ld64.lld",
"-headerpad_max_install_names",
"-Wl,-undefined,dynamic_lookup",
# Target Catalina as the minimum supported OS
"-Wl,-platform_version,macos,10.15.0,10.15",
],
link_libs = [
"-lc++",
"-lm",
],
opt_compile_flags = [
"-g0",
"-O2",
"-D_FORTIFY_SOURCE=1",
"-DNDEBUG",
"-ffunction-sections",
"-fdata-sections",
],
opt_link_flags = ["-Wl,-dead_strip"],
supports_start_end_lib = True,
target_libc = "macosx",
target_system_name = "x86_64-apple-macosx10.15",
tool_paths = {
"gcc": "cc_wrapper.sh",
"ld": "/usr/lib/llvm-18/bin/ld64.lld",
"ar": "/usr/lib/llvm-18/bin/llvm-libtool-darwin",
"cpp": "/usr/lib/llvm-18/bin/clang++",
"llvm-cov": "/usr/lib/llvm-18/bin/llvm-cov",
"nm": "/usr/lib/llvm-18/bin/llvm-nm",
"objdump": "/usr/lib/llvm-18/bin/llvm-objdump",
"strip": "/usr/lib/llvm-18/bin/llvm-strip",
},
toolchain_identifier = "macos_x86_toolchain",
unfiltered_compile_flags = [
"-no-canonical-prefixes",
"-Wno-builtin-macro-redefined",
"-D__DATE__=\"redacted\"",
"-D__TIMESTAMP__=\"redacted\"",
"-D__TIME__=\"redacted\"",
"-Wno-unused-command-line-argument",
"-Wno-gnu-offsetof-extensions",
],
)
toolchain(
name = "linux_x86_toolchain",
exec_compatible_with = [
"@platforms//os:linux",
"@platforms//cpu:x86_64",
],
target_compatible_with = [
"@platforms//os:linux",
"@platforms//cpu:x86_64",
],
toolchain = ":linux_x86_cc_toolchain",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
toolchain(
name = "linux_aarch64_toolchain",
exec_compatible_with = [
"@platforms//os:linux",
"@platforms//cpu:x86_64",
],
target_compatible_with = [
"@platforms//os:linux",
"@platforms//cpu:aarch64",
],
toolchain = ":linux_aarch64_cc_toolchain",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,120 @@
#!/bin/bash
#
# Copyright 2015 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.
#
# OS X relpath is not really working. This is a wrapper script around gcc
# to simulate relpath behavior.
#
# This wrapper uses install_name_tool to replace all paths in the binary
# (bazel-out/.../path/to/original/library.so) by the paths relative to
# the binary. It parses the command line to behave as rpath is supposed
# to work.
#
# See https://blogs.oracle.com/dipol/entry/dynamic_libraries_rpath_and_mac
# on how to set those paths for Mach-O binaries.
#
set -eu
LIBS=
LIB_DIRS=
RPATHS=
OUTPUT=
function parse_option() {
local -r opt="$1"
if [[ "${OUTPUT}" = "1" ]]; then
OUTPUT=$opt
elif [[ "$opt" =~ ^-l(.*)$ ]]; then
LIBS="${BASH_REMATCH[1]} $LIBS"
elif [[ "$opt" =~ ^-L(.*)$ ]]; then
LIB_DIRS="${BASH_REMATCH[1]} $LIB_DIRS"
elif [[ "$opt" =~ ^\@loader_path/(.*)$ ]]; then
RPATHS="${BASH_REMATCH[1]} ${RPATHS}"
elif [[ "$opt" = "-o" ]]; then
# output is coming
OUTPUT=1
fi
}
# let parse the option list
for i in "$@"; do
if [[ "$i" = @* && -r "${i:1}" ]]; then
while IFS= read -r opt
do
parse_option "$opt"
done < "${i:1}" || exit 1
else
parse_option "$i"
fi
done
# Call the C++ compiler
/usr/lib/llvm-18/bin/clang "$@"
function get_library_path() {
for libdir in ${LIB_DIRS}; do
if [ -f ${libdir}/lib$1.so ]; then
echo "${libdir}/lib$1.so"
elif [ -f ${libdir}/lib$1.dylib ]; then
echo "${libdir}/lib$1.dylib"
fi
done
}
# A convenient method to return the actual path even for non symlinks
# and multi-level symlinks, see b/300002682 for more details.
function get_realpath() {
local mangled=$(echo $1 | sed 's/[-_\/a-zA-Z0-9]*_solib_darwin[-_a-zA-Z0-9]*\///g')
if [[ "${mangled:0:3}" = "lib" ]]; then
mangled="${mangled:3}"
fi
if [[ "${mangled:0:2}" = "_U" ]]; then
mangled="${mangled:2}"
fi
local mangled_path=(${mangled//_S/ })
local demangled_path=()
for mangled in ${mangled_path[@]}; do
demangled_path+=(${mangled//_U/_})
done
demangled_path=${demangled_path[@]}
echo "bazel-out/darwin-opt/bin/${demangled_path// //}"
}
# Get the path of a lib inside a tool
function get_otool_path() {
# the lib path is the path of the original lib relative to the workspace
get_realpath $1 | sed 's|^.*/bazel-out/|bazel-out/|'
}
# Do replacements in the output
for rpath in ${RPATHS}; do
for lib in ${LIBS}; do
unset libname
if [ -f "$(dirname ${OUTPUT})/${rpath}/lib${lib}.so" ]; then
libname="lib${lib}.so"
elif [ -f "$(dirname ${OUTPUT})/${rpath}/lib${lib}.dylib" ]; then
libname="lib${lib}.dylib"
fi
# ${libname-} --> return $libname if defined, or undefined otherwise. This is to make
# this set -e friendly
if [[ -n "${libname-}" ]]; then
libpath=$(get_library_path ${lib})
if [ -n "${libpath}" ]; then
/usr/lib/llvm-18/bin/llvm-install-name-tool -change $(get_otool_path "${libpath}") \
"@loader_path/${rpath}/${libname}" "${OUTPUT}"
fi
fi
done
done
@@ -0,0 +1,45 @@
package(default_visibility = ["//visibility:public"])
licenses(["restricted"])
platform(
name = "linux_x86_64",
constraint_values = [
"@platforms//os:linux",
"@platforms//cpu:x86_64",
],
exec_properties = {
"container-image": "docker://gcr.io/tensorflow-testing/ml-devinfra-linux-aarch64-cross-compile@sha256:06040763c500bd2ebaaa4585d4729c88d2c8ccec94baa7fbe9bbe3dc2827d79d",
"OSFamily": "Linux",
},
)
platform(
name = "linux_aarch64",
constraint_values = [
"@platforms//os:linux",
"@platforms//cpu:aarch64",
],
)
platform(
name = "darwin_x86_64",
constraint_values = [
"@platforms//os:macos",
"@platforms//cpu:x86_64",
],
)
toolchain(
name = "macos-x86-cross-compile-cc-toolchain",
exec_compatible_with = [
"@platforms//os:linux",
"@platforms//cpu:x86_64",
],
target_compatible_with = [
"@platforms//os:macos",
"@platforms//cpu:x86_64",
],
toolchain = "//tools/toolchains/cross_compile/cc:macos_x86_cc_toolchain",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
@@ -0,0 +1,11 @@
platforms:
# Maps "--platforms=//tools/toolchains/cross_compile/config:darwin_x86_64"
# to "--cpu=darwin".
//tools/toolchains/cross_compile/config:darwin_x86_64
--cpu=darwin
flags:
# Maps "--cpu=darwin" to
# "--platforms=//tools/toolchains/cross_compile/config:darwin_x86_64".
--cpu=darwin
//tools/toolchains/cross_compile/config:darwin_x86_64
+4
View File
@@ -0,0 +1,4 @@
# Embedded toolchains
This repository contains toolchains for various embedded systems such as
Raspberry Pi and Coral development boards.
@@ -0,0 +1,10 @@
# ARM GCC toolchains
This repository contains Bazel C++ toolchain configurations for ARM GCC. The
following toolchains are configured:
source:
https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-a/downloads -
gcc 8.3 - glibc 2.28
target cpu: aarch64, armhf
@@ -0,0 +1,81 @@
package(default_visibility = ["//visibility:public"])
filegroup(
name = "gcc",
srcs = [
"bin/aarch64-none-linux-gnu-gcc",
],
)
filegroup(
name = "ar",
srcs = [
"bin/aarch64-none-linux-gnu-ar",
],
)
filegroup(
name = "ld",
srcs = [
"bin/aarch64-none-linux-gnu-ld",
],
)
filegroup(
name = "nm",
srcs = [
"bin/aarch64-none-linux-gnu-nm",
],
)
filegroup(
name = "objcopy",
srcs = [
"bin/aarch64-none-linux-gnu-objcopy",
],
)
filegroup(
name = "objdump",
srcs = [
"bin/aarch64-none-linux-gnu-objdump",
],
)
filegroup(
name = "strip",
srcs = [
"bin/aarch64-none-linux-gnu-strip",
],
)
filegroup(
name = "as",
srcs = [
"bin/aarch64-none-linux-gnu-as",
],
)
filegroup(
name = "compiler_pieces",
srcs = glob([
"aarch64-none-linux-gnu/**",
"libexec/**",
"lib/gcc/aarch64-none-linux-gnu/**",
"include/**",
]),
)
filegroup(
name = "compiler_components",
srcs = [
":ar",
":as",
":gcc",
":ld",
":nm",
":objcopy",
":objdump",
":strip",
],
)
@@ -0,0 +1,41 @@
"""Repository rule for ARM cross compiler autoconfiguration."""
def _tpl(repository_ctx, tpl, substitutions = {}, out = None):
if not out:
out = tpl
repository_ctx.template(
out,
Label("//tools/toolchains/embedded/arm-linux:%s.tpl" % tpl),
substitutions,
)
def _arm_linux_toolchain_configure_impl(repository_ctx):
# We need to find a cross-compilation include directory for Python, so look
# for an environment variable. Be warned, this crosstool template is only
# regenerated on the first run of Bazel, so if you change the variable after
# it may not be reflected in later builds. Doing a shutdown and clean of Bazel
# doesn't fix this, you'll need to delete the generated file at something like:
# external/local_config_arm_compiler/CROSSTOOL in your Bazel install.
if "CROSSTOOL_PYTHON_INCLUDE_PATH" in repository_ctx.os.environ:
python_include_path = repository_ctx.os.environ["CROSSTOOL_PYTHON_INCLUDE_PATH"]
else:
python_include_path = "/usr/include/python3.5"
_tpl(repository_ctx, "cc_config.bzl", {
"%{AARCH64_COMPILER_PATH}%": str(repository_ctx.path(
repository_ctx.attr.aarch64_repo,
)),
"%{ARMHF_COMPILER_PATH}%": str(repository_ctx.path(
repository_ctx.attr.armhf_repo,
)),
"%{PYTHON_INCLUDE_PATH}%": python_include_path,
})
repository_ctx.symlink(Label(repository_ctx.attr.build_file), "BUILD")
arm_linux_toolchain_configure = repository_rule(
implementation = _arm_linux_toolchain_configure_impl,
attrs = {
"aarch64_repo": attr.string(mandatory = True, default = ""),
"armhf_repo": attr.string(mandatory = True, default = ""),
"build_file": attr.string(),
},
)
@@ -0,0 +1,81 @@
package(default_visibility = ["//visibility:public"])
filegroup(
name = "gcc",
srcs = [
"bin/arm-none-linux-gnueabihf-gcc",
],
)
filegroup(
name = "ar",
srcs = [
"bin/arm-none-linux-gnueabihf-ar",
],
)
filegroup(
name = "ld",
srcs = [
"bin/arm-none-linux-gnueabihf-ld",
],
)
filegroup(
name = "nm",
srcs = [
"bin/arm-none-linux-gnueabihf-nm",
],
)
filegroup(
name = "objcopy",
srcs = [
"bin/arm-none-linux-gnueabihf-objcopy",
],
)
filegroup(
name = "objdump",
srcs = [
"bin/arm-none-linux-gnueabihf-objdump",
],
)
filegroup(
name = "strip",
srcs = [
"bin/arm-none-linux-gnueabihf-strip",
],
)
filegroup(
name = "as",
srcs = [
"bin/arm-none-linux-gnueabihf-as",
],
)
filegroup(
name = "compiler_pieces",
srcs = glob([
"arm-none-linux-gnueabihf/**",
"libexec/**",
"lib/gcc/arm-none-linux-gnueabihf/**",
"include/**",
]),
)
filegroup(
name = "compiler_components",
srcs = [
":ar",
":as",
":gcc",
":ld",
":nm",
":objcopy",
":objdump",
":strip",
],
)
@@ -0,0 +1,619 @@
load("@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl",
"action_config",
"artifact_name_pattern",
"env_entry",
"env_set",
"feature",
"feature_set",
"flag_group",
"flag_set",
"make_variable",
"tool",
"tool_path",
"variable_with_value",
"with_feature_set",
)
load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "ACTION_NAMES")
def _impl(ctx):
if (ctx.attr.cpu == "aarch64"):
toolchain_identifier = "aarch64-none-linux-gnu"
host_system_name = "aarch64"
target_system_name = "aarch64"
target_cpu = "aarch64"
target_libc = "aarch64"
abi_version = "aarch64"
abi_libc_version = "aarch64"
elif (ctx.attr.cpu == "armhf"):
toolchain_identifier = "armhf-linux-gnueabihf"
host_system_name = "armhf"
target_system_name = "armhf"
target_cpu = "armhf"
target_libc = "armhf"
abi_version = "armhf"
abi_libc_version = "armhf"
else:
fail("Unreachable")
compiler = "compiler"
cc_target_os = None
builtin_sysroot = None
all_compile_actions = [
ACTION_NAMES.c_compile,
ACTION_NAMES.cpp_compile,
ACTION_NAMES.linkstamp_compile,
ACTION_NAMES.assemble,
ACTION_NAMES.preprocess_assemble,
ACTION_NAMES.cpp_header_parsing,
ACTION_NAMES.cpp_module_compile,
ACTION_NAMES.cpp_module_codegen,
ACTION_NAMES.clif_match,
ACTION_NAMES.lto_backend,
]
all_cpp_compile_actions = [
ACTION_NAMES.cpp_compile,
ACTION_NAMES.linkstamp_compile,
ACTION_NAMES.cpp_header_parsing,
ACTION_NAMES.cpp_module_compile,
ACTION_NAMES.cpp_module_codegen,
ACTION_NAMES.clif_match,
]
preprocessor_compile_actions = [
ACTION_NAMES.c_compile,
ACTION_NAMES.cpp_compile,
ACTION_NAMES.linkstamp_compile,
ACTION_NAMES.preprocess_assemble,
ACTION_NAMES.cpp_header_parsing,
ACTION_NAMES.cpp_module_compile,
ACTION_NAMES.clif_match,
]
codegen_compile_actions = [
ACTION_NAMES.c_compile,
ACTION_NAMES.cpp_compile,
ACTION_NAMES.linkstamp_compile,
ACTION_NAMES.assemble,
ACTION_NAMES.preprocess_assemble,
ACTION_NAMES.cpp_module_codegen,
ACTION_NAMES.lto_backend,
]
all_link_actions = [
ACTION_NAMES.cpp_link_executable,
ACTION_NAMES.cpp_link_dynamic_library,
ACTION_NAMES.cpp_link_nodeps_dynamic_library,
]
if (ctx.attr.cpu == "aarch64" or ctx.attr.cpu == "armhf"):
action_configs = []
else:
fail("Unreachable")
opt_feature = feature(name = "opt")
dbg_feature = feature(name = "dbg")
sysroot_feature = feature(
name = "sysroot",
enabled = True,
flag_sets = [
flag_set(
actions = [
ACTION_NAMES.preprocess_assemble,
ACTION_NAMES.linkstamp_compile,
ACTION_NAMES.c_compile,
ACTION_NAMES.cpp_compile,
ACTION_NAMES.cpp_header_parsing,
ACTION_NAMES.cpp_module_compile,
ACTION_NAMES.cpp_module_codegen,
ACTION_NAMES.lto_backend,
ACTION_NAMES.clif_match,
ACTION_NAMES.cpp_link_executable,
ACTION_NAMES.cpp_link_dynamic_library,
ACTION_NAMES.cpp_link_nodeps_dynamic_library,
],
flag_groups = [
flag_group(
flags = ["--sysroot=%{sysroot}"],
expand_if_available = "sysroot",
),
],
),
],
)
if (ctx.attr.cpu == "aarch64" or ctx.attr.cpu == "armhf"):
unfiltered_compile_flags_feature = feature(
name = "unfiltered_compile_flags",
enabled = True,
flag_sets = [
flag_set(
actions = [
ACTION_NAMES.assemble,
ACTION_NAMES.preprocess_assemble,
ACTION_NAMES.linkstamp_compile,
ACTION_NAMES.c_compile,
ACTION_NAMES.cpp_compile,
ACTION_NAMES.cpp_header_parsing,
ACTION_NAMES.cpp_module_compile,
ACTION_NAMES.cpp_module_codegen,
ACTION_NAMES.lto_backend,
ACTION_NAMES.clif_match,
],
flag_groups = [
flag_group(
flags = [
"-Wno-builtin-macro-redefined",
"-D__DATE__=\"redacted\"",
"-D__TIMESTAMP__=\"redacted\"",
"-D__TIME__=\"redacted\"",
"-no-canonical-prefixes",
"-fno-canonical-system-headers",
],
),
],
),
],
)
else:
unfiltered_compile_flags_feature = None
if (ctx.attr.cpu == "aarch64"):
default_compile_flags_feature = feature(
name = "default_compile_flags",
enabled = True,
flag_sets = [
flag_set(
actions = [
ACTION_NAMES.assemble,
ACTION_NAMES.preprocess_assemble,
ACTION_NAMES.linkstamp_compile,
ACTION_NAMES.c_compile,
ACTION_NAMES.cpp_compile,
ACTION_NAMES.cpp_header_parsing,
ACTION_NAMES.cpp_module_compile,
ACTION_NAMES.cpp_module_codegen,
ACTION_NAMES.lto_backend,
ACTION_NAMES.clif_match,
],
flag_groups = [
flag_group(
flags = [
"-fstack-protector", # TODO: needed?
],
),
],
),
flag_set(
actions = [
ACTION_NAMES.assemble,
ACTION_NAMES.preprocess_assemble,
ACTION_NAMES.linkstamp_compile,
ACTION_NAMES.c_compile,
ACTION_NAMES.cpp_compile,
ACTION_NAMES.cpp_header_parsing,
ACTION_NAMES.cpp_module_compile,
ACTION_NAMES.cpp_module_codegen,
ACTION_NAMES.lto_backend,
ACTION_NAMES.clif_match,
],
flag_groups = [flag_group(flags = ["-g"])],
with_features = [with_feature_set(features = ["dbg"])],
),
flag_set(
actions = [
ACTION_NAMES.assemble,
ACTION_NAMES.preprocess_assemble,
ACTION_NAMES.linkstamp_compile,
ACTION_NAMES.c_compile,
ACTION_NAMES.cpp_compile,
ACTION_NAMES.cpp_header_parsing,
ACTION_NAMES.cpp_module_compile,
ACTION_NAMES.cpp_module_codegen,
ACTION_NAMES.lto_backend,
ACTION_NAMES.clif_match,
],
flag_groups = [
flag_group(
flags = [
"-g0",
"-O2",
"-DNDEBUG",
"-ffunction-sections",
"-fdata-sections",
],
),
],
with_features = [with_feature_set(features = ["opt"])],
),
flag_set(
actions = [
ACTION_NAMES.linkstamp_compile,
ACTION_NAMES.cpp_compile,
ACTION_NAMES.cpp_header_parsing,
ACTION_NAMES.cpp_module_compile,
ACTION_NAMES.cpp_module_codegen,
ACTION_NAMES.lto_backend,
ACTION_NAMES.clif_match,
],
flag_groups = [
flag_group(
flags = [
"-isystem",
"%{AARCH64_COMPILER_PATH}%/lib/gcc/aarch64-none-linux-gnu/11.3.1/include",
"-isystem",
"%{AARCH64_COMPILER_PATH}%/lib/gcc/aarch64-none-linux-gnu/11.3.1/include-fixed",
"-isystem",
"%{AARCH64_COMPILER_PATH}%/aarch64-none-linux-gnu/include/c++/11.3.1/",
"-isystem",
"%{AARCH64_COMPILER_PATH}%/aarch64-none-linux-gnu/libc/usr/include/",
"-isystem",
"%{PYTHON_INCLUDE_PATH}%",
"-isystem",
"/usr/include/",
],
),
],
),
],
)
elif (ctx.attr.cpu == "armhf"):
default_compile_flags_feature = feature(
name = "default_compile_flags",
enabled = True,
flag_sets = [
flag_set(
actions = [
ACTION_NAMES.assemble,
ACTION_NAMES.preprocess_assemble,
ACTION_NAMES.linkstamp_compile,
ACTION_NAMES.c_compile,
ACTION_NAMES.cpp_compile,
ACTION_NAMES.cpp_header_parsing,
ACTION_NAMES.cpp_module_compile,
ACTION_NAMES.cpp_module_codegen,
ACTION_NAMES.lto_backend,
ACTION_NAMES.clif_match,
],
flag_groups = [
flag_group(
flags = [
"-fstack-protector",
],
),
],
),
flag_set(
actions = [
ACTION_NAMES.assemble,
ACTION_NAMES.preprocess_assemble,
ACTION_NAMES.linkstamp_compile,
ACTION_NAMES.c_compile,
ACTION_NAMES.cpp_compile,
ACTION_NAMES.cpp_header_parsing,
ACTION_NAMES.cpp_module_compile,
ACTION_NAMES.cpp_module_codegen,
ACTION_NAMES.lto_backend,
ACTION_NAMES.clif_match,
],
flag_groups = [flag_group(flags = ["-g"])],
with_features = [with_feature_set(features = ["dbg"])],
),
flag_set(
actions = [
ACTION_NAMES.assemble,
ACTION_NAMES.preprocess_assemble,
ACTION_NAMES.linkstamp_compile,
ACTION_NAMES.c_compile,
ACTION_NAMES.cpp_compile,
ACTION_NAMES.cpp_header_parsing,
ACTION_NAMES.cpp_module_compile,
ACTION_NAMES.cpp_module_codegen,
ACTION_NAMES.lto_backend,
ACTION_NAMES.clif_match,
],
flag_groups = [
flag_group(
flags = [
"-g0",
"-O2",
"-DNDEBUG",
"-ffunction-sections",
"-fdata-sections",
],
),
],
with_features = [with_feature_set(features = ["opt"])],
),
flag_set(
actions = [
ACTION_NAMES.linkstamp_compile,
ACTION_NAMES.cpp_compile,
ACTION_NAMES.cpp_header_parsing,
ACTION_NAMES.cpp_module_compile,
ACTION_NAMES.cpp_module_codegen,
ACTION_NAMES.lto_backend,
ACTION_NAMES.clif_match,
],
flag_groups = [
flag_group(
flags = [
"-isystem",
"%{ARMHF_COMPILER_PATH}%/lib/gcc/arm-none-linux-gnueabihf/11.3.1/include",
"-isystem",
"%{ARMHF_COMPILER_PATH}%/lib/gcc/arm-none-linux-gnueabihf/11.3.1/include-fixed",
"-isystem",
"%{ARMHF_COMPILER_PATH}%/arm-none-linux-gnueabihf/include/c++/11.3.1/",
"-isystem",
"%{ARMHF_COMPILER_PATH}%/arm-none-linux-gnueabihf/libc/usr/include/",
"-isystem",
"%{PYTHON_INCLUDE_PATH}%",
"-isystem",
"/usr/include/",
],
),
],
),
],
)
else:
default_compile_flags_feature = None
if (ctx.attr.cpu == "aarch64"):
default_link_flags_feature = feature(
name = "default_link_flags",
enabled = True,
flag_sets = [
flag_set(
actions = all_link_actions,
flag_groups = [
flag_group(
flags = [
"-lstdc++",
"-Wl,-z,relro,-z,now",
"-no-canonical-prefixes",
"-pass-exit-codes",
"-Wl,--build-id=md5",
"-Wl,--hash-style=gnu",
],
),
],
),
flag_set(
actions = all_link_actions,
flag_groups = [flag_group(flags = ["-Wl,--gc-sections"])],
with_features = [with_feature_set(features = ["opt"])],
),
],
)
elif (ctx.attr.cpu == "armhf"):
default_link_flags_feature = feature(
name = "default_link_flags",
enabled = True,
flag_sets = [
flag_set(
actions = all_link_actions,
flag_groups = [
flag_group(
flags = [
"-lstdc++",
"-Wl,-z,relro,-z,now",
"-no-canonical-prefixes",
"-pass-exit-codes",
"-Wl,--build-id=md5",
"-Wl,--hash-style=gnu",
],
),
],
),
flag_set(
actions = all_link_actions,
flag_groups = [flag_group(flags = ["-Wl,--gc-sections"])],
with_features = [with_feature_set(features = ["opt"])],
),
],
)
else:
default_link_flags_feature = None
supports_dynamic_linker_feature = feature(name = "supports_dynamic_linker", enabled = True)
supports_pic_feature = feature(name = "supports_pic", enabled = True)
user_compile_flags_feature = feature(
name = "user_compile_flags",
enabled = True,
flag_sets = [
flag_set(
actions = [
ACTION_NAMES.assemble,
ACTION_NAMES.preprocess_assemble,
ACTION_NAMES.linkstamp_compile,
ACTION_NAMES.c_compile,
ACTION_NAMES.cpp_compile,
ACTION_NAMES.cpp_header_parsing,
ACTION_NAMES.cpp_module_compile,
ACTION_NAMES.cpp_module_codegen,
ACTION_NAMES.lto_backend,
ACTION_NAMES.clif_match,
],
flag_groups = [
flag_group(
flags = ["%{user_compile_flags}"],
iterate_over = "user_compile_flags",
expand_if_available = "user_compile_flags",
),
],
),
],
)
if (ctx.attr.cpu == "aarch64" or ctx.attr.cpu == "armhf"):
features = [
default_compile_flags_feature,
default_link_flags_feature,
supports_dynamic_linker_feature,
supports_pic_feature,
opt_feature,
dbg_feature,
user_compile_flags_feature,
sysroot_feature,
unfiltered_compile_flags_feature,
]
else:
fail("Unreachable")
if (ctx.attr.cpu == "aarch64"):
cxx_builtin_include_directories = [
"%{AARCH64_COMPILER_PATH}%/lib/gcc/aarch64-none-linux-gnu/11.3.1/include",
"%{AARCH64_COMPILER_PATH}%/lib/gcc/aarch64-none-linux-gnu/11.3.1/include-fixed",
"%{AARCH64_COMPILER_PATH}%/aarch64-none-linux-gnu/include/c++/11.3.1/",
"%{AARCH64_COMPILER_PATH}%/aarch64-none-linux-gnu/libc/usr/include/",
"/usr/include",
]
elif (ctx.attr.cpu == "armhf"):
cxx_builtin_include_directories = [
"%{ARMHF_COMPILER_PATH}%/lib/gcc/arm-none-linux-gnueabihf/11.3.1/include",
"%{ARMHF_COMPILER_PATH}%/lib/gcc/arm-none-linux-gnueabihf/11.3.1/include-fixed",
"%{ARMHF_COMPILER_PATH}%/arm-none-linux-gnueabihf/include/c++/11.3.1/",
"%{ARMHF_COMPILER_PATH}%/arm-none-linux-gnueabihf/libc/usr/include/",
"/usr/include",
]
else:
fail("Unreachable")
artifact_name_patterns = []
make_variables = []
if (ctx.attr.cpu == "aarch64"):
tool_paths = [
tool_path(
name = "ar",
path = "%{AARCH64_COMPILER_PATH}%/bin/aarch64-none-linux-gnu-ar",
),
tool_path(name = "compat-ld", path = "/bin/false"),
tool_path(
name = "cpp",
path = "%{AARCH64_COMPILER_PATH}%/bin/aarch64-none-linux-gnu-cpp",
),
tool_path(
name = "dwp",
path = "%{AARCH64_COMPILER_PATH}%/bin/aarch64-none-linux-gnu-dwp",
),
tool_path(
name = "gcc",
path = "%{AARCH64_COMPILER_PATH}%/bin/aarch64-none-linux-gnu-gcc",
),
tool_path(
name = "gcov",
path = "%{AARCH64_COMPILER_PATH}%/bin/aarch64-none-linux-gnu-gcov",
),
tool_path(
name = "ld",
path = "%{AARCH64_COMPILER_PATH}%/bin/aarch64-none-linux-gnu-ld",
),
tool_path(
name = "nm",
path = "%{AARCH64_COMPILER_PATH}%/bin/aarch64-none-linux-gnu-nm",
),
tool_path(
name = "objcopy",
path = "%{AARCH64_COMPILER_PATH}%/bin/aarch64-none-linux-gnu-objcopy",
),
tool_path(
name = "objdump",
path = "%{AARCH64_COMPILER_PATH}%/bin/aarch64-none-linux-gnu-objdump",
),
tool_path(
name = "strip",
path = "%{AARCH64_COMPILER_PATH}%/bin/aarch64-none-linux-gnu-strip",
),
]
elif (ctx.attr.cpu == "armhf"):
tool_paths = [
tool_path(
name = "ar",
path = "%{ARMHF_COMPILER_PATH}%/bin/arm-none-linux-gnueabihf-ar",
),
tool_path(name = "compat-ld", path = "/bin/false"),
tool_path(
name = "cpp",
path = "%{ARMHF_COMPILER_PATH}%/bin/arm-none-linux-gnueabihf-cpp",
),
tool_path(
name = "dwp",
path = "%{ARMHF_COMPILER_PATH}%/bin/arm-none-linux-gnueabihf-dwp",
),
tool_path(
name = "gcc",
path = "%{ARMHF_COMPILER_PATH}%/bin/arm-none-linux-gnueabihf-gcc",
),
tool_path(
name = "gcov",
path = "%{ARMHF_COMPILER_PATH}%/bin/arm-none-linux-gnueabihf-gcov",
),
tool_path(
name = "ld",
path = "%{ARMHF_COMPILER_PATH}%/bin/arm-none-linux-gnueabihf-ld",
),
tool_path(
name = "nm",
path = "%{ARMHF_COMPILER_PATH}%/bin/arm-none-linux-gnueabihf-nm",
),
tool_path(
name = "objcopy",
path = "%{ARMHF_COMPILER_PATH}%/bin/arm-none-linux-gnueabihf-objcopy",
),
tool_path(
name = "objdump",
path = "%{ARMHF_COMPILER_PATH}%/bin/arm-none-linux-gnueabihf-objdump",
),
tool_path(
name = "strip",
path = "%{ARMHF_COMPILER_PATH}%/bin/arm-none-linux-gnueabihf-strip",
),
]
else:
fail("Unreachable")
out = ctx.actions.declare_file(ctx.label.name)
ctx.actions.write(out, "Fake executable")
return [
cc_common.create_cc_toolchain_config_info(
ctx = ctx,
features = features,
action_configs = action_configs,
artifact_name_patterns = artifact_name_patterns,
cxx_builtin_include_directories = cxx_builtin_include_directories,
toolchain_identifier = toolchain_identifier,
host_system_name = host_system_name,
target_system_name = target_system_name,
target_cpu = target_cpu,
target_libc = target_libc,
compiler = compiler,
abi_version = abi_version,
abi_libc_version = abi_libc_version,
tool_paths = tool_paths,
make_variables = make_variables,
builtin_sysroot = builtin_sysroot,
cc_target_os = cc_target_os
),
DefaultInfo(
executable = out,
),
]
cc_toolchain_config = rule(
implementation = _impl,
attrs = {
"cpu": attr.string(mandatory=True, values=["aarch64", "armhf"]),
},
provides = [CcToolchainConfigInfo],
executable = True,
)
@@ -0,0 +1,66 @@
load(":cc_config.bzl", "cc_toolchain_config")
package(default_visibility = ["//visibility:public"])
licenses(["restricted"]) # GPLv3
cc_toolchain_suite(
name = "toolchain",
toolchains = {
"aarch64": ":cc-compiler-aarch64",
"armhf": ":cc-compiler-armhf",
},
)
filegroup(
name = "empty",
srcs = [],
)
filegroup(
name = "aarch64_toolchain_all_files",
srcs = [
"@aarch64_linux_toolchain//:compiler_pieces",
],
)
filegroup(
name = "armhf_toolchain_all_files",
srcs = [
"@armhf_linux_toolchain//:compiler_pieces",
],
)
cc_toolchain_config(
name = "aarch64_toolchain_config",
cpu = "aarch64",
)
cc_toolchain_config(
name = "armhf_toolchain_config",
cpu = "armhf",
)
cc_toolchain(
name = "cc-compiler-aarch64",
all_files = ":aarch64_toolchain_all_files",
compiler_files = ":aarch64_toolchain_all_files",
dwp_files = ":empty",
linker_files = ":aarch64_toolchain_all_files",
objcopy_files = "aarch64_toolchain_all_files",
strip_files = "aarch64_toolchain_all_files",
supports_param_files = 1,
toolchain_config = ":aarch64_toolchain_config",
)
cc_toolchain(
name = "cc-compiler-armhf",
all_files = ":armhf_toolchain_all_files",
compiler_files = ":armhf_toolchain_all_files",
dwp_files = ":empty",
linker_files = ":armhf_toolchain_all_files",
objcopy_files = "armhf_toolchain_all_files",
strip_files = "armhf_toolchain_all_files",
supports_param_files = 1,
toolchain_config = ":armhf_toolchain_config",
)
+13
View File
@@ -0,0 +1,13 @@
licenses(["restricted"])
package(default_visibility = ["//visibility:public"])
platform(
name = "ios_armv7",
constraint_values = [
"@platforms//cpu:armv7",
"@platforms//os:ios",
"@build_bazel_apple_support//constraints:apple",
"@build_bazel_apple_support//constraints:device",
],
)
+18
View File
@@ -0,0 +1,18 @@
# For workaround https://github.com/bazelbuild/bazel/issues/8772 with Bazel >= 0.29.1
# TensorFlow still targets Java 1.7 (See JAVACOPTS in tensorflow/java/build_defs.bzl)
# which doesn't support "-parameters" flag. Starting from Java 11 (default since Bazel
# 0.29.1), a warning message will be thrown if "-parameters" is passed. If "-Werror" also exists,
# the compiling action will fail. To workaround this, we override the misc value of
# the default java toolchain to remove "-parameters" flag.
load("@bazel_tools//tools/jdk:default_java_toolchain.bzl", "default_java_toolchain")
licenses(["notice"])
default_java_toolchain(
name = "tf_java_toolchain",
misc = [
"-XDskipDuplicateBridges=true",
"-g",
],
visibility = ["//visibility:public"],
)
+19
View File
@@ -0,0 +1,19 @@
licenses(["restricted"])
package(default_visibility = ["//visibility:public"])
platform(
name = "linux_aarch64",
constraint_values = [
"@platforms//cpu:aarch64",
"@platforms//os:linux",
],
)
platform(
name = "linux_armhf",
constraint_values = [
"@platforms//cpu:armv7e-mf",
"@platforms//os:linux",
],
)
View File
+42
View File
@@ -0,0 +1,42 @@
"""
Repository rule to set python version and wheel name.
Version can be set via build parameter "--repo_env=TF_PYTHON_VERSION=3.10"
Defaults to 3.10.
To set wheel name, add "--repo_env=WHEEL_NAME=tensorflow_cpu"
"""
VERSIONS = ["3.10", "3.11", "3.12", "3.13", "3.14"]
DEFAULT_VERSION = "3.11"
WARNING = """
TF_PYTHON_VERSION environment variable was not set correctly; using Python {}.
To set Python version, run:
export TF_PYTHON_VERSION=3.11
""".format(DEFAULT_VERSION)
content = """
TF_PYTHON_VERSION = "{}"
HERMETIC_PYTHON_VERSION = "{}"
WHEEL_NAME = "{}"
WHEEL_COLLAB = "{}"
"""
def _python_repository_impl(repository_ctx):
repository_ctx.file("BUILD", "")
version = repository_ctx.os.environ.get("TF_PYTHON_VERSION", "")
wheel_name = repository_ctx.os.environ.get("WHEEL_NAME", "tensorflow")
wheel_collab = repository_ctx.os.environ.get("WHEEL_COLLAB", False)
if version not in VERSIONS:
print(WARNING) # buildifier: disable=print
version = DEFAULT_VERSION
repository_ctx.file(
"py_version.bzl",
content.format(version, version, wheel_name, wheel_collab),
)
python_repository = repository_rule(
implementation = _python_repository_impl,
environ = ["TF_PYTHON_VERSION", "WHEEL_NAME", "WHEEL_COLLAB"],
)
View File
View File
+43
View File
@@ -0,0 +1,43 @@
"""Repository rule for remote GPU autoconfiguration.
This rule creates the starlark file
//tensorflow/tools/toolchains/remote:execution.bzl
providing the function `gpu_test_tags`.
`gpu_test_tags` will return:
* `local`: if `REMOTE_GPU_TESTING` is false, allowing CPU tests to run
remotely and GPU tests to run locally in the same bazel invocation.
* `remote-gpu`: if `REMOTE_GPU_TESTING` is true; this allows rules to
set an execution requirement that enables a GPU-enabled remote platform.
"""
_REMOTE_GPU_TESTING = "REMOTE_GPU_TESTING"
def _flag_enabled(repository_ctx, flag_name):
if flag_name not in repository_ctx.os.environ:
return False
return repository_ctx.os.environ[flag_name].strip() == "1"
def _remote_execution_configure(repository_ctx):
# If we do not support remote gpu test execution, mark them as local, so we
# can combine remote builds with local gpu tests.
gpu_test_tags = "\"local\""
if _flag_enabled(repository_ctx, _REMOTE_GPU_TESTING):
gpu_test_tags = "\"remote-gpu\""
repository_ctx.template(
"remote_execution.bzl",
Label("//tools/toolchains/remote:execution.bzl.tpl"),
{
"%{gpu_test_tags}": gpu_test_tags,
},
)
repository_ctx.template(
"BUILD",
Label("//tools/toolchains/remote:BUILD.tpl"),
)
remote_execution_configure = repository_rule(
implementation = _remote_execution_configure,
environ = [_REMOTE_GPU_TESTING],
)
@@ -0,0 +1,2 @@
def gpu_test_tags():
return [%{gpu_test_tags}]
@@ -0,0 +1,107 @@
"""Configurations of RBE builds used with remote config."""
load("//tools/toolchains/remote_config:rbe_config.bzl", "ml_build_rbe_config", "sigbuild_tf_configs", "tensorflow_local_config", "tensorflow_rbe_config", "tensorflow_rbe_win_config")
def initialize_rbe_configs():
tensorflow_local_config(
name = "local_execution",
)
tensorflow_rbe_config(
name = "ubuntu20.04-clang_manylinux2014-cuda12.3-cudnn8.9",
cuda_version = "12.3.2",
cudnn_version = "8.9.7.29",
os = "ubuntu20.04-manylinux2014-multipython",
)
tensorflow_rbe_config(
name = "ubuntu20.04-clang_manylinux2014-cuda12.3-cudnn9.1",
cuda_version = "12.3.2",
cudnn_version = "9.1.1",
os = "ubuntu20.04-manylinux2014-multipython",
)
tensorflow_rbe_config(
name = "ubuntu20.04-gcc9_manylinux2014-cuda12.3-cudnn8.9",
cuda_version = "12.3.2",
cudnn_version = "8.9.7.29",
os = "ubuntu20.04-manylinux2014-multipython",
)
tensorflow_rbe_config(
name = "ubuntu22.04-clang_manylinux2014-cuda12.3-cudnn8.9",
cuda_version = "12.3.2",
cudnn_version = "8.9.7.29",
os = "ubuntu22.04-manylinux2014-multipython",
)
tensorflow_rbe_config(
name = "ubuntu22.04-gcc9_manylinux2014-cuda12.3-cudnn8.9",
cuda_version = "12.3.2",
cudnn_version = "8.9.7.29",
os = "ubuntu22.04-manylinux2014-multipython",
)
tensorflow_rbe_win_config(
name = "windows_py37",
python_bin_path = "C:/Python37/python.exe",
)
# The `ml-build`'s base image is a standard `ubuntu22.04` image.
# Note that in order to use this image with RBE GPU builds, you need to have hermetic CUDA
# toolchain integrated into your project, and pass
# `--@cuda_driver//:include_cuda_umd_libs=true` to Bazel command.
ml_build_rbe_config("docker://us-docker.pkg.dev/ml-oss-artifacts-published/ml-public-container/ml-build@sha256:ea67e8453d8b09c2ba48853da5e79efef4b65804b4a48dfae4b4da89ffd38405")
# TF-Version-Specific SIG Build RBE Configs. The crosstool generated from these
# configs are python-version-independent because they only care about the
# tooling paths; the container mapping is useful only so that TF RBE users
# may specify a specific Python version container. Yes, we could use the tag name instead,
# but for vague security reasons we're obligated to use the pinned hash and update manually.
# The name_container_map is helpfully auto-generated by a GitHub Action. You have to run it
# manually. See go/tf-devinfra/docker#how-do-i-update-rbe-images
sigbuild_tf_configs(
name_container_map = {
"sigbuild-r2.16": "docker://gcr.io/tensorflow-sigs/build@sha256:842a5ba84d3658c5bf1f8a31e16284f7becc35409da0dfd71816afa3cd28d728",
"sigbuild-r2.16-python3.10": "docker://gcr.io/tensorflow-sigs/build@sha256:da15288c8464153eadd35da720540a544b76aa9d78cceb42a6821b2f3e70a0fa",
"sigbuild-r2.16-python3.11": "docker://gcr.io/tensorflow-sigs/build@sha256:842a5ba84d3658c5bf1f8a31e16284f7becc35409da0dfd71816afa3cd28d728",
"sigbuild-r2.16-python3.12": "docker://gcr.io/tensorflow-sigs/build@sha256:40fcd1d05c672672b599d9cb3784dcf379d6aa876f043b46c6ab18237d5d4e10",
},
)
sigbuild_tf_configs(
name_container_map = {
"sigbuild-r2.16-clang": "docker://gcr.io/tensorflow-sigs/build@sha256:842a5ba84d3658c5bf1f8a31e16284f7becc35409da0dfd71816afa3cd28d728",
"sigbuild-r2.16-clang-python3.10": "docker://gcr.io/tensorflow-sigs/build@sha256:da15288c8464153eadd35da720540a544b76aa9d78cceb42a6821b2f3e70a0fa",
"sigbuild-r2.16-clang-python3.11": "docker://gcr.io/tensorflow-sigs/build@sha256:842a5ba84d3658c5bf1f8a31e16284f7becc35409da0dfd71816afa3cd28d728",
"sigbuild-r2.16-clang-python3.12": "docker://gcr.io/tensorflow-sigs/build@sha256:40fcd1d05c672672b599d9cb3784dcf379d6aa876f043b46c6ab18237d5d4e10",
},
)
sigbuild_tf_configs(
name_container_map = {
"sigbuild-r2.17": "docker://gcr.io/tensorflow-sigs/build@sha256:b6f572a897a69fa3311773f949b9aa9e81bc393e4fbe2c0d56d8afb03a6de080",
"sigbuild-r2.17-python3.10": "docker://gcr.io/tensorflow-sigs/build@sha256:64e68a1d65ac265a2a59c8c2f6eb1f2148a323048a679a08e53239d467fa1478",
"sigbuild-r2.17-python3.11": "docker://gcr.io/tensorflow-sigs/build@sha256:b6f572a897a69fa3311773f949b9aa9e81bc393e4fbe2c0d56d8afb03a6de080",
"sigbuild-r2.17-python3.12": "docker://gcr.io/tensorflow-sigs/build@sha256:8b856ad736147bb9c8bc9e1ec2c8e1ab17d36397905da7a5b63dadeff9310f0c",
},
)
sigbuild_tf_configs(
name_container_map = {
"sigbuild-r2.17-clang": "docker://gcr.io/tensorflow-sigs/build@sha256:2d737fc9fe931507a89927eee792b1bb934215e6aaae58b1941586e3400e2645",
"sigbuild-r2.17-clang-python3.10": "docker://gcr.io/tensorflow-sigs/build@sha256:89730ded5c2268e53238bf8c5fb6d162b105baa31ab0480a94a7d0204203de66",
"sigbuild-r2.17-clang-python3.11": "docker://gcr.io/tensorflow-sigs/build@sha256:2d737fc9fe931507a89927eee792b1bb934215e6aaae58b1941586e3400e2645",
"sigbuild-r2.17-clang-python3.12": "docker://gcr.io/tensorflow-sigs/build@sha256:45ea78e79305f91cdae5a26094f80233bba54bbfbc612623381012f097035b9a",
},
)
sigbuild_tf_configs(
name_container_map = {
"sigbuild-r2.17-clang-cudnn9": "docker://gcr.io/tensorflow-sigs/build@sha256:daa5bdd802fe3def188e2200ed707c73d278f6f1930bf26c933d6ba041b0e027",
"sigbuild-r2.17-clang-cudnn9-python3.10": "docker://gcr.io/tensorflow-sigs/build@sha256:c3df6982305d70dfb44cbfbedee3465782d6cbf791f7920e6246de0140216da0",
"sigbuild-r2.17-clang-cudnn9-python3.11": "docker://gcr.io/tensorflow-sigs/build@sha256:daa5bdd802fe3def188e2200ed707c73d278f6f1930bf26c933d6ba041b0e027",
"sigbuild-r2.17-clang-cudnn9-python3.12": "docker://gcr.io/tensorflow-sigs/build@sha256:23e477895dd02e45df1056d4a0a9c4229dec3a20c23fb2f3fb5832ecbd0a29bc",
},
)
@@ -0,0 +1,169 @@
"""Docker images used with remote config and RBE."""
# SHA 256 values for each image.
container_digests = {
# TF now uses only this container
"cuda11.2-cudnn8.1-ubuntu20.04-manylinux2014-multipython": "sha256:48612bd85709cd014711d0b0f87e0806f3567d06d2e81c6e860516b87498b821",
# JAX manylinux2014 configs.
"cuda11.8-cudnn8.6-ubuntu20.04-manylinux2014-multipython": "sha256:45619e91f14faabddd79fe0cb1526df4c4ad92fc2e6ebdc725ea4419225429c3",
"cuda12.1-cudnn8.9-ubuntu20.04-manylinux2014-multipython": "sha256:8c266e5b0acd203aed5e8871b63f68a39d8d23f6d882e619797e58b973f7fe63",
"cuda12.1-cudnn9.1-ubuntu20.04-manylinux2014-multipython": "sha256:7c14249d42f6fb4254a8085cea0683951979e9a325bda14522bf910802226394",
"cuda12.2-cudnn8.9-ubuntu20.04-manylinux2014-multipython": "sha256:9fefda035b4a12b24cd5bae56c7dbb9527a5fd06a41ced0a22ac86fe5ed26428",
"cuda12.2-cudnn9.1-ubuntu20.04-manylinux2014-multipython": "sha256:0c78f3428cde36f041b758fc2f01d23d2f0dd72dec248f78667fb0c9d1f74cef",
"cuda12.3-cudnn8.9-ubuntu20.04-manylinux2014-multipython": "sha256:6f9524a2ed7f75255dc4be3a0c5e3bda581385a1c13e2fa890bc17fa62da95b2",
"cuda12.3-cudnn8.9-ubuntu22.04-manylinux2014-multipython": "sha256:97b219abb22994cf0530771d536f26fe301bacd328f0485c38af3847c2ee6b14",
"cuda12.3-cudnn9.1-ubuntu20.04-manylinux2014-multipython": "sha256:89aa860228092d78dc336545a5ad32e342d656a8258186327c989bd301bb3eb8",
# ROCM, probably not all of them still in use
"rocm-ubuntu18.04-manylinux2010-multipython": "sha256:6e953a09b145df338bcb03e9e36f99b291140c29b72d0a048fb6c5905ccad5eb",
"rocm-ubuntu20.04-manylinux2014-multipython": "sha256:906faec7765fe5dd067f2b092b5d5f220c1fedde725fb42c83d031b4d6f32204",
# Unused?
"ubuntu16.04": "sha256:b90dcf2f35f3354909f4491bdf019c110b4b4d95ef0395ebf178bc5d523a4208",
"centos6": "sha256:d09c12fb26fbbe8398b4973260c75172eb67d509dae9d6f4ad54279b7d6b0494",
"ubuntu16.04-manylinux2010": "sha256:5b6a55a33046843a3c3b3b3d13b028cc6e61d8af5275998e95fa539cafe72c51",
"cuda10.0-cudnn7-ubuntu14.04": "sha256:d433e1221f802dac393bc8652fabcc63aa46896cd920bb888ae0e2002fe6b756",
"cuda10.0-cudnn7-centos7": "sha256:a453b7147a60928a8345689eae48916a746b3578b5e831bfa151f0529d469c88",
"cuda10.0-cudnn7-centos6": "sha256:a1909ba09c703340ee0074ce63dd94fe8fea48035a25264677907a609e2375e0",
"cuda10.1-cudnn7-centos6": "sha256:454b899657e87893ee5e68dc0f87df59b6a0a7418ae09cafcc3dd65ac71feca9",
"cuda10.0-cudnn7-ubuntu16.04-manylinux2010": "sha256:5812d9d0ef0a3276fc5faaf4cd01f3d6e03d635893a6e2d2e04f6f01d626c432",
"cuda10.1-cudnn7-ubuntu16.04-manylinux2010": "sha256:5e6d21c8ef226316eb6df5e2e6015244c16a8e5d936b52a09820442d2f8a919f",
"cuda10.1-cudnn7-ubuntu16.04-manylinux2010-multipython": "sha256:3f890a951c81a201d60d0161a56ce628a90323be0c7f795550caa37f6f41a85c",
"cuda10.1-cudnn7-ubuntu18.04-manylinux2010-multipython": "sha256:71e946b59a63e80d10178f9e2869af3b31583737b779edc27688c99f4998dd05",
"cuda10.2-cudnn7-ubuntu18.04-manylinux2010-multipython": "sha256:9bb24f6f98e71b424dd885ec9fe39770831376840fa2231057807c89f814c803",
"cuda11.0-cudnn8-ubuntu18.04-manylinux2010-multipython": "sha256:3e5c991f67e2cca610cb9f6b39927e3757ba1e7f2424d18cef8b871bfa4d75b3",
"windows-1803": "sha256:f109576c7c0c8a1783ff22b666e8923b52dbbe7933f69a1c7a7275202c304a12",
}
containers = {
# Built with //tensorflow/tools/ci_build/Dockerfile.rbe.ubuntu16.04-manylinux2010.
"ubuntu16.04-manylinux2010": {
"registry": "gcr.io",
"repository": "tensorflow-testing/nosla-ubuntu16.04-manylinux2010",
"digest": container_digests["ubuntu16.04-manylinux2010"],
},
# Built with //tensorflow/tools/ci_build/Dockerfile.rbe.cuda10.0-cudnn7-ubuntu16.04-manylinux2010.
"cuda10.0-cudnn7-ubuntu16.04-manylinux2010": {
"registry": "gcr.io",
"repository": "tensorflow-testing/nosla-cuda10.0-cudnn7-ubuntu16.04-manylinux2010",
"digest": container_digests["cuda10.0-cudnn7-ubuntu16.04-manylinux2010"],
},
# Built with //tensorflow/tools/ci_build/Dockerfile.rbe.cuda10.1-cudnn7-ubuntu16.04-manylinux2010.
"cuda10.1-cudnn7-ubuntu16.04-manylinux2010": {
"registry": "gcr.io",
"repository": "tensorflow-testing/nosla-cuda10.1-cudnn7-ubuntu16.04-manylinux2010",
"digest": container_digests["cuda10.1-cudnn7-ubuntu16.04-manylinux2010"],
},
# Built with //tensorflow/tools/ci_build/Dockerfile.rbe.cuda10.1-cudnn7-ubuntu16.04-manylinux2010-multipython.
"cuda10.1-cudnn7-ubuntu16.04-manylinux2010-multipython": {
"registry": "gcr.io",
"repository": "tensorflow-testing/nosla-cuda10.1-cudnn7-ubuntu16.04-manylinux2010-multipython",
"digest": container_digests["cuda10.1-cudnn7-ubuntu16.04-manylinux2010-multipython"],
},
# Built with //tensorflow/tools/ci_build/Dockerfile.rbe.cuda10.1-cudnn7-ubuntu18.04-manylinux2010-multipython.
"cuda10.1-cudnn7-ubuntu18.04-manylinux2010-multipython": {
"registry": "gcr.io",
"repository": "tensorflow-testing/nosla-cuda10.1-cudnn7-ubuntu18.04-manylinux2010-multipython",
"digest": container_digests["cuda10.1-cudnn7-ubuntu18.04-manylinux2010-multipython"],
},
# Built with //tensorflow/tools/ci_build/Dockerfile.rbe.cuda10.2-cudnn7-ubuntu18.04-manylinux2010-multipython.
"cuda10.2-cudnn7-ubuntu18.04-manylinux2010-multipython": {
"registry": "gcr.io",
"repository": "tensorflow-testing/nosla-cuda10.2-cudnn7-ubuntu18.04-manylinux2010-multipython",
"digest": container_digests["cuda10.2-cudnn7-ubuntu18.04-manylinux2010-multipython"],
},
# Built with //tensorflow/tools/ci_build/Dockerfile.rbe.cuda11.0-cudnn8-ubuntu18.04-manylinux2010-multipython.
"cuda11.0-cudnn8-ubuntu18.04-manylinux2010-multipython": {
"registry": "gcr.io",
"repository": "tensorflow-testing/nosla-cuda11.0-cudnn8-ubuntu18.04-manylinux2010-multipython",
"digest": container_digests["cuda11.0-cudnn8-ubuntu18.04-manylinux2010-multipython"],
},
# Built with //tensorflow/tools/ci_build/Dockerfile.rbe.cuda11.2-cudnn8.1-ubuntu20.04-manylinux2014-multipython.
"cuda11.2-cudnn8.1-ubuntu20.04-manylinux2014-multipython": {
"registry": "gcr.io",
"repository": "tensorflow-testing/nosla-cuda11.2-cudnn8.1-ubuntu20.04-manylinux2014-multipython",
"digest": container_digests["cuda11.2-cudnn8.1-ubuntu20.04-manylinux2014-multipython"],
},
# Built with //tensorflow/tools/ci_build/Dockerfile.rbe.cuda11.8-cudnn8.6-ubuntu20.04-manylinux2014-multipython.
"cuda11.8-cudnn8.6-ubuntu20.04-manylinux2014-multipython": {
"registry": "gcr.io",
"repository": "tensorflow-testing/nosla-cuda11.8-cudnn8.6-ubuntu20.04-manylinux2014-multipython",
"digest": container_digests["cuda11.8-cudnn8.6-ubuntu20.04-manylinux2014-multipython"],
},
# Built with //tensorflow/tools/ci_build/Dockerfile.rbe.cuda12.1-cudnn8.9-ubuntu20.04-manylinux2014-multipython.
"cuda12.1-cudnn8.9-ubuntu20.04-manylinux2014-multipython": {
"registry": "gcr.io",
"repository": "tensorflow-testing/nosla-cuda12.1-cudnn8.9-ubuntu20.04-manylinux2014-multipython",
"digest": container_digests["cuda12.1-cudnn8.9-ubuntu20.04-manylinux2014-multipython"],
},
# Built with //tensorflow/tools/ci_build/Dockerfile.rbe.cuda12.1-cudnn9.1-ubuntu20.04-manylinux2014-multipython.
"cuda12.1-cudnn9.1-ubuntu20.04-manylinux2014-multipython": {
"registry": "gcr.io",
"repository": "tensorflow-testing/nosla-cuda12.1-cudnn9.1-ubuntu20.04-manylinux2014-multipython",
"digest": container_digests["cuda12.1-cudnn9.1-ubuntu20.04-manylinux2014-multipython"],
},
# Built with //tensorflow/tools/ci_build/Dockerfile.rbe.cuda12.2-cudnn8.9-ubuntu20.04-manylinux2014-multipython.
"cuda12.2-cudnn8.9-ubuntu20.04-manylinux2014-multipython": {
"registry": "gcr.io",
"repository": "tensorflow-testing/nosla-cuda12.2-cudnn8.9-ubuntu20.04-manylinux2014-multipython",
"digest": container_digests["cuda12.2-cudnn8.9-ubuntu20.04-manylinux2014-multipython"],
},
# Built with //tensorflow/tools/ci_build/Dockerfile.rbe.cuda12.2-cudnn9.1-ubuntu20.04-manylinux2014-multipython.
"cuda12.2-cudnn9.1-ubuntu20.04-manylinux2014-multipython": {
"registry": "gcr.io",
"repository": "tensorflow-testing/nosla-cuda12.2-cudnn9.1-ubuntu20.04-manylinux2014-multipython",
"digest": container_digests["cuda12.2-cudnn9.1-ubuntu20.04-manylinux2014-multipython"],
},
# Built with //tensorflow/tools/ci_build/Dockerfile.rbe.cuda12.3-cudnn8.9-ubuntu20.04-manylinux2014-multipython.
"cuda12.3-cudnn8.9-ubuntu20.04-manylinux2014-multipython": {
"registry": "gcr.io",
"repository": "tensorflow-testing/nosla-cuda12.3-cudnn8.9-ubuntu20.04-manylinux2014-multipython",
"digest": container_digests["cuda12.3-cudnn8.9-ubuntu20.04-manylinux2014-multipython"],
},
# Built with //tensorflow/tools/ci_build/Dockerfile.rbe.cuda12.3-cudnn9.1-ubuntu20.04-manylinux2014-multipython.
"cuda12.3-cudnn9.1-ubuntu20.04-manylinux2014-multipython": {
"registry": "gcr.io",
"repository": "tensorflow-testing/nosla-cuda12.3-cudnn9.1-ubuntu20.04-manylinux2014-multipython",
"digest": container_digests["cuda12.3-cudnn9.1-ubuntu20.04-manylinux2014-multipython"],
},
# Built with //tensorflow/tools/ci_build/Dockerfile.rbe.cuda12.3-cudnn8.9-ubuntu20.04-manylinux2014-multipython.
"cuda12.3-cudnn8.9-ubuntu22.04-manylinux2014-multipython": {
"registry": "gcr.io",
"repository": "tensorflow-testing/nosla-cuda12.3-cudnn8.9-ubuntu22.04-manylinux2014-multipython",
"digest": container_digests["cuda12.3-cudnn8.9-ubuntu22.04-manylinux2014-multipython"],
},
# Built with //tensorflow/tools/ci_build/Dockerfile.rbe.rocm-ubuntu18.04-manylinux2010-multipython.
"rocm-ubuntu18.04-manylinux2010-multipython": {
"registry": "gcr.io",
"repository": "tensorflow-testing/nosla-rocm-ubuntu18.04-manylinux2010-multipython",
"digest": container_digests["rocm-ubuntu18.04-manylinux2010-multipython"],
},
# Built with //tensorflow/tools/ci_build/Dockerfile.rbe.rocm-ubuntu20.04-manylinux2014-multipython.
"rocm-ubuntu20.04-manylinux2014-multipython": {
"registry": "gcr.io",
"repository": "tensorflow-testing/nosla-rocm-ubuntu20.04-manylinux2014-multipython",
"digest": container_digests["rocm-ubuntu20.04-manylinux2014-multipython"],
},
# Built by mihaimaruseac@ from a private Dockerfile.
"windows-1803": {
"registry": "gcr.io",
"repository": "tensorflow-testing/tf-win-rbe",
"digest": container_digests["windows-1803"],
},
}
@@ -0,0 +1,127 @@
"""Macro that creates external repositories for remote config."""
load("@rules_ml_toolchain//py:python_configure.bzl", "local_python_configure", "remote_python_configure")
load("//third_party/gpus:rocm_configure.bzl", "remote_rocm_configure")
load("//third_party/remote_config:remote_platform_configure.bzl", "remote_platform_configure")
load("//tools/toolchains/remote_config:containers.bzl", "containers")
def _container_image_uri(container_name):
container = containers[container_name]
return "docker://%s/%s@%s" % (container["registry"], container["repository"], container["digest"])
def _tensorflow_rbe_config(name, os, rocm_version = None, cuda_version = None, cudnn_version = None):
if cuda_version != None and rocm_version != None:
fail("Specifying both cuda_version and rocm_version is not supported.")
env = {}
if cuda_version != None:
cuda_version_in_container = ".".join(cuda_version.split(".")[:2])
cudnn_version_in_container = ".".join(cudnn_version.split(".")[:2])
container_name = "cuda%s-cudnn%s-%s" % (
cuda_version_in_container,
cudnn_version_in_container,
os,
)
container_image = _container_image_uri(container_name)
exec_properties = {
"container-image": container_image,
"Pool": "default",
}
elif rocm_version != None:
# The rocm toolchain currently contains its own C++ toolchain definition,
# so we do not fetch local_config_cc.
env.update({
"TF_NEED_ROCM": "1",
})
container_name = "rocm-%s" % (os)
container_image = _container_image_uri(container_name)
exec_properties = {
"container-image": container_image,
"Pool": "default",
}
remote_rocm_configure(
name = "%s_config_rocm" % name,
environ = env,
exec_properties = exec_properties,
)
else:
fail("Neither cuda_version nor rocm_version specified.")
remote_platform_configure(
name = "%s_config_platform" % name,
platform = "linux",
platform_exec_properties = exec_properties,
)
def _tensorflow_rbe_win_config(name, python_bin_path, container_name = "windows-1803"):
container_image = _container_image_uri(container_name)
exec_properties = {
"container-image": container_image,
"OSFamily": "Windows",
}
env = {
"PYTHON_BIN_PATH": python_bin_path,
}
remote_platform_configure(
name = "%s_config_platform" % name,
platform = "windows",
platform_exec_properties = exec_properties,
)
remote_python_configure(
name = "%s_config_python" % name,
exec_properties = exec_properties,
environ = env,
platform_constraint = "@%s_config_platform//:platform_constraint" % name,
)
def _tensorflow_local_config(name):
remote_platform_configure(
name = "%s_config_platform" % name,
platform = "local",
platform_exec_properties = {},
)
local_python_configure(
name = "%s_config_python" % name,
platform_constraint = "@%s_config_platform//:platform_constraint" % name,
)
def _ml_build_rbe_config(container_image):
exec_properties = {
"container-image": container_image,
"Pool": "default",
}
remote_platform_configure(
name = "ml_build_config_platform",
platform = "linux",
platform_exec_properties = exec_properties,
)
tensorflow_rbe_config = _tensorflow_rbe_config
tensorflow_rbe_win_config = _tensorflow_rbe_win_config
tensorflow_local_config = _tensorflow_local_config
ml_build_rbe_config = _ml_build_rbe_config
# TODO(b/369382309): Remove this once ml_build_rbe_config is used everywhere.
# Streamlined platform configuration for the SIG Build containers.
# See //tensorflow/tools/tf_sig_build_dockerfiles
# These containers do not support ROCm and all have CUDA.
def sigbuild_tf_configs(name_container_map):
for name, container in name_container_map.items():
exec_properties = {
"container-image": container,
"Pool": "default",
}
remote_platform_configure(
name = "%s_config_platform" % name,
platform = "linux",
platform_exec_properties = exec_properties,
)
+650
View File
@@ -0,0 +1,650 @@
# Copyright 2018 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.
# This becomes the BUILD file for @local_config_cc// under Windows.
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_toolchain", "cc_toolchain_suite")
load(":armeabi_cc_toolchain_config.bzl", "armeabi_cc_toolchain_config")
load(":windows_cc_toolchain_config.bzl", "cc_toolchain_config")
package(default_visibility = ["//visibility:public"])
cc_library(
name = "malloc",
)
filegroup(
name = "empty",
srcs = [],
)
filegroup(
name = "mingw_compiler_files",
srcs = [":builtin_include_directory_paths_mingw"],
)
filegroup(
name = "clangcl_compiler_files",
srcs = [":builtin_include_directory_paths_clangcl"],
)
filegroup(
name = "msvc_compiler_files",
srcs = [":builtin_include_directory_paths_msvc"],
)
# Hardcoded toolchain, legacy behaviour.
cc_toolchain_suite(
name = "toolchain",
toolchains = {
"armeabi-v7a|compiler": ":cc-compiler-armeabi-v7a",
"x64_windows|msvc-cl": ":cc-compiler-x64_windows",
"x64_x86_windows|msvc-cl": ":cc-compiler-x64_x86_windows",
"x64_arm_windows|msvc-cl": ":cc-compiler-x64_arm_windows",
"x64_arm64_windows|msvc-cl": ":cc-compiler-arm64_windows",
"arm64_windows|msvc-cl": ":cc-compiler-arm64_windows",
"x64_windows|msys-gcc": ":cc-compiler-x64_windows_msys",
"x64_windows|mingw-gcc": ":cc-compiler-x64_windows_mingw",
"x64_windows|clang-cl": ":cc-compiler-x64_windows-clang-cl",
"x64_windows_msys": ":cc-compiler-x64_windows_msys",
"x64_windows": ":cc-compiler-x64_windows",
"x64_x86_windows": ":cc-compiler-x64_x86_windows",
"x64_arm_windows": ":cc-compiler-x64_arm_windows",
"x64_arm64_windows": ":cc-compiler-arm64_windows",
"arm64_windows": ":cc-compiler-arm64_windows",
"x64_arm64_windows|clang-cl": ":cc-compiler-arm64_windows-clang-cl",
"arm64_windows|clang-cl": ":cc-compiler-arm64_windows-clang-cl",
"armeabi-v7a": ":cc-compiler-armeabi-v7a",
},
)
cc_toolchain(
name = "cc-compiler-x64_windows_msys",
all_files = ":empty",
ar_files = ":empty",
as_files = ":mingw_compiler_files",
compiler_files = ":mingw_compiler_files",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":msys_x64",
toolchain_identifier = "msys_x64",
)
cc_toolchain_config(
name = "msys_x64",
abi_libc_version = "local",
abi_version = "local",
compiler = "msys-gcc",
cpu = "x64_windows",
cxx_builtin_include_directories = [
"c:/tools/msys64/usr/",
],
dbg_mode_debug_flag = "/DEBUG:FULL",
fastbuild_mode_debug_flag = "/DEBUG:FASTLINK",
host_system_name = "local",
target_libc = "msys",
target_system_name = "local",
tool_bin_path = "c:/tools/msys64/usr/bin",
tool_paths = {
"ar": "c:/tools/msys64/usr/bin/ar",
"cpp": "c:/tools/msys64/usr/bin/cpp",
"dwp": "c:/tools/msys64/usr/bin/dwp",
"gcc": "c:/tools/msys64/usr/bin/gcc",
"gcov": "c:/tools/msys64/usr/bin/gcov",
"ld": "c:/tools/msys64/usr/bin/ld",
"nm": "c:/tools/msys64/usr/bin/nm",
"objcopy": "c:/tools/msys64/usr/bin/objcopy",
"objdump": "c:/tools/msys64/usr/bin/objdump",
"strip": "c:/tools/msys64/usr/bin/strip",
},
)
toolchain(
name = "cc-toolchain-x64_windows_msys",
exec_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
"@bazel_tools//tools/cpp:msys",
],
target_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
],
toolchain = ":cc-compiler-x64_windows_msys",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
cc_toolchain(
name = "cc-compiler-x64_windows_mingw",
all_files = ":empty",
ar_files = ":empty",
as_files = ":mingw_compiler_files",
compiler_files = ":mingw_compiler_files",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 0,
toolchain_config = ":msys_x64_mingw",
toolchain_identifier = "msys_x64_mingw",
)
cc_toolchain_config(
name = "msys_x64_mingw",
abi_libc_version = "local",
abi_version = "local",
compiler = "mingw-gcc",
cpu = "x64_windows",
cxx_builtin_include_directories = [
"c:/tools/msys64/mingw64/",
],
dbg_mode_debug_flag = "/DEBUG:FULL",
fastbuild_mode_debug_flag = "/DEBUG:FASTLINK",
host_system_name = "local",
target_libc = "mingw",
target_system_name = "local",
tool_bin_path = "c:/tools/msys64/mingw64/bin",
tool_paths = {
"ar": "c:/tools/msys64/mingw64/bin/ar",
"cpp": "c:/tools/msys64/mingw64/bin/cpp",
"dwp": "c:/tools/msys64/mingw64/bin/dwp",
"gcc": "c:/tools/msys64/mingw64/bin/gcc",
"gcov": "c:/tools/msys64/mingw64/bin/gcov",
"ld": "c:/tools/msys64/mingw64/bin/ld",
"nm": "c:/tools/msys64/mingw64/bin/nm",
"objcopy": "c:/tools/msys64/mingw64/bin/objcopy",
"objdump": "c:/tools/msys64/mingw64/bin/objdump",
"strip": "c:/tools/msys64/mingw64/bin/strip",
},
)
toolchain(
name = "cc-toolchain-x64_windows_mingw",
exec_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
"@bazel_tools//tools/cpp:mingw",
],
target_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
],
toolchain = ":cc-compiler-x64_windows_mingw",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
cc_toolchain(
name = "cc-compiler-x64_windows",
all_files = ":empty",
ar_files = ":empty",
as_files = ":msvc_compiler_files",
compiler_files = ":msvc_compiler_files",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":msvc_x64",
toolchain_identifier = "msvc_x64",
)
cc_toolchain_config(
name = "msvc_x64",
abi_libc_version = "local",
abi_version = "local",
archiver_flags = ["/MACHINE:X64"],
compiler = "msvc-cl",
cpu = "x64_windows",
cxx_builtin_include_directories = [
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\include",
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\ATLMFC\\include",
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\VS\\include",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22621.0\\ucrt",
"C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\um",
"C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\shared",
"C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\winrt",
"C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\cppwinrt",
],
dbg_mode_debug_flag = "/DEBUG:FULL",
default_link_flags = ["/MACHINE:X64"],
fastbuild_mode_debug_flag = "/DEBUG:FASTLINK",
host_system_name = "local",
msvc_cl_path = "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/cl.exe",
msvc_env_include = "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\include;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\ATLMFC\\include;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\VS\\include;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22621.0\\ucrt;C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\um;C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\shared;C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\winrt;C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\cppwinrt",
msvc_env_lib = "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\ATLMFC\\lib\\x64;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\lib\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.22621.0\\ucrt\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\\\lib\\10.0.22621.0\\\\um\\x64",
msvc_env_path = "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\bin\\HostX64\\x64;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\VC\\VCPackages;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\CommonExtensions\\Microsoft\\TeamFoundation\\Team Explorer;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\bin\\Roslyn;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.22621.0\\\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\\\x64;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\\\MSBuild\\Current\\Bin\\amd64;C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\Tools\\;;C:\\Windows\\system32;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\VC\\Linux\\bin\\ConnectionManagerExe",
msvc_env_tmp = "C:\\Users\\ContainerAdministrator\\AppData\\Local\\Temp",
msvc_lib_path = "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/lib.exe",
msvc_link_path = "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/link.exe",
msvc_ml_path = "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/ml64.exe",
supports_parse_showincludes = True,
target_libc = "msvcrt",
target_system_name = "local",
tool_paths = {
"ar": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/lib.exe",
"ml": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/ml64.exe",
"cpp": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/cl.exe",
"gcc": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/cl.exe",
"gcov": "wrapper/bin/msvc_nop.bat",
"ld": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/link.exe",
"nm": "wrapper/bin/msvc_nop.bat",
"objcopy": "wrapper/bin/msvc_nop.bat",
"objdump": "wrapper/bin/msvc_nop.bat",
"strip": "wrapper/bin/msvc_nop.bat",
},
toolchain_identifier = "msvc_x64",
)
toolchain(
name = "cc-toolchain-x64_windows",
exec_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
],
target_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
],
toolchain = ":cc-compiler-x64_windows",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
cc_toolchain(
name = "cc-compiler-x64_x86_windows",
all_files = ":empty",
ar_files = ":empty",
as_files = ":msvc_compiler_files",
compiler_files = ":msvc_compiler_files",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":msvc_x64_x86",
toolchain_identifier = "msvc_x64_x86",
)
cc_toolchain_config(
name = "msvc_x64_x86",
abi_libc_version = "local",
abi_version = "local",
archiver_flags = ["/MACHINE:X86"],
compiler = "msvc-cl",
cpu = "x64_windows",
cxx_builtin_include_directories = [
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\include",
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\ATLMFC\\include",
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\VS\\include",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22621.0\\ucrt",
"C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\um",
"C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\shared",
"C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\winrt",
"C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\cppwinrt",
],
dbg_mode_debug_flag = "/DEBUG:FULL",
default_link_flags = ["/MACHINE:X86"],
fastbuild_mode_debug_flag = "/DEBUG:FASTLINK",
host_system_name = "local",
msvc_cl_path = "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x86/cl.exe",
msvc_env_include = "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\include;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\ATLMFC\\include;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\VS\\include;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22621.0\\ucrt;C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\um;C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\shared;C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\winrt;C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\cppwinrt",
msvc_env_lib = "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\ATLMFC\\lib\\x86;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\lib\\x86;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.22621.0\\ucrt\\x86;C:\\Program Files (x86)\\Windows Kits\\10\\\\lib\\10.0.22621.0\\\\um\\x86",
msvc_env_path = "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\bin\\HostX64\\x86;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\bin\\HostX64\\x64;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\VC\\VCPackages;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\CommonExtensions\\Microsoft\\TeamFoundation\\Team Explorer;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\bin\\Roslyn;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.22621.0\\\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\\\x64;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\\\MSBuild\\Current\\Bin\\amd64;C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\Tools\\;;C:\\Windows\\system32;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\VC\\Linux\\bin\\ConnectionManagerExe",
msvc_env_tmp = "C:\\Users\\ContainerAdministrator\\AppData\\Local\\Temp",
msvc_lib_path = "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x86/lib.exe",
msvc_link_path = "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x86/link.exe",
msvc_ml_path = "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x86/ml.exe",
supports_parse_showincludes = True,
target_libc = "msvcrt",
target_system_name = "local",
tool_paths = {
"ar": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x86/lib.exe",
"ml": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x86/ml.exe",
"cpp": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x86/cl.exe",
"gcc": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x86/cl.exe",
"gcov": "wrapper/bin/msvc_nop.bat",
"ld": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x86/link.exe",
"nm": "wrapper/bin/msvc_nop.bat",
"objcopy": "wrapper/bin/msvc_nop.bat",
"objdump": "wrapper/bin/msvc_nop.bat",
"strip": "wrapper/bin/msvc_nop.bat",
},
toolchain_identifier = "msvc_x64_x86",
)
toolchain(
name = "cc-toolchain-x64_x86_windows",
exec_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
],
target_compatible_with = [
"@platforms//cpu:x86_32",
"@platforms//os:windows",
],
toolchain = ":cc-compiler-x64_x86_windows",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
cc_toolchain(
name = "cc-compiler-x64_arm_windows",
all_files = ":empty",
ar_files = ":empty",
as_files = ":msvc_compiler_files",
compiler_files = ":msvc_compiler_files",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":msvc_x64_arm",
toolchain_identifier = "msvc_x64_arm",
)
cc_toolchain_config(
name = "msvc_x64_arm",
abi_libc_version = "local",
abi_version = "local",
archiver_flags = ["/MACHINE:ARM"],
compiler = "msvc-cl",
cpu = "x64_windows",
cxx_builtin_include_directories = [],
dbg_mode_debug_flag = "/DEBUG",
default_link_flags = ["/MACHINE:ARM"],
fastbuild_mode_debug_flag = "/DEBUG",
host_system_name = "local",
msvc_cl_path = "vc_installation_error_arm.bat",
msvc_env_include = "msvc_not_found",
msvc_env_lib = "msvc_not_found",
msvc_env_path = "msvc_not_found",
msvc_env_tmp = "msvc_not_found",
msvc_lib_path = "vc_installation_error_arm.bat",
msvc_link_path = "vc_installation_error_arm.bat",
msvc_ml_path = "vc_installation_error_arm.bat",
supports_parse_showincludes = False,
target_libc = "msvcrt",
target_system_name = "local",
tool_paths = {
"ar": "vc_installation_error_arm.bat",
"ml": "vc_installation_error_arm.bat",
"cpp": "vc_installation_error_arm.bat",
"gcc": "vc_installation_error_arm.bat",
"gcov": "wrapper/bin/msvc_nop.bat",
"ld": "vc_installation_error_arm.bat",
"nm": "wrapper/bin/msvc_nop.bat",
"objcopy": "wrapper/bin/msvc_nop.bat",
"objdump": "wrapper/bin/msvc_nop.bat",
"strip": "wrapper/bin/msvc_nop.bat",
},
toolchain_identifier = "msvc_x64_arm",
)
toolchain(
name = "cc-toolchain-x64_arm_windows",
exec_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
],
target_compatible_with = [
"@platforms//cpu:arm",
"@platforms//os:windows",
],
toolchain = ":cc-compiler-x64_arm_windows",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
cc_toolchain(
name = "cc-compiler-arm64_windows",
all_files = ":empty",
ar_files = ":empty",
as_files = ":msvc_compiler_files",
compiler_files = ":msvc_compiler_files",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":msvc_arm64",
toolchain_identifier = "msvc_arm64",
)
cc_toolchain_config(
name = "msvc_arm64",
abi_libc_version = "local",
abi_version = "local",
archiver_flags = ["/MACHINE:ARM64"],
compiler = "msvc-cl",
cpu = "x64_windows",
cxx_builtin_include_directories = [],
dbg_mode_debug_flag = "/DEBUG",
default_link_flags = ["/MACHINE:ARM64"],
fastbuild_mode_debug_flag = "/DEBUG",
host_system_name = "local",
msvc_cl_path = "vc_installation_error_arm64.bat",
msvc_env_include = "msvc_not_found",
msvc_env_lib = "msvc_not_found",
msvc_env_path = "msvc_not_found",
msvc_env_tmp = "msvc_not_found",
msvc_lib_path = "vc_installation_error_arm64.bat",
msvc_link_path = "vc_installation_error_arm64.bat",
msvc_ml_path = "vc_installation_error_arm64.bat",
supports_parse_showincludes = False,
target_libc = "msvcrt",
target_system_name = "local",
tool_paths = {
"ar": "vc_installation_error_arm64.bat",
"ml": "vc_installation_error_arm64.bat",
"cpp": "vc_installation_error_arm64.bat",
"gcc": "vc_installation_error_arm64.bat",
"gcov": "wrapper/bin/msvc_nop.bat",
"ld": "vc_installation_error_arm64.bat",
"nm": "wrapper/bin/msvc_nop.bat",
"objcopy": "wrapper/bin/msvc_nop.bat",
"objdump": "wrapper/bin/msvc_nop.bat",
"strip": "wrapper/bin/msvc_nop.bat",
},
toolchain_identifier = "msvc_arm64",
)
toolchain(
name = "cc-toolchain-arm64_windows",
exec_compatible_with = [
"@platforms//os:windows",
],
target_compatible_with = [
"@platforms//cpu:arm64",
"@platforms//os:windows",
],
toolchain = ":cc-compiler-arm64_windows",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
cc_toolchain(
name = "cc-compiler-x64_windows-clang-cl",
all_files = ":empty",
ar_files = ":empty",
as_files = ":clangcl_compiler_files",
compiler_files = ":clangcl_compiler_files",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":clang_cl_x64",
toolchain_identifier = "clang_cl_x64",
)
cc_toolchain_config(
name = "clang_cl_x64",
abi_libc_version = "local",
abi_version = "local",
archiver_flags = ["/MACHINE:X64"],
compiler = "clang-cl",
cpu = "x64_windows",
cxx_builtin_include_directories = [
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\include",
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\ATLMFC\\include",
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\VS\\include",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22621.0\\ucrt",
"C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\um",
"C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\shared",
"C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\winrt",
"C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\cppwinrt",
"C:\\tools\\LLVM\\lib\\clang\\18\\include",
],
dbg_mode_debug_flag = "/DEBUG",
default_link_flags = [
"/MACHINE:X64",
"/DEFAULTLIB:clang_rt.builtins-x86_64.lib",
],
fastbuild_mode_debug_flag = "/DEBUG",
host_system_name = "local",
msvc_cl_path = "C:/tools/LLVM/bin/clang-cl.exe",
msvc_env_include = "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\include;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\ATLMFC\\include;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\VS\\include;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22621.0\\ucrt;C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\um;C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\shared;C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\winrt;C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\cppwinrt;C:\\tools\\LLVM\\lib\\clang\\18\\include",
msvc_env_lib = "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\ATLMFC\\lib\\x64;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\lib\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.22621.0\\ucrt\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\\\lib\\10.0.22621.0\\\\um\\x64;C:\\tools\\LLVM\\lib\\clang\\18\\lib\\windows",
msvc_env_path = "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\bin\\HostX64\\x64;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\VC\\VCPackages;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\CommonExtensions\\Microsoft\\TeamFoundation\\Team Explorer;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\bin\\Roslyn;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.22621.0\\\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\\\x64;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\\\MSBuild\\Current\\Bin\\amd64;C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\Tools\\;;C:\\Windows\\system32;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\VC\\Linux\\bin\\ConnectionManagerExe",
msvc_env_tmp = "C:\\Users\\ContainerAdministrator\\AppData\\Local\\Temp",
msvc_lib_path = "C:/tools/LLVM/bin/llvm-lib.exe",
msvc_link_path = "C:/tools/LLVM/bin/lld-link.exe",
msvc_ml_path = "C:/tools/LLVM/bin/clang-cl.exe",
supports_parse_showincludes = True,
target_libc = "msvcrt",
target_system_name = "local",
tool_paths = {
"ar": "C:/tools/LLVM/bin/llvm-lib.exe",
"ml": "C:/tools/LLVM/bin/clang-cl.exe",
"cpp": "C:/tools/LLVM/bin/clang-cl.exe",
"gcc": "C:/tools/LLVM/bin/clang-cl.exe",
"gcov": "wrapper/bin/msvc_nop.bat",
"ld": "C:/tools/LLVM/bin/lld-link.exe",
"nm": "wrapper/bin/msvc_nop.bat",
"objcopy": "wrapper/bin/msvc_nop.bat",
"objdump": "wrapper/bin/msvc_nop.bat",
"strip": "wrapper/bin/msvc_nop.bat",
},
toolchain_identifier = "clang_cl_x64",
)
toolchain(
name = "cc-toolchain-x64_windows-clang-cl",
exec_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
"@bazel_tools//tools/cpp:clang-cl",
],
target_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
],
toolchain = ":cc-compiler-x64_windows-clang-cl",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
cc_toolchain(
name = "cc-compiler-arm64_windows-clang-cl",
all_files = ":empty",
ar_files = ":empty",
as_files = ":clangcl_compiler_files",
compiler_files = ":clangcl_compiler_files",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":clang_cl_arm64",
toolchain_identifier = "clang_cl_arm64",
)
cc_toolchain_config(
name = "clang_cl_arm64",
abi_libc_version = "local",
abi_version = "local",
archiver_flags = ["/MACHINE:ARM64"],
compiler = "clang-cl",
cpu = "arm64_windows",
cxx_builtin_include_directories = [],
dbg_mode_debug_flag = "/DEBUG",
default_link_flags = ["/MACHINE:ARM64"],
fastbuild_mode_debug_flag = "/DEBUG",
host_system_name = "local",
msvc_cl_path = "vc_installation_error_arm64.bat",
msvc_env_include = "clang_cl_not_found",
msvc_env_lib = "clang_cl_not_found",
msvc_env_path = "clang_cl_not_found",
msvc_env_tmp = "clang_cl_not_found",
msvc_lib_path = "vc_installation_error_arm64.bat",
msvc_link_path = "vc_installation_error_arm64.bat",
msvc_ml_path = "vc_installation_error_arm64.bat",
supports_parse_showincludes = False,
target_libc = "msvcrt",
target_system_name = "aarch64-pc-windows-msvc",
tool_paths = {
"ar": "vc_installation_error_arm64.bat",
"ml": "vc_installation_error_arm64.bat",
"cpp": "vc_installation_error_arm64.bat",
"gcc": "vc_installation_error_arm64.bat",
"gcov": "wrapper/bin/msvc_nop.bat",
"ld": "vc_installation_error_arm64.bat",
"nm": "wrapper/bin/msvc_nop.bat",
"objcopy": "wrapper/bin/msvc_nop.bat",
"objdump": "wrapper/bin/msvc_nop.bat",
"strip": "wrapper/bin/msvc_nop.bat",
},
toolchain_identifier = "clang_cl_arm64",
)
toolchain(
name = "cc-toolchain-arm64_windows-clang-cl",
exec_compatible_with = [
"@platforms//os:windows",
"@bazel_tools//tools/cpp:clang-cl",
],
target_compatible_with = [
"@platforms//cpu:arm64",
"@platforms//os:windows",
],
toolchain = ":cc-compiler-arm64_windows-clang-cl",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
cc_toolchain(
name = "cc-compiler-armeabi-v7a",
all_files = ":empty",
ar_files = ":empty",
as_files = ":empty",
compiler_files = ":empty",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":stub_armeabi-v7a",
toolchain_identifier = "stub_armeabi-v7a",
)
armeabi_cc_toolchain_config(name = "stub_armeabi-v7a")
toolchain(
name = "cc-toolchain-armeabi-v7a",
exec_compatible_with = [
],
target_compatible_with = [
"@platforms//cpu:armv7",
"@platforms//os:android",
],
toolchain = ":cc-compiler-armeabi-v7a",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
@@ -0,0 +1,83 @@
# Copyright 2019 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.
"""A Starlark cc_toolchain configuration rule"""
load(
"@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl",
"feature",
"tool_path",
)
load("@rules_cc//cc/common:cc_common.bzl", "cc_common")
def _impl(ctx):
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"
cc_target_os = None
builtin_sysroot = None
action_configs = []
supports_pic_feature = feature(name = "supports_pic", enabled = True)
supports_dynamic_linker_feature = feature(name = "supports_dynamic_linker", enabled = True)
features = [supports_dynamic_linker_feature, supports_pic_feature]
cxx_builtin_include_directories = []
artifact_name_patterns = []
make_variables = []
tool_paths = [
tool_path(name = "ar", 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 = "llvm-profdata", 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"),
]
return cc_common.create_cc_toolchain_config_info(
ctx = ctx,
features = features,
action_configs = action_configs,
artifact_name_patterns = artifact_name_patterns,
cxx_builtin_include_directories = cxx_builtin_include_directories,
toolchain_identifier = toolchain_identifier,
host_system_name = host_system_name,
target_system_name = target_system_name,
target_cpu = target_cpu,
target_libc = target_libc,
compiler = compiler,
abi_version = abi_version,
abi_libc_version = abi_libc_version,
tool_paths = tool_paths,
make_variables = make_variables,
builtin_sysroot = builtin_sysroot,
cc_target_os = cc_target_os,
)
armeabi_cc_toolchain_config = rule(
implementation = _impl,
attrs = {},
provides = [CcToolchainConfigInfo],
)
@@ -0,0 +1,7 @@
This file is generated by cc_configure and contains builtin include directories
that clang-cl reported. This file is a dependency of every compilation action and
changes to it will be reflected in the action cache key. When some of these
paths change, Bazel will make sure to rerun the action, even though none of
declared action inputs or the action commandline changes.
@@ -0,0 +1,7 @@
This file is generated by cc_configure and contains builtin include directories
that msvc reported. This file is a dependency of every compilation action and
changes to it will be reflected in the action cache key. When some of these
paths change, Bazel will make sure to rerun the action, even though none of
declared action inputs or the action commandline changes.
@@ -0,0 +1,2 @@
REPOSITORY TAG DIGEST IMAGE ID CREATED SIZE
gcr.io/tensorflow-testing/tf-win2019-rbe latest sha256:d3577d20dea75966faf7fd03479c71462441937df5694259109c2ee1d002a3dd b601adb43430 8 minutes ago 20.4GB
File diff suppressed because it is too large Load Diff
+39
View File
@@ -0,0 +1,39 @@
licenses(["restricted"])
package(default_visibility = ["//visibility:public"])
java_runtime(
name = "windows_jdk8",
srcs = [],
java_home = "C:/openjdk",
)
platform(
name = "rbe_windows_ltsc2019",
constraint_values = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
],
exec_properties = {
"container-image": "docker://gcr.io/tensorflow-testing/tf-win2019-rbe@sha256:d3577d20dea75966faf7fd03479c71462441937df5694259109c2ee1d002a3dd",
"OSFamily": "Windows",
"Pool": "default",
"dockerNetwork": "off",
},
)
# Register the clang-cl platform
platform(
name = "x64_windows-clang-cl",
constraint_values = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
"@bazel_tools//tools/cpp:clang-cl",
],
exec_properties = {
"container-image": "docker://gcr.io/tensorflow-testing/tf-win2019-rbe@sha256:d3577d20dea75966faf7fd03479c71462441937df5694259109c2ee1d002a3dd",
"OSFamily": "Windows",
"Pool": "default",
"dockerNetwork": "off",
},
)
+356
View File
@@ -0,0 +1,356 @@
# Copyright 2018 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.
# This becomes the BUILD file for @local_config_cc// under Windows.
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_toolchain", "cc_toolchain_suite")
load(":armeabi_cc_toolchain_config.bzl", "armeabi_cc_toolchain_config")
load(":windows_cc_toolchain_config.bzl", "cc_toolchain_config")
package(default_visibility = ["//visibility:public"])
cc_library(
name = "malloc",
)
filegroup(
name = "empty",
srcs = [],
)
filegroup(
name = "mingw_compiler_files",
srcs = [":builtin_include_directory_paths_mingw"],
)
filegroup(
name = "clangcl_compiler_files",
srcs = [":builtin_include_directory_paths_clangcl"],
)
filegroup(
name = "msvc_compiler_files",
srcs = [":builtin_include_directory_paths_msvc"],
)
# Hardcoded toolchain, legacy behaviour.
cc_toolchain_suite(
name = "toolchain",
toolchains = {
"armeabi-v7a|compiler": ":cc-compiler-armeabi-v7a",
"x64_windows|msvc-cl": ":cc-compiler-x64_windows",
"x64_windows|msys-gcc": ":cc-compiler-x64_windows_msys",
"x64_windows|mingw-gcc": ":cc-compiler-x64_windows_mingw",
"x64_windows|clang-cl": ":cc-compiler-x64_windows-clang-cl",
"x64_windows_msys": ":cc-compiler-x64_windows_msys",
"x64_windows": ":cc-compiler-x64_windows",
"armeabi-v7a": ":cc-compiler-armeabi-v7a",
},
)
cc_toolchain(
name = "cc-compiler-x64_windows_msys",
all_files = ":empty",
ar_files = ":empty",
as_files = ":mingw_compiler_files",
compiler_files = ":mingw_compiler_files",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":msys_x64",
toolchain_identifier = "msys_x64",
)
cc_toolchain_config(
name = "msys_x64",
abi_libc_version = "local",
abi_version = "local",
compiler = "msys-gcc",
cpu = "x64_windows",
cxx_builtin_include_directories = [
"c:/tools/msys64/usr/",
],
dbg_mode_debug_flag = "/DEBUG:FULL",
fastbuild_mode_debug_flag = "/DEBUG:FASTLINK",
host_system_name = "local",
target_libc = "msys",
target_system_name = "local",
tool_bin_path = "c:/tools/msys64/usr/bin",
tool_paths = {
"ar": "c:/tools/msys64/usr/bin/ar",
"compat-ld": "c:/tools/msys64/usr/bin/compat-ld",
"cpp": "c:/tools/msys64/usr/bin/cpp",
"dwp": "c:/tools/msys64/usr/bin/dwp",
"gcc": "c:/tools/msys64/usr/bin/gcc",
"gcov": "c:/tools/msys64/usr/bin/gcov",
"ld": "c:/tools/msys64/usr/bin/ld",
"nm": "c:/tools/msys64/usr/bin/nm",
"objcopy": "c:/tools/msys64/usr/bin/objcopy",
"objdump": "c:/tools/msys64/usr/bin/objdump",
"strip": "c:/tools/msys64/usr/bin/strip",
},
)
toolchain(
name = "cc-toolchain-x64_windows_msys",
exec_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
"@bazel_tools//tools/cpp:msys",
],
target_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
],
toolchain = ":cc-compiler-x64_windows_msys",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
cc_toolchain(
name = "cc-compiler-x64_windows_mingw",
all_files = ":empty",
ar_files = ":empty",
as_files = ":mingw_compiler_files",
compiler_files = ":mingw_compiler_files",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 0,
toolchain_config = ":msys_x64_mingw",
toolchain_identifier = "msys_x64_mingw",
)
cc_toolchain_config(
name = "msys_x64_mingw",
abi_libc_version = "local",
abi_version = "local",
compiler = "mingw-gcc",
cpu = "x64_windows",
cxx_builtin_include_directories = [
"c:/tools/msys64/mingw64/",
],
dbg_mode_debug_flag = "/DEBUG:FULL",
fastbuild_mode_debug_flag = "/DEBUG:FASTLINK",
host_system_name = "local",
target_libc = "mingw",
target_system_name = "local",
tool_bin_path = "c:/tools/msys64/mingw64/bin",
tool_paths = {
"ar": "c:/tools/msys64/mingw64/bin/ar",
"compat-ld": "c:/tools/msys64/mingw64/bin/compat-ld",
"cpp": "c:/tools/msys64/mingw64/bin/cpp",
"dwp": "c:/tools/msys64/mingw64/bin/dwp",
"gcc": "c:/tools/msys64/mingw64/bin/gcc",
"gcov": "c:/tools/msys64/mingw64/bin/gcov",
"ld": "c:/tools/msys64/mingw64/bin/ld",
"nm": "c:/tools/msys64/mingw64/bin/nm",
"objcopy": "c:/tools/msys64/mingw64/bin/objcopy",
"objdump": "c:/tools/msys64/mingw64/bin/objdump",
"strip": "c:/tools/msys64/mingw64/bin/strip",
},
)
toolchain(
name = "cc-toolchain-x64_windows_mingw",
exec_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
"@bazel_tools//tools/cpp:mingw",
],
target_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
],
toolchain = ":cc-compiler-x64_windows_mingw",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
cc_toolchain(
name = "cc-compiler-x64_windows",
all_files = ":empty",
ar_files = ":empty",
as_files = ":msvc_compiler_files",
compiler_files = ":msvc_compiler_files",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":msvc_x64",
toolchain_identifier = "msvc_x64",
)
cc_toolchain_config(
name = "msvc_x64",
abi_libc_version = "local",
abi_version = "local",
compiler = "msvc-cl",
cpu = "x64_windows",
cxx_builtin_include_directories = [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Preview\\VC\\Tools\\MSVC\\14.25.28610\\include",
"C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.8\\include\\um",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17763.0\\ucrt",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17763.0\\shared",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17763.0\\um",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17763.0\\winrt",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17763.0\\cppwinrt",
],
dbg_mode_debug_flag = "/DEBUG:FULL",
default_link_flags = ["/MACHINE:X64"],
fastbuild_mode_debug_flag = "/DEBUG:FASTLINK",
host_system_name = "local",
msvc_cl_path = "C:/Program Files (x86)/Microsoft Visual Studio/2019/Preview/VC/Tools/MSVC/14.25.28610/bin/HostX64/x64/cl.exe",
msvc_env_include = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Preview\\VC\\Tools\\MSVC\\14.25.28610\\include;C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.8\\include\\um;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17763.0\\ucrt;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17763.0\\shared;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17763.0\\um;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17763.0\\winrt;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17763.0\\cppwinrt",
msvc_env_lib = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Preview\\VC\\Tools\\MSVC\\14.25.28610\\lib\\x64;C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.8\\lib\\um\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.17763.0\\ucrt\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.17763.0\\um\\x64;",
msvc_env_path = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Preview\\VC\\Tools\\MSVC\\14.25.28610\\bin\\HostX64\\x64;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Preview\\Common7\\IDE\\VC\\VCPackages;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Preview\\Common7\\IDE\\CommonExtensions\\Microsoft\\TeamFoundation\\Team Explorer;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Preview\\MSBuild\\Current\\bin\\Roslyn;C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.8 Tools\\x64\\;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.17763.0\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\x64;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Preview\\\\MSBuild\\Current\\Bin;C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Preview\\Common7\\IDE\\;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Preview\\Common7\\Tools\\;;C:\\Windows\\system32",
msvc_env_tmp = "C:\\Users\\ContainerAdministrator\\AppData\\Local\\Temp",
msvc_lib_path = "C:/Program Files (x86)/Microsoft Visual Studio/2019/Preview/VC/Tools/MSVC/14.25.28610/bin/HostX64/x64/lib.exe",
msvc_link_path = "C:/Program Files (x86)/Microsoft Visual Studio/2019/Preview/VC/Tools/MSVC/14.25.28610/bin/HostX64/x64/link.exe",
msvc_ml_path = "C:/Program Files (x86)/Microsoft Visual Studio/2019/Preview/VC/Tools/MSVC/14.25.28610/bin/HostX64/x64/ml64.exe",
target_libc = "msvcrt",
target_system_name = "local",
tool_paths = {
"ar": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Preview/VC/Tools/MSVC/14.25.28610/bin/HostX64/x64/lib.exe",
"ml": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Preview/VC/Tools/MSVC/14.25.28610/bin/HostX64/x64/ml64.exe",
"cpp": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Preview/VC/Tools/MSVC/14.25.28610/bin/HostX64/x64/cl.exe",
"gcc": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Preview/VC/Tools/MSVC/14.25.28610/bin/HostX64/x64/cl.exe",
"gcov": "wrapper/bin/msvc_nop.bat",
"ld": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Preview/VC/Tools/MSVC/14.25.28610/bin/HostX64/x64/link.exe",
"nm": "wrapper/bin/msvc_nop.bat",
"objcopy": "wrapper/bin/msvc_nop.bat",
"objdump": "wrapper/bin/msvc_nop.bat",
"strip": "wrapper/bin/msvc_nop.bat",
},
toolchain_identifier = "msvc_x64",
)
toolchain(
name = "cc-toolchain-x64_windows",
exec_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
],
target_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
],
toolchain = ":cc-compiler-x64_windows",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
cc_toolchain(
name = "cc-compiler-x64_windows-clang-cl",
all_files = ":empty",
ar_files = ":empty",
as_files = ":clangcl_compiler_files",
compiler_files = ":clangcl_compiler_files",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":clang_cl_x64",
toolchain_identifier = "clang_cl_x64",
)
cc_toolchain_config(
name = "clang_cl_x64",
abi_libc_version = "local",
abi_version = "local",
compiler = "clang-cl",
cpu = "x64_windows",
cxx_builtin_include_directories = [],
dbg_mode_debug_flag = "/DEBUG",
default_link_flags = [
"/MACHINE:X64",
"/DEFAULTLIB:clang_rt.builtins-x86_64.lib",
],
fastbuild_mode_debug_flag = "/DEBUG",
host_system_name = "local",
msvc_cl_path = "clang_installation_error.bat",
msvc_env_include = "clang_cl_not_found",
msvc_env_lib = "clang_cl_not_found",
msvc_env_path = "clang_cl_not_found",
msvc_env_tmp = "clang_cl_not_found",
msvc_lib_path = "clang_installation_error.bat",
msvc_link_path = "clang_installation_error.bat",
msvc_ml_path = "clang_installation_error.bat",
target_libc = "msvcrt",
target_system_name = "local",
tool_paths = {
"ar": "clang_installation_error.bat",
"ml": "clang_installation_error.bat",
"cpp": "clang_installation_error.bat",
"gcc": "clang_installation_error.bat",
"gcov": "wrapper/bin/msvc_nop.bat",
"ld": "clang_installation_error.bat",
"nm": "wrapper/bin/msvc_nop.bat",
"objcopy": "wrapper/bin/msvc_nop.bat",
"objdump": "wrapper/bin/msvc_nop.bat",
"strip": "wrapper/bin/msvc_nop.bat",
},
toolchain_identifier = "clang_cl_x64",
)
toolchain(
name = "cc-toolchain-x64_windows-clang-cl",
exec_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
"@bazel_tools//tools/cpp:clang-cl",
],
target_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
],
toolchain = ":cc-compiler-x64_windows-clang-cl",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
cc_toolchain(
name = "cc-compiler-armeabi-v7a",
all_files = ":empty",
ar_files = ":empty",
as_files = ":empty",
compiler_files = ":empty",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":stub_armeabi-v7a",
toolchain_identifier = "stub_armeabi-v7a",
)
armeabi_cc_toolchain_config(name = "stub_armeabi-v7a")
toolchain(
name = "cc-toolchain-armeabi-v7a",
exec_compatible_with = [
],
target_compatible_with = [
"@platforms//cpu:arm",
"@platforms//os:android",
],
toolchain = ":cc-compiler-armeabi-v7a",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
filegroup(
name = "link_dynamic_library",
srcs = ["link_dynamic_library.sh"],
)
@@ -0,0 +1,83 @@
# Copyright 2019 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.
"""A Starlark cc_toolchain configuration rule"""
load(
"@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl",
"feature",
"tool_path",
)
load("@rules_cc//cc/common:cc_common.bzl", "cc_common")
def _impl(ctx):
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"
cc_target_os = None
builtin_sysroot = None
action_configs = []
supports_pic_feature = feature(name = "supports_pic", enabled = True)
supports_dynamic_linker_feature = feature(name = "supports_dynamic_linker", enabled = True)
features = [supports_dynamic_linker_feature, supports_pic_feature]
cxx_builtin_include_directories = []
artifact_name_patterns = []
make_variables = []
tool_paths = [
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"),
]
return cc_common.create_cc_toolchain_config_info(
ctx = ctx,
features = features,
action_configs = action_configs,
artifact_name_patterns = artifact_name_patterns,
cxx_builtin_include_directories = cxx_builtin_include_directories,
toolchain_identifier = toolchain_identifier,
host_system_name = host_system_name,
target_system_name = target_system_name,
target_cpu = target_cpu,
target_libc = target_libc,
compiler = compiler,
abi_version = abi_version,
abi_libc_version = abi_libc_version,
tool_paths = tool_paths,
make_variables = make_variables,
builtin_sysroot = builtin_sysroot,
cc_target_os = cc_target_os,
)
armeabi_cc_toolchain_config = rule(
implementation = _impl,
attrs = {},
provides = [CcToolchainConfigInfo],
)
@@ -0,0 +1,13 @@
This file is generated by cc_configure and contains builtin include directories
that msvc reported. This file is a dependency of every compilation action and
changes to it will be reflected in the action cache key. When some of these
paths change, Bazel will make sure to rerun the action, even though none of
declared action inputs or the action commandline changes.
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Preview\\VC\\Tools\\MSVC\\14.25.28610\\include"
"C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.8\\include\\um"
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17763.0\\ucrt"
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17763.0\\shared"
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17763.0\\um"
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17763.0\\winrt"
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17763.0\\cppwinrt"
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,630 @@
# Copyright 2018 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.
# This becomes the BUILD file for @local_config_cc// under Windows.
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_toolchain", "cc_toolchain_suite")
load(":armeabi_cc_toolchain_config.bzl", "armeabi_cc_toolchain_config")
load(":windows_cc_toolchain_config.bzl", "cc_toolchain_config")
package(default_visibility = ["//visibility:public"])
cc_library(
name = "malloc",
)
filegroup(
name = "empty",
srcs = [],
)
filegroup(
name = "mingw_compiler_files",
srcs = [":builtin_include_directory_paths_mingw"],
)
filegroup(
name = "clangcl_compiler_files",
srcs = [":builtin_include_directory_paths_clangcl"],
)
filegroup(
name = "msvc_compiler_files",
srcs = [":builtin_include_directory_paths_msvc"],
)
# Hardcoded toolchain, legacy behaviour.
cc_toolchain_suite(
name = "toolchain",
toolchains = {
"armeabi-v7a|compiler": ":cc-compiler-armeabi-v7a",
"x64_windows|msvc-cl": ":cc-compiler-x64_windows",
"x64_x86_windows|msvc-cl": ":cc-compiler-x64_x86_windows",
"x64_arm_windows|msvc-cl": ":cc-compiler-x64_arm_windows",
"x64_arm64_windows|msvc-cl": ":cc-compiler-arm64_windows",
"arm64_windows|msvc-cl": ":cc-compiler-arm64_windows",
"x64_windows|msys-gcc": ":cc-compiler-x64_windows_msys",
"x64_windows|mingw-gcc": ":cc-compiler-x64_windows_mingw",
"x64_windows|clang-cl": ":cc-compiler-x64_windows-clang-cl",
"x64_windows_msys": ":cc-compiler-x64_windows_msys",
"x64_windows": ":cc-compiler-x64_windows",
"x64_x86_windows": ":cc-compiler-x64_x86_windows",
"x64_arm_windows": ":cc-compiler-x64_arm_windows",
"x64_arm64_windows": ":cc-compiler-arm64_windows",
"arm64_windows": ":cc-compiler-arm64_windows",
"x64_arm64_windows|clang-cl": ":cc-compiler-arm64_windows-clang-cl",
"arm64_windows|clang-cl": ":cc-compiler-arm64_windows-clang-cl",
"armeabi-v7a": ":cc-compiler-armeabi-v7a",
},
)
cc_toolchain(
name = "cc-compiler-x64_windows_msys",
all_files = ":empty",
ar_files = ":empty",
as_files = ":mingw_compiler_files",
compiler_files = ":mingw_compiler_files",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":msys_x64",
toolchain_identifier = "msys_x64",
)
cc_toolchain_config(
name = "msys_x64",
abi_libc_version = "local",
abi_version = "local",
compiler = "msys-gcc",
cpu = "x64_windows",
cxx_builtin_include_directories = [
"c:/tools/msys64/usr/",
],
dbg_mode_debug_flag = "/DEBUG:FULL",
fastbuild_mode_debug_flag = "/DEBUG:FASTLINK",
host_system_name = "local",
target_libc = "msys",
target_system_name = "local",
tool_bin_path = "c:/tools/msys64/usr/bin",
tool_paths = {
"ar": "c:/tools/msys64/usr/bin/ar",
"cpp": "c:/tools/msys64/usr/bin/cpp",
"dwp": "c:/tools/msys64/usr/bin/dwp",
"gcc": "c:/tools/msys64/usr/bin/gcc",
"gcov": "c:/tools/msys64/usr/bin/gcov",
"ld": "c:/tools/msys64/usr/bin/ld",
"nm": "c:/tools/msys64/usr/bin/nm",
"objcopy": "c:/tools/msys64/usr/bin/objcopy",
"objdump": "c:/tools/msys64/usr/bin/objdump",
"strip": "c:/tools/msys64/usr/bin/strip",
},
)
toolchain(
name = "cc-toolchain-x64_windows_msys",
exec_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
"@bazel_tools//tools/cpp:msys",
],
target_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
],
toolchain = ":cc-compiler-x64_windows_msys",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
cc_toolchain(
name = "cc-compiler-x64_windows_mingw",
all_files = ":empty",
ar_files = ":empty",
as_files = ":mingw_compiler_files",
compiler_files = ":mingw_compiler_files",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 0,
toolchain_config = ":msys_x64_mingw",
toolchain_identifier = "msys_x64_mingw",
)
cc_toolchain_config(
name = "msys_x64_mingw",
abi_libc_version = "local",
abi_version = "local",
compiler = "mingw-gcc",
cpu = "x64_windows",
cxx_builtin_include_directories = [
"c:/tools/msys64/mingw64/",
],
dbg_mode_debug_flag = "/DEBUG:FULL",
fastbuild_mode_debug_flag = "/DEBUG:FASTLINK",
host_system_name = "local",
target_libc = "mingw",
target_system_name = "local",
tool_bin_path = "c:/tools/msys64/mingw64/bin",
tool_paths = {
"ar": "c:/tools/msys64/mingw64/bin/ar",
"cpp": "c:/tools/msys64/mingw64/bin/cpp",
"dwp": "c:/tools/msys64/mingw64/bin/dwp",
"gcc": "c:/tools/msys64/mingw64/bin/gcc",
"gcov": "c:/tools/msys64/mingw64/bin/gcov",
"ld": "c:/tools/msys64/mingw64/bin/ld",
"nm": "c:/tools/msys64/mingw64/bin/nm",
"objcopy": "c:/tools/msys64/mingw64/bin/objcopy",
"objdump": "c:/tools/msys64/mingw64/bin/objdump",
"strip": "c:/tools/msys64/mingw64/bin/strip",
},
)
toolchain(
name = "cc-toolchain-x64_windows_mingw",
exec_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
"@bazel_tools//tools/cpp:mingw",
],
target_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
],
toolchain = ":cc-compiler-x64_windows_mingw",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
cc_toolchain(
name = "cc-compiler-x64_windows",
all_files = ":empty",
ar_files = ":empty",
as_files = ":msvc_compiler_files",
compiler_files = ":msvc_compiler_files",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":msvc_x64",
toolchain_identifier = "msvc_x64",
)
cc_toolchain_config(
name = "msvc_x64",
abi_libc_version = "local",
abi_version = "local",
archiver_flags = ["/MACHINE:X64"],
compiler = "msvc-cl",
cpu = "x64_windows",
cxx_builtin_include_directories = [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.29.30133\\include",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\ucrt",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\shared",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\um",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\winrt",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\cppwinrt",
],
dbg_mode_debug_flag = "/DEBUG:FULL",
default_link_flags = ["/MACHINE:X64"],
fastbuild_mode_debug_flag = "/DEBUG:FASTLINK",
host_system_name = "local",
msvc_cl_path = "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/cl.exe",
msvc_env_include = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.29.30133\\include;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\ucrt;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\shared;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\um;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\winrt;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\cppwinrt",
msvc_env_lib = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.29.30133\\lib\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.20348.0\\ucrt\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.20348.0\\um\\x64",
msvc_env_path = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX64\\x64;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\IDE\\VC\\VCPackages;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\IDE\\CommonExtensions\\Microsoft\\TeamFoundation\\Team Explorer;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\MSBuild\\Current\\bin\\Roslyn;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\Tools\\devinit;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.20348.0\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\x64;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\\\MSBuild\\Current\\Bin;C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\IDE\\;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\Tools\\;;C:\\Windows\\system32",
msvc_env_tmp = "C:\\Users\\ContainerAdministrator\\AppData\\Local\\Temp",
msvc_lib_path = "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/lib.exe",
msvc_link_path = "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/link.exe",
msvc_ml_path = "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/ml64.exe",
target_libc = "msvcrt",
target_system_name = "local",
tool_paths = {
"ar": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/lib.exe",
"ml": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/ml64.exe",
"cpp": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/cl.exe",
"gcc": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/cl.exe",
"gcov": "wrapper/bin/msvc_nop.bat",
"ld": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/link.exe",
"nm": "wrapper/bin/msvc_nop.bat",
"objcopy": "wrapper/bin/msvc_nop.bat",
"objdump": "wrapper/bin/msvc_nop.bat",
"strip": "wrapper/bin/msvc_nop.bat",
},
toolchain_identifier = "msvc_x64",
)
toolchain(
name = "cc-toolchain-x64_windows",
exec_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
],
target_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
],
toolchain = ":cc-compiler-x64_windows",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
cc_toolchain(
name = "cc-compiler-x64_x86_windows",
all_files = ":empty",
ar_files = ":empty",
as_files = ":msvc_compiler_files",
compiler_files = ":msvc_compiler_files",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":msvc_x64_x86",
toolchain_identifier = "msvc_x64_x86",
)
cc_toolchain_config(
name = "msvc_x64_x86",
abi_libc_version = "local",
abi_version = "local",
archiver_flags = ["/MACHINE:X86"],
compiler = "msvc-cl",
cpu = "x64_windows",
cxx_builtin_include_directories = [
"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.29.30133\\include",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\ucrt",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\shared",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\um",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\winrt",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\cppwinrt",
],
dbg_mode_debug_flag = "/DEBUG:FULL",
default_link_flags = ["/MACHINE:X86"],
fastbuild_mode_debug_flag = "/DEBUG:FASTLINK",
host_system_name = "local",
msvc_cl_path = "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/HostX64/x86/cl.exe",
msvc_env_include = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.29.30133\\include;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\ucrt;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\shared;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\um;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\winrt;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.20348.0\\cppwinrt",
msvc_env_lib = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.29.30133\\lib\\x86;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.20348.0\\ucrt\\x86;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.20348.0\\um\\x86",
msvc_env_path = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX64\\x86;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX64\\x64;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\IDE\\VC\\VCPackages;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\IDE\\CommonExtensions\\Microsoft\\TeamFoundation\\Team Explorer;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\MSBuild\\Current\\bin\\Roslyn;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\Tools\\devinit;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.20348.0\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\x64;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\\\MSBuild\\Current\\Bin;C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\IDE\\;C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\Tools\\;;C:\\Windows\\system32",
msvc_env_tmp = "C:\\Users\\ContainerAdministrator\\AppData\\Local\\Temp",
msvc_lib_path = "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/HostX64/x86/lib.exe",
msvc_link_path = "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/HostX64/x86/link.exe",
msvc_ml_path = "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/HostX64/x86/ml.exe",
target_libc = "msvcrt",
target_system_name = "local",
tool_paths = {
"ar": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/HostX64/x86/lib.exe",
"ml": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/HostX64/x86/ml.exe",
"cpp": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/HostX64/x86/cl.exe",
"gcc": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/HostX64/x86/cl.exe",
"gcov": "wrapper/bin/msvc_nop.bat",
"ld": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/HostX64/x86/link.exe",
"nm": "wrapper/bin/msvc_nop.bat",
"objcopy": "wrapper/bin/msvc_nop.bat",
"objdump": "wrapper/bin/msvc_nop.bat",
"strip": "wrapper/bin/msvc_nop.bat",
},
toolchain_identifier = "msvc_x64_x86",
)
toolchain(
name = "cc-toolchain-x64_x86_windows",
exec_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
],
target_compatible_with = [
"@platforms//cpu:x86_32",
"@platforms//os:windows",
],
toolchain = ":cc-compiler-x64_x86_windows",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
cc_toolchain(
name = "cc-compiler-x64_arm_windows",
all_files = ":empty",
ar_files = ":empty",
as_files = ":msvc_compiler_files",
compiler_files = ":msvc_compiler_files",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":msvc_x64_arm",
toolchain_identifier = "msvc_x64_arm",
)
cc_toolchain_config(
name = "msvc_x64_arm",
abi_libc_version = "local",
abi_version = "local",
archiver_flags = ["/MACHINE:ARM"],
compiler = "msvc-cl",
cpu = "x64_windows",
cxx_builtin_include_directories = [],
dbg_mode_debug_flag = "/DEBUG",
default_link_flags = ["/MACHINE:ARM"],
fastbuild_mode_debug_flag = "/DEBUG",
host_system_name = "local",
msvc_cl_path = "vc_installation_error_arm.bat",
msvc_env_include = "msvc_not_found",
msvc_env_lib = "msvc_not_found",
msvc_env_path = "msvc_not_found",
msvc_env_tmp = "msvc_not_found",
msvc_lib_path = "vc_installation_error_arm.bat",
msvc_link_path = "vc_installation_error_arm.bat",
msvc_ml_path = "vc_installation_error_arm.bat",
target_libc = "msvcrt",
target_system_name = "local",
tool_paths = {
"ar": "vc_installation_error_arm.bat",
"ml": "vc_installation_error_arm.bat",
"cpp": "vc_installation_error_arm.bat",
"gcc": "vc_installation_error_arm.bat",
"gcov": "wrapper/bin/msvc_nop.bat",
"ld": "vc_installation_error_arm.bat",
"nm": "wrapper/bin/msvc_nop.bat",
"objcopy": "wrapper/bin/msvc_nop.bat",
"objdump": "wrapper/bin/msvc_nop.bat",
"strip": "wrapper/bin/msvc_nop.bat",
},
toolchain_identifier = "msvc_x64_arm",
)
toolchain(
name = "cc-toolchain-x64_arm_windows",
exec_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
],
target_compatible_with = [
"@platforms//cpu:arm",
"@platforms//os:windows",
],
toolchain = ":cc-compiler-x64_arm_windows",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
cc_toolchain(
name = "cc-compiler-arm64_windows",
all_files = ":empty",
ar_files = ":empty",
as_files = ":msvc_compiler_files",
compiler_files = ":msvc_compiler_files",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":msvc_arm64",
toolchain_identifier = "msvc_arm64",
)
cc_toolchain_config(
name = "msvc_arm64",
abi_libc_version = "local",
abi_version = "local",
archiver_flags = ["/MACHINE:ARM64"],
compiler = "msvc-cl",
cpu = "x64_windows",
cxx_builtin_include_directories = [],
dbg_mode_debug_flag = "/DEBUG",
default_link_flags = ["/MACHINE:ARM64"],
fastbuild_mode_debug_flag = "/DEBUG",
host_system_name = "local",
msvc_cl_path = "vc_installation_error_arm64.bat",
msvc_env_include = "msvc_not_found",
msvc_env_lib = "msvc_not_found",
msvc_env_path = "msvc_not_found",
msvc_env_tmp = "msvc_not_found",
msvc_lib_path = "vc_installation_error_arm64.bat",
msvc_link_path = "vc_installation_error_arm64.bat",
msvc_ml_path = "vc_installation_error_arm64.bat",
target_libc = "msvcrt",
target_system_name = "local",
tool_paths = {
"ar": "vc_installation_error_arm64.bat",
"ml": "vc_installation_error_arm64.bat",
"cpp": "vc_installation_error_arm64.bat",
"gcc": "vc_installation_error_arm64.bat",
"gcov": "wrapper/bin/msvc_nop.bat",
"ld": "vc_installation_error_arm64.bat",
"nm": "wrapper/bin/msvc_nop.bat",
"objcopy": "wrapper/bin/msvc_nop.bat",
"objdump": "wrapper/bin/msvc_nop.bat",
"strip": "wrapper/bin/msvc_nop.bat",
},
toolchain_identifier = "msvc_arm64",
)
toolchain(
name = "cc-toolchain-arm64_windows",
exec_compatible_with = [
"@platforms//os:windows",
],
target_compatible_with = [
"@platforms//cpu:arm64",
"@platforms//os:windows",
],
toolchain = ":cc-compiler-arm64_windows",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
cc_toolchain(
name = "cc-compiler-x64_windows-clang-cl",
all_files = ":empty",
ar_files = ":empty",
as_files = ":clangcl_compiler_files",
compiler_files = ":clangcl_compiler_files",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":clang_cl_x64",
toolchain_identifier = "clang_cl_x64",
)
cc_toolchain_config(
name = "clang_cl_x64",
abi_libc_version = "local",
abi_version = "local",
archiver_flags = ["/MACHINE:X64"],
compiler = "clang-cl",
cpu = "x64_windows",
cxx_builtin_include_directories = [],
dbg_mode_debug_flag = "/DEBUG",
default_link_flags = [
"/MACHINE:X64",
"/DEFAULTLIB:clang_rt.builtins-x86_64.lib",
],
fastbuild_mode_debug_flag = "/DEBUG",
host_system_name = "local",
msvc_cl_path = "clang_installation_error.bat",
msvc_env_include = "clang_cl_not_found",
msvc_env_lib = "clang_cl_not_found",
msvc_env_path = "clang_cl_not_found",
msvc_env_tmp = "clang_cl_not_found",
msvc_lib_path = "clang_installation_error.bat",
msvc_link_path = "clang_installation_error.bat",
msvc_ml_path = "clang_installation_error.bat",
target_libc = "msvcrt",
target_system_name = "local",
tool_paths = {
"ar": "clang_installation_error.bat",
"ml": "clang_installation_error.bat",
"cpp": "clang_installation_error.bat",
"gcc": "clang_installation_error.bat",
"gcov": "wrapper/bin/msvc_nop.bat",
"ld": "clang_installation_error.bat",
"nm": "wrapper/bin/msvc_nop.bat",
"objcopy": "wrapper/bin/msvc_nop.bat",
"objdump": "wrapper/bin/msvc_nop.bat",
"strip": "wrapper/bin/msvc_nop.bat",
},
toolchain_identifier = "clang_cl_x64",
)
toolchain(
name = "cc-toolchain-x64_windows-clang-cl",
exec_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
"@bazel_tools//tools/cpp:clang-cl",
],
target_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
],
toolchain = ":cc-compiler-x64_windows-clang-cl",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
cc_toolchain(
name = "cc-compiler-arm64_windows-clang-cl",
all_files = ":empty",
ar_files = ":empty",
as_files = ":clangcl_compiler_files",
compiler_files = ":clangcl_compiler_files",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":clang_cl_arm64",
toolchain_identifier = "clang_cl_arm64",
)
cc_toolchain_config(
name = "clang_cl_arm64",
abi_libc_version = "local",
abi_version = "local",
archiver_flags = ["/MACHINE:ARM64"],
compiler = "clang-cl",
cpu = "arm64_windows",
cxx_builtin_include_directories = [],
dbg_mode_debug_flag = "/DEBUG",
default_link_flags = ["/MACHINE:ARM64"],
fastbuild_mode_debug_flag = "/DEBUG",
host_system_name = "local",
msvc_cl_path = "vc_installation_error_arm64.bat",
msvc_env_include = "clang_cl_not_found",
msvc_env_lib = "clang_cl_not_found",
msvc_env_path = "clang_cl_not_found",
msvc_env_tmp = "clang_cl_not_found",
msvc_lib_path = "vc_installation_error_arm64.bat",
msvc_link_path = "vc_installation_error_arm64.bat",
msvc_ml_path = "vc_installation_error_arm64.bat",
target_libc = "msvcrt",
target_system_name = "aarch64-pc-windows-msvc",
tool_paths = {
"ar": "vc_installation_error_arm64.bat",
"ml": "vc_installation_error_arm64.bat",
"cpp": "vc_installation_error_arm64.bat",
"gcc": "vc_installation_error_arm64.bat",
"gcov": "wrapper/bin/msvc_nop.bat",
"ld": "vc_installation_error_arm64.bat",
"nm": "wrapper/bin/msvc_nop.bat",
"objcopy": "wrapper/bin/msvc_nop.bat",
"objdump": "wrapper/bin/msvc_nop.bat",
"strip": "wrapper/bin/msvc_nop.bat",
},
toolchain_identifier = "clang_cl_arm64",
)
toolchain(
name = "cc-toolchain-arm64_windows-clang-cl",
exec_compatible_with = [
"@platforms//os:windows",
"@bazel_tools//tools/cpp:clang-cl",
],
target_compatible_with = [
"@platforms//cpu:arm64",
"@platforms//os:windows",
],
toolchain = ":cc-compiler-arm64_windows-clang-cl",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
cc_toolchain(
name = "cc-compiler-armeabi-v7a",
all_files = ":empty",
ar_files = ":empty",
as_files = ":empty",
compiler_files = ":empty",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":stub_armeabi-v7a",
toolchain_identifier = "stub_armeabi-v7a",
)
armeabi_cc_toolchain_config(name = "stub_armeabi-v7a")
toolchain(
name = "cc-toolchain-armeabi-v7a",
exec_compatible_with = [
],
target_compatible_with = [
"@platforms//cpu:armv7",
"@platforms//os:android",
],
toolchain = ":cc-compiler-armeabi-v7a",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
@@ -0,0 +1,83 @@
# Copyright 2019 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.
"""A Starlark cc_toolchain configuration rule"""
load(
"@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl",
"feature",
"tool_path",
)
load("@rules_cc//cc/common:cc_common.bzl", "cc_common")
def _impl(ctx):
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"
cc_target_os = None
builtin_sysroot = None
action_configs = []
supports_pic_feature = feature(name = "supports_pic", enabled = True)
supports_dynamic_linker_feature = feature(name = "supports_dynamic_linker", enabled = True)
features = [supports_dynamic_linker_feature, supports_pic_feature]
cxx_builtin_include_directories = []
artifact_name_patterns = []
make_variables = []
tool_paths = [
tool_path(name = "ar", 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 = "llvm-profdata", 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"),
]
return cc_common.create_cc_toolchain_config_info(
ctx = ctx,
features = features,
action_configs = action_configs,
artifact_name_patterns = artifact_name_patterns,
cxx_builtin_include_directories = cxx_builtin_include_directories,
toolchain_identifier = toolchain_identifier,
host_system_name = host_system_name,
target_system_name = target_system_name,
target_cpu = target_cpu,
target_libc = target_libc,
compiler = compiler,
abi_version = abi_version,
abi_libc_version = abi_libc_version,
tool_paths = tool_paths,
make_variables = make_variables,
builtin_sysroot = builtin_sysroot,
cc_target_os = cc_target_os,
)
armeabi_cc_toolchain_config = rule(
implementation = _impl,
attrs = {},
provides = [CcToolchainConfigInfo],
)
@@ -0,0 +1,6 @@
This file is generated by cc_configure and contains builtin include directories
that msvc reported. This file is a dependency of every compilation action and
changes to it will be reflected in the action cache key. When some of these
paths change, Bazel will make sure to rerun the action, even though none of
declared action inputs or the action commandline changes.
@@ -0,0 +1,2 @@
REPOSITORY TAG DIGEST IMAGE ID CREATED SIZE
gcr.io/tensorflow-testing/tf-win2019-docker-staging latest sha256:775f2889a35e7cc87f8e1dc83f3195acb4e709cebe3572cf3ae591ccef27e7e8 a41aae797393 21 minutes ago 15.9GB
File diff suppressed because it is too large Load Diff
+647
View File
@@ -0,0 +1,647 @@
# Copyright 2018 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.
# This becomes the BUILD file for @local_config_cc// under Windows.
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_toolchain", "cc_toolchain_suite")
load(":armeabi_cc_toolchain_config.bzl", "armeabi_cc_toolchain_config")
load(":windows_cc_toolchain_config.bzl", "cc_toolchain_config")
package(default_visibility = ["//visibility:public"])
cc_library(
name = "malloc",
)
filegroup(
name = "empty",
srcs = [],
)
filegroup(
name = "mingw_compiler_files",
srcs = [":builtin_include_directory_paths_mingw"],
)
filegroup(
name = "clangcl_compiler_files",
srcs = [":builtin_include_directory_paths_clangcl"],
)
filegroup(
name = "msvc_compiler_files",
srcs = [":builtin_include_directory_paths_msvc"],
)
# Hardcoded toolchain, legacy behaviour.
cc_toolchain_suite(
name = "toolchain",
toolchains = {
"armeabi-v7a|compiler": ":cc-compiler-armeabi-v7a",
"x64_windows|msvc-cl": ":cc-compiler-x64_windows",
"x64_x86_windows|msvc-cl": ":cc-compiler-x64_x86_windows",
"x64_arm_windows|msvc-cl": ":cc-compiler-x64_arm_windows",
"x64_arm64_windows|msvc-cl": ":cc-compiler-arm64_windows",
"arm64_windows|msvc-cl": ":cc-compiler-arm64_windows",
"x64_windows|msys-gcc": ":cc-compiler-x64_windows_msys",
"x64_windows|mingw-gcc": ":cc-compiler-x64_windows_mingw",
"x64_windows|clang-cl": ":cc-compiler-x64_windows-clang-cl",
"x64_windows_msys": ":cc-compiler-x64_windows_msys",
"x64_windows": ":cc-compiler-x64_windows",
"x64_x86_windows": ":cc-compiler-x64_x86_windows",
"x64_arm_windows": ":cc-compiler-x64_arm_windows",
"x64_arm64_windows": ":cc-compiler-arm64_windows",
"arm64_windows": ":cc-compiler-arm64_windows",
"x64_arm64_windows|clang-cl": ":cc-compiler-arm64_windows-clang-cl",
"arm64_windows|clang-cl": ":cc-compiler-arm64_windows-clang-cl",
"armeabi-v7a": ":cc-compiler-armeabi-v7a",
},
)
cc_toolchain(
name = "cc-compiler-x64_windows_msys",
all_files = ":empty",
ar_files = ":empty",
as_files = ":mingw_compiler_files",
compiler_files = ":mingw_compiler_files",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":msys_x64",
toolchain_identifier = "msys_x64",
)
cc_toolchain_config(
name = "msys_x64",
abi_libc_version = "local",
abi_version = "local",
compiler = "msys-gcc",
cpu = "x64_windows",
cxx_builtin_include_directories = [
"c:/tools/msys64/usr/",
],
dbg_mode_debug_flag = "/DEBUG:FULL",
fastbuild_mode_debug_flag = "/DEBUG:FASTLINK",
host_system_name = "local",
target_libc = "msys",
target_system_name = "local",
tool_bin_path = "c:/tools/msys64/usr/bin",
tool_paths = {
"ar": "c:/tools/msys64/usr/bin/ar",
"cpp": "c:/tools/msys64/usr/bin/cpp",
"dwp": "c:/tools/msys64/usr/bin/dwp",
"gcc": "c:/tools/msys64/usr/bin/gcc",
"gcov": "c:/tools/msys64/usr/bin/gcov",
"ld": "c:/tools/msys64/usr/bin/ld",
"nm": "c:/tools/msys64/usr/bin/nm",
"objcopy": "c:/tools/msys64/usr/bin/objcopy",
"objdump": "c:/tools/msys64/usr/bin/objdump",
"strip": "c:/tools/msys64/usr/bin/strip",
},
)
toolchain(
name = "cc-toolchain-x64_windows_msys",
exec_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
"@bazel_tools//tools/cpp:msys",
],
target_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
],
toolchain = ":cc-compiler-x64_windows_msys",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
cc_toolchain(
name = "cc-compiler-x64_windows_mingw",
all_files = ":empty",
ar_files = ":empty",
as_files = ":mingw_compiler_files",
compiler_files = ":mingw_compiler_files",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 0,
toolchain_config = ":msys_x64_mingw",
toolchain_identifier = "msys_x64_mingw",
)
cc_toolchain_config(
name = "msys_x64_mingw",
abi_libc_version = "local",
abi_version = "local",
compiler = "mingw-gcc",
cpu = "x64_windows",
cxx_builtin_include_directories = [
"c:/tools/msys64/mingw64/",
],
dbg_mode_debug_flag = "/DEBUG:FULL",
fastbuild_mode_debug_flag = "/DEBUG:FASTLINK",
host_system_name = "local",
target_libc = "mingw",
target_system_name = "local",
tool_bin_path = "c:/tools/msys64/mingw64/bin",
tool_paths = {
"ar": "c:/tools/msys64/mingw64/bin/ar",
"cpp": "c:/tools/msys64/mingw64/bin/cpp",
"dwp": "c:/tools/msys64/mingw64/bin/dwp",
"gcc": "c:/tools/msys64/mingw64/bin/gcc",
"gcov": "c:/tools/msys64/mingw64/bin/gcov",
"ld": "c:/tools/msys64/mingw64/bin/ld",
"nm": "c:/tools/msys64/mingw64/bin/nm",
"objcopy": "c:/tools/msys64/mingw64/bin/objcopy",
"objdump": "c:/tools/msys64/mingw64/bin/objdump",
"strip": "c:/tools/msys64/mingw64/bin/strip",
},
)
toolchain(
name = "cc-toolchain-x64_windows_mingw",
exec_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
"@bazel_tools//tools/cpp:mingw",
],
target_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
],
toolchain = ":cc-compiler-x64_windows_mingw",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
cc_toolchain(
name = "cc-compiler-x64_windows",
all_files = ":empty",
ar_files = ":empty",
as_files = ":msvc_compiler_files",
compiler_files = ":msvc_compiler_files",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":msvc_x64",
toolchain_identifier = "msvc_x64",
)
cc_toolchain_config(
name = "msvc_x64",
abi_libc_version = "local",
abi_version = "local",
archiver_flags = ["/MACHINE:X64"],
compiler = "msvc-cl",
cpu = "x64_windows",
cxx_builtin_include_directories = [
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\include",
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\VS\\include",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22621.0\\ucrt",
"C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\um",
"C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\shared",
"C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\winrt",
"C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\cppwinrt",
],
dbg_mode_debug_flag = "/DEBUG:FULL",
default_link_flags = ["/MACHINE:X64"],
fastbuild_mode_debug_flag = "/DEBUG:FASTLINK",
host_system_name = "local",
msvc_cl_path = "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/cl.exe",
msvc_env_include = "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\include;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\VS\\include;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22621.0\\ucrt;C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\um;C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\shared;C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\winrt;C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\cppwinrt",
msvc_env_lib = "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\lib\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.22621.0\\ucrt\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\\\lib\\10.0.22621.0\\\\um\\x64",
msvc_env_path = "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\bin\\HostX64\\x64;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\VC\\VCPackages;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\CommonExtensions\\Microsoft\\TeamFoundation\\Team Explorer;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\bin\\Roslyn;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.22621.0\\\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\\\x64;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\\\MSBuild\\Current\\Bin\\amd64;C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\Tools\\;;C:\\Windows\\system32;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\VC\\Linux\\bin\\ConnectionManagerExe",
msvc_env_tmp = "C:\\TMP",
msvc_lib_path = "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/lib.exe",
msvc_link_path = "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/link.exe",
msvc_ml_path = "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/ml64.exe",
supports_parse_showincludes = True,
target_libc = "msvcrt",
target_system_name = "local",
tool_paths = {
"ar": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/lib.exe",
"ml": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/ml64.exe",
"cpp": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/cl.exe",
"gcc": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/cl.exe",
"gcov": "wrapper/bin/msvc_nop.bat",
"ld": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x64/link.exe",
"nm": "wrapper/bin/msvc_nop.bat",
"objcopy": "wrapper/bin/msvc_nop.bat",
"objdump": "wrapper/bin/msvc_nop.bat",
"strip": "wrapper/bin/msvc_nop.bat",
},
toolchain_identifier = "msvc_x64",
)
toolchain(
name = "cc-toolchain-x64_windows",
exec_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
],
target_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
],
toolchain = ":cc-compiler-x64_windows",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
cc_toolchain(
name = "cc-compiler-x64_x86_windows",
all_files = ":empty",
ar_files = ":empty",
as_files = ":msvc_compiler_files",
compiler_files = ":msvc_compiler_files",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":msvc_x64_x86",
toolchain_identifier = "msvc_x64_x86",
)
cc_toolchain_config(
name = "msvc_x64_x86",
abi_libc_version = "local",
abi_version = "local",
archiver_flags = ["/MACHINE:X86"],
compiler = "msvc-cl",
cpu = "x64_windows",
cxx_builtin_include_directories = [
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\include",
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\VS\\include",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22621.0\\ucrt",
"C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\um",
"C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\shared",
"C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\winrt",
"C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\cppwinrt",
],
dbg_mode_debug_flag = "/DEBUG:FULL",
default_link_flags = ["/MACHINE:X86"],
fastbuild_mode_debug_flag = "/DEBUG:FASTLINK",
host_system_name = "local",
msvc_cl_path = "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x86/cl.exe",
msvc_env_include = "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\include;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\VS\\include;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22621.0\\ucrt;C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\um;C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\shared;C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\winrt;C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\cppwinrt",
msvc_env_lib = "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\lib\\x86;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.22621.0\\ucrt\\x86;C:\\Program Files (x86)\\Windows Kits\\10\\\\lib\\10.0.22621.0\\\\um\\x86",
msvc_env_path = "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\bin\\HostX64\\x86;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\bin\\HostX64\\x64;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\VC\\VCPackages;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\CommonExtensions\\Microsoft\\TeamFoundation\\Team Explorer;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\bin\\Roslyn;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.22621.0\\\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\\\x64;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\\\MSBuild\\Current\\Bin\\amd64;C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\Tools\\;;C:\\Windows\\system32;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\VC\\Linux\\bin\\ConnectionManagerExe",
msvc_env_tmp = "C:\\TMP",
msvc_lib_path = "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x86/lib.exe",
msvc_link_path = "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x86/link.exe",
msvc_ml_path = "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x86/ml.exe",
supports_parse_showincludes = True,
target_libc = "msvcrt",
target_system_name = "local",
tool_paths = {
"ar": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x86/lib.exe",
"ml": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x86/ml.exe",
"cpp": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x86/cl.exe",
"gcc": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x86/cl.exe",
"gcov": "wrapper/bin/msvc_nop.bat",
"ld": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/HostX64/x86/link.exe",
"nm": "wrapper/bin/msvc_nop.bat",
"objcopy": "wrapper/bin/msvc_nop.bat",
"objdump": "wrapper/bin/msvc_nop.bat",
"strip": "wrapper/bin/msvc_nop.bat",
},
toolchain_identifier = "msvc_x64_x86",
)
toolchain(
name = "cc-toolchain-x64_x86_windows",
exec_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
],
target_compatible_with = [
"@platforms//cpu:x86_32",
"@platforms//os:windows",
],
toolchain = ":cc-compiler-x64_x86_windows",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
cc_toolchain(
name = "cc-compiler-x64_arm_windows",
all_files = ":empty",
ar_files = ":empty",
as_files = ":msvc_compiler_files",
compiler_files = ":msvc_compiler_files",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":msvc_x64_arm",
toolchain_identifier = "msvc_x64_arm",
)
cc_toolchain_config(
name = "msvc_x64_arm",
abi_libc_version = "local",
abi_version = "local",
archiver_flags = ["/MACHINE:ARM"],
compiler = "msvc-cl",
cpu = "x64_windows",
cxx_builtin_include_directories = [],
dbg_mode_debug_flag = "/DEBUG",
default_link_flags = ["/MACHINE:ARM"],
fastbuild_mode_debug_flag = "/DEBUG",
host_system_name = "local",
msvc_cl_path = "vc_installation_error_arm.bat",
msvc_env_include = "msvc_not_found",
msvc_env_lib = "msvc_not_found",
msvc_env_path = "msvc_not_found",
msvc_env_tmp = "msvc_not_found",
msvc_lib_path = "vc_installation_error_arm.bat",
msvc_link_path = "vc_installation_error_arm.bat",
msvc_ml_path = "vc_installation_error_arm.bat",
supports_parse_showincludes = False,
target_libc = "msvcrt",
target_system_name = "local",
tool_paths = {
"ar": "vc_installation_error_arm.bat",
"ml": "vc_installation_error_arm.bat",
"cpp": "vc_installation_error_arm.bat",
"gcc": "vc_installation_error_arm.bat",
"gcov": "wrapper/bin/msvc_nop.bat",
"ld": "vc_installation_error_arm.bat",
"nm": "wrapper/bin/msvc_nop.bat",
"objcopy": "wrapper/bin/msvc_nop.bat",
"objdump": "wrapper/bin/msvc_nop.bat",
"strip": "wrapper/bin/msvc_nop.bat",
},
toolchain_identifier = "msvc_x64_arm",
)
toolchain(
name = "cc-toolchain-x64_arm_windows",
exec_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
],
target_compatible_with = [
"@platforms//cpu:arm",
"@platforms//os:windows",
],
toolchain = ":cc-compiler-x64_arm_windows",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
cc_toolchain(
name = "cc-compiler-arm64_windows",
all_files = ":empty",
ar_files = ":empty",
as_files = ":msvc_compiler_files",
compiler_files = ":msvc_compiler_files",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":msvc_arm64",
toolchain_identifier = "msvc_arm64",
)
cc_toolchain_config(
name = "msvc_arm64",
abi_libc_version = "local",
abi_version = "local",
archiver_flags = ["/MACHINE:ARM64"],
compiler = "msvc-cl",
cpu = "x64_windows",
cxx_builtin_include_directories = [],
dbg_mode_debug_flag = "/DEBUG",
default_link_flags = ["/MACHINE:ARM64"],
fastbuild_mode_debug_flag = "/DEBUG",
host_system_name = "local",
msvc_cl_path = "vc_installation_error_arm64.bat",
msvc_env_include = "msvc_not_found",
msvc_env_lib = "msvc_not_found",
msvc_env_path = "msvc_not_found",
msvc_env_tmp = "msvc_not_found",
msvc_lib_path = "vc_installation_error_arm64.bat",
msvc_link_path = "vc_installation_error_arm64.bat",
msvc_ml_path = "vc_installation_error_arm64.bat",
supports_parse_showincludes = False,
target_libc = "msvcrt",
target_system_name = "local",
tool_paths = {
"ar": "vc_installation_error_arm64.bat",
"ml": "vc_installation_error_arm64.bat",
"cpp": "vc_installation_error_arm64.bat",
"gcc": "vc_installation_error_arm64.bat",
"gcov": "wrapper/bin/msvc_nop.bat",
"ld": "vc_installation_error_arm64.bat",
"nm": "wrapper/bin/msvc_nop.bat",
"objcopy": "wrapper/bin/msvc_nop.bat",
"objdump": "wrapper/bin/msvc_nop.bat",
"strip": "wrapper/bin/msvc_nop.bat",
},
toolchain_identifier = "msvc_arm64",
)
toolchain(
name = "cc-toolchain-arm64_windows",
exec_compatible_with = [
"@platforms//os:windows",
],
target_compatible_with = [
"@platforms//cpu:arm64",
"@platforms//os:windows",
],
toolchain = ":cc-compiler-arm64_windows",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
cc_toolchain(
name = "cc-compiler-x64_windows-clang-cl",
all_files = ":empty",
ar_files = ":empty",
as_files = ":clangcl_compiler_files",
compiler_files = ":clangcl_compiler_files",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":clang_cl_x64",
toolchain_identifier = "clang_cl_x64",
)
cc_toolchain_config(
name = "clang_cl_x64",
abi_libc_version = "local",
abi_version = "local",
archiver_flags = ["/MACHINE:X64"],
compiler = "clang-cl",
cpu = "x64_windows",
cxx_builtin_include_directories = [
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\include",
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\VS\\include",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22621.0\\ucrt",
"C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\um",
"C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\shared",
"C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\winrt",
"C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\cppwinrt",
"C:\\tools\\LLVM\\lib\\clang\\18\\include",
],
dbg_mode_debug_flag = "/DEBUG",
default_link_flags = [
"/MACHINE:X64",
"/DEFAULTLIB:clang_rt.builtins-x86_64.lib",
],
fastbuild_mode_debug_flag = "/DEBUG",
host_system_name = "local",
msvc_cl_path = "C:/tools/LLVM/bin/clang-cl.exe",
msvc_env_include = "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\include;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\VS\\include;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22621.0\\ucrt;C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\um;C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\shared;C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\winrt;C:\\Program Files (x86)\\Windows Kits\\10\\\\include\\10.0.22621.0\\\\cppwinrt;C:\\tools\\LLVM\\lib\\clang\\18\\include",
msvc_env_lib = "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\lib\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.22621.0\\ucrt\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\\\lib\\10.0.22621.0\\\\um\\x64;C:\\tools\\LLVM\\lib\\clang\\18\\lib\\windows",
msvc_env_path = "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.42.34433\\bin\\HostX64\\x64;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\VC\\VCPackages;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\CommonExtensions\\Microsoft\\TeamFoundation\\Team Explorer;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\bin\\Roslyn;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.22621.0\\\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\\\x64;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\\\MSBuild\\Current\\Bin\\amd64;C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\Tools\\;;C:\\Windows\\system32;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\VC\\Linux\\bin\\ConnectionManagerExe",
msvc_env_tmp = "C:\\TMP",
msvc_lib_path = "C:/tools/LLVM/bin/llvm-lib.exe",
msvc_link_path = "C:/tools/LLVM/bin/lld-link.exe",
msvc_ml_path = "C:/tools/LLVM/bin/clang-cl.exe",
supports_parse_showincludes = True,
target_libc = "msvcrt",
target_system_name = "local",
tool_paths = {
"ar": "C:/tools/LLVM/bin/llvm-lib.exe",
"ml": "C:/tools/LLVM/bin/clang-cl.exe",
"cpp": "C:/tools/LLVM/bin/clang-cl.exe",
"gcc": "C:/tools/LLVM/bin/clang-cl.exe",
"gcov": "wrapper/bin/msvc_nop.bat",
"ld": "C:/tools/LLVM/bin/lld-link.exe",
"nm": "wrapper/bin/msvc_nop.bat",
"objcopy": "wrapper/bin/msvc_nop.bat",
"objdump": "wrapper/bin/msvc_nop.bat",
"strip": "wrapper/bin/msvc_nop.bat",
},
toolchain_identifier = "clang_cl_x64",
)
toolchain(
name = "cc-toolchain-x64_windows-clang-cl",
exec_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
"@bazel_tools//tools/cpp:clang-cl",
],
target_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
],
toolchain = ":cc-compiler-x64_windows-clang-cl",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
cc_toolchain(
name = "cc-compiler-arm64_windows-clang-cl",
all_files = ":empty",
ar_files = ":empty",
as_files = ":clangcl_compiler_files",
compiler_files = ":clangcl_compiler_files",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":clang_cl_arm64",
toolchain_identifier = "clang_cl_arm64",
)
cc_toolchain_config(
name = "clang_cl_arm64",
abi_libc_version = "local",
abi_version = "local",
archiver_flags = ["/MACHINE:ARM64"],
compiler = "clang-cl",
cpu = "arm64_windows",
cxx_builtin_include_directories = [],
dbg_mode_debug_flag = "/DEBUG",
default_link_flags = ["/MACHINE:ARM64"],
fastbuild_mode_debug_flag = "/DEBUG",
host_system_name = "local",
msvc_cl_path = "vc_installation_error_arm64.bat",
msvc_env_include = "clang_cl_not_found",
msvc_env_lib = "clang_cl_not_found",
msvc_env_path = "clang_cl_not_found",
msvc_env_tmp = "clang_cl_not_found",
msvc_lib_path = "vc_installation_error_arm64.bat",
msvc_link_path = "vc_installation_error_arm64.bat",
msvc_ml_path = "vc_installation_error_arm64.bat",
supports_parse_showincludes = False,
target_libc = "msvcrt",
target_system_name = "aarch64-pc-windows-msvc",
tool_paths = {
"ar": "vc_installation_error_arm64.bat",
"ml": "vc_installation_error_arm64.bat",
"cpp": "vc_installation_error_arm64.bat",
"gcc": "vc_installation_error_arm64.bat",
"gcov": "wrapper/bin/msvc_nop.bat",
"ld": "vc_installation_error_arm64.bat",
"nm": "wrapper/bin/msvc_nop.bat",
"objcopy": "wrapper/bin/msvc_nop.bat",
"objdump": "wrapper/bin/msvc_nop.bat",
"strip": "wrapper/bin/msvc_nop.bat",
},
toolchain_identifier = "clang_cl_arm64",
)
toolchain(
name = "cc-toolchain-arm64_windows-clang-cl",
exec_compatible_with = [
"@platforms//os:windows",
"@bazel_tools//tools/cpp:clang-cl",
],
target_compatible_with = [
"@platforms//cpu:arm64",
"@platforms//os:windows",
],
toolchain = ":cc-compiler-arm64_windows-clang-cl",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
cc_toolchain(
name = "cc-compiler-armeabi-v7a",
all_files = ":empty",
ar_files = ":empty",
as_files = ":empty",
compiler_files = ":empty",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":stub_armeabi-v7a",
toolchain_identifier = "stub_armeabi-v7a",
)
armeabi_cc_toolchain_config(name = "stub_armeabi-v7a")
toolchain(
name = "cc-toolchain-armeabi-v7a",
exec_compatible_with = [
],
target_compatible_with = [
"@platforms//cpu:armv7",
"@platforms//os:android",
],
toolchain = ":cc-compiler-armeabi-v7a",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
@@ -0,0 +1,83 @@
# Copyright 2019 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.
"""A Starlark cc_toolchain configuration rule"""
load(
"@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl",
"feature",
"tool_path",
)
load("@rules_cc//cc/common:cc_common.bzl", "cc_common")
def _impl(ctx):
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"
cc_target_os = None
builtin_sysroot = None
action_configs = []
supports_pic_feature = feature(name = "supports_pic", enabled = True)
supports_dynamic_linker_feature = feature(name = "supports_dynamic_linker", enabled = True)
features = [supports_dynamic_linker_feature, supports_pic_feature]
cxx_builtin_include_directories = []
artifact_name_patterns = []
make_variables = []
tool_paths = [
tool_path(name = "ar", 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 = "llvm-profdata", 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"),
]
return cc_common.create_cc_toolchain_config_info(
ctx = ctx,
features = features,
action_configs = action_configs,
artifact_name_patterns = artifact_name_patterns,
cxx_builtin_include_directories = cxx_builtin_include_directories,
toolchain_identifier = toolchain_identifier,
host_system_name = host_system_name,
target_system_name = target_system_name,
target_cpu = target_cpu,
target_libc = target_libc,
compiler = compiler,
abi_version = abi_version,
abi_libc_version = abi_libc_version,
tool_paths = tool_paths,
make_variables = make_variables,
builtin_sysroot = builtin_sysroot,
cc_target_os = cc_target_os,
)
armeabi_cc_toolchain_config = rule(
implementation = _impl,
attrs = {},
provides = [CcToolchainConfigInfo],
)
@@ -0,0 +1,7 @@
This file is generated by cc_configure and contains builtin include directories
that clang-cl reported. This file is a dependency of every compilation action and
changes to it will be reflected in the action cache key. When some of these
paths change, Bazel will make sure to rerun the action, even though none of
declared action inputs or the action commandline changes.
@@ -0,0 +1,7 @@
This file is generated by cc_configure and contains builtin include directories
that msvc reported. This file is a dependency of every compilation action and
changes to it will be reflected in the action cache key. When some of these
paths change, Bazel will make sure to rerun the action, even though none of
declared action inputs or the action commandline changes.
File diff suppressed because it is too large Load Diff
+649
View File
@@ -0,0 +1,649 @@
# Copyright 2026 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.
# This becomes the BUILD file for @local_config_cc// under Windows.
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_toolchain", "cc_toolchain_suite")
load(":armeabi_cc_toolchain_config.bzl", "armeabi_cc_toolchain_config")
load(":windows_cc_toolchain_config.bzl", "cc_toolchain_config")
package(default_visibility = ["//visibility:public"])
cc_library(
name = "malloc",
)
filegroup(
name = "empty",
srcs = [],
)
filegroup(
name = "mingw_compiler_files",
srcs = [":builtin_include_directory_paths_mingw"],
)
filegroup(
name = "clangcl_compiler_files",
srcs = [":builtin_include_directory_paths_clangcl"],
)
filegroup(
name = "msvc_compiler_files",
srcs = [":builtin_include_directory_paths_msvc"],
)
# Hardcoded toolchain, legacy behaviour.
cc_toolchain_suite(
name = "toolchain",
toolchains = {
"armeabi-v7a|compiler": ":cc-compiler-armeabi-v7a",
"x64_windows|msvc-cl": ":cc-compiler-x64_windows",
"x64_x86_windows|msvc-cl": ":cc-compiler-x64_x86_windows",
"x64_arm_windows|msvc-cl": ":cc-compiler-x64_arm_windows",
"x64_arm64_windows|msvc-cl": ":cc-compiler-arm64_windows",
"arm64_windows|msvc-cl": ":cc-compiler-arm64_windows",
"x64_windows|msys-gcc": ":cc-compiler-x64_windows_msys",
"x64_windows|mingw-gcc": ":cc-compiler-x64_windows_mingw",
"x64_windows|clang-cl": ":cc-compiler-x64_windows-clang-cl",
"x64_windows_msys": ":cc-compiler-x64_windows_msys",
"x64_windows": ":cc-compiler-x64_windows",
"x64_x86_windows": ":cc-compiler-x64_x86_windows",
"x64_arm_windows": ":cc-compiler-x64_arm_windows",
"x64_arm64_windows": ":cc-compiler-arm64_windows",
"arm64_windows": ":cc-compiler-arm64_windows",
"x64_arm64_windows|clang-cl": ":cc-compiler-arm64_windows-clang-cl",
"arm64_windows|clang-cl": ":cc-compiler-arm64_windows-clang-cl",
"armeabi-v7a": ":cc-compiler-armeabi-v7a",
},
)
cc_toolchain(
name = "cc-compiler-x64_windows_msys",
all_files = ":empty",
ar_files = ":empty",
as_files = ":mingw_compiler_files",
compiler_files = ":mingw_compiler_files",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":msys_x64",
toolchain_identifier = "msys_x64",
)
cc_toolchain_config(
name = "msys_x64",
abi_libc_version = "local",
abi_version = "local",
compiler = "msys-gcc",
cpu = "x64_windows",
cxx_builtin_include_directories = [
"c:/tools/msys64/usr/",
],
dbg_mode_debug_flag = "/DEBUG:FULL",
fastbuild_mode_debug_flag = "/DEBUG:FASTLINK",
host_system_name = "local",
target_libc = "msys",
target_system_name = "local",
tool_bin_path = "c:/tools/msys64/usr/bin",
tool_paths = {
"ar": "c:/tools/msys64/usr/bin/ar",
"cpp": "c:/tools/msys64/usr/bin/cpp",
"dwp": "c:/tools/msys64/usr/bin/dwp",
"gcc": "c:/tools/msys64/usr/bin/gcc",
"gcov": "c:/tools/msys64/usr/bin/gcov",
"ld": "c:/tools/msys64/usr/bin/ld",
"nm": "c:/tools/msys64/usr/bin/nm",
"objcopy": "c:/tools/msys64/usr/bin/objcopy",
"objdump": "c:/tools/msys64/usr/bin/objdump",
"strip": "c:/tools/msys64/usr/bin/strip",
},
)
toolchain(
name = "cc-toolchain-x64_windows_msys",
exec_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
"@bazel_tools//tools/cpp:msys",
],
target_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
],
toolchain = ":cc-compiler-x64_windows_msys",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
cc_toolchain(
name = "cc-compiler-x64_windows_mingw",
all_files = ":empty",
ar_files = ":empty",
as_files = ":mingw_compiler_files",
compiler_files = ":mingw_compiler_files",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 0,
toolchain_config = ":msys_x64_mingw",
toolchain_identifier = "msys_x64_mingw",
)
cc_toolchain_config(
name = "msys_x64_mingw",
abi_libc_version = "local",
abi_version = "local",
compiler = "mingw-gcc",
cpu = "x64_windows",
cxx_builtin_include_directories = [
"c:/tools/msys64/mingw64/",
],
dbg_mode_debug_flag = "/DEBUG:FULL",
fastbuild_mode_debug_flag = "/DEBUG:FASTLINK",
host_system_name = "local",
target_libc = "mingw",
target_system_name = "local",
tool_bin_path = "c:/tools/msys64/mingw64/bin",
tool_paths = {
"ar": "c:/tools/msys64/mingw64/bin/ar",
"cpp": "c:/tools/msys64/mingw64/bin/cpp",
"dwp": "c:/tools/msys64/mingw64/bin/dwp",
"gcc": "c:/tools/msys64/mingw64/bin/gcc",
"gcov": "c:/tools/msys64/mingw64/bin/gcov",
"ld": "c:/tools/msys64/mingw64/bin/ld",
"nm": "c:/tools/msys64/mingw64/bin/nm",
"objcopy": "c:/tools/msys64/mingw64/bin/objcopy",
"objdump": "c:/tools/msys64/mingw64/bin/objdump",
"strip": "c:/tools/msys64/mingw64/bin/strip",
},
)
toolchain(
name = "cc-toolchain-x64_windows_mingw",
exec_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
"@bazel_tools//tools/cpp:mingw",
],
target_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
],
toolchain = ":cc-compiler-x64_windows_mingw",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
cc_toolchain(
name = "cc-compiler-x64_windows",
all_files = ":empty",
ar_files = ":empty",
as_files = ":msvc_compiler_files",
compiler_files = ":msvc_compiler_files",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":msvc_x64",
toolchain_identifier = "msvc_x64",
)
# buildifier: disable=platform-specific-binaries
cc_toolchain_config(
name = "msvc_x64",
abi_libc_version = "local",
abi_version = "local",
archiver_flags = ["/MACHINE:X64"],
compiler = "msvc-cl",
cpu = "x64_windows",
cxx_builtin_include_directories = [
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.44.35207\\include",
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\VS\\include",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22621.0\\ucrt",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22621.0\\um",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22621.0\\shared",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22621.0\\winrt",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22621.0\\cppwinrt",
],
dbg_mode_debug_flag = "/DEBUG:FULL",
default_link_flags = ["/MACHINE:X64"],
fastbuild_mode_debug_flag = "/DEBUG:FASTLINK",
host_system_name = "local",
msvc_cl_path = "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.44.35207/bin/HostX64/x64/cl.exe",
msvc_env_include = "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.44.35207\\include;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\VS\\include;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22621.0\\ucrt;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22621.0\\um;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22621.0\\shared;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22621.0\\winrt;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22621.0\\cppwinrt",
msvc_env_lib = "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.44.35207\\lib\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.22621.0\\ucrt\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.22621.0\\um\\x64",
msvc_env_path = "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.44.35207\\bin\\HostX64\\x64;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\VC\\VCPackages;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\CommonExtensions\\Microsoft\\TeamFoundation\\Team Explorer;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\bin\\Roslyn;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.22621.0\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\x64;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin\\amd64;C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\Tools\\;;C:\\Windows\\system32;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\VC\\Linux\\bin\\ConnectionManagerExe",
msvc_env_tmp = "C:\\TMP",
msvc_lib_path = "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.44.35207/bin/HostX64/x64/lib.exe",
msvc_link_path = "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.44.35207/bin/HostX64/x64/link.exe",
msvc_ml_path = "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.44.35207/bin/HostX64/x64/ml64.exe",
supports_parse_showincludes = True,
target_libc = "msvcrt",
target_system_name = "local",
tool_paths = {
"ar": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.44.35207/bin/HostX64/x64/lib.exe",
"ml": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.44.35207/bin/HostX64/x64/ml64.exe",
"cpp": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.44.35207/bin/HostX64/x64/cl.exe",
"gcc": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.44.35207/bin/HostX64/x64/cl.exe",
"gcov": "wrapper/bin/msvc_nop.bat",
"ld": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.44.35207/bin/HostX64/x64/link.exe",
"nm": "wrapper/bin/msvc_nop.bat",
"objcopy": "wrapper/bin/msvc_nop.bat",
"objdump": "wrapper/bin/msvc_nop.bat",
"strip": "wrapper/bin/msvc_nop.bat",
},
toolchain_identifier = "msvc_x64",
)
toolchain(
name = "cc-toolchain-x64_windows",
exec_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
],
target_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
],
toolchain = ":cc-compiler-x64_windows",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
cc_toolchain(
name = "cc-compiler-x64_x86_windows",
all_files = ":empty",
ar_files = ":empty",
as_files = ":msvc_compiler_files",
compiler_files = ":msvc_compiler_files",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":msvc_x64_x86",
toolchain_identifier = "msvc_x64_x86",
)
cc_toolchain_config(
name = "msvc_x64_x86",
abi_libc_version = "local",
abi_version = "local",
archiver_flags = ["/MACHINE:X86"],
compiler = "msvc-cl",
cpu = "x64_windows",
cxx_builtin_include_directories = [
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.44.35207\\include",
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\VS\\include",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22621.0\\ucrt",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22621.0\\um",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22621.0\\shared",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22621.0\\winrt",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22621.0\\cppwinrt",
],
dbg_mode_debug_flag = "/DEBUG:FULL",
default_link_flags = ["/MACHINE:X86"],
fastbuild_mode_debug_flag = "/DEBUG:FASTLINK",
host_system_name = "local",
msvc_cl_path = "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.44.35207/bin/HostX64/x86/cl.exe",
msvc_env_include = "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.44.35207\\include;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\VS\\include;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22621.0\\ucrt;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22621.0\\um;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22621.0\\shared;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22621.0\\winrt;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22621.0\\cppwinrt",
msvc_env_lib = "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.44.35207\\lib\\x86;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.22621.0\\ucrt\\x86;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.22621.0\\um\\x86",
msvc_env_path = "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.44.35207\\bin\\HostX64\\x86;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.44.35207\\bin\\HostX64\\x64;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\VC\\VCPackages;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\CommonExtensions\\Microsoft\\TeamFoundation\\Team Explorer;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\bin\\Roslyn;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.22621.0\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\x64;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin\\amd64;C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\Tools\\;;C:\\Windows\\system32;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\VC\\Linux\\bin\\ConnectionManagerExe",
msvc_env_tmp = "C:\\TMP",
msvc_lib_path = "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.44.35207/bin/HostX64/x86/lib.exe",
msvc_link_path = "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.44.35207/bin/HostX64/x86/link.exe",
msvc_ml_path = "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.44.35207/bin/HostX64/x86/ml.exe",
supports_parse_showincludes = True,
target_libc = "msvcrt",
target_system_name = "local",
tool_paths = {
"ar": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.44.35207/bin/HostX64/x86/lib.exe",
"ml": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.44.35207/bin/HostX64/x86/ml.exe",
"cpp": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.44.35207/bin/HostX64/x86/cl.exe",
"gcc": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.44.35207/bin/HostX64/x86/cl.exe",
"gcov": "wrapper/bin/msvc_nop.bat",
"ld": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.44.35207/bin/HostX86/link.exe",
"nm": "wrapper/bin/msvc_nop.bat",
"objcopy": "wrapper/bin/msvc_nop.bat",
"objdump": "wrapper/bin/msvc_nop.bat",
"strip": "wrapper/bin/msvc_nop.bat",
},
toolchain_identifier = "msvc_x64_x86",
)
toolchain(
name = "cc-toolchain-x64_x86_windows",
exec_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
],
target_compatible_with = [
"@platforms//cpu:x86_32",
"@platforms//os:windows",
],
toolchain = ":cc-compiler-x64_x86_windows",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
cc_toolchain(
name = "cc-compiler-x64_arm_windows",
all_files = ":empty",
ar_files = ":empty",
as_files = ":msvc_compiler_files",
compiler_files = ":msvc_compiler_files",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":msvc_x64_arm",
toolchain_identifier = "msvc_x64_arm",
)
cc_toolchain_config(
name = "msvc_x64_arm",
abi_libc_version = "local",
abi_version = "local",
archiver_flags = ["/MACHINE:ARM"],
compiler = "msvc-cl",
cpu = "x64_windows",
cxx_builtin_include_directories = [],
dbg_mode_debug_flag = "/DEBUG",
default_link_flags = ["/MACHINE:ARM"],
fastbuild_mode_debug_flag = "/DEBUG",
host_system_name = "local",
msvc_cl_path = "vc_installation_error_arm.bat",
msvc_env_include = "msvc_not_found",
msvc_env_lib = "msvc_not_found",
msvc_env_path = "msvc_not_found",
msvc_env_tmp = "msvc_not_found",
msvc_lib_path = "vc_installation_error_arm.bat",
msvc_link_path = "vc_installation_error_arm.bat",
msvc_ml_path = "vc_installation_error_arm.bat",
supports_parse_showincludes = False,
target_libc = "msvcrt",
target_system_name = "local",
tool_paths = {
"ar": "vc_installation_error_arm.bat",
"ml": "vc_installation_error_arm.bat",
"cpp": "vc_installation_error_arm.bat",
"gcc": "vc_installation_error_arm.bat",
"gcov": "wrapper/bin/msvc_nop.bat",
"ld": "vc_installation_error_arm.bat",
"nm": "wrapper/bin/msvc_nop.bat",
"objcopy": "wrapper/bin/msvc_nop.bat",
"objdump": "wrapper/bin/msvc_nop.bat",
"strip": "wrapper/bin/msvc_nop.bat",
},
toolchain_identifier = "msvc_x64_arm",
)
toolchain(
name = "cc-toolchain-x64_arm_windows",
exec_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
],
target_compatible_with = [
"@platforms//cpu:arm",
"@platforms//os:windows",
],
toolchain = ":cc-compiler-x64_arm_windows",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
cc_toolchain(
name = "cc-compiler-arm64_windows",
all_files = ":empty",
ar_files = ":empty",
as_files = ":msvc_compiler_files",
compiler_files = ":msvc_compiler_files",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":msvc_arm64",
toolchain_identifier = "msvc_arm64",
)
cc_toolchain_config(
name = "msvc_arm64",
abi_libc_version = "local",
abi_version = "local",
archiver_flags = ["/MACHINE:ARM64"],
compiler = "msvc-cl",
cpu = "x64_windows",
cxx_builtin_include_directories = [],
dbg_mode_debug_flag = "/DEBUG",
default_link_flags = ["/MACHINE:ARM64"],
fastbuild_mode_debug_flag = "/DEBUG",
host_system_name = "local",
msvc_cl_path = "vc_installation_error_arm64.bat",
msvc_env_include = "msvc_not_found",
msvc_env_lib = "msvc_not_found",
msvc_env_path = "msvc_not_found",
msvc_env_tmp = "msvc_not_found",
msvc_lib_path = "vc_installation_error_arm64.bat",
msvc_link_path = "vc_installation_error_arm64.bat",
msvc_ml_path = "vc_installation_error_arm64.bat",
supports_parse_showincludes = False,
target_libc = "msvcrt",
target_system_name = "local",
tool_paths = {
"ar": "vc_installation_error_arm64.bat",
"ml": "vc_installation_error_arm64.bat",
"cpp": "vc_installation_error_arm64.bat",
"gcc": "vc_installation_error_arm64.bat",
"gcov": "wrapper/bin/msvc_nop.bat",
"ld": "vc_installation_error_arm64.bat",
"nm": "wrapper/bin/msvc_nop.bat",
"objcopy": "wrapper/bin/msvc_nop.bat",
"objdump": "wrapper/bin/msvc_nop.bat",
"strip": "wrapper/bin/msvc_nop.bat",
},
toolchain_identifier = "msvc_arm64",
)
toolchain(
name = "cc-toolchain-arm64_windows",
exec_compatible_with = [
"@platforms//os:windows",
],
target_compatible_with = [
"@platforms//cpu:arm64",
"@platforms//os:windows",
],
toolchain = ":cc-compiler-arm64_windows",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
cc_toolchain(
name = "cc-compiler-x64_windows-clang-cl",
all_files = ":empty",
ar_files = ":empty",
as_files = ":clangcl_compiler_files",
compiler_files = ":clangcl_compiler_files",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":clang_cl_x64",
toolchain_identifier = "clang_cl_x64",
)
# buildifier: disable=platform-specific-binaries
cc_toolchain_config(
name = "clang_cl_x64",
abi_libc_version = "local",
abi_version = "local",
archiver_flags = ["/MACHINE:X64"],
compiler = "clang-cl",
cpu = "x64_windows",
cxx_builtin_include_directories = [
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.44.35207\\include",
"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\VS\\include",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22621.0\\ucrt",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22621.0\\um",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22621.0\\shared",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22621.0\\winrt",
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22621.0\\cppwinrt",
"C:\\tools\\LLVM\\lib\\clang\\18\\include",
],
dbg_mode_debug_flag = "/DEBUG",
default_link_flags = [
"/MACHINE:X64",
"/DEFAULTLIB:clang_rt.builtins-x86_64.lib",
],
fastbuild_mode_debug_flag = "/DEBUG",
host_system_name = "local",
msvc_cl_path = "C:/tools/LLVM/bin/clang-cl.exe",
msvc_env_include = "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.44.35207\\include;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\VS\\include;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22621.0\\ucrt;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22621.0\\um;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22621.0\\shared;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22621.0\\winrt;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.22621.0\\cppwinrt;C:\\tools\\LLVM\\lib\\clang\\18\\include",
msvc_env_lib = "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.44.35207\\lib\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.22621.0\\ucrt\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.22621.0\\um\\x64;C:\\tools\\LLVM\\lib\\clang\\18\\lib\\windows",
msvc_env_path = "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.44.35207\\bin\\HostX64\\x64;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\VC\\VCPackages;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\CommonExtensions\\Microsoft\\TeamFoundation\\Team Explorer;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\bin\\Roslyn;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.22621.0\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\x64;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\MSBuild\\Current\\Bin\\amd64;C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\Tools\\;;C:\\Windows\\system32;C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\VC\\Linux\\bin\\ConnectionManagerExe",
msvc_env_tmp = "C:\\TMP",
msvc_lib_path = "C:/tools/LLVM/bin/llvm-lib.exe",
msvc_link_path = "C:/tools/LLVM/bin/lld-link.exe",
msvc_ml_path = "C:/tools/LLVM/bin/clang-cl.exe",
supports_parse_showincludes = True,
target_libc = "msvcrt",
target_system_name = "local",
tool_paths = {
"ar": "C:/tools/LLVM/bin/llvm-lib.exe",
"ml": "C:/tools/LLVM/bin/clang-cl.exe",
"cpp": "C:/tools/LLVM/bin/clang-cl.exe",
"gcc": "C:/tools/LLVM/bin/clang-cl.exe",
"gcov": "wrapper/bin/msvc_nop.bat",
"ld": "C:/tools/LLVM/bin/lld-link.exe",
"nm": "wrapper/bin/msvc_nop.bat",
"objcopy": "wrapper/bin/msvc_nop.bat",
"objdump": "wrapper/bin/msvc_nop.bat",
"strip": "wrapper/bin/msvc_nop.bat",
},
toolchain_identifier = "clang_cl_x64",
)
toolchain(
name = "cc-toolchain-x64_windows-clang-cl",
exec_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
"@bazel_tools//tools/cpp:clang-cl",
],
target_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
],
toolchain = ":cc-compiler-x64_windows-clang-cl",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
cc_toolchain(
name = "cc-compiler-arm64_windows-clang-cl",
all_files = ":empty",
ar_files = ":empty",
as_files = ":clangcl_compiler_files",
compiler_files = ":clangcl_compiler_files",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":clang_cl_arm64",
toolchain_identifier = "clang_cl_arm64",
)
cc_toolchain_config(
name = "clang_cl_arm64",
abi_libc_version = "local",
abi_version = "local",
archiver_flags = ["/MACHINE:ARM64"],
compiler = "clang-cl",
cpu = "arm64_windows",
cxx_builtin_include_directories = [],
dbg_mode_debug_flag = "/DEBUG",
default_link_flags = ["/MACHINE:ARM64"],
fastbuild_mode_debug_flag = "/DEBUG",
host_system_name = "local",
msvc_cl_path = "vc_installation_error_arm64.bat",
msvc_env_include = "clang_cl_not_found",
msvc_env_lib = "clang_cl_not_found",
msvc_env_path = "clang_cl_not_found",
msvc_env_tmp = "clang_cl_not_found",
msvc_lib_path = "vc_installation_error_arm64.bat",
msvc_link_path = "vc_installation_error_arm64.bat",
msvc_ml_path = "vc_installation_error_arm64.bat",
supports_parse_showincludes = False,
target_libc = "msvcrt",
target_system_name = "aarch64-pc-windows-msvc",
tool_paths = {
"ar": "vc_installation_error_arm64.bat",
"ml": "vc_installation_error_arm64.bat",
"cpp": "vc_installation_error_arm64.bat",
"gcc": "vc_installation_error_arm64.bat",
"gcov": "wrapper/bin/msvc_nop.bat",
"ld": "vc_installation_error_arm64.bat",
"nm": "wrapper/bin/msvc_nop.bat",
"objcopy": "wrapper/bin/msvc_nop.bat",
"objdump": "wrapper/bin/msvc_nop.bat",
"strip": "wrapper/bin/msvc_nop.bat",
},
toolchain_identifier = "clang_cl_arm64",
)
toolchain(
name = "cc-toolchain-arm64_windows-clang-cl",
exec_compatible_with = [
"@platforms//os:windows",
"@bazel_tools//tools/cpp:clang-cl",
],
target_compatible_with = [
"@platforms//cpu:arm64",
"@platforms//os:windows",
],
toolchain = ":cc-compiler-arm64_windows-clang-cl",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
cc_toolchain(
name = "cc-compiler-armeabi-v7a",
all_files = ":empty",
ar_files = ":empty",
as_files = ":empty",
compiler_files = ":empty",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":stub_armeabi-v7a",
toolchain_identifier = "stub_armeabi-v7a",
)
armeabi_cc_toolchain_config(name = "stub_armeabi-v7a")
toolchain(
name = "cc-toolchain-armeabi-v7a",
exec_compatible_with = [
],
target_compatible_with = [
"@platforms//cpu:armv7",
"@platforms//os:android",
],
toolchain = ":cc-compiler-armeabi-v7a",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
@@ -0,0 +1,83 @@
# Copyright 2026 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.
"""A Starlark cc_toolchain configuration rule"""
load(
"@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl",
"feature",
"tool_path",
)
load("@rules_cc//cc/common:cc_common.bzl", "cc_common")
def _impl(ctx):
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"
cc_target_os = None
builtin_sysroot = None
action_configs = []
supports_pic_feature = feature(name = "supports_pic", enabled = True)
supports_dynamic_linker_feature = feature(name = "supports_dynamic_linker", enabled = True)
features = [supports_dynamic_linker_feature, supports_pic_feature]
cxx_builtin_include_directories = []
artifact_name_patterns = []
make_variables = []
tool_paths = [
tool_path(name = "ar", 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 = "llvm-profdata", 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"),
]
return cc_common.create_cc_toolchain_config_info(
ctx = ctx,
features = features,
action_configs = action_configs,
artifact_name_patterns = artifact_name_patterns,
cxx_builtin_include_directories = cxx_builtin_include_directories,
toolchain_identifier = toolchain_identifier,
host_system_name = host_system_name,
target_system_name = target_system_name,
target_cpu = target_cpu,
target_libc = target_libc,
compiler = compiler,
abi_version = abi_version,
abi_libc_version = abi_libc_version,
tool_paths = tool_paths,
make_variables = make_variables,
builtin_sysroot = builtin_sysroot,
cc_target_os = cc_target_os,
)
armeabi_cc_toolchain_config = rule(
implementation = _impl,
attrs = {},
provides = [CcToolchainConfigInfo],
)
@@ -0,0 +1,7 @@
This file is generated by cc_configure and contains builtin include directories
that clang-cl reported. This file is a dependency of every compilation action and
changes to it will be reflected in the action cache key. When some of these
paths change, Bazel will make sure to rerun the action, even though none of
declared action inputs or the action commandline changes.
@@ -0,0 +1,7 @@
This file is generated by cc_configure and contains builtin include directories
that msvc reported. This file is a dependency of every compilation action and
changes to it will be reflected in the action cache key. When some of these
paths change, Bazel will make sure to rerun the action, even though none of
declared action inputs or the action commandline changes.
File diff suppressed because it is too large Load Diff
+60
View File
@@ -0,0 +1,60 @@
licenses(["restricted"])
package(default_visibility = ["//visibility:public"])
java_runtime(
name = "windows_jdk8",
srcs = [],
java_home = "C:/openjdk",
)
# Register a Windows 2022 (Clang) platform.
platform(
name = "windows_ltsc2022_clang",
constraint_values = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
"@bazel_tools//tools/cpp:clang-cl",
],
exec_properties = {
"container-image": "docker://gcr.io/tensorflow-testing/tf-win2022@sha256:915cb093630432c38b028f56bd31116a5559ebbc688d427b6092d86828ae03bc",
"OSFamily": "Windows",
"Pool": "win2022",
"dockerNetwork": "off",
"cache-silo-key": "20251105-1762360217",
},
)
# TODO(b/457398048): Deprecate the above platform once this one is working.
platform(
name = "windows_ltsc2022_clang_new",
constraint_values = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
"@bazel_tools//tools/cpp:clang-cl",
],
exec_properties = {
"container-image": "docker://gcr.io/tensorflow-testing/tf-win2022@sha256:915cb093630432c38b028f56bd31116a5559ebbc688d427b6092d86828ae03bc",
"OSFamily": "Windows",
"Pool": "windows-2022-pool",
"dockerNetwork": "off",
"cache-silo-key": "20251105-1762360217",
},
)
# RBE platform for ML Actions.
platform(
name = "windows_ltsc2022_clang_ml_actions",
constraint_values = [
"@platforms//cpu:x86_64",
"@platforms//os:windows",
"@bazel_tools//tools/cpp:clang-cl",
],
exec_properties = {
"container-image": "docker://us-docker.pkg.dev/ml-oss-artifacts-published/ml-public-container/ml-build-windows@sha256:023fa901fda70be8890b05689d0a667287692c1f59d0abe4add7208ec5a12707",
"OSFamily": "Windows",
"Pool": "windows-2022-pool",
"dockerNetwork": "off",
"cache-silo-key": "20260115",
},
)
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long