• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1LOCAL_PATH := $(call my-dir)
2
3libc_malloc_debug_src_files := \
4    BacktraceData.cpp \
5    Config.cpp \
6    DebugData.cpp \
7    debug_disable.cpp \
8    FreeTrackData.cpp \
9    GuardData.cpp \
10    malloc_debug.cpp \
11    TrackData.cpp \
12
13# ==============================================================
14# libc_malloc_debug_backtrace.a
15# ==============================================================
16# Used by libmemunreachable
17include $(CLEAR_VARS)
18
19LOCAL_MODULE := libc_malloc_debug_backtrace
20
21LOCAL_SRC_FILES := \
22    backtrace.cpp \
23    MapData.cpp \
24
25LOCAL_CXX_STL := libc++_static
26
27LOCAL_STATIC_LIBRARIES += \
28    libc_logging \
29
30LOCAL_C_INCLUDES += bionic/libc
31LOCAL_EXPORT_C_INCLUDE_DIRS += $(LOCAL_PATH)
32
33LOCAL_SANITIZE := never
34LOCAL_NATIVE_COVERAGE := false
35
36# -Wno-error=format-zero-length needed for gcc to compile.
37LOCAL_CFLAGS := \
38    -Wall \
39    -Werror \
40    -Wno-error=format-zero-length \
41
42include $(BUILD_STATIC_LIBRARY)
43
44# ==============================================================
45# libc_malloc_debug.so
46# ==============================================================
47include $(CLEAR_VARS)
48
49LOCAL_MODULE := libc_malloc_debug
50
51LOCAL_SRC_FILES := \
52    $(libc_malloc_debug_src_files) \
53
54LOCAL_CXX_STL := libc++_static
55
56# Only need this for arm since libc++ uses its own unwind code that
57# doesn't mix with the other default unwind code.
58LOCAL_STATIC_LIBRARIES_arm := libunwind_llvm
59
60LOCAL_STATIC_LIBRARIES += \
61    libc_malloc_debug_backtrace \
62    libc_logging \
63
64LOCAL_LDFLAGS_32 := -Wl,--version-script,$(LOCAL_PATH)/exported32.map
65LOCAL_LDFLAGS_64 := -Wl,--version-script,$(LOCAL_PATH)/exported64.map
66LOCAL_ALLOW_UNDEFINED_SYMBOLS := true
67LOCAL_C_INCLUDES += bionic/libc
68
69LOCAL_SANITIZE := never
70LOCAL_NATIVE_COVERAGE := false
71
72# -Wno-error=format-zero-length needed for gcc to compile.
73LOCAL_CFLAGS := \
74    -Wall \
75    -Werror \
76    -fno-stack-protector \
77    -Wno-error=format-zero-length \
78
79include $(BUILD_SHARED_LIBRARY)
80
81# ==============================================================
82# Unit Tests
83# ==============================================================
84include $(CLEAR_VARS)
85
86LOCAL_MODULE := malloc_debug_unit_tests
87LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
88LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
89
90LOCAL_SRC_FILES := \
91    tests/backtrace_fake.cpp \
92    tests/log_fake.cpp \
93    tests/libc_fake.cpp \
94    tests/property_fake.cpp \
95    tests/malloc_debug_config_tests.cpp \
96    tests/malloc_debug_unit_tests.cpp \
97    $(libc_malloc_debug_src_files) \
98
99LOCAL_C_INCLUDES := $(LOCAL_PATH)/tests
100LOCAL_C_INCLUDES += bionic/libc
101
102LOCAL_SHARED_LIBRARIES := libbase
103
104LOCAL_CFLAGS := \
105    -Wall \
106    -Werror \
107    -Wno-error=format-zero-length \
108
109include $(BUILD_NATIVE_TEST)
110