Add ability to build scudo-free 32-bit libc variant.
Scudo seems to have issues with camera blobs,
which also the case with google devices.
https://android-review.googlesource.com/q/topic:%22disable-camera24-memory-mitigations%22+(status:open%20OR%20status:merged)
These changes are applied upstream and needed much more
commits in various components which makes it difficult to backport.
Therefore add option to disable scudo only for 32 bit components,
like camera modules.
Change-Id: Ie4e62477b0801413827007c511e547b12ea2f46d
diff --git a/libc/Android.bp b/libc/Android.bp
index e30a632..ce71405 100644
--- a/libc/Android.bp
+++ b/libc/Android.bp
@@ -102,6 +102,18 @@
},
}
+libc32_scudo_product_variables = {
+ malloc_not_svelte_libc32: {
+ cflags: ["-DUSE_SCUDO"],
+ whole_static_libs: ["libscudo"],
+ exclude_static_libs: [
+ "libjemalloc5",
+ "libc_jemalloc_wrapper",
+ ],
+ },
+}
+
+
// Defaults for native allocator libs/includes to make it
// easier to change.
// To disable scudo for the non-svelte config remove the line:
@@ -116,7 +128,14 @@
"libc_jemalloc_wrapper",
],
header_libs: ["gwp_asan_headers"],
- product_variables: libc_scudo_product_variables,
+ multilib: {
+ lib64: {
+ product_variables: libc_scudo_product_variables,
+ },
+ lib32: {
+ product_variables: libc32_scudo_product_variables,
+ }
+ },
}
// Functions not implemented by jemalloc directly, or that need to