Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion cc/private/compile/compile_build_variables.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,6 @@ def _compute_all_linkstamp_defines(
code_coverage_enabled):
"""Computes defines for linkstamp compilation."""
defines = [
'GPLATFORM="' + cc_toolchain.toolchain_id + '"',
"BUILD_COVERAGE_ENABLED=" + ("1" if code_coverage_enabled else "0"),
# G3_TARGET_NAME is a C string literal that normally contain the label of the target
# being linked. However, they are set differently when using shared native deps. In
Expand Down
12 changes: 0 additions & 12 deletions cc/private/rules_impl/cc_toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -186,18 +186,6 @@ cc_toolchain = rule(
"licenses": attr.license() if hasattr(attr, "license") else attr.string_list(),
# buildifier: disable=attr-license
"output_licenses": attr.license() if hasattr(attr, "license") else attr.string_list(),
"toolchain_identifier": attr.string(
default = "",
doc = """
The identifier used to match this cc_toolchain with the corresponding
crosstool_config.toolchain.

<p>
Until issue <a href="https://github.com/bazelbuild/bazel/issues/5380">#5380</a> is fixed
this is the recommended way of associating <code>cc_toolchain</code> with
<code>CROSSTOOL.toolchain</code>. It will be replaced by the <code>toolchain_config</code>
attribute (<a href="https://github.com/bazelbuild/bazel/issues/5380">#5380</a>).</p>""",
),
"all_files": attr.label(
allow_files = True,
mandatory = True,
Expand Down
2 changes: 0 additions & 2 deletions cc/private/rules_impl/cc_toolchain_info.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ def _create_cc_toolchain_info(
libc = toolchain_config_info.target_libc,
cpu = toolchain_config_info.target_cpu,
target_gnu_system_name = toolchain_config_info.target_system_name,
toolchain_id = toolchain_config_info.toolchain_id,
dynamic_runtime_solib_dir = dynamic_runtime_solib_dir,
objcopy_executable = objcopy_executable,
compiler_executable = compiler_executable,
Expand Down Expand Up @@ -192,7 +191,6 @@ CcToolchainInfo, _ = provider(
"libc": "libc version string.",
"cpu": "Target CPU of the C++ toolchain.",
"target_gnu_system_name": "The GNU System Name.",
"toolchain_id": "",
"dynamic_runtime_solib_dir": "",
"objcopy_executable": "The path to the objcopy binary.",
"compiler_executable": "The path to the compiler binary.",
Expand Down
1 change: 0 additions & 1 deletion cc/private/toolchain/BUILD.empty.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ cc_toolchain(
objcopy_files = ":empty",
strip_files = ":empty",
toolchain_config = ":local_config",
toolchain_identifier = "local",
)

cc_toolchain_config(name = "local_config")
3 changes: 0 additions & 3 deletions cc/private/toolchain/BUILD.static.bsd
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ cc_toolchain(
strip_files = ":empty",
supports_param_files = 0,
toolchain_config = ":local_freebsd",
toolchain_identifier = "local_freebsd",
)

cc_toolchain_config(
Expand Down Expand Up @@ -107,7 +106,6 @@ cc_toolchain(
strip_files = ":empty",
supports_param_files = 0,
toolchain_config = ":local_openbsd",
toolchain_identifier = "local_openbsd",
)

cc_toolchain_config(
Expand Down Expand Up @@ -141,7 +139,6 @@ cc_toolchain(
strip_files = ":empty",
supports_param_files = 0,
toolchain_config = ":stub_armeabi-v7a",
toolchain_identifier = "stub_armeabi-v7a",
)

cc_toolchain_config(
Expand Down
7 changes: 2 additions & 5 deletions cc/private/toolchain/BUILD.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ cc_toolchain_suite(

cc_toolchain(
name = "cc-compiler-%{name}",
toolchain_identifier = "%{cc_toolchain_identifier}",
toolchain_config = ":%{cc_toolchain_identifier}",
toolchain_config = ":cc-config-%{name}",
all_files = ":compiler_deps",
ar_files = ":compiler_deps",
as_files = ":compiler_deps",
Expand All @@ -101,10 +100,9 @@ cc_toolchain(
)

cc_toolchain_config(
name = "%{cc_toolchain_identifier}",
name = ":cc-config-%{name}",
cpu = "%{target_cpu}",
compiler = "%{compiler}",
toolchain_identifier = "%{cc_toolchain_identifier}",
host_system_name = "%{host_system_name}",
target_system_name = "%{target_system_name}",
target_libc = "%{target_libc}",
Expand Down Expand Up @@ -132,7 +130,6 @@ cc_toolchain_config(
# 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",
Expand Down
17 changes: 0 additions & 17 deletions cc/private/toolchain/BUILD.windows.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ cc_toolchain_suite(

cc_toolchain(
name = "cc-compiler-x64_windows_msys",
toolchain_identifier = "msys_x64",
toolchain_config = ":msys_x64",
all_files = ":empty",
ar_files = ":empty",
Expand Down Expand Up @@ -148,7 +147,6 @@ toolchain(

cc_toolchain(
name = "cc-compiler-x64_x86_windows_msys",
toolchain_identifier = "msys_x64_x86",
toolchain_config = ":msys_x64_x86",
all_files = ":empty",
ar_files = ":empty",
Expand Down Expand Up @@ -199,7 +197,6 @@ toolchain(

cc_toolchain(
name = "cc-compiler-x64_windows_mingw",
toolchain_identifier = "msys_x64_mingw",
toolchain_config = ":msys_x64_mingw",
all_files = ":empty",
ar_files = ":empty",
Expand Down Expand Up @@ -248,7 +245,6 @@ toolchain(

cc_toolchain(
name = "cc-compiler-x64_x86_windows_mingw",
toolchain_identifier = "msys_x64_x86_mingw",
toolchain_config = ":msys_x64_x86_mingw",
all_files = ":empty",
ar_files = ":empty",
Expand Down Expand Up @@ -299,7 +295,6 @@ toolchain(

cc_toolchain(
name = "cc-compiler-x64_windows",
toolchain_identifier = "msvc_x64",
toolchain_config = ":msvc_x64",
all_files = ":empty",
ar_files = ":empty",
Expand All @@ -321,7 +316,6 @@ cc_toolchain_config(
target_libc = "msvcrt",
abi_version = "local",
abi_libc_version = "local",
toolchain_identifier = "msvc_x64",
msvc_env_tmp = "%{msvc_env_tmp_x64}",
msvc_env_path = "%{msvc_env_path_x64}",
msvc_env_include = "%{msvc_env_include_x64}",
Expand Down Expand Up @@ -374,7 +368,6 @@ toolchain(

cc_toolchain(
name = "cc-compiler-x64_x86_windows",
toolchain_identifier = "msvc_x64_x86",
toolchain_config = ":msvc_x64_x86",
all_files = ":empty",
ar_files = ":empty",
Expand All @@ -396,7 +389,6 @@ cc_toolchain_config(
target_libc = "msvcrt",
abi_version = "local",
abi_libc_version = "local",
toolchain_identifier = "msvc_x64_x86",
msvc_env_tmp = "%{msvc_env_tmp_x86}",
msvc_env_path = "%{msvc_env_path_x86}",
msvc_env_include = "%{msvc_env_include_x86}",
Expand Down Expand Up @@ -449,7 +441,6 @@ toolchain(

cc_toolchain(
name = "cc-compiler-x64_arm_windows",
toolchain_identifier = "msvc_x64_arm",
toolchain_config = ":msvc_x64_arm",
all_files = ":empty",
ar_files = ":empty",
Expand All @@ -471,7 +462,6 @@ cc_toolchain_config(
target_libc = "msvcrt",
abi_version = "local",
abi_libc_version = "local",
toolchain_identifier = "msvc_x64_arm",
msvc_env_tmp = "%{msvc_env_tmp_arm}",
msvc_env_path = "%{msvc_env_path_arm}",
msvc_env_include = "%{msvc_env_include_arm}",
Expand Down Expand Up @@ -524,7 +514,6 @@ toolchain(

cc_toolchain(
name = "cc-compiler-arm64_windows",
toolchain_identifier = "msvc_arm64",
toolchain_config = ":msvc_arm64",
all_files = ":empty",
ar_files = ":empty",
Expand All @@ -546,7 +535,6 @@ cc_toolchain_config(
target_libc = "msvcrt",
abi_version = "local",
abi_libc_version = "local",
toolchain_identifier = "msvc_arm64",
msvc_env_tmp = "%{msvc_env_tmp_arm64}",
msvc_env_path = "%{msvc_env_path_arm64}",
msvc_env_include = "%{msvc_env_include_arm64}",
Expand Down Expand Up @@ -599,7 +587,6 @@ toolchain(

cc_toolchain(
name = "cc-compiler-x64_windows-clang-cl",
toolchain_identifier = "clang_cl_x64",
toolchain_config = ":clang_cl_x64",
all_files = ":empty",
ar_files = ":empty",
Expand All @@ -621,7 +608,6 @@ cc_toolchain_config(
target_libc = "msvcrt",
abi_version = "local",
abi_libc_version = "local",
toolchain_identifier = "clang_cl_x64",
msvc_env_tmp = "%{clang_cl_env_tmp_x64}",
msvc_env_path = "%{clang_cl_env_path_x64}",
msvc_env_include = "%{clang_cl_env_include_x64}",
Expand Down Expand Up @@ -672,7 +658,6 @@ toolchain(

cc_toolchain(
name = "cc-compiler-arm64_windows-clang-cl",
toolchain_identifier = "clang_cl_arm64",
toolchain_config = ":clang_cl_arm64",
all_files = ":empty",
ar_files = ":empty",
Expand All @@ -694,7 +679,6 @@ cc_toolchain_config(
target_libc = "msvcrt",
abi_version = "local",
abi_libc_version = "local",
toolchain_identifier = "clang_cl_arm64",
msvc_env_tmp = "%{clang_cl_env_tmp_arm64}",
msvc_env_path = "%{clang_cl_env_path_arm64}",
msvc_env_include = "%{clang_cl_env_include_arm64}",
Expand Down Expand Up @@ -744,7 +728,6 @@ toolchain(

cc_toolchain(
name = "cc-compiler-armeabi-v7a",
toolchain_identifier = "stub_armeabi-v7a",
toolchain_config = ":stub_armeabi-v7a",
all_files = ":empty",
ar_files = ":empty",
Expand Down
2 changes: 0 additions & 2 deletions cc/private/toolchain/armeabi_cc_toolchain_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ load("@rules_cc//cc/common:cc_common.bzl", "cc_common")
load("@rules_cc//cc/toolchains:cc_toolchain_config_info.bzl", "CcToolchainConfigInfo")

def _impl(ctx):
toolchain_identifier = "stub_armeabi-v7a"
host_system_name = "armeabi-v7a"
target_system_name = "armeabi-v7a"
target_cpu = "armeabi-v7a"
Expand Down Expand Up @@ -63,7 +62,6 @@ def _impl(ctx):
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,
Expand Down
2 changes: 0 additions & 2 deletions cc/private/toolchain/bsd_cc_toolchain_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ def _impl(ctx):
cpu = ctx.attr.cpu
is_bsd = cpu == "freebsd" or cpu == "openbsd"
compiler = "compiler"
toolchain_identifier = "local_{}".format(cpu) if is_bsd else "stub_armeabi-v7a"
host_system_name = "local" if is_bsd else "armeabi-v7a"
target_system_name = "local" if is_bsd else "armeabi-v7a"
target_libc = "local" if is_bsd else "armeabi-v7a"
Expand Down Expand Up @@ -284,7 +283,6 @@ def _impl(ctx):
features = features,
action_configs = action_configs,
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 = cpu,
Expand Down
1 change: 0 additions & 1 deletion cc/private/toolchain/empty_cc_toolchain_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ def _impl(ctx):
return [
cc_common.create_cc_toolchain_config_info(
ctx = ctx,
toolchain_identifier = "local_linux",
host_system_name = "local",
target_system_name = "local",
target_cpu = "local",
Expand Down
7 changes: 0 additions & 7 deletions cc/private/toolchain/unix_cc_configure.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -414,12 +414,6 @@ def configure_unix_toolchain(repository_ctx, cpu_value, overridden_tools):
# The parse_header tool needs to be a wrapper around the compiler as it has
# to touch the output file.
tool_paths["parse_headers"] = "cc_wrapper.sh"
cc_toolchain_identifier = escape_string(get_env_var(
repository_ctx,
"CC_TOOLCHAIN_NAME",
"local",
False,
))

if "nm" in tool_paths and "c++filt" in tool_paths:
repository_ctx.template(
Expand Down Expand Up @@ -643,7 +637,6 @@ def configure_unix_toolchain(repository_ctx, cpu_value, overridden_tools):
] + (
[":validate_static_library"] if "validate_static_library" in tool_paths else []
)),
"%{cc_toolchain_identifier}": cc_toolchain_identifier,
"%{compile_flags}": get_starlark_list(
[
"-fstack-protector",
Expand Down
2 changes: 0 additions & 2 deletions cc/private/toolchain/unix_cc_toolchain_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -1956,7 +1956,6 @@ def _impl(ctx):
action_configs = action_configs,
artifact_name_patterns = artifact_name_patterns,
cxx_builtin_include_directories = ctx.attr.cxx_builtin_include_directories,
toolchain_identifier = ctx.attr.toolchain_identifier,
host_system_name = ctx.attr.host_system_name,
target_system_name = ctx.attr.target_system_name,
target_cpu = ctx.attr.cpu,
Expand Down Expand Up @@ -1996,7 +1995,6 @@ cc_toolchain_config = rule(
"target_libc": attr.string(mandatory = True),
"target_system_name": attr.string(mandatory = True),
"tool_paths": attr.string_dict(),
"toolchain_identifier": attr.string(mandatory = True),
"unfiltered_compile_flags": attr.string_list(),
"_xcode_config": attr.label(default = configuration_field(
fragment = "apple",
Expand Down
2 changes: 0 additions & 2 deletions cc/private/toolchain/windows_cc_toolchain_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -1709,7 +1709,6 @@ def _impl(ctx):
action_configs = action_configs,
artifact_name_patterns = artifact_name_patterns,
cxx_builtin_include_directories = ctx.attr.cxx_builtin_include_directories,
toolchain_identifier = ctx.attr.toolchain_identifier,
host_system_name = ctx.attr.host_system_name,
target_system_name = ctx.attr.target_system_name,
target_cpu = ctx.attr.cpu,
Expand Down Expand Up @@ -1753,7 +1752,6 @@ cc_toolchain_config = rule(
"target_system_name": attr.string(),
"tool_bin_path": attr.string(default = "not_found"),
"tool_paths": attr.string_dict(),
"toolchain_identifier": attr.string(),
"win32_winnt_flag": attr.string(default = "/D_WIN32_WINNT=0x0601"),
},
provides = [CcToolchainConfigInfo],
Expand Down
3 changes: 0 additions & 3 deletions cc/private/toolchain_config/cc_toolchain_config_info.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ CcToolchainConfigInfo, _new_cc_toolchain_config_info = provider(
"target_libc",
"target_system_name",
"tool_paths",
"toolchain_id",
],
init = _init,
)
Expand All @@ -55,7 +54,6 @@ CcToolchainConfigInfo, _new_cc_toolchain_config_info = provider(
def create_cc_toolchain_config_info(
*,
ctx,
toolchain_identifier,
compiler,
features = [],
action_configs = [],
Expand Down Expand Up @@ -135,7 +133,6 @@ def create_cc_toolchain_config_info(
target_libc = target_libc or "",
target_system_name = target_system_name or "",
tool_paths = tool_paths,
toolchain_id = toolchain_identifier,
)

# LINT.ThenChange(https://github.com/bazelbuild/bazel/blob/master/src/main/starlark/builtins_bzl/common/cc/toolchain_config/cc_toolchain_config_info.bzl:forked_exports)
4 changes: 0 additions & 4 deletions cc/toolchains/impl/toolchain_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@ def _cc_toolchain_config_impl(ctx):
make_variables = legacy.make_variables,
features = legacy.features,
cxx_builtin_include_directories = legacy.cxx_builtin_include_directories,
# toolchain_identifier is deprecated, but setting it to None results
# in an error that it expected a string, and for safety's sake, I'd
# prefer to provide something unique.
toolchain_identifier = str(ctx.label),
# This can be accessed by users through
# @rules_cc//cc/private/toolchain:compiler to select() on the current
# compiler
Expand Down
1 change: 0 additions & 1 deletion examples/custom_toolchain/toolchain_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ def _impl(ctx):
# C++ toolchain behavior.
return cc_common.create_cc_toolchain_config_info(
ctx = ctx,
toolchain_identifier = "custom-toolchain-identifier",
host_system_name = "local",
target_system_name = "local",
target_cpu = "sample_cpu",
Expand Down