Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(869)

Unified Diff: third_party/libc++/BUILD.gn

Issue 2937433003: Make operator new/delete symbols have default visibility (Closed)
Patch Set: update comment Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/libc++/BUILD.gn
diff --git a/third_party/libc++/BUILD.gn b/third_party/libc++/BUILD.gn
index ff51ab9260f771fcdafc6fa7f937bbe0dff607aa..d87f38bd803effb429cd80d24ae4b2e5ba537df1 100644
--- a/third_party/libc++/BUILD.gn
+++ b/third_party/libc++/BUILD.gn
@@ -18,6 +18,22 @@ config("config") {
defines += [
"_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS",
"_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS",
+
+ # This resets the visibility to default only for the various
+ # flavors of operator new and operator delete. These symbols
+ # are weak and get overriden by Chromium-provided ones, but if
+ # these symbols had hidden visibility, this would make the
+ # Chromium symbols hidden too because elf visibility rules
+ # require that linkers use the least visible form when merging,
+ # and if this is hidden, then when we merge it with tcmalloc's
+ # operator new, hidden visibility would win. However, tcmalloc
+ # needs a visible operator new to also override operator new
+ # references from system libraries.
+ # TODO(lld): Ask lld for a --force-public-visibility flag or
+ # similar to that overrides the default elf merging rules, and
+ # make tcmalloc's gn config pass that to all its dependencies,
+ # then remove this override here.
+ "_LIBCPP_OVERRIDABLE_FUNC_VIS=__attribute__((__visibility__(\"default\")))",
]
}
cflags = [
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698