Index: base/allocator/BUILD.gn |
diff --git a/base/allocator/BUILD.gn b/base/allocator/BUILD.gn |
index 96ccad239a5455f0dc72e07c4a67fe18a03aa151..d25239ae6f849ea320cb44f72ea7c734c7883cd6 100644 |
--- a/base/allocator/BUILD.gn |
+++ b/base/allocator/BUILD.gn |
@@ -236,8 +236,16 @@ if (use_allocator == "tcmalloc") { |
"-Wno-unused-result", |
] |
- configs -= [ "//build/config/gcc:symbol_visibility_hidden" ] |
- configs += [ "//build/config/gcc:symbol_visibility_default" ] |
+ # Compiling tcmalloc with -fvisibility=default is only necessary when |
+ # not using the allocator shim, which provides the correct visibility |
+ # annotations for those symbols which need to be exported (see |
+ # //base/allocator/allocator_shim_override_glibc_weak_symbols.h and |
+ # //base/allocator/allocator_shim_internals.h for the definition of |
+ # SHIM_ALWAYS_EXPORT). |
+ if (!use_experimental_allocator_shim) { |
+ configs -= [ "//build/config/gcc:symbol_visibility_hidden" ] |
+ configs += [ "//build/config/gcc:symbol_visibility_default" ] |
+ } |
ldflags = [ |
# Don't let linker rip this symbol out, otherwise the heap&cpu |