1 LOCAL_PATH := $(call my-dir) 2 3 libc_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 17 include $(CLEAR_VARS) 18 19 LOCAL_MODULE := libc_malloc_debug_backtrace 20 21 LOCAL_SRC_FILES := \ 22 backtrace.cpp \ 23 MapData.cpp \ 24 25 LOCAL_CXX_STL := libc++_static 26 27 LOCAL_STATIC_LIBRARIES += \ 28 libc_logging \ 29 30 LOCAL_C_INCLUDES += bionic/libc 31 LOCAL_EXPORT_C_INCLUDE_DIRS += $(LOCAL_PATH) 32 33 LOCAL_SANITIZE := never 34 LOCAL_NATIVE_COVERAGE := false 35 36 # -Wno-error=format-zero-length needed for gcc to compile. 37 LOCAL_CFLAGS := \ 38 -Wall \ 39 -Werror \ 40 -Wno-error=format-zero-length \ 41 42 include $(BUILD_STATIC_LIBRARY) 43 44 # ============================================================== 45 # libc_malloc_debug.so 46 # ============================================================== 47 include $(CLEAR_VARS) 48 49 LOCAL_MODULE := libc_malloc_debug 50 51 LOCAL_SRC_FILES := \ 52 $(libc_malloc_debug_src_files) \ 53 54 LOCAL_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. 58 LOCAL_STATIC_LIBRARIES_arm := libunwind_llvm 59 60 LOCAL_STATIC_LIBRARIES += \ 61 libc_malloc_debug_backtrace \ 62 libc_logging \ 63 64 LOCAL_LDFLAGS_32 := -Wl,--version-script,$(LOCAL_PATH)/exported32.map 65 LOCAL_LDFLAGS_64 := -Wl,--version-script,$(LOCAL_PATH)/exported64.map 66 LOCAL_ALLOW_UNDEFINED_SYMBOLS := true 67 LOCAL_C_INCLUDES += bionic/libc 68 69 LOCAL_SANITIZE := never 70 LOCAL_NATIVE_COVERAGE := false 71 72 # -Wno-error=format-zero-length needed for gcc to compile. 73 LOCAL_CFLAGS := \ 74 -Wall \ 75 -Werror \ 76 -fno-stack-protector \ 77 -Wno-error=format-zero-length \ 78 79 include $(BUILD_SHARED_LIBRARY) 80 81 # ============================================================== 82 # Unit Tests 83 # ============================================================== 84 include $(CLEAR_VARS) 85 86 LOCAL_MODULE := malloc_debug_unit_tests 87 LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32 88 LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64 89 90 LOCAL_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 99 LOCAL_C_INCLUDES := $(LOCAL_PATH)/tests 100 LOCAL_C_INCLUDES += bionic/libc 101 102 LOCAL_SHARED_LIBRARIES := libbase 103 104 LOCAL_CFLAGS := \ 105 -Wall \ 106 -Werror \ 107 -Wno-error=format-zero-length \ 108 109 include $(BUILD_NATIVE_TEST) 110