Skip to content

Commit

Permalink
Toolchain configs for marketplace.gcr.io/google/rbe-ubuntu16-04, Baze…
Browse files Browse the repository at this point in the history
…l 2.2.0 (2020/03/03) (#838)

* Toolchain configs for marketplace.gcr.io/google/rbe-ubuntu16-04, Bazel 2.2.0 (2020/03/03)

* Update test to use base container with Clang 11.0.0

* Update bazel container version

* Update test

Co-authored-by: RBE Toolchains Robot <[email protected]>
  • Loading branch information
alex1545 and rbe-toolchains-robot authored Mar 5, 2020
1 parent dc982b6 commit 868cc7c
Show file tree
Hide file tree
Showing 12 changed files with 1,564 additions and 6 deletions.
4 changes: 2 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -354,10 +354,10 @@ rbe_autoconfig(

rbe_autoconfig(
name = "rbe_autoconf_base_container_digest",
base_container_digest = "sha256:06f8f8e9f97daa1c15466536dc2a7ae6641d16962d7b58a393af8060e460f571",
base_container_digest = "sha256:b4dad0bfc4951d619229ab15343a311f2415a16ef83bcaa55b44f4e2bf1cf635",
bazel_version = _ubuntu1604_bazel,
create_testdata = True,
digest = "sha256:0151b16320e3132a9899022567ce2b1c3d237b20913140410b9037317d333672",
digest = "sha256:b28ddaf98c6e0bb840c5fded3c0a899a7db45bb44f69859f16c37be092bfcb4e",
env = clang_env(),
registry = "marketplace.gcr.io",
repository = "google/bazel",
Expand Down
2 changes: 1 addition & 1 deletion configs/dependency-tracking/ubuntu1604.bzl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Information tracking the latest published configs."""
bazel = "2.1.1"
bazel = "2.2.0"
registry = "marketplace.gcr.io"
repository = "google/rbe-ubuntu16-04"
digest = "sha256:b4dad0bfc4951d619229ab15343a311f2415a16ef83bcaa55b44f4e2bf1cf635"
Expand Down
163 changes: 163 additions & 0 deletions configs/ubuntu16_04_clang/11.0.0/bazel_2.2.0/cc/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
# 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.

load("@rules_cc//cc:defs.bzl", "cc_toolchain", "cc_toolchain_suite")
load(":armeabi_cc_toolchain_config.bzl", "armeabi_cc_toolchain_config")
load(":cc_toolchain_config.bzl", "cc_toolchain_config")

package(default_visibility = ["//visibility:public"])

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 = {
"armeabi-v7a": ":cc-compiler-armeabi-v7a",
"armeabi-v7a|compiler": ":cc-compiler-armeabi-v7a",
"k8": ":cc-compiler-k8",
"k8|clang": ":cc-compiler-k8",
},
)

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 = ":linux_gnu_x86",
toolchain_identifier = "linux_gnu_x86",
)

cc_toolchain_config(
name = "linux_gnu_x86",
abi_libc_version = "glibc_2.19",
abi_version = "clang",
compile_flags = [
"-U_FORTIFY_SOURCE",
"-fstack-protector",
"-Wall",
"-Wthread-safety",
"-Wself-assign",
"-fcolor-diagnostics",
"-fno-omit-frame-pointer",
],
compiler = "clang",
coverage_compile_flags = ["--coverage"],
coverage_link_flags = ["--coverage"],
cpu = "k8",
cxx_builtin_include_directories = [
"/usr/local/include",
"/usr/local/lib/clang/11.0.0/include",
"/usr/include/x86_64-linux-gnu",
"/usr/include",
"/usr/include/c++/5.4.0",
"/usr/include/x86_64-linux-gnu/c++/5.4.0",
"/usr/include/c++/5.4.0/backward",
],
cxx_flags = ["-std=c++0x"],
dbg_compile_flags = ["-g"],
host_system_name = "i686-unknown-linux-gnu",
link_flags = [
"-fuse-ld=/usr/bin/ld.gold",
"-Wl,-no-as-needed",
"-Wl,-z,relro,-z,now",
"-B/usr/local/bin",
"-lstdc++",
"-lm",
],
link_libs = [],
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 = "glibc_2.19",
target_system_name = "x86_64-unknown-linux-gnu",
tool_paths = {
"ar": "/usr/bin/ar",
"cpp": "/usr/bin/cpp",
"dwp": "/usr/bin/dwp",
"gcc": "/usr/local/bin/clang",
"gcov": "/dev/null",
"ld": "/usr/bin/ld",
"nm": "/usr/bin/nm",
"objcopy": "/usr/bin/objcopy",
"objdump": "/usr/bin/objdump",
"strip": "/usr/bin/strip",
},
toolchain_identifier = "linux_gnu_x86",
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")
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# 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],
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
This file is generated by cc_configure and contains builtin include directories
that /usr/local/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/local/lib/clang/11.0.0/include
/usr/include/x86_64-linux-gnu
/usr/include
/usr/include/c++/5.4.0
/usr/include/x86_64-linux-gnu/c++/5.4.0
/usr/include/c++/5.4.0/backward
Loading

0 comments on commit 868cc7c

Please sign in to comment.