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, + ], ), ], ),