bazel: Check in 5.3.0 cross compile clang toolchain (#11577)

* Check in 5.3.0 generated clang cross-toolchain

* Remove tools/cross-toolchain/configs/clang/bazel_5.0.0

* Add manual tags and run gazelle

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
This commit is contained in:
Preston Van Loon 2022-10-26 21:48:23 -05:00 committed by GitHub
parent 007c776d8a
commit 55690de685
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 50 additions and 11 deletions

View File

@ -37,7 +37,6 @@ build:minimal --@io_bazel_rules_go//go/config:tags=minimal
# Release flags
build:release --compilation_mode=opt
build:release --config=llvm
# LLVM compiler for building C/C++ dependencies.
build:llvm --define compiler=llvm

View File

@ -19,13 +19,13 @@
# Specifically, it includes all toolchain/platform flags
# This file is used for testing purposes.
build:remote --host_javabase=//tools/cross-toolchain/configs/clang/bazel_5.0.0/java:jdk
build:remote --javabase=//tools/cross-toolchain/configs/clang/bazel_5.0.0/java:jdk
build:remote --crosstool_top=//tools/cross-toolchain/configs/clang/bazel_5.0.0/cc:toolchain
build:remote --extra_toolchains=//tools/cross-toolchain/configs/clang/bazel_5.0.0/config:cc-toolchain
build:remote --extra_execution_platforms=//tools/cross-toolchain/configs/clang/bazel_5.0.0/config:platform
build:remote --host_platform=//tools/cross-toolchain/configs/clang/bazel_5.0.0/config:platform
build:remote --platforms=//tools/cross-toolchain/configs/clang/bazel_5.0.0/config:platform
build:remote --host_javabase=//tools/cross-toolchain/configs/clang/bazel_5.3.0/java:jdk
build:remote --javabase=//tools/cross-toolchain/configs/clang/bazel_5.3.0/java:jdk
build:remote --crosstool_top=//tools/cross-toolchain/configs/clang/bazel_5.3.0/cc:toolchain
build:remote --extra_toolchains=//tools/cross-toolchain/configs/clang/bazel_5.3.0/config:cc-toolchain
build:remote --extra_execution_platforms=//tools/cross-toolchain/configs/clang/bazel_5.3.0/config:platform
build:remote --host_platform=//tools/cross-toolchain/configs/clang/bazel_5.3.0/config:platform
build:remote --platforms=//tools/cross-toolchain/configs/clang/bazel_5.3.0/config:platform
# Import the default bazelrc file in bazel-toolchains repo.
# This will only work for tests executed from bazel-toolchains

View File

@ -84,7 +84,6 @@ cc_toolchain_config(
abi_libc_version = "local",
abi_version = "local",
compile_flags = [
"-U_FORTIFY_SOURCE",
"-fstack-protector",
"-Wall",
"-Wthread-safety",

View File

@ -173,6 +173,21 @@ def _impl(ctx):
name = "default_compile_flags",
enabled = True,
flag_sets = [
flag_set(
actions = all_compile_actions,
flag_groups = [
flag_group(
# Security hardening requires optimization.
# We need to undef it as some distributions now have it enabled by default.
flags = ["-U_FORTIFY_SOURCE"],
),
],
with_features = [
with_feature_set(
not_features = ["thin_lto"],
),
],
),
flag_set(
actions = all_compile_actions,
flag_groups = ([
@ -1049,6 +1064,31 @@ def _impl(ctx):
],
)
serialized_diagnostics_file_feature = feature(
name = "serialized_diagnostics_file",
flag_sets = [
flag_set(
actions = [
ACTION_NAMES.assemble,
ACTION_NAMES.preprocess_assemble,
ACTION_NAMES.c_compile,
ACTION_NAMES.cpp_compile,
ACTION_NAMES.cpp_module_compile,
ACTION_NAMES.objc_compile,
ACTION_NAMES.objcpp_compile,
ACTION_NAMES.cpp_header_parsing,
ACTION_NAMES.clif_match,
],
flag_groups = [
flag_group(
flags = ["--serialize-diagnostics", "%{serialized_diagnostics_file}"],
expand_if_available = "serialized_diagnostics_file",
),
],
),
],
)
dynamic_library_linker_tool_path = tool_paths
dynamic_library_linker_tool_feature = feature(
name = "dynamic_library_linker_tool",
@ -1187,6 +1227,7 @@ def _impl(ctx):
if is_linux:
features = [
dependency_file_feature,
serialized_diagnostics_file_feature,
random_seed_feature,
pic_feature,
per_object_debug_info_feature,

View File

@ -29,7 +29,7 @@ toolchain(
"@bazel_tools//platforms:linux",
"@bazel_tools//platforms:x86_64",
],
toolchain = "//tools/cross-toolchain/configs/clang/bazel_5.0.0/cc:cc-compiler-k8",
toolchain = "//tools/cross-toolchain/configs/clang/bazel_5.3.0/cc:cc-compiler-k8",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)

View File

@ -3,7 +3,7 @@
"""Definitions to be used in rbe_repo attr of an rbe_autoconf rule """
toolchain_config_spec0 = struct(config_repos = ["prysm_toolchains"], create_cc_configs = True, create_java_configs = True, env = {"BAZEL_COMPILER": "clang", "BAZEL_LINKLIBS": "-l%:libstdc++.a", "BAZEL_LINKOPTS": "-lm:-static-libgcc", "BAZEL_USE_LLVM_NATIVE_COVERAGE": "1", "GCOV": "llvm-profdata", "CC": "clang", "CXX": "clang++"}, java_home = "/usr/lib/jvm/java-8-openjdk-amd64", name = "clang")
_TOOLCHAIN_CONFIG_SPECS = [toolchain_config_spec0]
_BAZEL_TO_CONFIG_SPEC_NAMES = {"5.0.0": ["clang"]}
_BAZEL_TO_CONFIG_SPEC_NAMES = {"5.3.0": ["clang"]}
LATEST = "sha256:9e04c71268adeb4028b4016ca8cc02d134c2e5d7e3a53fdc68154d1797bb3d70"
CONTAINER_TO_CONFIG_SPEC_NAMES = {"sha256:9e04c71268adeb4028b4016ca8cc02d134c2e5d7e3a53fdc68154d1797bb3d70": ["clang"]}
_DEFAULT_TOOLCHAIN_CONFIG_SPEC = toolchain_config_spec0