Fix //... for darwin (#9273)

* Fixes

* More manual tags

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
This commit is contained in:
Preston Van Loon
2021-07-23 13:26:49 -05:00
committed by GitHub
parent 30e93f5763
commit 938a038c42
56 changed files with 57 additions and 9882 deletions

View File

@@ -8,6 +8,7 @@ load("//tools:build_settings.bzl", "base_image")
sh_binary(
name = "fuzz_wrapper",
srcs = ["fuzz_wrapper.sh"],
tags = ["manual"],
)
################################################################################
@@ -18,6 +19,7 @@ sh_binary(
passwd_entry(
name = "root_user",
gid = 0,
tags = ["manual"],
uid = 0,
username = "root",
)
@@ -25,6 +27,7 @@ passwd_entry(
passwd_entry(
name = "nonroot_user",
info = "nonroot",
tags = ["manual"],
uid = 1001,
username = "nonroot",
)
@@ -35,6 +38,7 @@ passwd_file(
":root_user",
":nonroot_user",
],
tags = ["manual"],
)
# Create a tar file containing the created passwd file
@@ -43,12 +47,14 @@ pkg_tar(
srcs = [":passwd"],
mode = "0o644",
package_dir = "etc",
tags = ["manual"],
)
# Include it in our base image as a tar.
container_image(
name = "cc_image",
base = CC_DEFAULT_BASE,
tags = ["manual"],
tars = [":passwd_tar"],
user = "root",
visibility = ["//visibility:public"],
@@ -57,6 +63,7 @@ container_image(
container_image(
name = "go_image",
base = GO_DEFAULT_BASE,
tags = ["manual"],
tars = [":passwd_tar"],
user = "root",
visibility = ["//visibility:public"],
@@ -65,6 +72,7 @@ container_image(
base_image(
name = "base_image",
build_setting_default = "cc_image",
tags = ["manual"],
)
config_setting(
@@ -80,6 +88,7 @@ config_setting(
container_image(
name = "alpine_cc_image",
base = "@alpine_cc_linux_amd64//image",
tags = ["manual"],
tars = [":passwd_tar"],
user = "root",
visibility = ["//visibility:public"],

View File

@@ -4,7 +4,6 @@ load(":cc_toolchain_config_osx.bzl", "osx_cc_toolchain_config")
load(":cc_toolchain_config_linux_arm64.bzl", "arm64_cc_toolchain_config")
load(":cc_toolchain_config_windows.bzl", "windows_cc_toolchain_config")
cc_toolchain_suite(
name = "multiarch_toolchain",
toolchains = {
@@ -15,6 +14,7 @@ cc_toolchain_suite(
"aarch64": ":cc-clang-arm64",
"k8|mingw-w64": ":cc-mingw-amd64",
},
tags = ["manual"],
)
cc_toolchain_suite(
@@ -22,11 +22,13 @@ cc_toolchain_suite(
toolchains = {
"k8": "cc-clang-amd64",
},
tags = ["manual"],
)
filegroup(
name = "empty",
srcs = [],
tags = ["manual"],
)
config_setting(
@@ -35,6 +37,7 @@ config_setting(
"@platforms//os:osx",
"@platforms//cpu:x86_64",
],
tags = ["manual"],
)
config_setting(
@@ -43,6 +46,7 @@ config_setting(
"@platforms//os:linux",
"@platforms//cpu:aarch64",
],
tags = ["manual"],
)
config_setting(
@@ -51,6 +55,7 @@ config_setting(
"@platforms//os:linux",
"@platforms//cpu:x86_64",
],
tags = ["manual"],
)
config_setting(
@@ -59,26 +64,31 @@ config_setting(
"@platforms//os:windows",
"@platforms//cpu:x86_64",
],
tags = ["manual"],
)
arm64_cc_toolchain_config(
name = "local-arm64",
target = "aarch64-linux-gnu",
tags = ["manual"],
)
arm64_cc_toolchain_config(
name = "local-amd64",
target = "x86_64-unknown-linux-gnu",
tags = ["manual"],
)
osx_cc_toolchain_config(
name = "local-osxcross",
target = "darwin_x86_64",
tags = ["manual"],
)
windows_cc_toolchain_config(
name = "local-windows",
target = "x86_64-w64",
tags = ["manual"],
)
cc_toolchain(
@@ -93,6 +103,7 @@ cc_toolchain(
strip_files = ":empty",
supports_param_files = 0,
toolchain_config = ":local-windows",
tags = ["manual"],
)
cc_toolchain(
@@ -105,6 +116,7 @@ cc_toolchain(
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":local-arm64",
tags = ["manual"],
)
cc_toolchain(
@@ -117,6 +129,7 @@ cc_toolchain(
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":local-osxcross",
tags = ["manual"],
)
cc_toolchain(
@@ -129,6 +142,7 @@ cc_toolchain(
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":local-amd64",
tags = ["manual"],
)
toolchain(
@@ -145,4 +159,5 @@ toolchain(
":windows_amd64": ":cc-mingw-amd64",
}),
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
tags = ["manual"],
)

View File

@@ -1,166 +0,0 @@
# Copyright 2016 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This becomes the BUILD file for @local_config_cc// under non-FreeBSD unixes.
package(default_visibility = ["//visibility:public"])
load(":cc_toolchain_config.bzl", "cc_toolchain_config")
load(":armeabi_cc_toolchain_config.bzl", "armeabi_cc_toolchain_config")
load("@rules_cc//cc:defs.bzl", "cc_toolchain", "cc_toolchain_suite")
licenses(["notice"]) # Apache 2.0
cc_library(
name = "malloc",
)
filegroup(
name = "empty",
srcs = [],
)
filegroup(
name = "cc_wrapper",
srcs = ["cc_wrapper.sh"],
)
filegroup(
name = "compiler_deps",
srcs = glob(
["extra_tools/**"],
allow_empty = True,
) + [":builtin_include_directory_paths"],
)
# This is the entry point for --crosstool_top. Toolchains are found
# by lopping off the name of --crosstool_top and searching for
# the "${CPU}" entry in the toolchains attribute.
cc_toolchain_suite(
name = "toolchain",
toolchains = {
"k8|clang": ":cc-compiler-k8",
"k8": ":cc-compiler-k8",
"armeabi-v7a|compiler": ":cc-compiler-armeabi-v7a",
"armeabi-v7a": ":cc-compiler-armeabi-v7a",
},
)
cc_toolchain(
name = "cc-compiler-k8",
all_files = ":compiler_deps",
ar_files = ":compiler_deps",
as_files = ":compiler_deps",
compiler_files = ":compiler_deps",
dwp_files = ":empty",
linker_files = ":compiler_deps",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":local",
toolchain_identifier = "local",
)
cc_toolchain_config(
name = "local",
abi_libc_version = "local",
abi_version = "local",
compile_flags = [
"-U_FORTIFY_SOURCE",
"-fstack-protector",
"-Wall",
"-Wthread-safety",
"-Wself-assign",
"-fcolor-diagnostics",
"-fno-omit-frame-pointer",
],
compiler = "clang",
coverage_compile_flags = [
"-fprofile-instr-generate",
"-fcoverage-mapping",
],
coverage_link_flags = ["-fprofile-instr-generate"],
cpu = "k8",
cxx_builtin_include_directories = [
"/usr/local/include",
"/usr/lib/clang/10.0.0/include",
"/usr/include/x86_64-linux-gnu",
"/usr/include",
"/usr/include/c++/8",
"/usr/include/x86_64-linux-gnu/c++/8",
"/usr/include/c++/8/backward",
],
cxx_flags = ["-std=c++0x"],
dbg_compile_flags = ["-g"],
host_system_name = "local",
link_flags = [
"-fuse-ld=/usr/bin/ld.gold",
"-Wl,-no-as-needed",
"-Wl,-z,relro,-z,now",
"-B/usr/bin",
"-lm",
"-static-libgcc",
],
link_libs = ["-l:libstdc++.a"],
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 = "local",
target_system_name = "local",
tool_paths = {
"ar": "/usr/bin/ar",
"ld": "/usr/bin/ld",
"cpp": "/usr/bin/cpp",
"gcc": "/usr/bin/clang",
"dwp": "/usr/bin/dwp",
"gcov": "/usr/bin/llvm-profdata",
"nm": "/usr/bin/nm",
"objcopy": "/usr/bin/objcopy",
"objdump": "/usr/bin/objdump",
"strip": "/usr/bin/strip",
},
toolchain_identifier = "local",
unfiltered_compile_flags = [
"-no-canonical-prefixes",
"-Wno-builtin-macro-redefined",
"-D__DATE__=\"redacted\"",
"-D__TIMESTAMP__=\"redacted\"",
"-D__TIME__=\"redacted\"",
],
)
# Android tooling requires a default toolchain for the armeabi-v7a cpu.
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")

View File

@@ -1,82 +0,0 @@
# 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",
)
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],
)

View File

@@ -1,13 +0,0 @@
This file is generated by cc_configure and contains builtin include directories
that /usr/bin/clang 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.
/usr/local/include
/usr/lib/clang/10.0.0/include
/usr/include/x86_64-linux-gnu
/usr/include
/usr/include/c++/8
/usr/include/x86_64-linux-gnu/c++/8
/usr/include/c++/8/backward

View File

@@ -1,25 +0,0 @@
#!/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.
#
# Ship the environment to the C++ action
#
set -eu
# Set-up the environment
# Call the C++ compiler
/usr/bin/clang "$@"

View File

@@ -1,47 +0,0 @@
# Copyright 2016 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This file is auto-generated by an rbe_autoconfig repository rule
# and should not be modified directly.
# See @bazel_toolchains//rules:rbe_repo.bzl
package(default_visibility = ["//visibility:public"])
toolchain(
name = "cc-toolchain",
exec_compatible_with = [
"@bazel_tools//platforms:x86_64",
"@bazel_tools//platforms:linux",
"@bazel_tools//tools/cpp:clang",
],
target_compatible_with = [
"@bazel_tools//platforms:linux",
"@bazel_tools//platforms:x86_64",
],
toolchain = "//tools/cross-toolchain/configs/clang/bazel_2.1.1/cc:cc-compiler-k8",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
platform(
name = "platform",
constraint_values = [
"@bazel_tools//platforms:x86_64",
"@bazel_tools//platforms:linux",
"@bazel_tools//tools/cpp:clang",
],
exec_properties = {
"container-image": "docker://gcr.io/prysmaticlabs/rbe-worker@sha256:d7407d58cee310e7ab788bf4256bba704344630621d8507f3c9cf253c7fc664f",
"OSFamily": "Linux",
},
)

View File

@@ -1,25 +0,0 @@
# Copyright 2016 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This file is auto-generated by an rbe_autoconfig repository rule
# and should not be modified directly.
# See @bazel_toolchains//rules:rbe_repo.bzl
package(default_visibility = ["//visibility:public"])
java_runtime(
name = "jdk",
srcs = [],
java_home = "/usr/lib/jvm/java-8-openjdk-amd64",
)

View File

@@ -1,147 +0,0 @@
package(default_visibility = ["//visibility:public"])
load(":cc_toolchain_config_osx.bzl", "osx_cc_toolchain_config")
load(":cc_toolchain_config_linux_arm64.bzl", "arm64_cc_toolchain_config")
load(":cc_toolchain_config_windows.bzl", "windows_cc_toolchain_config")
cc_toolchain_suite(
name = "multiarch_toolchain",
toolchains = {
"k8|osxcross": ":cc-clang-osx",
"k8|clang": "cc-clang-amd64",
"aarch64|clang": ":cc-clang-arm64",
"k8": "cc-clang-amd64",
"aarch64": ":cc-clang-arm64",
"k8|mingw-w64": ":cc-mingw-amd64",
},
)
cc_toolchain_suite(
name = "hostonly_toolchain",
toolchains = {
"k8": "cc-clang-amd64",
},
)
filegroup(
name = "empty",
srcs = [],
)
config_setting(
name = "osx_amd64",
constraint_values = [
"@platforms//os:osx",
"@platforms//cpu:x86_64",
],
)
config_setting(
name = "linux_arm64",
constraint_values = [
"@platforms//os:linux",
"@platforms//cpu:aarch64",
],
)
config_setting(
name = "linux_amd64",
constraint_values = [
"@platforms//os:linux",
"@platforms//cpu:x86_64",
],
)
config_setting(
name = "windows_amd64",
constraint_values = [
"@platforms//os:windows",
"@platforms//cpu:x86_64",
],
)
arm64_cc_toolchain_config(
name = "local-arm64",
target = "aarch64-linux-gnu",
)
arm64_cc_toolchain_config(
name = "local-amd64",
target = "x86_64-unknown-linux-gnu",
)
osx_cc_toolchain_config(
name = "local-osxcross",
target = "darwin_x86_64",
)
windows_cc_toolchain_config(
name = "local-windows",
target = "x86_64-w64",
)
cc_toolchain(
name = "cc-mingw-amd64",
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 = ":local-windows",
)
cc_toolchain(
name = "cc-clang-arm64",
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-arm64",
)
cc_toolchain(
name = "cc-clang-osx",
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-osxcross",
)
cc_toolchain(
name = "cc-clang-amd64",
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-amd64",
)
toolchain(
name = "cc-toolchain-multiarch",
exec_compatible_with = [
"@platforms//os:linux",
"@platforms//cpu:x86_64",
],
target_compatible_with = [],
toolchain = select({
":linux_arm64": ":cc-clang-arm64",
":linux_amd64": ":cc-clang-amd64",
":osx_amd64": ":cc-clang-osx",
":windows_amd64": ":cc-mingw-amd64",
}),
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)

View File

@@ -1,2 +0,0 @@
# DO NOT EDIT: automatically generated WORKSPACE file for prysm_toolchains rule
workspace(name = "prysm_toolchains")

View File

@@ -1,304 +0,0 @@
load(
"@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl",
"action_config",
"feature",
"feature_set",
"flag_group",
"flag_set",
"make_variable",
"tool",
"tool_path",
"with_feature_set",
)
load(
"@bazel_tools//tools/cpp:cc_toolchain_config.bzl",
ALL_COMPILE_ACTIONS = "all_compile_actions",
ALL_CPP_COMPILE_ACTIONS = "all_cpp_compile_actions",
ALL_LINK_ACTIONS = "all_link_actions",
)
def _impl(ctx):
toolchain_identifier = "clang-linux-cross"
compiler = "clang"
abi_version = "clang"
abi_libc_version = "glibc_unknown"
target_libc = "glibc_unknown"
target_cpu = ctx.attr.target.split("-")[0]
if (target_cpu == "aarch64"):
sysroot = "/usr/aarch64-linux-gnu"
include_path_prefix = sysroot
elif (target_cpu == "x86_64"):
sysroot = "/"
include_path_prefix = "/usr"
else:
fail("Unreachable")
if (target_cpu == "aarch64"):
cross_system_include_dirs = [
include_path_prefix + "/include/c++/v1",
include_path_prefix + "/lib/clang/10.0.0/include",
]
else:
cross_system_include_dirs = [
include_path_prefix + "/include/c++/v1",
include_path_prefix + "/lib/clang/10.0.0/include",
include_path_prefix + "/include/x86_64-linux-gnu",
]
cross_system_include_dirs += [
include_path_prefix + "/include/",
include_path_prefix + "/include/linux",
include_path_prefix + "/include/asm",
include_path_prefix + "/include/asm-generic",
]
if (target_cpu == "aarch64"):
cross_system_lib_dirs = [
"/usr/" + ctx.attr.target + "/lib",
]
else:
cross_system_lib_dirs = [
"/usr/lib/x86_64-linux-gnu/",
]
cross_system_lib_dirs += [
"/usr/lib/gcc/x86_64-linux-gnu/8",
]
opt_feature = feature(name = "opt")
dbg_feature = feature(name = "dbg")
fastbuild_feature = feature(name = "fastbuild")
random_seed_feature = feature(name = "random_seed", enabled = True)
supports_pic_feature = feature(name = "supports_pic", enabled = True)
supports_dynamic_linker_feature = feature(name = "supports_dynamic_linker", enabled = True)
unfiltered_compile_flags_feature = feature(
name = "unfiltered_compile_flags",
enabled = True,
flag_sets = [
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [
flag_group(
flags = [
"-no-canonical-prefixes",
"-Wno-builtin-macro-redefined",
"-D__DATE__=\"redacted\"",
"-D__TIMESTAMP__=\"redacted\"",
"-D__TIME__=\"redacted\"",
],
),
],
),
],
)
# explicit arch specific system includes
system_include_flags = []
for d in cross_system_include_dirs:
system_include_flags += ["-idirafter", d]
default_compile_flags_feature = feature(
name = "default_compile_flags",
enabled = True,
flag_sets = [
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [
flag_group(
flags = [
"--target=" + ctx.attr.target,
"-nostdinc",
"-U_FORTIFY_SOURCE",
"-fstack-protector",
"-fno-omit-frame-pointer",
"-fcolor-diagnostics",
"-Wall",
"-Wthread-safety",
"-Wself-assign",
] + system_include_flags,
),
],
),
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [flag_group(flags = ["-g", "-fstandalone-debug"])],
with_features = [with_feature_set(features = ["dbg"])],
),
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [
flag_group(
flags = [
"-g0",
"-O2",
"-D_FORTIFY_SOURCE=1",
"-DNDEBUG",
"-ffunction-sections",
"-fdata-sections",
],
),
],
with_features = [with_feature_set(features = ["opt"])],
),
flag_set(
actions = ALL_CPP_COMPILE_ACTIONS,
flag_groups = [flag_group(flags = ["-std=c++17", "-nostdinc++"])],
),
],
)
additional_link_flags = [
"-l:libc++.a",
"-l:libc++abi.a",
"-l:libunwind.a",
"-lpthread",
"-ldl",
"-rtlib=compiler-rt",
]
default_link_flags_feature = feature(
name = "default_link_flags",
enabled = True,
flag_sets = [
flag_set(
actions = ALL_LINK_ACTIONS,
flag_groups = [
flag_group(
flags = additional_link_flags + [
"--target=" + ctx.attr.target,
"-lm",
"-no-canonical-prefixes",
"-fuse-ld=lld",
"-Wl,--build-id=md5",
"-Wl,--hash-style=gnu",
"-Wl,-z,relro,-z,now",
] + ["-L" + d for d in cross_system_lib_dirs],
),
],
),
flag_set(
actions = ALL_LINK_ACTIONS,
flag_groups = [flag_group(flags = ["-Wl,--gc-sections"])],
with_features = [with_feature_set(features = ["opt"])],
),
],
)
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"])],
),
],
)
user_compile_flags_feature = feature(
name = "user_compile_flags",
enabled = True,
flag_sets = [
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [
flag_group(
expand_if_available = "user_compile_flags",
flags = ["%{user_compile_flags}"],
iterate_over = "user_compile_flags",
),
],
),
],
)
sysroot_feature = feature(
name = "sysroot",
enabled = True,
flag_sets = [
flag_set(
actions = ALL_COMPILE_ACTIONS + ALL_LINK_ACTIONS,
flag_groups = [
flag_group(
expand_if_available = "sysroot",
flags = ["--sysroot=%{sysroot}"],
),
],
),
],
)
coverage_feature = feature(
name = "coverage",
flag_sets = [
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [
flag_group(
flags = ["-fprofile-instr-generate", "-fcoverage-mapping"],
),
],
),
flag_set(
actions = ALL_LINK_ACTIONS,
flag_groups = [flag_group(flags = ["-fprofile-instr-generate"])],
),
],
provides = ["profile"],
)
features = [
opt_feature,
fastbuild_feature,
dbg_feature,
random_seed_feature,
supports_pic_feature,
supports_dynamic_linker_feature,
unfiltered_compile_flags_feature,
default_link_flags_feature,
default_compile_flags_feature,
objcopy_embed_flags_feature,
user_compile_flags_feature,
sysroot_feature,
coverage_feature,
]
tool_paths = [
tool_path(name = "ld", path = "/usr/bin/ld.lld"),
tool_path(name = "cpp", path = "/usr/bin/clang-cpp"),
tool_path(name = "dwp", path = "/usr/bin/llvm-dwp"),
tool_path(name = "gcov", path = "/usr/bin/llvm-profdata"),
tool_path(name = "nm", path = "/usr/bin/llvm-nm"),
tool_path(name = "objcopy", path = "/usr/bin/llvm-objcopy"),
tool_path(name = "objdump", path = "/usr/bin/llvm-objdump"),
tool_path(name = "strip", path = "/usr/bin/strip"),
tool_path(name = "gcc", path = "/usr/bin/clang"),
tool_path(name = "ar", path = "/usr/bin/llvm-ar"),
]
return cc_common.create_cc_toolchain_config_info(
ctx = ctx,
features = features,
abi_version = abi_version,
abi_libc_version = abi_libc_version,
builtin_sysroot = sysroot,
compiler = compiler,
cxx_builtin_include_directories = cross_system_include_dirs,
host_system_name = "x86_64-unknown-linux-gnu",
target_cpu = target_cpu,
target_libc = target_libc,
target_system_name = ctx.attr.target,
tool_paths = tool_paths,
toolchain_identifier = toolchain_identifier,
)
arm64_cc_toolchain_config = rule(
implementation = _impl,
attrs = {
"target": attr.string(mandatory = True),
"stdlib": attr.string(),
},
provides = [CcToolchainConfigInfo],
)

View File

@@ -1,250 +0,0 @@
load(
"@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl",
"action_config",
"feature",
"feature_set",
"flag_group",
"flag_set",
"make_variable",
"tool",
"tool_path",
"with_feature_set",
)
load(
"@bazel_tools//tools/cpp:cc_toolchain_config.bzl",
ALL_COMPILE_ACTIONS = "all_compile_actions",
ALL_CPP_COMPILE_ACTIONS = "all_cpp_compile_actions",
ALL_LINK_ACTIONS = "all_link_actions",
)
def _impl(ctx):
toolchain_identifier = "osxcross"
compiler = "clang"
abi_version = "darwin_x86_64"
abi_libc_version = "darwin_x86_64"
install = "/usr/x86_64-apple-darwin/"
clang_version = "10.0.0"
target_libc = "macosx"
target_cpu = "x86_64"
osxcross = install + "osxcross/"
osxcross_binprefix = osxcross + "bin/x86_64-apple-darwin14-"
sdkroot = osxcross + "SDK/MacOSX10.10.sdk/"
cross_system_include_dirs = [
"/usr/lib/clang/10.0.0/include",
osxcross + "include",
sdkroot + "usr/include",
]
cross_system_lib_dirs = [
"/usr/x86_64-apple-darwin/lib",
sdkroot + "usr/lib",
osxcross + "/lib",
]
opt_feature = feature(name = "opt")
dbg_feature = feature(name = "dbg")
fastbuild_feature = feature(name = "fastbuild")
random_seed_feature = feature(name = "random_seed", enabled = True)
supports_pic_feature = feature(name = "supports_pic", enabled = True)
supports_dynamic_linker_feature = feature(name = "supports_dynamic_linker", enabled = True)
unfiltered_compile_flags_feature = feature(
name = "unfiltered_compile_flags",
enabled = True,
flag_sets = [
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [
flag_group(
flags = [
"-stdlib=libc++",
"-no-canonical-prefixes",
"-Wno-builtin-macro-redefined",
"-D__DATE__=\"redacted\"",
"-D__TIMESTAMP__=\"redacted\"",
"-D__TIME__=\"redacted\"",
],
),
],
),
],
)
# explicit arch specific system includes
system_include_flags = []
for d in cross_system_include_dirs:
system_include_flags += ["-idirafter", d]
default_compile_flags_feature = feature(
name = "default_compile_flags",
enabled = True,
flag_sets = [
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [
flag_group(
flags = [
"-mlinker-version=400",
"-B " + osxcross + "bin",
"-nostdinc",
"-U_FORTIFY_SOURCE",
"-fstack-protector",
"-fno-omit-frame-pointer",
"-fcolor-diagnostics",
"-Wall",
"-Wthread-safety",
"-Wself-assign",
] + system_include_flags,
),
],
),
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [flag_group(flags = ["-g", "-fstandalone-debug"])],
with_features = [with_feature_set(features = ["dbg"])],
),
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [
flag_group(
flags = [
"-g0",
"-O2",
"-D_FORTIFY_SOURCE=1",
"-DNDEBUG",
"-ffunction-sections",
"-fdata-sections",
],
),
],
with_features = [with_feature_set(features = ["opt"])],
),
flag_set(
actions = ALL_CPP_COMPILE_ACTIONS,
flag_groups = [flag_group(flags = ["-std=c++17", "-nostdinc++"])],
),
],
)
default_link_flags_feature = feature(
name = "default_link_flags",
enabled = True,
flag_sets = [
flag_set(
actions = ALL_LINK_ACTIONS,
flag_groups = [
flag_group(
flags = [
"-v",
"-lm",
"-no-canonical-prefixes",
"-fuse-ld=lld",
"-lc++",
"-lc++abi",
"-F" + sdkroot + "System/Library/Frameworks/",
"-L" + sdkroot + "usr/lib",
"-undefined",
"dynamic_lookup",
],
),
],
),
],
)
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"])],
),
],
)
user_compile_flags_feature = feature(
name = "user_compile_flags",
enabled = True,
flag_sets = [
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [
flag_group(
expand_if_available = "user_compile_flags",
flags = ["%{user_compile_flags}"],
iterate_over = "user_compile_flags",
),
],
),
],
)
coverage_feature = feature(
name = "coverage",
flag_sets = [
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [
flag_group(
flags = ["-fprofile-instr-generate", "-fcoverage-mapping"],
),
],
),
flag_set(
actions = ALL_LINK_ACTIONS,
flag_groups = [flag_group(flags = ["-fprofile-instr-generate"])],
),
],
provides = ["profile"],
)
features = [
opt_feature,
fastbuild_feature,
dbg_feature,
random_seed_feature,
supports_pic_feature,
supports_dynamic_linker_feature,
unfiltered_compile_flags_feature,
default_link_flags_feature,
default_compile_flags_feature,
objcopy_embed_flags_feature,
user_compile_flags_feature,
coverage_feature,
]
tool_paths = [
tool_path(name = "ld", path = osxcross_binprefix + "ld"),
tool_path(name = "cpp", path = osxcross + "bin/o64-clang++"),
tool_path(name = "dwp", path = "/usr/bin/dwp"),
tool_path(name = "gcov", path = "/usr/bin/gcov"),
tool_path(name = "nm", path = osxcross_binprefix + "nm"),
tool_path(name = "objdump", path = osxcross_binprefix + "ObjectDump"),
tool_path(name = "strip", path = osxcross_binprefix + "strip"),
tool_path(name = "gcc", path = osxcross + "bin/o64-clang"),
tool_path(name = "ar", path = osxcross_binprefix + "libtool"),
]
return cc_common.create_cc_toolchain_config_info(
ctx = ctx,
features = features,
abi_version = abi_version,
abi_libc_version = abi_libc_version,
compiler = compiler,
cxx_builtin_include_directories = cross_system_include_dirs,
host_system_name = "x86_64-unknown-linux-gnu",
target_cpu = target_cpu,
target_libc = target_libc,
target_system_name = ctx.attr.target,
tool_paths = tool_paths,
toolchain_identifier = toolchain_identifier,
)
osx_cc_toolchain_config = rule(
implementation = _impl,
attrs = {
"target": attr.string(mandatory = True),
"stdlib": attr.string(),
},
provides = [CcToolchainConfigInfo],
)

View File

@@ -1,209 +0,0 @@
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",
"with_feature_set",
)
load(
"@bazel_tools//tools/cpp:cc_toolchain_config.bzl",
ALL_COMPILE_ACTIONS = "all_compile_actions",
ALL_CPP_COMPILE_ACTIONS = "all_cpp_compile_actions",
ALL_LINK_ACTIONS = "all_link_actions",
)
load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "ACTION_NAMES")
def _impl(ctx):
toolchain_identifier = "msys_x64_mingw"
host_system_name = "local"
target_system_name = "local"
target_cpu = "x64_windows"
target_libc = "mingw"
compiler = "mingw-gcc"
abi_version = "local"
abi_libc_version = "local"
cc_target_os = None
builtin_sysroot = None
action_configs = []
install = "/usr/x86_64-w64-mingw32/"
bin_prefix = "/usr/bin/x86_64-w64-mingw32-"
targets_windows_feature = feature(
name = "targets_windows",
implies = ["copy_dynamic_libraries_to_binary"],
enabled = True,
)
copy_dynamic_libraries_to_binary_feature = feature(name = "copy_dynamic_libraries_to_binary")
gcc_env_feature = feature(
name = "gcc_env",
enabled = True,
env_sets = [
env_set(
actions = [
ACTION_NAMES.c_compile,
ACTION_NAMES.cpp_compile,
ACTION_NAMES.cpp_module_compile,
ACTION_NAMES.cpp_module_codegen,
ACTION_NAMES.cpp_header_parsing,
ACTION_NAMES.assemble,
ACTION_NAMES.preprocess_assemble,
ACTION_NAMES.cpp_link_executable,
ACTION_NAMES.cpp_link_dynamic_library,
ACTION_NAMES.cpp_link_nodeps_dynamic_library,
ACTION_NAMES.cpp_link_static_library,
],
env_entries = [
env_entry(key = "PATH", value = "NOT_USED"),
],
),
],
)
msys_mingw_flags = [
"-B " + install + "bin",
"-nostdinc",
"-U_FORTIFY_SOURCE",
"-fstack-protector",
"-fno-omit-frame-pointer",
"-fcolor-diagnostics",
"-Wall",
"-Wthread-safety",
"-Wself-assign",
"-x c++",
"-lstdc++",
"-lpthread",
]
msys_mingw_link_flags = [
"-l:libstdc++.a",
"-L" + install + "lib",
"-L/usr/lib/gcc/x86_64-w64-mingw32/8.3-w32",
"-v",
"-lm",
"-no-canonical-prefixes",
]
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_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 = msys_mingw_flags)] if msys_mingw_flags else []),
),
],
)
compiler_param_file_feature = feature(
name = "compiler_param_file",
)
default_link_flags_feature = feature(
name = "default_link_flags",
enabled = True,
flag_sets = [
flag_set(
actions = ALL_LINK_ACTIONS,
flag_groups = ([flag_group(flags = msys_mingw_link_flags)] if msys_mingw_link_flags else []),
),
],
)
supports_dynamic_linker_feature = feature(name = "supports_dynamic_linker", enabled = True)
features = [
targets_windows_feature,
copy_dynamic_libraries_to_binary_feature,
gcc_env_feature,
default_compile_flags_feature,
compiler_param_file_feature,
default_link_flags_feature,
supports_dynamic_linker_feature,
]
cxx_builtin_include_directories = [
install + "include",
]
artifact_name_patterns = [
artifact_name_pattern(
category_name = "executable",
prefix = "",
extension = ".exe",
),
]
make_variables = []
tool_paths = [
tool_path(name = "ld", path = bin_prefix + "ld"),
tool_path(name = "cpp", path = bin_prefix + "cpp"),
tool_path(name = "gcov", path = "/usr/bin/gcov"),
tool_path(name = "nm", path = bin_prefix + "nm"),
tool_path(name = "objcopy", path = bin_prefix + "objcopy"),
tool_path(name = "objdump", path = bin_prefix + "objdump"),
tool_path(name = "strip", path = bin_prefix + "strip"),
tool_path(name = "gcc", path = bin_prefix + "gcc"),
tool_path(name = "ar", path = bin_prefix + "ar"),
]
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,
)
windows_cc_toolchain_config = rule(
implementation = _impl,
attrs = {
"target": attr.string(mandatory = True),
"stdlib": attr.string(),
},
provides = [CcToolchainConfigInfo],
)

View File

@@ -1,167 +0,0 @@
# Copyright 2016 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This becomes the BUILD file for @local_config_cc// under non-BSD unixes.
package(default_visibility = ["//visibility:public"])
load(":cc_toolchain_config.bzl", "cc_toolchain_config")
load(":armeabi_cc_toolchain_config.bzl", "armeabi_cc_toolchain_config")
load("@rules_cc//cc:defs.bzl", "cc_toolchain", "cc_toolchain_suite")
licenses(["notice"]) # Apache 2.0
cc_library(
name = "malloc",
)
filegroup(
name = "empty",
srcs = [],
)
filegroup(
name = "cc_wrapper",
srcs = ["cc_wrapper.sh"],
)
filegroup(
name = "compiler_deps",
srcs = glob(
["extra_tools/**"],
allow_empty = True,
) + [":builtin_include_directory_paths"],
)
# This is the entry point for --crosstool_top. Toolchains are found
# by lopping off the name of --crosstool_top and searching for
# the "${CPU}" entry in the toolchains attribute.
cc_toolchain_suite(
name = "toolchain",
toolchains = {
"k8|clang": ":cc-compiler-k8",
"k8": ":cc-compiler-k8",
"armeabi-v7a|compiler": ":cc-compiler-armeabi-v7a",
"armeabi-v7a": ":cc-compiler-armeabi-v7a",
},
)
cc_toolchain(
name = "cc-compiler-k8",
all_files = ":compiler_deps",
ar_files = ":compiler_deps",
as_files = ":compiler_deps",
compiler_files = ":compiler_deps",
dwp_files = ":empty",
linker_files = ":compiler_deps",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":local",
toolchain_identifier = "local",
)
cc_toolchain_config(
name = "local",
abi_libc_version = "local",
abi_version = "local",
compile_flags = [
"-U_FORTIFY_SOURCE",
"-fstack-protector",
"-Wall",
"-Wthread-safety",
"-Wself-assign",
"-fcolor-diagnostics",
"-fno-omit-frame-pointer",
],
compiler = "clang",
coverage_compile_flags = [
"-fprofile-instr-generate",
"-fcoverage-mapping",
],
coverage_link_flags = ["-fprofile-instr-generate"],
cpu = "k8",
cxx_builtin_include_directories = [
"/usr/local/include",
"/usr/lib/clang/10.0.0/include",
"/usr/include/x86_64-linux-gnu",
"/usr/include",
"/usr/lib/clang/10.0.0/share",
"/usr/include/c++/8",
"/usr/include/x86_64-linux-gnu/c++/8",
"/usr/include/c++/8/backward",
],
cxx_flags = ["-std=c++0x"],
dbg_compile_flags = ["-g"],
host_system_name = "local",
link_flags = [
"-fuse-ld=/usr/bin/ld.gold",
"-Wl,-no-as-needed",
"-Wl,-z,relro,-z,now",
"-B/usr/bin",
"-lm",
"-static-libgcc",
],
link_libs = ["-l:libstdc++.a"],
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 = "local",
target_system_name = "local",
tool_paths = {
"ar": "/usr/bin/ar",
"ld": "/usr/bin/ld",
"cpp": "/usr/bin/cpp",
"gcc": "/usr/bin/clang",
"dwp": "/usr/bin/dwp",
"gcov": "/usr/bin/llvm-profdata",
"nm": "/usr/bin/nm",
"objcopy": "/usr/bin/objcopy",
"objdump": "/usr/bin/objdump",
"strip": "/usr/bin/strip",
},
toolchain_identifier = "local",
unfiltered_compile_flags = [
"-no-canonical-prefixes",
"-Wno-builtin-macro-redefined",
"-D__DATE__=\"redacted\"",
"-D__TIMESTAMP__=\"redacted\"",
"-D__TIME__=\"redacted\"",
],
)
# Android tooling requires a default toolchain for the armeabi-v7a cpu.
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")

View File

@@ -1,82 +0,0 @@
# 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",
)
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],
)

View File

@@ -1,14 +0,0 @@
This file is generated by cc_configure and contains builtin include directories
that /usr/bin/clang 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.
/usr/local/include
/usr/lib/clang/10.0.0/include
/usr/include/x86_64-linux-gnu
/usr/include
/usr/lib/clang/10.0.0/share
/usr/include/c++/8
/usr/include/x86_64-linux-gnu/c++/8
/usr/include/c++/8/backward

View File

@@ -1,25 +0,0 @@
#!/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.
#
# Ship the environment to the C++ action
#
set -eu
# Set-up the environment
# Call the C++ compiler
/usr/bin/clang "$@"

View File

@@ -1,47 +0,0 @@
# Copyright 2016 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This file is auto-generated by an rbe_autoconfig repository rule
# and should not be modified directly.
# See @bazel_toolchains//rules:rbe_repo.bzl
package(default_visibility = ["//visibility:public"])
toolchain(
name = "cc-toolchain",
exec_compatible_with = [
"@bazel_tools//platforms:x86_64",
"@bazel_tools//platforms:linux",
"@bazel_tools//tools/cpp:clang",
],
target_compatible_with = [
"@bazel_tools//platforms:linux",
"@bazel_tools//platforms:x86_64",
],
toolchain = "//tools/cross-toolchain/configs/clang/bazel_3.2.0/cc:cc-compiler-k8",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
platform(
name = "platform",
constraint_values = [
"@bazel_tools//platforms:x86_64",
"@bazel_tools//platforms:linux",
"@bazel_tools//tools/cpp:clang",
],
exec_properties = {
"container-image": "docker://gcr.io/prysmaticlabs/rbe-worker@sha256:0175024b0968eee56a50d4d813c4b2fc68dca90e7ecc453cdae6e82e112b845d",
"OSFamily": "Linux",
},
)

View File

@@ -1,25 +0,0 @@
# Copyright 2016 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This file is auto-generated by an rbe_autoconfig repository rule
# and should not be modified directly.
# See @bazel_toolchains//rules:rbe_repo.bzl
package(default_visibility = ["//visibility:public"])
java_runtime(
name = "jdk",
srcs = [],
java_home = "/usr/lib/jvm/java-8-openjdk-amd64",
)

View File

@@ -1,147 +0,0 @@
package(default_visibility = ["//visibility:public"])
load(":cc_toolchain_config_osx.bzl", "osx_cc_toolchain_config")
load(":cc_toolchain_config_linux_arm64.bzl", "arm64_cc_toolchain_config")
load(":cc_toolchain_config_windows.bzl", "windows_cc_toolchain_config")
cc_toolchain_suite(
name = "multiarch_toolchain",
toolchains = {
"k8|osxcross": ":cc-clang-osx",
"k8|clang": "cc-clang-amd64",
"aarch64|clang": ":cc-clang-arm64",
"k8": "cc-clang-amd64",
"aarch64": ":cc-clang-arm64",
"k8|mingw-w64": ":cc-mingw-amd64",
},
)
cc_toolchain_suite(
name = "hostonly_toolchain",
toolchains = {
"k8": "cc-clang-amd64",
},
)
filegroup(
name = "empty",
srcs = [],
)
config_setting(
name = "osx_amd64",
constraint_values = [
"@platforms//os:osx",
"@platforms//cpu:x86_64",
],
)
config_setting(
name = "linux_arm64",
constraint_values = [
"@platforms//os:linux",
"@platforms//cpu:aarch64",
],
)
config_setting(
name = "linux_amd64",
constraint_values = [
"@platforms//os:linux",
"@platforms//cpu:x86_64",
],
)
config_setting(
name = "windows_amd64",
constraint_values = [
"@platforms//os:windows",
"@platforms//cpu:x86_64",
],
)
arm64_cc_toolchain_config(
name = "local-arm64",
target = "aarch64-linux-gnu",
)
arm64_cc_toolchain_config(
name = "local-amd64",
target = "x86_64-unknown-linux-gnu",
)
osx_cc_toolchain_config(
name = "local-osxcross",
target = "darwin_x86_64",
)
windows_cc_toolchain_config(
name = "local-windows",
target = "x86_64-w64",
)
cc_toolchain(
name = "cc-mingw-amd64",
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 = ":local-windows",
)
cc_toolchain(
name = "cc-clang-arm64",
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-arm64",
)
cc_toolchain(
name = "cc-clang-osx",
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-osxcross",
)
cc_toolchain(
name = "cc-clang-amd64",
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-amd64",
)
toolchain(
name = "cc-toolchain-multiarch",
exec_compatible_with = [
"@platforms//os:linux",
"@platforms//cpu:x86_64",
],
target_compatible_with = [],
toolchain = select({
":linux_arm64": ":cc-clang-arm64",
":linux_amd64": ":cc-clang-amd64",
":osx_amd64": ":cc-clang-osx",
":windows_amd64": ":cc-mingw-amd64",
}),
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)

View File

@@ -1,2 +0,0 @@
# DO NOT EDIT: automatically generated WORKSPACE file for prysm_toolchains rule
workspace(name = "prysm_toolchains")

View File

@@ -1,305 +0,0 @@
load(
"@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl",
"action_config",
"feature",
"feature_set",
"flag_group",
"flag_set",
"make_variable",
"tool",
"tool_path",
"with_feature_set",
)
load(
"@bazel_tools//tools/cpp:cc_toolchain_config.bzl",
ALL_COMPILE_ACTIONS = "all_compile_actions",
ALL_CPP_COMPILE_ACTIONS = "all_cpp_compile_actions",
ALL_LINK_ACTIONS = "all_link_actions",
)
def _impl(ctx):
toolchain_identifier = "clang-linux-cross"
compiler = "clang"
abi_version = "clang"
abi_libc_version = "glibc_unknown"
target_libc = "glibc_unknown"
target_cpu = ctx.attr.target.split("-")[0]
if (target_cpu == "aarch64"):
sysroot = "/usr/aarch64-linux-gnu"
include_path_prefix = sysroot
elif (target_cpu == "x86_64"):
sysroot = "/"
include_path_prefix = "/usr"
else:
fail("Unreachable")
if (target_cpu == "aarch64"):
cross_system_include_dirs = [
include_path_prefix + "/include/c++/v1",
include_path_prefix + "/lib/clang/10.0.0/include",
]
else:
cross_system_include_dirs = [
include_path_prefix + "/include/c++/v1",
include_path_prefix + "/lib/clang/10.0.0/include",
include_path_prefix + "/include/x86_64-linux-gnu",
]
cross_system_include_dirs += [
include_path_prefix + "/include/",
include_path_prefix + "/include/linux",
include_path_prefix + "/include/asm",
include_path_prefix + "/include/asm-generic",
]
if (target_cpu == "aarch64"):
cross_system_lib_dirs = [
"/usr/" + ctx.attr.target + "/lib",
]
else:
cross_system_lib_dirs = [
"/usr/lib/x86_64-linux-gnu/",
]
cross_system_lib_dirs += [
"/usr/lib/gcc/x86_64-linux-gnu/8",
]
opt_feature = feature(name = "opt")
dbg_feature = feature(name = "dbg")
fastbuild_feature = feature(name = "fastbuild")
random_seed_feature = feature(name = "random_seed", enabled = True)
supports_pic_feature = feature(name = "supports_pic", enabled = True)
supports_dynamic_linker_feature = feature(name = "supports_dynamic_linker", enabled = True)
unfiltered_compile_flags_feature = feature(
name = "unfiltered_compile_flags",
enabled = True,
flag_sets = [
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [
flag_group(
flags = [
"-no-canonical-prefixes",
"-Wno-builtin-macro-redefined",
"-D__DATE__=\"redacted\"",
"-D__TIMESTAMP__=\"redacted\"",
"-D__TIME__=\"redacted\"",
],
),
],
),
],
)
# explicit arch specific system includes
system_include_flags = []
for d in cross_system_include_dirs:
system_include_flags += ["-idirafter", d]
default_compile_flags_feature = feature(
name = "default_compile_flags",
enabled = True,
flag_sets = [
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [
flag_group(
flags = [
"--target=" + ctx.attr.target,
"-nostdinc",
"-U_FORTIFY_SOURCE",
"-fstack-protector",
"-fno-omit-frame-pointer",
"-fcolor-diagnostics",
"-Wall",
"-Wthread-safety",
"-Wself-assign",
] + system_include_flags,
),
],
),
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [flag_group(flags = ["-g", "-fstandalone-debug"])],
with_features = [with_feature_set(features = ["dbg"])],
),
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [
flag_group(
flags = [
"-g0",
"-O2",
"-D_FORTIFY_SOURCE=1",
"-DNDEBUG",
"-ffunction-sections",
"-fdata-sections",
],
),
],
with_features = [with_feature_set(features = ["opt"])],
),
flag_set(
actions = ALL_CPP_COMPILE_ACTIONS,
flag_groups = [flag_group(flags = ["-std=c++17", "-nostdinc++"])],
),
],
)
additional_link_flags = [
"-l:libc++.a",
"-l:libc++abi.a",
"-l:libunwind.a",
"-lpthread",
"-ldl",
"-rtlib=compiler-rt",
]
default_link_flags_feature = feature(
name = "default_link_flags",
enabled = True,
flag_sets = [
flag_set(
actions = ALL_LINK_ACTIONS,
flag_groups = [
flag_group(
flags = additional_link_flags + [
"--target=" + ctx.attr.target,
"-lm",
"-no-canonical-prefixes",
"-fuse-ld=lld",
"-Wl,--build-id=md5",
"-Wl,--hash-style=gnu",
"-Wl,-z,relro,-z,now",
] + ["-L" + d for d in cross_system_lib_dirs],
),
],
),
flag_set(
actions = ALL_LINK_ACTIONS,
flag_groups = [flag_group(flags = ["-Wl,--gc-sections"])],
with_features = [with_feature_set(features = ["opt"])],
),
],
)
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"])],
),
],
)
user_compile_flags_feature = feature(
name = "user_compile_flags",
enabled = True,
flag_sets = [
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [
flag_group(
expand_if_available = "user_compile_flags",
flags = ["%{user_compile_flags}"],
iterate_over = "user_compile_flags",
),
],
),
],
)
sysroot_feature = feature(
name = "sysroot",
enabled = True,
flag_sets = [
flag_set(
actions = ALL_COMPILE_ACTIONS + ALL_LINK_ACTIONS,
flag_groups = [
flag_group(
expand_if_available = "sysroot",
flags = ["--sysroot=%{sysroot}"],
),
],
),
],
)
coverage_feature = feature(
name = "coverage",
flag_sets = [
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [
flag_group(
flags = ["-fprofile-instr-generate", "-fcoverage-mapping"],
),
],
),
flag_set(
actions = ALL_LINK_ACTIONS,
flag_groups = [flag_group(flags = ["-fprofile-instr-generate"])],
),
],
provides = ["profile"],
)
features = [
opt_feature,
fastbuild_feature,
dbg_feature,
random_seed_feature,
supports_pic_feature,
supports_dynamic_linker_feature,
unfiltered_compile_flags_feature,
default_link_flags_feature,
default_compile_flags_feature,
objcopy_embed_flags_feature,
user_compile_flags_feature,
sysroot_feature,
coverage_feature,
]
tool_paths = [
tool_path(name = "ld", path = "/usr/bin/ld.lld"),
tool_path(name = "cpp", path = "/usr/bin/clang-cpp"),
tool_path(name = "dwp", path = "/usr/bin/llvm-dwp"),
tool_path(name = "gcov", path = "/usr/bin/llvm-profdata"),
tool_path(name = "nm", path = "/usr/bin/llvm-nm"),
tool_path(name = "objcopy", path = "/usr/bin/llvm-objcopy"),
tool_path(name = "objdump", path = "/usr/bin/llvm-objdump"),
tool_path(name = "strip", path = "/usr/bin/strip"),
tool_path(name = "gcc", path = "/usr/bin/clang"),
tool_path(name = "ar", path = "/usr/bin/llvm-ar"),
]
return cc_common.create_cc_toolchain_config_info(
ctx = ctx,
features = features,
abi_version = abi_version,
abi_libc_version = abi_libc_version,
builtin_sysroot = sysroot,
compiler = compiler,
cxx_builtin_include_directories = cross_system_include_dirs,
host_system_name = "x86_64-unknown-linux-gnu",
target_cpu = target_cpu,
target_libc = target_libc,
target_system_name = ctx.attr.target,
tool_paths = tool_paths,
toolchain_identifier = toolchain_identifier,
)
arm64_cc_toolchain_config = rule(
implementation = _impl,
attrs = {
"target": attr.string(mandatory = True),
"stdlib": attr.string(),
},
provides = [CcToolchainConfigInfo],
)

View File

@@ -1,251 +0,0 @@
load(
"@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl",
"action_config",
"feature",
"feature_set",
"flag_group",
"flag_set",
"make_variable",
"tool",
"tool_path",
"with_feature_set",
)
load(
"@bazel_tools//tools/cpp:cc_toolchain_config.bzl",
ALL_COMPILE_ACTIONS = "all_compile_actions",
ALL_CPP_COMPILE_ACTIONS = "all_cpp_compile_actions",
ALL_LINK_ACTIONS = "all_link_actions",
)
def _impl(ctx):
toolchain_identifier = "osxcross"
compiler = "clang"
abi_version = "darwin_x86_64"
abi_libc_version = "darwin_x86_64"
install = "/usr/x86_64-apple-darwin/"
clang_version = "10.0.0"
target_libc = "macosx"
target_cpu = "x86_64"
osxcross = install + "osxcross/"
osxcross_binprefix = osxcross + "bin/x86_64-apple-darwin14-"
sdkroot = osxcross + "SDK/MacOSX10.10.sdk/"
cross_system_include_dirs = [
"/usr/lib/clang/10.0.0/include",
osxcross + "include",
sdkroot + "usr/include",
]
cross_system_lib_dirs = [
"/usr/x86_64-apple-darwin/lib",
sdkroot + "usr/lib",
osxcross + "/lib",
]
opt_feature = feature(name = "opt")
dbg_feature = feature(name = "dbg")
fastbuild_feature = feature(name = "fastbuild")
random_seed_feature = feature(name = "random_seed", enabled = True)
supports_pic_feature = feature(name = "supports_pic", enabled = True)
supports_dynamic_linker_feature = feature(name = "supports_dynamic_linker", enabled = True)
unfiltered_compile_flags_feature = feature(
name = "unfiltered_compile_flags",
enabled = True,
flag_sets = [
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [
flag_group(
flags = [
"-stdlib=libc++",
"-no-canonical-prefixes",
"-Wno-builtin-macro-redefined",
"-D__DATE__=\"redacted\"",
"-D__TIMESTAMP__=\"redacted\"",
"-D__TIME__=\"redacted\"",
],
),
],
),
],
)
# explicit arch specific system includes
system_include_flags = []
for d in cross_system_include_dirs:
system_include_flags += ["-idirafter", d]
default_compile_flags_feature = feature(
name = "default_compile_flags",
enabled = True,
flag_sets = [
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [
flag_group(
flags = [
"-mlinker-version=400",
"-B " + osxcross + "bin",
"-nostdinc",
"-U_FORTIFY_SOURCE",
"-fstack-protector",
"-fno-omit-frame-pointer",
"-fcolor-diagnostics",
"-Wall",
"-Wthread-safety",
"-Wself-assign",
] + system_include_flags,
),
],
),
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [flag_group(flags = ["-g", "-fstandalone-debug"])],
with_features = [with_feature_set(features = ["dbg"])],
),
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [
flag_group(
flags = [
"-g0",
"-O2",
"-D_FORTIFY_SOURCE=1",
"-DNDEBUG",
"-ffunction-sections",
"-fdata-sections",
],
),
],
with_features = [with_feature_set(features = ["opt"])],
),
flag_set(
actions = ALL_CPP_COMPILE_ACTIONS,
flag_groups = [flag_group(flags = ["-std=c++17", "-nostdinc++"])],
),
],
)
default_link_flags_feature = feature(
name = "default_link_flags",
enabled = True,
flag_sets = [
flag_set(
actions = ALL_LINK_ACTIONS,
flag_groups = [
flag_group(
flags = [
"-v",
"-lm",
"-no-canonical-prefixes",
"-fuse-ld=lld",
"-lc++",
"-lc++abi",
"-F" + sdkroot + "System/Library/Frameworks/",
"-L"+ sdkroot + "usr/lib",
"-undefined",
"dynamic_lookup",
],
),
],
),
],
)
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"])],
),
],
)
user_compile_flags_feature = feature(
name = "user_compile_flags",
enabled = True,
flag_sets = [
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [
flag_group(
expand_if_available = "user_compile_flags",
flags = ["%{user_compile_flags}"],
iterate_over = "user_compile_flags",
),
],
),
],
)
coverage_feature = feature(
name = "coverage",
flag_sets = [
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [
flag_group(
flags = ["-fprofile-instr-generate", "-fcoverage-mapping"],
),
],
),
flag_set(
actions = ALL_LINK_ACTIONS,
flag_groups = [flag_group(flags = ["-fprofile-instr-generate"])],
),
],
provides = ["profile"],
)
features = [
opt_feature,
fastbuild_feature,
dbg_feature,
random_seed_feature,
supports_pic_feature,
supports_dynamic_linker_feature,
unfiltered_compile_flags_feature,
default_link_flags_feature,
default_compile_flags_feature,
objcopy_embed_flags_feature,
user_compile_flags_feature,
coverage_feature,
]
tool_paths = [
tool_path(name = "ld", path = osxcross_binprefix + "ld"),
tool_path(name = "cpp", path = osxcross + "bin/o64-clang++"),
tool_path(name = "dwp", path = "/usr/bin/dwp"),
tool_path(name = "gcov", path = "/usr/bin/gcov"),
tool_path(name = "nm", path = osxcross_binprefix + "nm"),
tool_path(name = "objdump", path = osxcross_binprefix + "ObjectDump"),
tool_path(name = "strip", path = osxcross_binprefix + "strip"),
tool_path(name = "gcc", path = osxcross + "bin/o64-clang"),
tool_path(name = "ar", path = osxcross_binprefix + "libtool"),
]
return cc_common.create_cc_toolchain_config_info(
ctx = ctx,
features = features,
abi_version = abi_version,
abi_libc_version = abi_libc_version,
compiler = compiler,
cxx_builtin_include_directories = cross_system_include_dirs,
host_system_name = "x86_64-unknown-linux-gnu",
target_cpu = target_cpu,
target_libc = target_libc,
target_system_name = ctx.attr.target,
tool_paths = tool_paths,
toolchain_identifier = toolchain_identifier,
)
osx_cc_toolchain_config = rule(
implementation = _impl,
attrs = {
"target": attr.string(mandatory = True),
"stdlib": attr.string(),
},
provides = [CcToolchainConfigInfo],
)

View File

@@ -1,213 +0,0 @@
load(
"@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl",
"action_config",
"feature",
"feature_set",
"flag_group",
"flag_set",
"make_variable",
"tool",
"tool_path",
"with_feature_set",
"artifact_name_pattern",
"env_set",
"env_entry",
)
load(
"@bazel_tools//tools/cpp:cc_toolchain_config.bzl",
ALL_COMPILE_ACTIONS = "all_compile_actions",
ALL_CPP_COMPILE_ACTIONS = "all_cpp_compile_actions",
ALL_LINK_ACTIONS = "all_link_actions",
)
load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "ACTION_NAMES")
def _impl(ctx):
toolchain_identifier = "msys_x64_mingw"
host_system_name = "local"
target_system_name = "local"
target_cpu = "x64_windows"
target_libc = "mingw"
compiler = "mingw-gcc"
abi_version = "local"
abi_libc_version = "local"
cc_target_os = None
builtin_sysroot = None
action_configs = []
install = "/usr/x86_64-w64-mingw32/"
bin_prefix = "/usr/bin/x86_64-w64-mingw32-"
targets_windows_feature = feature(
name = "targets_windows",
implies = ["copy_dynamic_libraries_to_binary"],
enabled = True,
)
copy_dynamic_libraries_to_binary_feature = feature(name = "copy_dynamic_libraries_to_binary")
gcc_env_feature = feature(
name = "gcc_env",
enabled = True,
env_sets = [
env_set(
actions = [
ACTION_NAMES.c_compile,
ACTION_NAMES.cpp_compile,
ACTION_NAMES.cpp_module_compile,
ACTION_NAMES.cpp_module_codegen,
ACTION_NAMES.cpp_header_parsing,
ACTION_NAMES.assemble,
ACTION_NAMES.preprocess_assemble,
ACTION_NAMES.cpp_link_executable,
ACTION_NAMES.cpp_link_dynamic_library,
ACTION_NAMES.cpp_link_nodeps_dynamic_library,
ACTION_NAMES.cpp_link_static_library,
],
env_entries = [
env_entry(key = "PATH", value = "NOT_USED"),
],
),
],
)
msys_mingw_flags = [
"-B " + install + "bin",
"-nostdinc",
"-U_FORTIFY_SOURCE",
"-fstack-protector",
"-fno-omit-frame-pointer",
"-fcolor-diagnostics",
"-Wall",
"-Wthread-safety",
"-Wself-assign",
"-x c++",
"-lstdc++",
"-lpthread"
]
msys_mingw_link_flags = [
"-l:libstdc++.a",
"-L" + install + "lib",
"-L/usr/lib/gcc/x86_64-w64-mingw32/8.3-w32",
"-v",
"-lm",
"-no-canonical-prefixes",
]
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_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 = msys_mingw_flags)] if msys_mingw_flags else []),
),
],
)
compiler_param_file_feature = feature(
name = "compiler_param_file",
)
default_link_flags_feature = feature(
name = "default_link_flags",
enabled = True,
flag_sets = [
flag_set(
actions = ALL_LINK_ACTIONS,
flag_groups = ([flag_group(flags = msys_mingw_link_flags)] if msys_mingw_link_flags else []),
),
],
)
supports_dynamic_linker_feature = feature(name = "supports_dynamic_linker", enabled = True)
features = [
targets_windows_feature,
copy_dynamic_libraries_to_binary_feature,
gcc_env_feature,
default_compile_flags_feature,
compiler_param_file_feature,
default_link_flags_feature,
supports_dynamic_linker_feature,
]
cxx_builtin_include_directories = [
install +"include"
]
artifact_name_patterns = [
artifact_name_pattern(
category_name = "executable",
prefix = "",
extension = ".exe",
),
]
make_variables = []
tool_paths = [
tool_path(name = "ld", path = bin_prefix + "ld"),
tool_path(name = "cpp", path = bin_prefix + "cpp"),
tool_path(name = "gcov", path = "/usr/bin/gcov"),
tool_path(name = "nm", path = bin_prefix + "nm"),
tool_path(name = "objcopy", path = bin_prefix + "objcopy"),
tool_path(name = "objdump", path = bin_prefix + "objdump"),
tool_path(name = "strip", path = bin_prefix + "strip"),
tool_path(name = "gcc", path = bin_prefix + "gcc"),
tool_path(name = "ar", path = bin_prefix + "ar"),
]
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,
)
windows_cc_toolchain_config = rule(
implementation = _impl,
attrs = {
"target": attr.string(mandatory = True),
"stdlib": attr.string(),
},
provides = [CcToolchainConfigInfo],
)

View File

@@ -24,16 +24,19 @@ licenses(["notice"]) # Apache 2.0
cc_library(
name = "malloc",
tags = ["manual"],
)
filegroup(
name = "empty",
srcs = [],
tags = ["manual"],
)
filegroup(
name = "cc_wrapper",
srcs = ["cc_wrapper.sh"],
tags = ["manual"],
)
filegroup(
@@ -42,6 +45,7 @@ filegroup(
["extra_tools/**"],
allow_empty = True,
) + [":builtin_include_directory_paths"],
tags = ["manual"],
)
# This is the entry point for --crosstool_top. Toolchains are found
@@ -49,6 +53,7 @@ filegroup(
# the "${CPU}" entry in the toolchains attribute.
cc_toolchain_suite(
name = "toolchain",
tags = ["manual"],
toolchains = {
"k8|clang": ":cc-compiler-k8",
"k8": ":cc-compiler-k8",
@@ -69,6 +74,7 @@ cc_toolchain(
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
tags = ["manual"],
toolchain_config = ":local",
toolchain_identifier = "local",
)
@@ -125,6 +131,7 @@ cc_toolchain_config(
],
opt_link_flags = ["-Wl,--gc-sections"],
supports_start_end_lib = True,
tags = ["manual"],
target_libc = "local",
target_system_name = "local",
tool_paths = {
@@ -161,8 +168,12 @@ cc_toolchain(
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
tags = ["manual"],
toolchain_config = ":stub_armeabi-v7a",
toolchain_identifier = "stub_armeabi-v7a",
)
armeabi_cc_toolchain_config(name = "stub_armeabi-v7a")
armeabi_cc_toolchain_config(
name = "stub_armeabi-v7a",
tags = ["manual"],
)

View File

@@ -22,4 +22,5 @@ java_runtime(
name = "jdk",
srcs = [],
java_home = "/usr/lib/jvm/java-8-openjdk-amd64",
tags = ["manual"],
)

View File

@@ -6,6 +6,7 @@ load(":cc_toolchain_config_windows.bzl", "windows_cc_toolchain_config")
cc_toolchain_suite(
name = "multiarch_toolchain",
tags = ["manual"],
toolchains = {
"k8|osxcross": ":cc-clang-osx",
"k8|clang": "cc-clang-amd64",
@@ -18,6 +19,7 @@ cc_toolchain_suite(
cc_toolchain_suite(
name = "hostonly_toolchain",
tags = ["manual"],
toolchains = {
"k8": "cc-clang-amd64",
},
@@ -26,6 +28,7 @@ cc_toolchain_suite(
filegroup(
name = "empty",
srcs = [],
tags = ["manual"],
)
config_setting(
@@ -34,6 +37,7 @@ config_setting(
"@platforms//os:osx",
"@platforms//cpu:x86_64",
],
tags = ["manual"],
)
config_setting(
@@ -42,6 +46,7 @@ config_setting(
"@platforms//os:linux",
"@platforms//cpu:aarch64",
],
tags = ["manual"],
)
config_setting(
@@ -50,6 +55,7 @@ config_setting(
"@platforms//os:linux",
"@platforms//cpu:x86_64",
],
tags = ["manual"],
)
config_setting(
@@ -58,25 +64,30 @@ config_setting(
"@platforms//os:windows",
"@platforms//cpu:x86_64",
],
tags = ["manual"],
)
arm64_cc_toolchain_config(
name = "local-arm64",
tags = ["manual"],
target = "aarch64-linux-gnu",
)
arm64_cc_toolchain_config(
name = "local-amd64",
tags = ["manual"],
target = "x86_64-unknown-linux-gnu",
)
osx_cc_toolchain_config(
name = "local-osxcross",
tags = ["manual"],
target = "darwin_x86_64",
)
windows_cc_toolchain_config(
name = "local-windows",
tags = ["manual"],
target = "x86_64-w64",
)
@@ -91,6 +102,7 @@ cc_toolchain(
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 0,
tags = ["manual"],
toolchain_config = ":local-windows",
)
@@ -103,6 +115,7 @@ cc_toolchain(
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
tags = ["manual"],
toolchain_config = ":local-arm64",
)
@@ -115,6 +128,7 @@ cc_toolchain(
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
tags = ["manual"],
toolchain_config = ":local-osxcross",
)
@@ -127,6 +141,7 @@ cc_toolchain(
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
tags = ["manual"],
toolchain_config = ":local-amd64",
)
@@ -136,6 +151,7 @@ toolchain(
"@platforms//os:linux",
"@platforms//cpu:x86_64",
],
tags = ["manual"],
target_compatible_with = [],
toolchain = select({
":linux_arm64": ":cc-clang-arm64",

View File

@@ -1,164 +0,0 @@
# Copyright 2016 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This becomes the BUILD file for @local_config_cc// under non-FreeBSD unixes.
package(default_visibility = ["//visibility:public"])
load(":cc_toolchain_config.bzl", "cc_toolchain_config")
load(":armeabi_cc_toolchain_config.bzl", "armeabi_cc_toolchain_config")
load("@rules_cc//cc:defs.bzl", "cc_toolchain", "cc_toolchain_suite")
licenses(["notice"]) # Apache 2.0
cc_library(
name = "malloc",
)
filegroup(
name = "empty",
srcs = [],
)
filegroup(
name = "cc_wrapper",
srcs = ["cc_wrapper.sh"],
)
filegroup(
name = "compiler_deps",
srcs = glob(
["extra_tools/**"],
allow_empty = True,
) + [":builtin_include_directory_paths"],
)
# This is the entry point for --crosstool_top. Toolchains are found
# by lopping off the name of --crosstool_top and searching for
# the "${CPU}" entry in the toolchains attribute.
cc_toolchain_suite(
name = "toolchain",
toolchains = {
"k8|gcc": ":cc-compiler-k8",
"k8": ":cc-compiler-k8",
"armeabi-v7a|compiler": ":cc-compiler-armeabi-v7a",
"armeabi-v7a": ":cc-compiler-armeabi-v7a",
},
)
cc_toolchain(
name = "cc-compiler-k8",
all_files = ":compiler_deps",
ar_files = ":compiler_deps",
as_files = ":compiler_deps",
compiler_files = ":compiler_deps",
dwp_files = ":empty",
linker_files = ":compiler_deps",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":local",
toolchain_identifier = "local",
)
cc_toolchain_config(
name = "local",
abi_libc_version = "local",
abi_version = "local",
compile_flags = [
"-U_FORTIFY_SOURCE",
"-fstack-protector",
"-Wall",
"-Wunused-but-set-parameter",
"-Wno-free-nonheap-object",
"-fno-omit-frame-pointer",
],
compiler = "gcc",
coverage_compile_flags = ["--coverage"],
coverage_link_flags = ["--coverage"],
cpu = "k8",
cxx_builtin_include_directories = [
"/usr/lib/gcc/x86_64-linux-gnu/8/include",
"/usr/local/include",
"/usr/lib/gcc/x86_64-linux-gnu/8/include-fixed",
"/usr/include/x86_64-linux-gnu",
"/usr/include",
"/usr/include/c++/8",
"/usr/include/x86_64-linux-gnu/c++/8",
"/usr/include/c++/8/backward",
],
cxx_flags = ["-std=c++0x"],
dbg_compile_flags = ["-g"],
host_system_name = "local",
link_flags = [
"-fuse-ld=gold",
"-Wl,-no-as-needed",
"-Wl,-z,relro,-z,now",
"-B/usr/bin",
"-pass-exit-codes",
"-lm",
"-static-libgcc",
],
link_libs = ["-l:libstdc++.a"],
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 = "local",
target_system_name = "local",
tool_paths = {
"ar": "/usr/bin/ar",
"ld": "/usr/bin/ld",
"cpp": "/usr/bin/cpp",
"gcc": "/usr/bin/gcc",
"dwp": "/usr/bin/dwp",
"gcov": "/usr/bin/gcov",
"nm": "/usr/bin/nm",
"objcopy": "/usr/bin/objcopy",
"objdump": "/usr/bin/objdump",
"strip": "/usr/bin/strip",
},
toolchain_identifier = "local",
unfiltered_compile_flags = [
"-fno-canonical-system-headers",
"-Wno-builtin-macro-redefined",
"-D__DATE__=\"redacted\"",
"-D__TIMESTAMP__=\"redacted\"",
"-D__TIME__=\"redacted\"",
],
)
# Android tooling requires a default toolchain for the armeabi-v7a cpu.
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")

View File

@@ -1,82 +0,0 @@
# 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",
)
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],
)

View File

@@ -1,14 +0,0 @@
This file is generated by cc_configure and contains builtin include directories
that /usr/bin/gcc 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.
/usr/lib/gcc/x86_64-linux-gnu/8/include
/usr/local/include
/usr/lib/gcc/x86_64-linux-gnu/8/include-fixed
/usr/include/x86_64-linux-gnu
/usr/include
/usr/include/c++/8
/usr/include/x86_64-linux-gnu/c++/8
/usr/include/c++/8/backward

View File

@@ -1,25 +0,0 @@
#!/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.
#
# Ship the environment to the C++ action
#
set -eu
# Set-up the environment
# Call the C++ compiler
/usr/bin/gcc "$@"

View File

@@ -1,47 +0,0 @@
# Copyright 2016 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This file is auto-generated by an rbe_autoconfig repository rule
# and should not be modified directly.
# See @bazel_toolchains//rules:rbe_repo.bzl
package(default_visibility = ["//visibility:public"])
toolchain(
name = "cc-toolchain",
exec_compatible_with = [
"@bazel_tools//platforms:x86_64",
"@bazel_tools//platforms:linux",
"@bazel_tools//tools/cpp:gcc",
],
target_compatible_with = [
"@bazel_tools//platforms:linux",
"@bazel_tools//platforms:x86_64",
],
toolchain = "//tools/cross-toolchain/configs/gcc/bazel_2.1.1/cc:cc-compiler-k8",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
platform(
name = "platform",
constraint_values = [
"@bazel_tools//platforms:x86_64",
"@bazel_tools//platforms:linux",
"@bazel_tools//tools/cpp:gcc",
],
exec_properties = {
"container-image": "docker://gcr.io/prysmaticlabs/rbe-worker@sha256:d7407d58cee310e7ab788bf4256bba704344630621d8507f3c9cf253c7fc664f",
"OSFamily": "Linux",
},
)

View File

@@ -1,25 +0,0 @@
# Copyright 2016 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This file is auto-generated by an rbe_autoconfig repository rule
# and should not be modified directly.
# See @bazel_toolchains//rules:rbe_repo.bzl
package(default_visibility = ["//visibility:public"])
java_runtime(
name = "jdk",
srcs = [],
java_home = "/usr/lib/jvm/java-8-openjdk-amd64",
)

View File

@@ -1,147 +0,0 @@
package(default_visibility = ["//visibility:public"])
load(":cc_toolchain_config_osx.bzl", "osx_cc_toolchain_config")
load(":cc_toolchain_config_linux_arm64.bzl", "arm64_cc_toolchain_config")
load(":cc_toolchain_config_windows.bzl", "windows_cc_toolchain_config")
cc_toolchain_suite(
name = "multiarch_toolchain",
toolchains = {
"k8|osxcross": ":cc-clang-osx",
"k8|clang": "cc-clang-amd64",
"aarch64|clang": ":cc-clang-arm64",
"k8": "cc-clang-amd64",
"aarch64": ":cc-clang-arm64",
"k8|mingw-w64": ":cc-mingw-amd64",
},
)
cc_toolchain_suite(
name = "hostonly_toolchain",
toolchains = {
"k8": "cc-clang-amd64",
},
)
filegroup(
name = "empty",
srcs = [],
)
config_setting(
name = "osx_amd64",
constraint_values = [
"@platforms//os:osx",
"@platforms//cpu:x86_64",
],
)
config_setting(
name = "linux_arm64",
constraint_values = [
"@platforms//os:linux",
"@platforms//cpu:aarch64",
],
)
config_setting(
name = "linux_amd64",
constraint_values = [
"@platforms//os:linux",
"@platforms//cpu:x86_64",
],
)
config_setting(
name = "windows_amd64",
constraint_values = [
"@platforms//os:windows",
"@platforms//cpu:x86_64",
],
)
arm64_cc_toolchain_config(
name = "local-arm64",
target = "aarch64-linux-gnu",
)
arm64_cc_toolchain_config(
name = "local-amd64",
target = "x86_64-unknown-linux-gnu",
)
osx_cc_toolchain_config(
name = "local-osxcross",
target = "darwin_x86_64",
)
windows_cc_toolchain_config(
name = "local-windows",
target = "x86_64-w64",
)
cc_toolchain(
name = "cc-mingw-amd64",
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 = ":local-windows",
)
cc_toolchain(
name = "cc-clang-arm64",
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-arm64",
)
cc_toolchain(
name = "cc-clang-osx",
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-osxcross",
)
cc_toolchain(
name = "cc-clang-amd64",
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-amd64",
)
toolchain(
name = "cc-toolchain-multiarch",
exec_compatible_with = [
"@platforms//os:linux",
"@platforms//cpu:x86_64",
],
target_compatible_with = [],
toolchain = select({
":linux_arm64": ":cc-clang-arm64",
":linux_amd64": ":cc-clang-amd64",
":osx_amd64": ":cc-clang-osx",
":windows_amd64": ":cc-mingw-amd64",
}),
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)

View File

@@ -1,2 +0,0 @@
# DO NOT EDIT: automatically generated WORKSPACE file for prysm_toolchains rule
workspace(name = "prysm_toolchains")

View File

@@ -1,304 +0,0 @@
load(
"@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl",
"action_config",
"feature",
"feature_set",
"flag_group",
"flag_set",
"make_variable",
"tool",
"tool_path",
"with_feature_set",
)
load(
"@bazel_tools//tools/cpp:cc_toolchain_config.bzl",
ALL_COMPILE_ACTIONS = "all_compile_actions",
ALL_CPP_COMPILE_ACTIONS = "all_cpp_compile_actions",
ALL_LINK_ACTIONS = "all_link_actions",
)
def _impl(ctx):
toolchain_identifier = "clang-linux-cross"
compiler = "clang"
abi_version = "clang"
abi_libc_version = "glibc_unknown"
target_libc = "glibc_unknown"
target_cpu = ctx.attr.target.split("-")[0]
if (target_cpu == "aarch64"):
sysroot = "/usr/aarch64-linux-gnu"
include_path_prefix = sysroot
elif (target_cpu == "x86_64"):
sysroot = "/"
include_path_prefix = "/usr"
else:
fail("Unreachable")
if (target_cpu == "aarch64"):
cross_system_include_dirs = [
include_path_prefix + "/include/c++/v1",
include_path_prefix + "/lib/clang/10.0.0/include",
]
else:
cross_system_include_dirs = [
include_path_prefix + "/include/c++/v1",
include_path_prefix + "/lib/clang/10.0.0/include",
include_path_prefix + "/include/x86_64-linux-gnu",
]
cross_system_include_dirs += [
include_path_prefix + "/include/",
include_path_prefix + "/include/linux",
include_path_prefix + "/include/asm",
include_path_prefix + "/include/asm-generic",
]
if (target_cpu == "aarch64"):
cross_system_lib_dirs = [
"/usr/" + ctx.attr.target + "/lib",
]
else:
cross_system_lib_dirs = [
"/usr/lib/x86_64-linux-gnu/",
]
cross_system_lib_dirs += [
"/usr/lib/gcc/x86_64-linux-gnu/8",
]
opt_feature = feature(name = "opt")
dbg_feature = feature(name = "dbg")
fastbuild_feature = feature(name = "fastbuild")
random_seed_feature = feature(name = "random_seed", enabled = True)
supports_pic_feature = feature(name = "supports_pic", enabled = True)
supports_dynamic_linker_feature = feature(name = "supports_dynamic_linker", enabled = True)
unfiltered_compile_flags_feature = feature(
name = "unfiltered_compile_flags",
enabled = True,
flag_sets = [
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [
flag_group(
flags = [
"-no-canonical-prefixes",
"-Wno-builtin-macro-redefined",
"-D__DATE__=\"redacted\"",
"-D__TIMESTAMP__=\"redacted\"",
"-D__TIME__=\"redacted\"",
],
),
],
),
],
)
# explicit arch specific system includes
system_include_flags = []
for d in cross_system_include_dirs:
system_include_flags += ["-idirafter", d]
default_compile_flags_feature = feature(
name = "default_compile_flags",
enabled = True,
flag_sets = [
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [
flag_group(
flags = [
"--target=" + ctx.attr.target,
"-nostdinc",
"-U_FORTIFY_SOURCE",
"-fstack-protector",
"-fno-omit-frame-pointer",
"-fcolor-diagnostics",
"-Wall",
"-Wthread-safety",
"-Wself-assign",
] + system_include_flags,
),
],
),
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [flag_group(flags = ["-g", "-fstandalone-debug"])],
with_features = [with_feature_set(features = ["dbg"])],
),
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [
flag_group(
flags = [
"-g0",
"-O2",
"-D_FORTIFY_SOURCE=1",
"-DNDEBUG",
"-ffunction-sections",
"-fdata-sections",
],
),
],
with_features = [with_feature_set(features = ["opt"])],
),
flag_set(
actions = ALL_CPP_COMPILE_ACTIONS,
flag_groups = [flag_group(flags = ["-std=c++17", "-nostdinc++"])],
),
],
)
additional_link_flags = [
"-l:libc++.a",
"-l:libc++abi.a",
"-l:libunwind.a",
"-lpthread",
"-ldl",
"-rtlib=compiler-rt",
]
default_link_flags_feature = feature(
name = "default_link_flags",
enabled = True,
flag_sets = [
flag_set(
actions = ALL_LINK_ACTIONS,
flag_groups = [
flag_group(
flags = additional_link_flags + [
"--target=" + ctx.attr.target,
"-lm",
"-no-canonical-prefixes",
"-fuse-ld=lld",
"-Wl,--build-id=md5",
"-Wl,--hash-style=gnu",
"-Wl,-z,relro,-z,now",
] + ["-L" + d for d in cross_system_lib_dirs],
),
],
),
flag_set(
actions = ALL_LINK_ACTIONS,
flag_groups = [flag_group(flags = ["-Wl,--gc-sections"])],
with_features = [with_feature_set(features = ["opt"])],
),
],
)
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"])],
),
],
)
user_compile_flags_feature = feature(
name = "user_compile_flags",
enabled = True,
flag_sets = [
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [
flag_group(
expand_if_available = "user_compile_flags",
flags = ["%{user_compile_flags}"],
iterate_over = "user_compile_flags",
),
],
),
],
)
sysroot_feature = feature(
name = "sysroot",
enabled = True,
flag_sets = [
flag_set(
actions = ALL_COMPILE_ACTIONS + ALL_LINK_ACTIONS,
flag_groups = [
flag_group(
expand_if_available = "sysroot",
flags = ["--sysroot=%{sysroot}"],
),
],
),
],
)
coverage_feature = feature(
name = "coverage",
flag_sets = [
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [
flag_group(
flags = ["-fprofile-instr-generate", "-fcoverage-mapping"],
),
],
),
flag_set(
actions = ALL_LINK_ACTIONS,
flag_groups = [flag_group(flags = ["-fprofile-instr-generate"])],
),
],
provides = ["profile"],
)
features = [
opt_feature,
fastbuild_feature,
dbg_feature,
random_seed_feature,
supports_pic_feature,
supports_dynamic_linker_feature,
unfiltered_compile_flags_feature,
default_link_flags_feature,
default_compile_flags_feature,
objcopy_embed_flags_feature,
user_compile_flags_feature,
sysroot_feature,
coverage_feature,
]
tool_paths = [
tool_path(name = "ld", path = "/usr/bin/ld.lld"),
tool_path(name = "cpp", path = "/usr/bin/clang-cpp"),
tool_path(name = "dwp", path = "/usr/bin/llvm-dwp"),
tool_path(name = "gcov", path = "/usr/bin/llvm-profdata"),
tool_path(name = "nm", path = "/usr/bin/llvm-nm"),
tool_path(name = "objcopy", path = "/usr/bin/llvm-objcopy"),
tool_path(name = "objdump", path = "/usr/bin/llvm-objdump"),
tool_path(name = "strip", path = "/usr/bin/strip"),
tool_path(name = "gcc", path = "/usr/bin/clang"),
tool_path(name = "ar", path = "/usr/bin/llvm-ar"),
]
return cc_common.create_cc_toolchain_config_info(
ctx = ctx,
features = features,
abi_version = abi_version,
abi_libc_version = abi_libc_version,
builtin_sysroot = sysroot,
compiler = compiler,
cxx_builtin_include_directories = cross_system_include_dirs,
host_system_name = "x86_64-unknown-linux-gnu",
target_cpu = target_cpu,
target_libc = target_libc,
target_system_name = ctx.attr.target,
tool_paths = tool_paths,
toolchain_identifier = toolchain_identifier,
)
arm64_cc_toolchain_config = rule(
implementation = _impl,
attrs = {
"target": attr.string(mandatory = True),
"stdlib": attr.string(),
},
provides = [CcToolchainConfigInfo],
)

View File

@@ -1,250 +0,0 @@
load(
"@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl",
"action_config",
"feature",
"feature_set",
"flag_group",
"flag_set",
"make_variable",
"tool",
"tool_path",
"with_feature_set",
)
load(
"@bazel_tools//tools/cpp:cc_toolchain_config.bzl",
ALL_COMPILE_ACTIONS = "all_compile_actions",
ALL_CPP_COMPILE_ACTIONS = "all_cpp_compile_actions",
ALL_LINK_ACTIONS = "all_link_actions",
)
def _impl(ctx):
toolchain_identifier = "osxcross"
compiler = "clang"
abi_version = "darwin_x86_64"
abi_libc_version = "darwin_x86_64"
install = "/usr/x86_64-apple-darwin/"
clang_version = "10.0.0"
target_libc = "macosx"
target_cpu = "x86_64"
osxcross = install + "osxcross/"
osxcross_binprefix = osxcross + "bin/x86_64-apple-darwin14-"
sdkroot = osxcross + "SDK/MacOSX10.10.sdk/"
cross_system_include_dirs = [
"/usr/lib/clang/10.0.0/include",
osxcross + "include",
sdkroot + "usr/include",
]
cross_system_lib_dirs = [
"/usr/x86_64-apple-darwin/lib",
sdkroot + "usr/lib",
osxcross + "/lib",
]
opt_feature = feature(name = "opt")
dbg_feature = feature(name = "dbg")
fastbuild_feature = feature(name = "fastbuild")
random_seed_feature = feature(name = "random_seed", enabled = True)
supports_pic_feature = feature(name = "supports_pic", enabled = True)
supports_dynamic_linker_feature = feature(name = "supports_dynamic_linker", enabled = True)
unfiltered_compile_flags_feature = feature(
name = "unfiltered_compile_flags",
enabled = True,
flag_sets = [
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [
flag_group(
flags = [
"-stdlib=libc++",
"-no-canonical-prefixes",
"-Wno-builtin-macro-redefined",
"-D__DATE__=\"redacted\"",
"-D__TIMESTAMP__=\"redacted\"",
"-D__TIME__=\"redacted\"",
],
),
],
),
],
)
# explicit arch specific system includes
system_include_flags = []
for d in cross_system_include_dirs:
system_include_flags += ["-idirafter", d]
default_compile_flags_feature = feature(
name = "default_compile_flags",
enabled = True,
flag_sets = [
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [
flag_group(
flags = [
"-mlinker-version=400",
"-B " + osxcross + "bin",
"-nostdinc",
"-U_FORTIFY_SOURCE",
"-fstack-protector",
"-fno-omit-frame-pointer",
"-fcolor-diagnostics",
"-Wall",
"-Wthread-safety",
"-Wself-assign",
] + system_include_flags,
),
],
),
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [flag_group(flags = ["-g", "-fstandalone-debug"])],
with_features = [with_feature_set(features = ["dbg"])],
),
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [
flag_group(
flags = [
"-g0",
"-O2",
"-D_FORTIFY_SOURCE=1",
"-DNDEBUG",
"-ffunction-sections",
"-fdata-sections",
],
),
],
with_features = [with_feature_set(features = ["opt"])],
),
flag_set(
actions = ALL_CPP_COMPILE_ACTIONS,
flag_groups = [flag_group(flags = ["-std=c++17", "-nostdinc++"])],
),
],
)
default_link_flags_feature = feature(
name = "default_link_flags",
enabled = True,
flag_sets = [
flag_set(
actions = ALL_LINK_ACTIONS,
flag_groups = [
flag_group(
flags = [
"-v",
"-lm",
"-no-canonical-prefixes",
"-fuse-ld=lld",
"-lc++",
"-lc++abi",
"-F" + sdkroot + "System/Library/Frameworks/",
"-L" + sdkroot + "usr/lib",
"-undefined",
"dynamic_lookup",
],
),
],
),
],
)
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"])],
),
],
)
user_compile_flags_feature = feature(
name = "user_compile_flags",
enabled = True,
flag_sets = [
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [
flag_group(
expand_if_available = "user_compile_flags",
flags = ["%{user_compile_flags}"],
iterate_over = "user_compile_flags",
),
],
),
],
)
coverage_feature = feature(
name = "coverage",
flag_sets = [
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [
flag_group(
flags = ["-fprofile-instr-generate", "-fcoverage-mapping"],
),
],
),
flag_set(
actions = ALL_LINK_ACTIONS,
flag_groups = [flag_group(flags = ["-fprofile-instr-generate"])],
),
],
provides = ["profile"],
)
features = [
opt_feature,
fastbuild_feature,
dbg_feature,
random_seed_feature,
supports_pic_feature,
supports_dynamic_linker_feature,
unfiltered_compile_flags_feature,
default_link_flags_feature,
default_compile_flags_feature,
objcopy_embed_flags_feature,
user_compile_flags_feature,
coverage_feature,
]
tool_paths = [
tool_path(name = "ld", path = osxcross_binprefix + "ld"),
tool_path(name = "cpp", path = osxcross + "bin/o64-clang++"),
tool_path(name = "dwp", path = "/usr/bin/dwp"),
tool_path(name = "gcov", path = "/usr/bin/gcov"),
tool_path(name = "nm", path = osxcross_binprefix + "nm"),
tool_path(name = "objdump", path = osxcross_binprefix + "ObjectDump"),
tool_path(name = "strip", path = osxcross_binprefix + "strip"),
tool_path(name = "gcc", path = osxcross + "bin/o64-clang"),
tool_path(name = "ar", path = osxcross_binprefix + "libtool"),
]
return cc_common.create_cc_toolchain_config_info(
ctx = ctx,
features = features,
abi_version = abi_version,
abi_libc_version = abi_libc_version,
compiler = compiler,
cxx_builtin_include_directories = cross_system_include_dirs,
host_system_name = "x86_64-unknown-linux-gnu",
target_cpu = target_cpu,
target_libc = target_libc,
target_system_name = ctx.attr.target,
tool_paths = tool_paths,
toolchain_identifier = toolchain_identifier,
)
osx_cc_toolchain_config = rule(
implementation = _impl,
attrs = {
"target": attr.string(mandatory = True),
"stdlib": attr.string(),
},
provides = [CcToolchainConfigInfo],
)

View File

@@ -1,209 +0,0 @@
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",
"with_feature_set",
)
load(
"@bazel_tools//tools/cpp:cc_toolchain_config.bzl",
ALL_COMPILE_ACTIONS = "all_compile_actions",
ALL_CPP_COMPILE_ACTIONS = "all_cpp_compile_actions",
ALL_LINK_ACTIONS = "all_link_actions",
)
load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "ACTION_NAMES")
def _impl(ctx):
toolchain_identifier = "msys_x64_mingw"
host_system_name = "local"
target_system_name = "local"
target_cpu = "x64_windows"
target_libc = "mingw"
compiler = "mingw-gcc"
abi_version = "local"
abi_libc_version = "local"
cc_target_os = None
builtin_sysroot = None
action_configs = []
install = "/usr/x86_64-w64-mingw32/"
bin_prefix = "/usr/bin/x86_64-w64-mingw32-"
targets_windows_feature = feature(
name = "targets_windows",
implies = ["copy_dynamic_libraries_to_binary"],
enabled = True,
)
copy_dynamic_libraries_to_binary_feature = feature(name = "copy_dynamic_libraries_to_binary")
gcc_env_feature = feature(
name = "gcc_env",
enabled = True,
env_sets = [
env_set(
actions = [
ACTION_NAMES.c_compile,
ACTION_NAMES.cpp_compile,
ACTION_NAMES.cpp_module_compile,
ACTION_NAMES.cpp_module_codegen,
ACTION_NAMES.cpp_header_parsing,
ACTION_NAMES.assemble,
ACTION_NAMES.preprocess_assemble,
ACTION_NAMES.cpp_link_executable,
ACTION_NAMES.cpp_link_dynamic_library,
ACTION_NAMES.cpp_link_nodeps_dynamic_library,
ACTION_NAMES.cpp_link_static_library,
],
env_entries = [
env_entry(key = "PATH", value = "NOT_USED"),
],
),
],
)
msys_mingw_flags = [
"-B " + install + "bin",
"-nostdinc",
"-U_FORTIFY_SOURCE",
"-fstack-protector",
"-fno-omit-frame-pointer",
"-fcolor-diagnostics",
"-Wall",
"-Wthread-safety",
"-Wself-assign",
"-x c++",
"-lstdc++",
"-lpthread",
]
msys_mingw_link_flags = [
"-l:libstdc++.a",
"-L" + install + "lib",
"-L/usr/lib/gcc/x86_64-w64-mingw32/8.3-w32",
"-v",
"-lm",
"-no-canonical-prefixes",
]
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_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 = msys_mingw_flags)] if msys_mingw_flags else []),
),
],
)
compiler_param_file_feature = feature(
name = "compiler_param_file",
)
default_link_flags_feature = feature(
name = "default_link_flags",
enabled = True,
flag_sets = [
flag_set(
actions = ALL_LINK_ACTIONS,
flag_groups = ([flag_group(flags = msys_mingw_link_flags)] if msys_mingw_link_flags else []),
),
],
)
supports_dynamic_linker_feature = feature(name = "supports_dynamic_linker", enabled = True)
features = [
targets_windows_feature,
copy_dynamic_libraries_to_binary_feature,
gcc_env_feature,
default_compile_flags_feature,
compiler_param_file_feature,
default_link_flags_feature,
supports_dynamic_linker_feature,
]
cxx_builtin_include_directories = [
install + "include",
]
artifact_name_patterns = [
artifact_name_pattern(
category_name = "executable",
prefix = "",
extension = ".exe",
),
]
make_variables = []
tool_paths = [
tool_path(name = "ld", path = bin_prefix + "ld"),
tool_path(name = "cpp", path = bin_prefix + "cpp"),
tool_path(name = "gcov", path = "/usr/bin/gcov"),
tool_path(name = "nm", path = bin_prefix + "nm"),
tool_path(name = "objcopy", path = bin_prefix + "objcopy"),
tool_path(name = "objdump", path = bin_prefix + "objdump"),
tool_path(name = "strip", path = bin_prefix + "strip"),
tool_path(name = "gcc", path = bin_prefix + "gcc"),
tool_path(name = "ar", path = bin_prefix + "ar"),
]
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,
)
windows_cc_toolchain_config = rule(
implementation = _impl,
attrs = {
"target": attr.string(mandatory = True),
"stdlib": attr.string(),
},
provides = [CcToolchainConfigInfo],
)

View File

@@ -1,164 +0,0 @@
# Copyright 2016 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This becomes the BUILD file for @local_config_cc// under non-BSD unixes.
package(default_visibility = ["//visibility:public"])
load(":cc_toolchain_config.bzl", "cc_toolchain_config")
load(":armeabi_cc_toolchain_config.bzl", "armeabi_cc_toolchain_config")
load("@rules_cc//cc:defs.bzl", "cc_toolchain", "cc_toolchain_suite")
licenses(["notice"]) # Apache 2.0
cc_library(
name = "malloc",
)
filegroup(
name = "empty",
srcs = [],
)
filegroup(
name = "cc_wrapper",
srcs = ["cc_wrapper.sh"],
)
filegroup(
name = "compiler_deps",
srcs = glob(
["extra_tools/**"],
allow_empty = True,
) + [":builtin_include_directory_paths"],
)
# This is the entry point for --crosstool_top. Toolchains are found
# by lopping off the name of --crosstool_top and searching for
# the "${CPU}" entry in the toolchains attribute.
cc_toolchain_suite(
name = "toolchain",
toolchains = {
"k8|gcc": ":cc-compiler-k8",
"k8": ":cc-compiler-k8",
"armeabi-v7a|compiler": ":cc-compiler-armeabi-v7a",
"armeabi-v7a": ":cc-compiler-armeabi-v7a",
},
)
cc_toolchain(
name = "cc-compiler-k8",
all_files = ":compiler_deps",
ar_files = ":compiler_deps",
as_files = ":compiler_deps",
compiler_files = ":compiler_deps",
dwp_files = ":empty",
linker_files = ":compiler_deps",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":local",
toolchain_identifier = "local",
)
cc_toolchain_config(
name = "local",
abi_libc_version = "local",
abi_version = "local",
compile_flags = [
"-U_FORTIFY_SOURCE",
"-fstack-protector",
"-Wall",
"-Wunused-but-set-parameter",
"-Wno-free-nonheap-object",
"-fno-omit-frame-pointer",
],
compiler = "gcc",
coverage_compile_flags = ["--coverage"],
coverage_link_flags = ["--coverage"],
cpu = "k8",
cxx_builtin_include_directories = [
"/usr/lib/gcc/x86_64-linux-gnu/8/include",
"/usr/local/include",
"/usr/lib/gcc/x86_64-linux-gnu/8/include-fixed",
"/usr/include/x86_64-linux-gnu",
"/usr/include",
"/usr/include/c++/8",
"/usr/include/x86_64-linux-gnu/c++/8",
"/usr/include/c++/8/backward",
],
cxx_flags = ["-std=c++0x"],
dbg_compile_flags = ["-g"],
host_system_name = "local",
link_flags = [
"-fuse-ld=gold",
"-Wl,-no-as-needed",
"-Wl,-z,relro,-z,now",
"-B/usr/bin",
"-pass-exit-codes",
"-lm",
"-static-libgcc",
],
link_libs = ["-l:libstdc++.a"],
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 = "local",
target_system_name = "local",
tool_paths = {
"ar": "/usr/bin/ar",
"ld": "/usr/bin/ld",
"cpp": "/usr/bin/cpp",
"gcc": "/usr/bin/gcc",
"dwp": "/usr/bin/dwp",
"gcov": "/usr/bin/gcov",
"nm": "/usr/bin/nm",
"objcopy": "/usr/bin/objcopy",
"objdump": "/usr/bin/objdump",
"strip": "/usr/bin/strip",
},
toolchain_identifier = "local",
unfiltered_compile_flags = [
"-fno-canonical-system-headers",
"-Wno-builtin-macro-redefined",
"-D__DATE__=\"redacted\"",
"-D__TIMESTAMP__=\"redacted\"",
"-D__TIME__=\"redacted\"",
],
)
# Android tooling requires a default toolchain for the armeabi-v7a cpu.
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")

View File

@@ -1,82 +0,0 @@
# 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",
)
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],
)

View File

@@ -1,14 +0,0 @@
This file is generated by cc_configure and contains builtin include directories
that /usr/bin/gcc 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.
/usr/lib/gcc/x86_64-linux-gnu/8/include
/usr/local/include
/usr/lib/gcc/x86_64-linux-gnu/8/include-fixed
/usr/include/x86_64-linux-gnu
/usr/include
/usr/include/c++/8
/usr/include/x86_64-linux-gnu/c++/8
/usr/include/c++/8/backward

View File

@@ -1,25 +0,0 @@
#!/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.
#
# Ship the environment to the C++ action
#
set -eu
# Set-up the environment
# Call the C++ compiler
/usr/bin/gcc "$@"

View File

@@ -1,47 +0,0 @@
# Copyright 2016 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This file is auto-generated by an rbe_autoconfig repository rule
# and should not be modified directly.
# See @bazel_toolchains//rules:rbe_repo.bzl
package(default_visibility = ["//visibility:public"])
toolchain(
name = "cc-toolchain",
exec_compatible_with = [
"@bazel_tools//platforms:x86_64",
"@bazel_tools//platforms:linux",
"@bazel_tools//tools/cpp:gcc",
],
target_compatible_with = [
"@bazel_tools//platforms:linux",
"@bazel_tools//platforms:x86_64",
],
toolchain = "//tools/cross-toolchain/configs/gcc/bazel_3.2.0/cc:cc-compiler-k8",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
platform(
name = "platform",
constraint_values = [
"@bazel_tools//platforms:x86_64",
"@bazel_tools//platforms:linux",
"@bazel_tools//tools/cpp:gcc",
],
exec_properties = {
"container-image": "docker://gcr.io/prysmaticlabs/rbe-worker@sha256:0175024b0968eee56a50d4d813c4b2fc68dca90e7ecc453cdae6e82e112b845d",
"OSFamily": "Linux",
},
)

View File

@@ -1,25 +0,0 @@
# Copyright 2016 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This file is auto-generated by an rbe_autoconfig repository rule
# and should not be modified directly.
# See @bazel_toolchains//rules:rbe_repo.bzl
package(default_visibility = ["//visibility:public"])
java_runtime(
name = "jdk",
srcs = [],
java_home = "/usr/lib/jvm/java-8-openjdk-amd64",
)

View File

@@ -1,147 +0,0 @@
package(default_visibility = ["//visibility:public"])
load(":cc_toolchain_config_osx.bzl", "osx_cc_toolchain_config")
load(":cc_toolchain_config_linux_arm64.bzl", "arm64_cc_toolchain_config")
load(":cc_toolchain_config_windows.bzl", "windows_cc_toolchain_config")
cc_toolchain_suite(
name = "multiarch_toolchain",
toolchains = {
"k8|osxcross": ":cc-clang-osx",
"k8|clang": "cc-clang-amd64",
"aarch64|clang": ":cc-clang-arm64",
"k8": "cc-clang-amd64",
"aarch64": ":cc-clang-arm64",
"k8|mingw-w64": ":cc-mingw-amd64",
},
)
cc_toolchain_suite(
name = "hostonly_toolchain",
toolchains = {
"k8": "cc-clang-amd64",
},
)
filegroup(
name = "empty",
srcs = [],
)
config_setting(
name = "osx_amd64",
constraint_values = [
"@platforms//os:osx",
"@platforms//cpu:x86_64",
],
)
config_setting(
name = "linux_arm64",
constraint_values = [
"@platforms//os:linux",
"@platforms//cpu:aarch64",
],
)
config_setting(
name = "linux_amd64",
constraint_values = [
"@platforms//os:linux",
"@platforms//cpu:x86_64",
],
)
config_setting(
name = "windows_amd64",
constraint_values = [
"@platforms//os:windows",
"@platforms//cpu:x86_64",
],
)
arm64_cc_toolchain_config(
name = "local-arm64",
target = "aarch64-linux-gnu",
)
arm64_cc_toolchain_config(
name = "local-amd64",
target = "x86_64-unknown-linux-gnu",
)
osx_cc_toolchain_config(
name = "local-osxcross",
target = "darwin_x86_64",
)
windows_cc_toolchain_config(
name = "local-windows",
target = "x86_64-w64",
)
cc_toolchain(
name = "cc-mingw-amd64",
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 = ":local-windows",
)
cc_toolchain(
name = "cc-clang-arm64",
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-arm64",
)
cc_toolchain(
name = "cc-clang-osx",
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-osxcross",
)
cc_toolchain(
name = "cc-clang-amd64",
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-amd64",
)
toolchain(
name = "cc-toolchain-multiarch",
exec_compatible_with = [
"@platforms//os:linux",
"@platforms//cpu:x86_64",
],
target_compatible_with = [],
toolchain = select({
":linux_arm64": ":cc-clang-arm64",
":linux_amd64": ":cc-clang-amd64",
":osx_amd64": ":cc-clang-osx",
":windows_amd64": ":cc-mingw-amd64",
}),
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)

View File

@@ -1,2 +0,0 @@
# DO NOT EDIT: automatically generated WORKSPACE file for prysm_toolchains rule
workspace(name = "prysm_toolchains")

View File

@@ -1,305 +0,0 @@
load(
"@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl",
"action_config",
"feature",
"feature_set",
"flag_group",
"flag_set",
"make_variable",
"tool",
"tool_path",
"with_feature_set",
)
load(
"@bazel_tools//tools/cpp:cc_toolchain_config.bzl",
ALL_COMPILE_ACTIONS = "all_compile_actions",
ALL_CPP_COMPILE_ACTIONS = "all_cpp_compile_actions",
ALL_LINK_ACTIONS = "all_link_actions",
)
def _impl(ctx):
toolchain_identifier = "clang-linux-cross"
compiler = "clang"
abi_version = "clang"
abi_libc_version = "glibc_unknown"
target_libc = "glibc_unknown"
target_cpu = ctx.attr.target.split("-")[0]
if (target_cpu == "aarch64"):
sysroot = "/usr/aarch64-linux-gnu"
include_path_prefix = sysroot
elif (target_cpu == "x86_64"):
sysroot = "/"
include_path_prefix = "/usr"
else:
fail("Unreachable")
if (target_cpu == "aarch64"):
cross_system_include_dirs = [
include_path_prefix + "/include/c++/v1",
include_path_prefix + "/lib/clang/10.0.0/include",
]
else:
cross_system_include_dirs = [
include_path_prefix + "/include/c++/v1",
include_path_prefix + "/lib/clang/10.0.0/include",
include_path_prefix + "/include/x86_64-linux-gnu",
]
cross_system_include_dirs += [
include_path_prefix + "/include/",
include_path_prefix + "/include/linux",
include_path_prefix + "/include/asm",
include_path_prefix + "/include/asm-generic",
]
if (target_cpu == "aarch64"):
cross_system_lib_dirs = [
"/usr/" + ctx.attr.target + "/lib",
]
else:
cross_system_lib_dirs = [
"/usr/lib/x86_64-linux-gnu/",
]
cross_system_lib_dirs += [
"/usr/lib/gcc/x86_64-linux-gnu/8",
]
opt_feature = feature(name = "opt")
dbg_feature = feature(name = "dbg")
fastbuild_feature = feature(name = "fastbuild")
random_seed_feature = feature(name = "random_seed", enabled = True)
supports_pic_feature = feature(name = "supports_pic", enabled = True)
supports_dynamic_linker_feature = feature(name = "supports_dynamic_linker", enabled = True)
unfiltered_compile_flags_feature = feature(
name = "unfiltered_compile_flags",
enabled = True,
flag_sets = [
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [
flag_group(
flags = [
"-no-canonical-prefixes",
"-Wno-builtin-macro-redefined",
"-D__DATE__=\"redacted\"",
"-D__TIMESTAMP__=\"redacted\"",
"-D__TIME__=\"redacted\"",
],
),
],
),
],
)
# explicit arch specific system includes
system_include_flags = []
for d in cross_system_include_dirs:
system_include_flags += ["-idirafter", d]
default_compile_flags_feature = feature(
name = "default_compile_flags",
enabled = True,
flag_sets = [
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [
flag_group(
flags = [
"--target=" + ctx.attr.target,
"-nostdinc",
"-U_FORTIFY_SOURCE",
"-fstack-protector",
"-fno-omit-frame-pointer",
"-fcolor-diagnostics",
"-Wall",
"-Wthread-safety",
"-Wself-assign",
] + system_include_flags,
),
],
),
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [flag_group(flags = ["-g", "-fstandalone-debug"])],
with_features = [with_feature_set(features = ["dbg"])],
),
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [
flag_group(
flags = [
"-g0",
"-O2",
"-D_FORTIFY_SOURCE=1",
"-DNDEBUG",
"-ffunction-sections",
"-fdata-sections",
],
),
],
with_features = [with_feature_set(features = ["opt"])],
),
flag_set(
actions = ALL_CPP_COMPILE_ACTIONS,
flag_groups = [flag_group(flags = ["-std=c++17", "-nostdinc++"])],
),
],
)
additional_link_flags = [
"-l:libc++.a",
"-l:libc++abi.a",
"-l:libunwind.a",
"-lpthread",
"-ldl",
"-rtlib=compiler-rt",
]
default_link_flags_feature = feature(
name = "default_link_flags",
enabled = True,
flag_sets = [
flag_set(
actions = ALL_LINK_ACTIONS,
flag_groups = [
flag_group(
flags = additional_link_flags + [
"--target=" + ctx.attr.target,
"-lm",
"-no-canonical-prefixes",
"-fuse-ld=lld",
"-Wl,--build-id=md5",
"-Wl,--hash-style=gnu",
"-Wl,-z,relro,-z,now",
] + ["-L" + d for d in cross_system_lib_dirs],
),
],
),
flag_set(
actions = ALL_LINK_ACTIONS,
flag_groups = [flag_group(flags = ["-Wl,--gc-sections"])],
with_features = [with_feature_set(features = ["opt"])],
),
],
)
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"])],
),
],
)
user_compile_flags_feature = feature(
name = "user_compile_flags",
enabled = True,
flag_sets = [
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [
flag_group(
expand_if_available = "user_compile_flags",
flags = ["%{user_compile_flags}"],
iterate_over = "user_compile_flags",
),
],
),
],
)
sysroot_feature = feature(
name = "sysroot",
enabled = True,
flag_sets = [
flag_set(
actions = ALL_COMPILE_ACTIONS + ALL_LINK_ACTIONS,
flag_groups = [
flag_group(
expand_if_available = "sysroot",
flags = ["--sysroot=%{sysroot}"],
),
],
),
],
)
coverage_feature = feature(
name = "coverage",
flag_sets = [
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [
flag_group(
flags = ["-fprofile-instr-generate", "-fcoverage-mapping"],
),
],
),
flag_set(
actions = ALL_LINK_ACTIONS,
flag_groups = [flag_group(flags = ["-fprofile-instr-generate"])],
),
],
provides = ["profile"],
)
features = [
opt_feature,
fastbuild_feature,
dbg_feature,
random_seed_feature,
supports_pic_feature,
supports_dynamic_linker_feature,
unfiltered_compile_flags_feature,
default_link_flags_feature,
default_compile_flags_feature,
objcopy_embed_flags_feature,
user_compile_flags_feature,
sysroot_feature,
coverage_feature,
]
tool_paths = [
tool_path(name = "ld", path = "/usr/bin/ld.lld"),
tool_path(name = "cpp", path = "/usr/bin/clang-cpp"),
tool_path(name = "dwp", path = "/usr/bin/llvm-dwp"),
tool_path(name = "gcov", path = "/usr/bin/llvm-profdata"),
tool_path(name = "nm", path = "/usr/bin/llvm-nm"),
tool_path(name = "objcopy", path = "/usr/bin/llvm-objcopy"),
tool_path(name = "objdump", path = "/usr/bin/llvm-objdump"),
tool_path(name = "strip", path = "/usr/bin/strip"),
tool_path(name = "gcc", path = "/usr/bin/clang"),
tool_path(name = "ar", path = "/usr/bin/llvm-ar"),
]
return cc_common.create_cc_toolchain_config_info(
ctx = ctx,
features = features,
abi_version = abi_version,
abi_libc_version = abi_libc_version,
builtin_sysroot = sysroot,
compiler = compiler,
cxx_builtin_include_directories = cross_system_include_dirs,
host_system_name = "x86_64-unknown-linux-gnu",
target_cpu = target_cpu,
target_libc = target_libc,
target_system_name = ctx.attr.target,
tool_paths = tool_paths,
toolchain_identifier = toolchain_identifier,
)
arm64_cc_toolchain_config = rule(
implementation = _impl,
attrs = {
"target": attr.string(mandatory = True),
"stdlib": attr.string(),
},
provides = [CcToolchainConfigInfo],
)

View File

@@ -1,251 +0,0 @@
load(
"@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl",
"action_config",
"feature",
"feature_set",
"flag_group",
"flag_set",
"make_variable",
"tool",
"tool_path",
"with_feature_set",
)
load(
"@bazel_tools//tools/cpp:cc_toolchain_config.bzl",
ALL_COMPILE_ACTIONS = "all_compile_actions",
ALL_CPP_COMPILE_ACTIONS = "all_cpp_compile_actions",
ALL_LINK_ACTIONS = "all_link_actions",
)
def _impl(ctx):
toolchain_identifier = "osxcross"
compiler = "clang"
abi_version = "darwin_x86_64"
abi_libc_version = "darwin_x86_64"
install = "/usr/x86_64-apple-darwin/"
clang_version = "10.0.0"
target_libc = "macosx"
target_cpu = "x86_64"
osxcross = install + "osxcross/"
osxcross_binprefix = osxcross + "bin/x86_64-apple-darwin14-"
sdkroot = osxcross + "SDK/MacOSX10.10.sdk/"
cross_system_include_dirs = [
"/usr/lib/clang/10.0.0/include",
osxcross + "include",
sdkroot + "usr/include",
]
cross_system_lib_dirs = [
"/usr/x86_64-apple-darwin/lib",
sdkroot + "usr/lib",
osxcross + "/lib",
]
opt_feature = feature(name = "opt")
dbg_feature = feature(name = "dbg")
fastbuild_feature = feature(name = "fastbuild")
random_seed_feature = feature(name = "random_seed", enabled = True)
supports_pic_feature = feature(name = "supports_pic", enabled = True)
supports_dynamic_linker_feature = feature(name = "supports_dynamic_linker", enabled = True)
unfiltered_compile_flags_feature = feature(
name = "unfiltered_compile_flags",
enabled = True,
flag_sets = [
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [
flag_group(
flags = [
"-stdlib=libc++",
"-no-canonical-prefixes",
"-Wno-builtin-macro-redefined",
"-D__DATE__=\"redacted\"",
"-D__TIMESTAMP__=\"redacted\"",
"-D__TIME__=\"redacted\"",
],
),
],
),
],
)
# explicit arch specific system includes
system_include_flags = []
for d in cross_system_include_dirs:
system_include_flags += ["-idirafter", d]
default_compile_flags_feature = feature(
name = "default_compile_flags",
enabled = True,
flag_sets = [
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [
flag_group(
flags = [
"-mlinker-version=400",
"-B " + osxcross + "bin",
"-nostdinc",
"-U_FORTIFY_SOURCE",
"-fstack-protector",
"-fno-omit-frame-pointer",
"-fcolor-diagnostics",
"-Wall",
"-Wthread-safety",
"-Wself-assign",
] + system_include_flags,
),
],
),
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [flag_group(flags = ["-g", "-fstandalone-debug"])],
with_features = [with_feature_set(features = ["dbg"])],
),
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [
flag_group(
flags = [
"-g0",
"-O2",
"-D_FORTIFY_SOURCE=1",
"-DNDEBUG",
"-ffunction-sections",
"-fdata-sections",
],
),
],
with_features = [with_feature_set(features = ["opt"])],
),
flag_set(
actions = ALL_CPP_COMPILE_ACTIONS,
flag_groups = [flag_group(flags = ["-std=c++17", "-nostdinc++"])],
),
],
)
default_link_flags_feature = feature(
name = "default_link_flags",
enabled = True,
flag_sets = [
flag_set(
actions = ALL_LINK_ACTIONS,
flag_groups = [
flag_group(
flags = [
"-v",
"-lm",
"-no-canonical-prefixes",
"-fuse-ld=lld",
"-lc++",
"-lc++abi",
"-F" + sdkroot + "System/Library/Frameworks/",
"-L"+ sdkroot + "usr/lib",
"-undefined",
"dynamic_lookup",
],
),
],
),
],
)
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"])],
),
],
)
user_compile_flags_feature = feature(
name = "user_compile_flags",
enabled = True,
flag_sets = [
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [
flag_group(
expand_if_available = "user_compile_flags",
flags = ["%{user_compile_flags}"],
iterate_over = "user_compile_flags",
),
],
),
],
)
coverage_feature = feature(
name = "coverage",
flag_sets = [
flag_set(
actions = ALL_COMPILE_ACTIONS,
flag_groups = [
flag_group(
flags = ["-fprofile-instr-generate", "-fcoverage-mapping"],
),
],
),
flag_set(
actions = ALL_LINK_ACTIONS,
flag_groups = [flag_group(flags = ["-fprofile-instr-generate"])],
),
],
provides = ["profile"],
)
features = [
opt_feature,
fastbuild_feature,
dbg_feature,
random_seed_feature,
supports_pic_feature,
supports_dynamic_linker_feature,
unfiltered_compile_flags_feature,
default_link_flags_feature,
default_compile_flags_feature,
objcopy_embed_flags_feature,
user_compile_flags_feature,
coverage_feature,
]
tool_paths = [
tool_path(name = "ld", path = osxcross_binprefix + "ld"),
tool_path(name = "cpp", path = osxcross + "bin/o64-clang++"),
tool_path(name = "dwp", path = "/usr/bin/dwp"),
tool_path(name = "gcov", path = "/usr/bin/gcov"),
tool_path(name = "nm", path = osxcross_binprefix + "nm"),
tool_path(name = "objdump", path = osxcross_binprefix + "ObjectDump"),
tool_path(name = "strip", path = osxcross_binprefix + "strip"),
tool_path(name = "gcc", path = osxcross + "bin/o64-clang"),
tool_path(name = "ar", path = osxcross_binprefix + "libtool"),
]
return cc_common.create_cc_toolchain_config_info(
ctx = ctx,
features = features,
abi_version = abi_version,
abi_libc_version = abi_libc_version,
compiler = compiler,
cxx_builtin_include_directories = cross_system_include_dirs,
host_system_name = "x86_64-unknown-linux-gnu",
target_cpu = target_cpu,
target_libc = target_libc,
target_system_name = ctx.attr.target,
tool_paths = tool_paths,
toolchain_identifier = toolchain_identifier,
)
osx_cc_toolchain_config = rule(
implementation = _impl,
attrs = {
"target": attr.string(mandatory = True),
"stdlib": attr.string(),
},
provides = [CcToolchainConfigInfo],
)

View File

@@ -1,213 +0,0 @@
load(
"@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl",
"action_config",
"feature",
"feature_set",
"flag_group",
"flag_set",
"make_variable",
"tool",
"tool_path",
"with_feature_set",
"artifact_name_pattern",
"env_set",
"env_entry",
)
load(
"@bazel_tools//tools/cpp:cc_toolchain_config.bzl",
ALL_COMPILE_ACTIONS = "all_compile_actions",
ALL_CPP_COMPILE_ACTIONS = "all_cpp_compile_actions",
ALL_LINK_ACTIONS = "all_link_actions",
)
load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "ACTION_NAMES")
def _impl(ctx):
toolchain_identifier = "msys_x64_mingw"
host_system_name = "local"
target_system_name = "local"
target_cpu = "x64_windows"
target_libc = "mingw"
compiler = "mingw-gcc"
abi_version = "local"
abi_libc_version = "local"
cc_target_os = None
builtin_sysroot = None
action_configs = []
install = "/usr/x86_64-w64-mingw32/"
bin_prefix = "/usr/bin/x86_64-w64-mingw32-"
targets_windows_feature = feature(
name = "targets_windows",
implies = ["copy_dynamic_libraries_to_binary"],
enabled = True,
)
copy_dynamic_libraries_to_binary_feature = feature(name = "copy_dynamic_libraries_to_binary")
gcc_env_feature = feature(
name = "gcc_env",
enabled = True,
env_sets = [
env_set(
actions = [
ACTION_NAMES.c_compile,
ACTION_NAMES.cpp_compile,
ACTION_NAMES.cpp_module_compile,
ACTION_NAMES.cpp_module_codegen,
ACTION_NAMES.cpp_header_parsing,
ACTION_NAMES.assemble,
ACTION_NAMES.preprocess_assemble,
ACTION_NAMES.cpp_link_executable,
ACTION_NAMES.cpp_link_dynamic_library,
ACTION_NAMES.cpp_link_nodeps_dynamic_library,
ACTION_NAMES.cpp_link_static_library,
],
env_entries = [
env_entry(key = "PATH", value = "NOT_USED"),
],
),
],
)
msys_mingw_flags = [
"-B " + install + "bin",
"-nostdinc",
"-U_FORTIFY_SOURCE",
"-fstack-protector",
"-fno-omit-frame-pointer",
"-fcolor-diagnostics",
"-Wall",
"-Wthread-safety",
"-Wself-assign",
"-x c++",
"-lstdc++",
"-lpthread"
]
msys_mingw_link_flags = [
"-l:libstdc++.a",
"-L" + install + "lib",
"-L/usr/lib/gcc/x86_64-w64-mingw32/8.3-w32",
"-v",
"-lm",
"-no-canonical-prefixes",
]
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_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 = msys_mingw_flags)] if msys_mingw_flags else []),
),
],
)
compiler_param_file_feature = feature(
name = "compiler_param_file",
)
default_link_flags_feature = feature(
name = "default_link_flags",
enabled = True,
flag_sets = [
flag_set(
actions = ALL_LINK_ACTIONS,
flag_groups = ([flag_group(flags = msys_mingw_link_flags)] if msys_mingw_link_flags else []),
),
],
)
supports_dynamic_linker_feature = feature(name = "supports_dynamic_linker", enabled = True)
features = [
targets_windows_feature,
copy_dynamic_libraries_to_binary_feature,
gcc_env_feature,
default_compile_flags_feature,
compiler_param_file_feature,
default_link_flags_feature,
supports_dynamic_linker_feature,
]
cxx_builtin_include_directories = [
install +"include"
]
artifact_name_patterns = [
artifact_name_pattern(
category_name = "executable",
prefix = "",
extension = ".exe",
),
]
make_variables = []
tool_paths = [
tool_path(name = "ld", path = bin_prefix + "ld"),
tool_path(name = "cpp", path = bin_prefix + "cpp"),
tool_path(name = "gcov", path = "/usr/bin/gcov"),
tool_path(name = "nm", path = bin_prefix + "nm"),
tool_path(name = "objcopy", path = bin_prefix + "objcopy"),
tool_path(name = "objdump", path = bin_prefix + "objdump"),
tool_path(name = "strip", path = bin_prefix + "strip"),
tool_path(name = "gcc", path = bin_prefix + "gcc"),
tool_path(name = "ar", path = bin_prefix + "ar"),
]
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,
)
windows_cc_toolchain_config = rule(
implementation = _impl,
attrs = {
"target": attr.string(mandatory = True),
"stdlib": attr.string(),
},
provides = [CcToolchainConfigInfo],
)