Index: build/config/c++/BUILD.gn |
diff --git a/build/config/c++/BUILD.gn b/build/config/c++/BUILD.gn |
index 21316ba1c8bd3160c4b08a0a65bea5b72871e6c9..baad310d724d423cada78d237f0f06b2607b2985 100644 |
--- a/build/config/c++/BUILD.gn |
+++ b/build/config/c++/BUILD.gn |
@@ -8,6 +8,12 @@ config("c++flags") { |
if (use_custom_libcxx) { |
prefix = "//buildtools/third_party" |
include = "trunk/include" |
+ if (!is_clang) { |
+ # Gcc has a built-in abs() definition with default visibility. |
+ # If it was not disabled, it would conflict with libc++'s abs() |
+ # with hidden visibility. |
+ cflags = [ "-fno-builtin-abs" ] |
+ } |
cflags_cc = [ |
"-nostdinc++", |
"-isystem" + rebase_path("$prefix/libc++/$include", root_build_dir), |