From f3d431def1459e46afa91f565339cdc8ccbbe902 Mon Sep 17 00:00:00 2001 From: Brian Silverman Date: Thu, 18 Aug 2016 14:07:40 +0000 Subject: Use -fno-canonical-system-headers when supported This makes the same change to cc_configure.bzl made to the hard-coded CROSSTOOL in 763f1397155fc7c12e1f1071a1bc942f91b867c4 to fix #1642 -- Change-Id: Ia05788243d0128ea4921f12c437ef6cebd83a4ff Reviewed-on: https://bazel-review.git.corp.google.com/#/c/5450/ MOS_MIGRATED_REVID=130636065 --- tools/cpp/cc_configure.bzl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/cpp/cc_configure.bzl b/tools/cpp/cc_configure.bzl index b7b057a33b..9a94b16424 100644 --- a/tools/cpp/cc_configure.bzl +++ b/tools/cpp/cc_configure.bzl @@ -278,7 +278,11 @@ def _crosstool_content(repository_ctx, cc, cpu_value, darwin): _add_option_if_supported(repository_ctx, cc, "-Wno-free-nonheap-object") + # Enable coloring even if there's no attached terminal. Bazel removes the # escape sequences if --nocolor is specified. - _add_option_if_supported(repository_ctx, cc, "-fcolor-diagnostics")) + [ + _add_option_if_supported(repository_ctx, cc, "-fcolor-diagnostics") + + # If the compiler sometimes rewrites paths in the .d files without symlinks + # (ie when they're shorter), it confuses Bazel's logic for verifying all + # #included header files are listed as inputs to the action. + _add_option_if_supported(repository_ctx, cc, "-fno-canonical-system-headers")) + [ # Keep stack frames for debugging, even in opt mode. "-fno-omit-frame-pointer", ], -- cgit v1.2.3