From b360b9e388351aaed97f2ead98dd951fb5f1951e Mon Sep 17 00:00:00 2001 From: deannagarcia <69992229+deannagarcia@users.noreply.github.com> Date: Thu, 16 Dec 2021 15:07:05 -0800 Subject: [PATCH] Change toolchain includes (#9318) This fixes path resolution failures when following `#include_next` directives in headers found from paths in `extra_compiler_flags`. --- toolchain/BUILD | 8 ++++---- toolchain/cc_toolchain_config.bzl | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/toolchain/BUILD b/toolchain/BUILD index d94003e96f..467d1a5df7 100644 --- a/toolchain/BUILD +++ b/toolchain/BUILD @@ -150,8 +150,8 @@ cc_toolchain_config( bit_flag = "-m32", cpp_flag = "-lstdc++", extra_compiler_flags = [ - "-I/usr/lib/gcc/i686-w64-mingw32/8.3-posix/include/c++", - "-I/usr/lib/gcc/i686-w64-mingw32/8.3-posix/include/c++/i686-w64-mingw32", + "-isystem/usr/lib/gcc/i686-w64-mingw32/8.3-posix/include/c++", + "-isystem/usr/lib/gcc/i686-w64-mingw32/8.3-posix/include/c++/i686-w64-mingw32", "-fsjlj-exceptions", ], extra_include = "/usr/lib/gcc/i686-w64-mingw32/8.3-posix/include", @@ -171,8 +171,8 @@ cc_toolchain_config( bit_flag = "-m64", cpp_flag = "-lstdc++", extra_compiler_flags = [ - "-I/usr/lib/gcc/x86_64-w64-mingw32/8.3-posix/include/c++/", - "-I/usr/lib/gcc/x86_64-w64-mingw32/8.3-posix/include/c++/x86_64-w64-mingw32", + "-isystem/usr/lib/gcc/x86_64-w64-mingw32/8.3-posix/include/c++/", + "-isystem/usr/lib/gcc/x86_64-w64-mingw32/8.3-posix/include/c++/x86_64-w64-mingw32", ], extra_include = "/usr/lib/gcc/x86_64-w64-mingw32/8.3-posix/include", extra_linker_flags = [ diff --git a/toolchain/cc_toolchain_config.bzl b/toolchain/cc_toolchain_config.bzl index b86c39611f..6310c69762 100644 --- a/toolchain/cc_toolchain_config.bzl +++ b/toolchain/cc_toolchain_config.bzl @@ -134,10 +134,11 @@ def _impl(ctx): "-Wall", "-no-canonical-prefixes", "--target=" + ctx.attr.target_full_name, + "-fvisibility=hidden", + ] + ctx.attr.extra_compiler_flags + [ "-isystem", ctx.attr.toolchain_dir, - "-fvisibility=hidden", - ] + ctx.attr.extra_compiler_flags, + ], ), ], ),