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
@@ -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("//tensorflow/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",
)