diff --git a/.bazelrc b/.bazelrc index 1f43fc9c4..d4447811b 100644 --- a/.bazelrc +++ b/.bazelrc @@ -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 diff --git a/tools/cross-toolchain/configs/.latest.bazelrc b/tools/cross-toolchain/configs/.latest.bazelrc index cd5888b61..44e6c707d 100644 --- a/tools/cross-toolchain/configs/.latest.bazelrc +++ b/tools/cross-toolchain/configs/.latest.bazelrc @@ -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 diff --git a/tools/cross-toolchain/configs/clang/bazel_5.0.0/cc/BUILD b/tools/cross-toolchain/configs/clang/bazel_5.3.0/cc/BUILD similarity index 99% rename from tools/cross-toolchain/configs/clang/bazel_5.0.0/cc/BUILD rename to tools/cross-toolchain/configs/clang/bazel_5.3.0/cc/BUILD index 7b1615144..c58ce8725 100755 --- a/tools/cross-toolchain/configs/clang/bazel_5.0.0/cc/BUILD +++ b/tools/cross-toolchain/configs/clang/bazel_5.3.0/cc/BUILD @@ -84,7 +84,6 @@ cc_toolchain_config( abi_libc_version = "local", abi_version = "local", compile_flags = [ - "-U_FORTIFY_SOURCE", "-fstack-protector", "-Wall", "-Wthread-safety", diff --git a/tools/cross-toolchain/configs/clang/bazel_5.0.0/cc/armeabi_cc_toolchain_config.bzl b/tools/cross-toolchain/configs/clang/bazel_5.3.0/cc/armeabi_cc_toolchain_config.bzl similarity index 100% rename from tools/cross-toolchain/configs/clang/bazel_5.0.0/cc/armeabi_cc_toolchain_config.bzl rename to tools/cross-toolchain/configs/clang/bazel_5.3.0/cc/armeabi_cc_toolchain_config.bzl diff --git a/tools/cross-toolchain/configs/clang/bazel_5.0.0/cc/builtin_include_directory_paths b/tools/cross-toolchain/configs/clang/bazel_5.3.0/cc/builtin_include_directory_paths similarity index 100% rename from tools/cross-toolchain/configs/clang/bazel_5.0.0/cc/builtin_include_directory_paths rename to tools/cross-toolchain/configs/clang/bazel_5.3.0/cc/builtin_include_directory_paths diff --git a/tools/cross-toolchain/configs/clang/bazel_5.0.0/cc/cc_toolchain_config.bzl b/tools/cross-toolchain/configs/clang/bazel_5.3.0/cc/cc_toolchain_config.bzl similarity index 96% rename from tools/cross-toolchain/configs/clang/bazel_5.0.0/cc/cc_toolchain_config.bzl rename to tools/cross-toolchain/configs/clang/bazel_5.3.0/cc/cc_toolchain_config.bzl index 261191410..0b77afcb7 100755 --- a/tools/cross-toolchain/configs/clang/bazel_5.0.0/cc/cc_toolchain_config.bzl +++ b/tools/cross-toolchain/configs/clang/bazel_5.3.0/cc/cc_toolchain_config.bzl @@ -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, diff --git a/tools/cross-toolchain/configs/clang/bazel_5.0.0/cc/cc_wrapper.sh b/tools/cross-toolchain/configs/clang/bazel_5.3.0/cc/cc_wrapper.sh similarity index 100% rename from tools/cross-toolchain/configs/clang/bazel_5.0.0/cc/cc_wrapper.sh rename to tools/cross-toolchain/configs/clang/bazel_5.3.0/cc/cc_wrapper.sh diff --git a/tools/cross-toolchain/configs/clang/bazel_5.0.0/cc/module.modulemap b/tools/cross-toolchain/configs/clang/bazel_5.3.0/cc/module.modulemap similarity index 100% rename from tools/cross-toolchain/configs/clang/bazel_5.0.0/cc/module.modulemap rename to tools/cross-toolchain/configs/clang/bazel_5.3.0/cc/module.modulemap diff --git a/tools/cross-toolchain/configs/clang/bazel_5.0.0/config/BUILD b/tools/cross-toolchain/configs/clang/bazel_5.3.0/config/BUILD similarity index 96% rename from tools/cross-toolchain/configs/clang/bazel_5.0.0/config/BUILD rename to tools/cross-toolchain/configs/clang/bazel_5.3.0/config/BUILD index 33abfdcce..f5fde854d 100644 --- a/tools/cross-toolchain/configs/clang/bazel_5.0.0/config/BUILD +++ b/tools/cross-toolchain/configs/clang/bazel_5.3.0/config/BUILD @@ -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", ) diff --git a/tools/cross-toolchain/configs/clang/bazel_5.0.0/java/BUILD b/tools/cross-toolchain/configs/clang/bazel_5.3.0/java/BUILD similarity index 100% rename from tools/cross-toolchain/configs/clang/bazel_5.0.0/java/BUILD rename to tools/cross-toolchain/configs/clang/bazel_5.3.0/java/BUILD diff --git a/tools/cross-toolchain/configs/clang/bazel_5.0.0/prysm_toolchains/BUILD.bazel b/tools/cross-toolchain/configs/clang/bazel_5.3.0/prysm_toolchains/BUILD.bazel similarity index 100% rename from tools/cross-toolchain/configs/clang/bazel_5.0.0/prysm_toolchains/BUILD.bazel rename to tools/cross-toolchain/configs/clang/bazel_5.3.0/prysm_toolchains/BUILD.bazel diff --git a/tools/cross-toolchain/configs/clang/bazel_5.0.0/prysm_toolchains/WORKSPACE b/tools/cross-toolchain/configs/clang/bazel_5.3.0/prysm_toolchains/WORKSPACE similarity index 100% rename from tools/cross-toolchain/configs/clang/bazel_5.0.0/prysm_toolchains/WORKSPACE rename to tools/cross-toolchain/configs/clang/bazel_5.3.0/prysm_toolchains/WORKSPACE diff --git a/tools/cross-toolchain/configs/clang/bazel_5.0.0/prysm_toolchains/cc_toolchain_config_linux_arm64.bzl b/tools/cross-toolchain/configs/clang/bazel_5.3.0/prysm_toolchains/cc_toolchain_config_linux_arm64.bzl similarity index 100% rename from tools/cross-toolchain/configs/clang/bazel_5.0.0/prysm_toolchains/cc_toolchain_config_linux_arm64.bzl rename to tools/cross-toolchain/configs/clang/bazel_5.3.0/prysm_toolchains/cc_toolchain_config_linux_arm64.bzl diff --git a/tools/cross-toolchain/configs/clang/bazel_5.0.0/prysm_toolchains/cc_toolchain_config_osx.bzl b/tools/cross-toolchain/configs/clang/bazel_5.3.0/prysm_toolchains/cc_toolchain_config_osx.bzl similarity index 100% rename from tools/cross-toolchain/configs/clang/bazel_5.0.0/prysm_toolchains/cc_toolchain_config_osx.bzl rename to tools/cross-toolchain/configs/clang/bazel_5.3.0/prysm_toolchains/cc_toolchain_config_osx.bzl diff --git a/tools/cross-toolchain/configs/clang/bazel_5.0.0/prysm_toolchains/cc_toolchain_config_windows.bzl b/tools/cross-toolchain/configs/clang/bazel_5.3.0/prysm_toolchains/cc_toolchain_config_windows.bzl similarity index 100% rename from tools/cross-toolchain/configs/clang/bazel_5.0.0/prysm_toolchains/cc_toolchain_config_windows.bzl rename to tools/cross-toolchain/configs/clang/bazel_5.3.0/prysm_toolchains/cc_toolchain_config_windows.bzl diff --git a/tools/cross-toolchain/configs/versions.bzl b/tools/cross-toolchain/configs/versions.bzl index 521db923e..8b628468c 100644 --- a/tools/cross-toolchain/configs/versions.bzl +++ b/tools/cross-toolchain/configs/versions.bzl @@ -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