Add libwilhelm to app_process.
If an app exposes new/delete from a shared library, the libwilhelm
shared library can wind up using the new from the app shared library,
and the delete from libc++. It is completely legal for the app to
export new/delete in this way, so in order to avoid this situation,
preload libwilhelm in the zygote. This forces libwilhelm to always
resolve the new/delete from libc++.
This library cannot be added to android_runtime since libwilhelm
has a shared library which depends on android_runtime.
Bug: 21032018
Change-Id: Id89c196df62d98d62855a1421f397b75a7e990a9
diff --git a/cmds/app_process/Android.mk b/cmds/app_process/Android.mk
index 3599695..7ce0846 100644
--- a/cmds/app_process/Android.mk
+++ b/cmds/app_process/Android.mk
@@ -1,5 +1,12 @@
LOCAL_PATH:= $(call my-dir)
+# This is a list of libraries that need to be included in order to avoid
+# bad apps. This prevents a library from having a mismatch when resolving
+# new/delete from an app shared library.
+# See b/21032018 for more details.
+app_process_common_shared_libs := \
+ libwilhelm \
+
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= \
@@ -13,7 +20,8 @@
libutils \
liblog \
libbinder \
- libandroid_runtime
+ libandroid_runtime \
+ $(app_process_common_shared_libs) \
LOCAL_WHOLE_STATIC_LIBRARIES := libsigchain
@@ -44,7 +52,8 @@
libutils \
liblog \
libbinder \
- libandroid_runtime
+ libandroid_runtime \
+ $(app_process_common_shared_libs) \
LOCAL_WHOLE_STATIC_LIBRARIES := libsigchain