OSDN Git Service

libc: Add an intermediate version of the static libc without malloc
authorDima Zavin <dima@android.com>
Wed, 27 May 2009 17:52:37 +0000 (10:52 -0700)
committerDima Zavin <dima@android.com>
Thu, 28 May 2009 03:16:19 +0000 (20:16 -0700)
For now, this will only used by the dynamic loader to ensure that
malloc and friends are never called.

Signed-off-by: Dima Zavin <dima@android.com>
libc/Android.mk

index 1c1b312..59a4c6b 100644 (file)
@@ -444,6 +444,32 @@ include $(BUILD_STATIC_LIBRARY)
 
 
 # ========================================================
+# libc_nomalloc.a
+# ========================================================
+#
+# This is a version of the static C library that does not
+# include malloc. It's useful in situations when calling
+# the user wants to provide their own malloc implementation,
+# or wants to explicitly disallow the use of the use of malloc,
+# like the dynamic loader.
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+       $(libc_arch_static_src_files) \
+       bionic/libc_init_static.c
+
+LOCAL_C_INCLUDES := $(libc_common_c_includes)
+LOCAL_CFLAGS := $(libc_common_cflags)
+
+LOCAL_MODULE := libc_nomalloc
+LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
+LOCAL_SYSTEM_SHARED_LIBRARIES :=
+
+include $(BUILD_STATIC_LIBRARY)
+
+
+# ========================================================
 # libc.a
 # ========================================================
 include $(CLEAR_VARS)