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

Unified Diff: base/allocator/BUILD.gn

Issue 1719433002: Introduce allocator shim for Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@shim_traceintegration
Patch Set: Add readme changes, do NOT enabled by default in this cl Created 4 years, 8 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 | base/allocator/README.md » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/allocator/BUILD.gn
diff --git a/base/allocator/BUILD.gn b/base/allocator/BUILD.gn
index c1599bb6855669c1a2d39fe2b038f0918e5c42f5..b2ec91e40c5842a6bcee91dea4dd03824a150653 100644
--- a/base/allocator/BUILD.gn
+++ b/base/allocator/BUILD.gn
@@ -267,9 +267,23 @@ buildflag_header("features") {
}
if (use_experimental_allocator_shim) {
+ # Used to shim malloc symbols on Android. see //base/allocator/README.md.
+ config("wrap_malloc_symbols") {
+ ldflags = [
+ "-Wl,-wrap,calloc",
+ "-Wl,-wrap,free",
+ "-Wl,-wrap,malloc",
+ "-Wl,-wrap,memalign",
+ "-Wl,-wrap,posix_memalign",
+ "-Wl,-wrap,pvalloc",
+ "-Wl,-wrap,realloc",
+ "-Wl,-wrap,valloc",
+ ]
+ }
+
source_set("unified_allocator_shim") {
# TODO(primiano): support other platforms, currently this works only on
- # Linux/CrOS. http://crbug.com/550886 .
+ # Linux/CrOS/Android. http://crbug.com/550886 .
configs += [ "//base:base_implementation" ] # for BASE_EXPORT
visibility = [ "//base:base" ]
sources = [
@@ -289,6 +303,12 @@ if (use_experimental_allocator_shim) {
]
} else if (is_linux && use_allocator == "none") {
sources += [ "allocator_shim_default_dispatch_to_glibc.cc" ]
+ } else if (is_android && use_allocator == "none") {
+ sources += [
+ "allocator_shim_default_dispatch_to_linker_wrapped_symbols.cc",
+ "allocator_shim_override_linker_wrapped_symbols.h",
+ ]
+ all_dependent_configs = [ ":wrap_malloc_symbols" ]
}
}
}
« no previous file with comments | « no previous file | base/allocator/README.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698