aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/cpp/cc_configure.bzl8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/cpp/cc_configure.bzl b/tools/cpp/cc_configure.bzl
index f2a1d40f2c..27f4089881 100644
--- a/tools/cpp/cc_configure.bzl
+++ b/tools/cpp/cc_configure.bzl
@@ -213,7 +213,10 @@ def _crosstool_content(repository_ctx, cc, cpu_value, darwin):
# Enable a few more warnings that aren't part of -Wall.
] + (["-Wthread-safety", "-Wself-assign"] if darwin else [
# Disable some that are problematic.
- "-Wl,-z,-relro,-z,now"
+ "-Wl,-z,-relro,-z,now",
+ "-B" + str(repository_ctx.path(cc).dirname),
+ # Always have -B/usr/bin, see https://github.com/bazelbuild/bazel/issues/760.
+ "-B/usr/bin",
]) + (
_add_option_if_supported(repository_ctx, cc, "-Wunused-but-set-parameter") +
# has false positives
@@ -264,6 +267,9 @@ def _find_cc(repository_ctx):
cc_name = "gcc"
if "CC" in repository_ctx.os.environ:
cc_name = repository_ctx.os.environ["CC"]
+ if cc_name.startswith("/"):
+ # Absolute path, maybe we should make this suported by our which function.
+ return cc_name
cc = repository_ctx.which(cc_name)
if cc == None:
fail(