Migrate toolchains for --incompatible_use_specific_tool_files
This will fix Cuda and ROCm RBE build with Bazel 1.0
Related https://github.com/bazelbuild/bazel/issues/8531
Preconfigured toolchains are updated by:
tensorflow/third_party/toolchains/preconfig/generate/update.sh ubuntu16.04-py3-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0
tensorflow/third_party/toolchains/preconfig/generate/update.sh ubuntu16.04-py3-gcc7_manylinux2010-cuda10.0-cudnn7-tensorrt5.1
tensorflow/third_party/toolchains/preconfig/generate/update.sh ubuntu16.04-py3_opt-gcc5-rocm
PiperOrigin-RevId: 279942421
Change-Id: Ic8538d49b970b074e35acebc1345482170d98847
diff --git a/third_party/gpus/crosstool/BUILD.rocm.tpl b/third_party/gpus/crosstool/BUILD.rocm.tpl
index 8ca69e1..ee222d7 100644
--- a/third_party/gpus/crosstool/BUILD.rocm.tpl
+++ b/third_party/gpus/crosstool/BUILD.rocm.tpl
@@ -35,10 +35,12 @@
cc_toolchain(
name = "cc-compiler-local",
- all_files = "%{linker_files}",
- compiler_files = ":empty",
+ all_files = ":crosstool_wrapper_driver_is_not_gcc",
+ compiler_files = ":crosstool_wrapper_driver_is_not_gcc",
+ ar_files = ":crosstool_wrapper_driver_is_not_gcc",
+ as_files = ":crosstool_wrapper_driver_is_not_gcc",
dwp_files = ":empty",
- linker_files = "%{linker_files}",
+ linker_files = ":crosstool_wrapper_driver_is_not_gcc",
objcopy_files = ":empty",
strip_files = ":empty",
# To support linker flags that need to go to the start of command line
diff --git a/third_party/gpus/crosstool/BUILD.tpl b/third_party/gpus/crosstool/BUILD.tpl
index ab77276..5a78654 100644
--- a/third_party/gpus/crosstool/BUILD.tpl
+++ b/third_party/gpus/crosstool/BUILD.tpl
@@ -39,10 +39,12 @@
cc_toolchain(
name = "cc-compiler-local",
- all_files = "%{linker_files}",
- compiler_files = ":empty",
+ all_files = "%{compiler_deps}",
+ compiler_files = "%{compiler_deps}",
+ ar_files = "%{compiler_deps}",
+ as_files = "%{compiler_deps}",
dwp_files = ":empty",
- linker_files = "%{linker_files}",
+ linker_files = "%{compiler_deps}",
objcopy_files = ":empty",
strip_files = ":empty",
# To support linker flags that need to go to the start of command line
@@ -70,10 +72,12 @@
cc_toolchain(
name = "cc-compiler-darwin",
- all_files = "%{linker_files}",
- compiler_files = ":empty",
+ all_files = "%{compiler_deps}",
+ compiler_files = "%{compiler_deps}",
+ ar_files = "%{compiler_deps}",
+ as_files = "%{compiler_deps}",
dwp_files = ":empty",
- linker_files = "%{linker_files}",
+ linker_files = "%{compiler_deps}",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 0,
@@ -95,10 +99,12 @@
cc_toolchain(
name = "cc-compiler-windows",
- all_files = "%{win_linker_files}",
- compiler_files = ":empty",
+ all_files = "%{win_compiler_deps}",
+ compiler_files = "%{win_compiler_deps}",
+ ar_files = "%{win_compiler_deps}",
+ as_files = "%{win_compiler_deps}",
dwp_files = ":empty",
- linker_files = "%{win_linker_files}",
+ linker_files = "%{win_compiler_deps}",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
diff --git a/third_party/gpus/cuda_configure.bzl b/third_party/gpus/cuda_configure.bzl
index af1bc96..ba4bd8a 100644
--- a/third_party/gpus/cuda_configure.bzl
+++ b/third_party/gpus/cuda_configure.bzl
@@ -81,7 +81,7 @@
"host_compiler_prefix",
"host_compiler_warnings",
"linker_bin_path",
- "linker_files",
+ "compiler_deps",
"msvc_cl_path",
"msvc_env_include",
"msvc_env_lib",
@@ -91,7 +91,7 @@
"msvc_link_path",
"msvc_ml_path",
"unfiltered_compile_flags",
- "win_linker_files",
+ "win_compiler_deps",
]:
if ("%{" + param + "}") not in params:
missing.append(param)
@@ -1171,8 +1171,8 @@
"-Wno-invalid-partial-specialization"
"""
cuda_defines["%{cxx_builtin_include_directories}"] = to_list_of_strings(host_compiler_includes)
- cuda_defines["%{linker_files}"] = ":empty"
- cuda_defines["%{win_linker_files}"] = ":empty"
+ cuda_defines["%{compiler_deps}"] = ":empty"
+ cuda_defines["%{win_compiler_deps}"] = ":empty"
repository_ctx.file(
"crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc",
"",
@@ -1205,8 +1205,8 @@
".exe" if _is_windows(repository_ctx) else "",
)),
)
- cuda_defines["%{linker_files}"] = ":crosstool_wrapper_driver_is_not_gcc"
- cuda_defines["%{win_linker_files}"] = ":windows_msvc_wrapper_files"
+ cuda_defines["%{compiler_deps}"] = ":crosstool_wrapper_driver_is_not_gcc"
+ cuda_defines["%{win_compiler_deps}"] = ":windows_msvc_wrapper_files"
wrapper_defines = {
"%{cpu_compiler}": str(cc),
diff --git a/third_party/gpus/rocm_configure.bzl b/third_party/gpus/rocm_configure.bzl
index 7a02bb4..9928848 100644
--- a/third_party/gpus/rocm_configure.bzl
+++ b/third_party/gpus/rocm_configure.bzl
@@ -46,7 +46,6 @@
"host_compiler_path",
"host_compiler_prefix",
"linker_bin_path",
- "linker_files",
"unfiltered_compile_flags",
]:
if ("%{" + param + "}") not in params:
@@ -793,8 +792,6 @@
rocm_defines["%{cxx_builtin_include_directories}"] = to_list_of_strings(host_compiler_includes +
_rocm_include_path(repository_ctx, rocm_config))
- rocm_defines["%{linker_files}"] = "clang/bin/crosstool_wrapper_driver_is_not_gcc"
-
verify_build_defines(rocm_defines)
# Only expand template variables in the BUILD file
diff --git a/third_party/toolchains/preconfig/ubuntu16.04/gcc5-rocm/BUILD b/third_party/toolchains/preconfig/ubuntu16.04/gcc5-rocm/BUILD
index e1b16d2..0dcee09 100755
--- a/third_party/toolchains/preconfig/ubuntu16.04/gcc5-rocm/BUILD
+++ b/third_party/toolchains/preconfig/ubuntu16.04/gcc5-rocm/BUILD
@@ -35,10 +35,12 @@
cc_toolchain(
name = "cc-compiler-local",
- all_files = "clang/bin/crosstool_wrapper_driver_is_not_gcc",
- compiler_files = ":empty",
+ all_files = ":crosstool_wrapper_driver_is_not_gcc",
+ ar_files = ":crosstool_wrapper_driver_is_not_gcc",
+ as_files = ":crosstool_wrapper_driver_is_not_gcc",
+ compiler_files = ":crosstool_wrapper_driver_is_not_gcc",
dwp_files = ":empty",
- linker_files = "clang/bin/crosstool_wrapper_driver_is_not_gcc",
+ linker_files = ":crosstool_wrapper_driver_is_not_gcc",
objcopy_files = ":empty",
strip_files = ":empty",
# To support linker flags that need to go to the start of command line
diff --git a/third_party/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010-nvcc-cuda10.0/BUILD b/third_party/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010-nvcc-cuda10.0/BUILD
index 18b97f6..a0096e5 100755
--- a/third_party/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010-nvcc-cuda10.0/BUILD
+++ b/third_party/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010-nvcc-cuda10.0/BUILD
@@ -40,7 +40,9 @@
cc_toolchain(
name = "cc-compiler-local",
all_files = ":crosstool_wrapper_driver_is_not_gcc",
- compiler_files = ":empty",
+ ar_files = ":crosstool_wrapper_driver_is_not_gcc",
+ as_files = ":crosstool_wrapper_driver_is_not_gcc",
+ compiler_files = ":crosstool_wrapper_driver_is_not_gcc",
dwp_files = ":empty",
linker_files = ":crosstool_wrapper_driver_is_not_gcc",
objcopy_files = ":empty",
@@ -80,7 +82,9 @@
cc_toolchain(
name = "cc-compiler-darwin",
all_files = ":crosstool_wrapper_driver_is_not_gcc",
- compiler_files = ":empty",
+ ar_files = ":crosstool_wrapper_driver_is_not_gcc",
+ as_files = ":crosstool_wrapper_driver_is_not_gcc",
+ compiler_files = ":crosstool_wrapper_driver_is_not_gcc",
dwp_files = ":empty",
linker_files = ":crosstool_wrapper_driver_is_not_gcc",
objcopy_files = ":empty",
@@ -116,7 +120,9 @@
cc_toolchain(
name = "cc-compiler-windows",
all_files = ":windows_msvc_wrapper_files",
- compiler_files = ":empty",
+ ar_files = ":windows_msvc_wrapper_files",
+ as_files = ":windows_msvc_wrapper_files",
+ compiler_files = ":windows_msvc_wrapper_files",
dwp_files = ":empty",
linker_files = ":windows_msvc_wrapper_files",
objcopy_files = ":empty",
diff --git a/third_party/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010-nvcc-cuda10.1/BUILD b/third_party/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010-nvcc-cuda10.1/BUILD
index effc178..1537a03 100755
--- a/third_party/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010-nvcc-cuda10.1/BUILD
+++ b/third_party/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010-nvcc-cuda10.1/BUILD
@@ -40,7 +40,9 @@
cc_toolchain(
name = "cc-compiler-local",
all_files = ":crosstool_wrapper_driver_is_not_gcc",
- compiler_files = ":empty",
+ ar_files = ":crosstool_wrapper_driver_is_not_gcc",
+ as_files = ":crosstool_wrapper_driver_is_not_gcc",
+ compiler_files = ":crosstool_wrapper_driver_is_not_gcc",
dwp_files = ":empty",
linker_files = ":crosstool_wrapper_driver_is_not_gcc",
objcopy_files = ":empty",
@@ -82,7 +84,9 @@
cc_toolchain(
name = "cc-compiler-darwin",
all_files = ":crosstool_wrapper_driver_is_not_gcc",
- compiler_files = ":empty",
+ ar_files = ":crosstool_wrapper_driver_is_not_gcc",
+ as_files = ":crosstool_wrapper_driver_is_not_gcc",
+ compiler_files = ":crosstool_wrapper_driver_is_not_gcc",
dwp_files = ":empty",
linker_files = ":crosstool_wrapper_driver_is_not_gcc",
objcopy_files = ":empty",
@@ -118,7 +122,9 @@
cc_toolchain(
name = "cc-compiler-windows",
all_files = ":windows_msvc_wrapper_files",
- compiler_files = ":empty",
+ ar_files = ":windows_msvc_wrapper_files",
+ as_files = ":windows_msvc_wrapper_files",
+ compiler_files = ":windows_msvc_wrapper_files",
dwp_files = ":empty",
linker_files = ":windows_msvc_wrapper_files",
objcopy_files = ":empty",