From 2082d706a5ed3bbe07706cfb694b431b2fe50f89 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Wed, 13 Nov 2019 09:26:58 +0100 Subject: [PATCH] Remove adding of /usr/bin to compiler paths As the underlying Bazel issue bazelbuild/bazel#5634 is resolved, this code can (and should) go now Adding /usr/bin unconditionally does break builds with custom binutils installed elsewhere --- third_party/gpus/cuda_configure.bzl | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/third_party/gpus/cuda_configure.bzl b/third_party/gpus/cuda_configure.bzl index ba4bd8ad75f..3053348ed00 100644 --- a/third_party/gpus/cuda_configure.bzl +++ b/third_party/gpus/cuda_configure.bzl @@ -1148,18 +1148,7 @@ def _create_local_cuda_repository(repository_ctx): host_compiler_prefix = repository_ctx.os.environ[_GCC_HOST_COMPILER_PREFIX].strip() cuda_defines["%{host_compiler_prefix}"] = host_compiler_prefix - # Bazel sets '-B/usr/bin' flag to workaround build errors on RHEL (see - # https://github.com/bazelbuild/bazel/issues/760). - # However, this stops our custom clang toolchain from picking the provided - # LLD linker, so we're only adding '-B/usr/bin' when using non-downloaded - # toolchain. - # TODO: when bazel stops adding '-B/usr/bin' by default, remove this - # flag from the CROSSTOOL completely (see - # https://github.com/bazelbuild/bazel/issues/5634) - if should_download_clang: - cuda_defines["%{linker_bin_path}"] = "" - else: - cuda_defines["%{linker_bin_path}"] = host_compiler_prefix + cuda_defines["%{linker_bin_path}"] = "" cuda_defines["%{extra_no_canonical_prefixes_flags}"] = "" cuda_defines["%{unfiltered_compile_flags}"] = ""