| Christopher Ferris | 63860cb | 2015-11-16 17:30:32 -0800 | [diff] [blame] | 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 | # ============================================================== | 
| Colin Cross | 2c75991 | 2016-02-05 16:17:39 -0800 | [diff] [blame] | 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 \ | 
| Colin Cross | 2c75991 | 2016-02-05 16:17:39 -0800 | [diff] [blame] | 40 | -Wno-error=format-zero-length \ | 
|  | 41 |  | 
|  | 42 | include $(BUILD_STATIC_LIBRARY) | 
|  | 43 |  | 
|  | 44 | # ============================================================== | 
| Christopher Ferris | 63860cb | 2015-11-16 17:30:32 -0800 | [diff] [blame] | 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) \ | 
| Christopher Ferris | 63860cb | 2015-11-16 17:30:32 -0800 | [diff] [blame] | 53 |  | 
| Colin Cross | 2c75991 | 2016-02-05 16:17:39 -0800 | [diff] [blame] | 54 | LOCAL_CXX_STL := libc++_static | 
| Christopher Ferris | 63860cb | 2015-11-16 17:30:32 -0800 | [diff] [blame] | 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 |  | 
| Colin Cross | 2c75991 | 2016-02-05 16:17:39 -0800 | [diff] [blame] | 60 | LOCAL_STATIC_LIBRARIES += \ | 
|  | 61 | libc_malloc_debug_backtrace \ | 
|  | 62 | libc_logging \ | 
|  | 63 |  | 
| Christopher Ferris | 63860cb | 2015-11-16 17:30:32 -0800 | [diff] [blame] | 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 |  | 
| Christopher Ferris | f2b67b8 | 2016-01-25 14:36:34 -0800 | [diff] [blame] | 72 | # -Wno-error=format-zero-length needed for gcc to compile. | 
| Christopher Ferris | 63860cb | 2015-11-16 17:30:32 -0800 | [diff] [blame] | 73 | LOCAL_CFLAGS := \ | 
|  | 74 | -Wall \ | 
|  | 75 | -Werror \ | 
|  | 76 | -fno-stack-protector \ | 
| Christopher Ferris | f2b67b8 | 2016-01-25 14:36:34 -0800 | [diff] [blame] | 77 | -Wno-error=format-zero-length \ | 
| Christopher Ferris | 63860cb | 2015-11-16 17:30:32 -0800 | [diff] [blame] | 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 \ | 
| Christopher Ferris | 1e185a5 | 2016-01-25 17:23:38 -0800 | [diff] [blame] | 107 | -Wno-error=format-zero-length \ | 
| Christopher Ferris | 63860cb | 2015-11-16 17:30:32 -0800 | [diff] [blame] | 108 |  | 
|  | 109 | include $(BUILD_NATIVE_TEST) |