This commit is contained in:
Preston Van Loon
2020-11-06 10:13:21 -08:00
parent 8f8ba77968
commit ea4425bde6
3 changed files with 76 additions and 56 deletions

View File

@@ -38,7 +38,10 @@ filegroup(
filegroup(
name = "compiler_deps",
srcs = glob(["extra_tools/**"], allow_empty = True) + [":builtin_include_directory_paths"],
srcs = glob(
["extra_tools/**"],
allow_empty = True,
) + [":builtin_include_directory_paths"],
)
# This is the entry point for --crosstool_top. Toolchains are found
@@ -56,39 +59,76 @@ cc_toolchain_suite(
cc_toolchain(
name = "cc-compiler-k8",
toolchain_identifier = "local",
toolchain_config = ":local",
all_files = ":compiler_deps",
ar_files = ":compiler_deps",
as_files = ":compiler_deps",
compiler_files = ":compiler_deps",
dwp_files = ":empty",
linker_files = ":compiler_deps",
module_map = ":module.modulemap",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
module_map = ":module.modulemap",
toolchain_config = ":local",
toolchain_identifier = "local",
)
cc_toolchain_config(
name = "local",
cpu = "k8",
compiler = "clang",
toolchain_identifier = "local",
host_system_name = "local",
target_system_name = "local",
target_libc = "local",
abi_version = "local",
abi_libc_version = "local",
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"],
tool_paths = {"ar": "/usr/bin/ar",
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",
@@ -97,45 +137,21 @@ cc_toolchain_config(
"nm": "/usr/bin/nm",
"objcopy": "/usr/bin/objcopy",
"objdump": "/usr/bin/objdump",
"strip": "/usr/bin/strip"},
compile_flags = ["-U_FORTIFY_SOURCE",
"-fstack-protector",
"-Wall",
"-Wthread-safety",
"-Wself-assign",
"-fcolor-diagnostics",
"-fno-omit-frame-pointer"],
opt_compile_flags = ["-g0",
"-O2",
"-D_FORTIFY_SOURCE=1",
"-DNDEBUG",
"-ffunction-sections",
"-fdata-sections"],
dbg_compile_flags = ["-g"],
cxx_flags = ["-std=c++0x"],
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_link_flags = ["-Wl,--gc-sections"],
unfiltered_compile_flags = ["-no-canonical-prefixes",
"-Wno-builtin-macro-redefined",
"-D__DATE__=\"redacted\"",
"-D__TIMESTAMP__=\"redacted\"",
"-D__TIME__=\"redacted\""],
coverage_compile_flags = ["-fprofile-instr-generate", "-fcoverage-mapping"],
coverage_link_flags = ["-fprofile-instr-generate"],
supports_start_end_lib = True,
"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",
toolchain_identifier = "stub_armeabi-v7a",
toolchain_config = ":stub_armeabi-v7a",
all_files = ":empty",
ar_files = ":empty",
as_files = ":empty",
@@ -145,6 +161,8 @@ cc_toolchain(
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

@@ -40,5 +40,8 @@ platform(
"@bazel_tools//platforms:linux",
"@bazel_tools//tools/cpp:clang",
],
exec_properties = {"container-image": "docker://gcr.io/prysmaticlabs/rbe-worker@sha256:d5fa14154811dff0886e4c808dc15f18c4bb8545a1ef3c53805a0db13564bdad", "OSFamily": "Linux"},
exec_properties = {
"container-image": "docker://gcr.io/prysmaticlabs/rbe-worker@sha256:d5fa14154811dff0886e4c808dc15f18c4bb8545a1ef3c53805a0db13564bdad",
"OSFamily": "Linux",
},
)

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 = {