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 \ |
Christopher Ferris | 7bd0178 | 2016-04-20 12:30:58 -0700 | [diff] [blame^] | 11 | RecordData.cpp \ |
Christopher Ferris | 63860cb | 2015-11-16 17:30:32 -0800 | [diff] [blame] | 12 | TrackData.cpp \ |
| 13 | |
| 14 | # ============================================================== |
Colin Cross | 2c75991 | 2016-02-05 16:17:39 -0800 | [diff] [blame] | 15 | # libc_malloc_debug_backtrace.a |
| 16 | # ============================================================== |
| 17 | # Used by libmemunreachable |
| 18 | include $(CLEAR_VARS) |
| 19 | |
| 20 | LOCAL_MODULE := libc_malloc_debug_backtrace |
| 21 | |
| 22 | LOCAL_SRC_FILES := \ |
| 23 | backtrace.cpp \ |
| 24 | MapData.cpp \ |
| 25 | |
| 26 | LOCAL_CXX_STL := libc++_static |
| 27 | |
| 28 | LOCAL_STATIC_LIBRARIES += \ |
| 29 | libc_logging \ |
| 30 | |
| 31 | LOCAL_C_INCLUDES += bionic/libc |
| 32 | LOCAL_EXPORT_C_INCLUDE_DIRS += $(LOCAL_PATH) |
| 33 | |
| 34 | LOCAL_SANITIZE := never |
| 35 | LOCAL_NATIVE_COVERAGE := false |
| 36 | |
| 37 | # -Wno-error=format-zero-length needed for gcc to compile. |
| 38 | LOCAL_CFLAGS := \ |
| 39 | -Wall \ |
| 40 | -Werror \ |
Colin Cross | 2c75991 | 2016-02-05 16:17:39 -0800 | [diff] [blame] | 41 | -Wno-error=format-zero-length \ |
| 42 | |
| 43 | include $(BUILD_STATIC_LIBRARY) |
| 44 | |
| 45 | # ============================================================== |
Christopher Ferris | 63860cb | 2015-11-16 17:30:32 -0800 | [diff] [blame] | 46 | # libc_malloc_debug.so |
| 47 | # ============================================================== |
| 48 | include $(CLEAR_VARS) |
| 49 | |
| 50 | LOCAL_MODULE := libc_malloc_debug |
| 51 | |
| 52 | LOCAL_SRC_FILES := \ |
| 53 | $(libc_malloc_debug_src_files) \ |
Christopher Ferris | 63860cb | 2015-11-16 17:30:32 -0800 | [diff] [blame] | 54 | |
Colin Cross | 2c75991 | 2016-02-05 16:17:39 -0800 | [diff] [blame] | 55 | LOCAL_CXX_STL := libc++_static |
Christopher Ferris | 63860cb | 2015-11-16 17:30:32 -0800 | [diff] [blame] | 56 | |
| 57 | # Only need this for arm since libc++ uses its own unwind code that |
| 58 | # doesn't mix with the other default unwind code. |
| 59 | LOCAL_STATIC_LIBRARIES_arm := libunwind_llvm |
| 60 | |
Colin Cross | 2c75991 | 2016-02-05 16:17:39 -0800 | [diff] [blame] | 61 | LOCAL_STATIC_LIBRARIES += \ |
Christopher Ferris | 7bd0178 | 2016-04-20 12:30:58 -0700 | [diff] [blame^] | 62 | libbase \ |
Colin Cross | 2c75991 | 2016-02-05 16:17:39 -0800 | [diff] [blame] | 63 | libc_malloc_debug_backtrace \ |
| 64 | libc_logging \ |
| 65 | |
Christopher Ferris | 63860cb | 2015-11-16 17:30:32 -0800 | [diff] [blame] | 66 | LOCAL_LDFLAGS_32 := -Wl,--version-script,$(LOCAL_PATH)/exported32.map |
| 67 | LOCAL_LDFLAGS_64 := -Wl,--version-script,$(LOCAL_PATH)/exported64.map |
| 68 | LOCAL_ALLOW_UNDEFINED_SYMBOLS := true |
| 69 | LOCAL_C_INCLUDES += bionic/libc |
| 70 | |
| 71 | LOCAL_SANITIZE := never |
| 72 | LOCAL_NATIVE_COVERAGE := false |
| 73 | |
Christopher Ferris | f2b67b8 | 2016-01-25 14:36:34 -0800 | [diff] [blame] | 74 | # -Wno-error=format-zero-length needed for gcc to compile. |
Christopher Ferris | 63860cb | 2015-11-16 17:30:32 -0800 | [diff] [blame] | 75 | LOCAL_CFLAGS := \ |
| 76 | -Wall \ |
| 77 | -Werror \ |
| 78 | -fno-stack-protector \ |
Christopher Ferris | f2b67b8 | 2016-01-25 14:36:34 -0800 | [diff] [blame] | 79 | -Wno-error=format-zero-length \ |
Christopher Ferris | 63860cb | 2015-11-16 17:30:32 -0800 | [diff] [blame] | 80 | |
| 81 | include $(BUILD_SHARED_LIBRARY) |
| 82 | |
| 83 | # ============================================================== |
| 84 | # Unit Tests |
| 85 | # ============================================================== |
| 86 | include $(CLEAR_VARS) |
| 87 | |
| 88 | LOCAL_MODULE := malloc_debug_unit_tests |
| 89 | LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32 |
| 90 | LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64 |
| 91 | |
| 92 | LOCAL_SRC_FILES := \ |
| 93 | tests/backtrace_fake.cpp \ |
| 94 | tests/log_fake.cpp \ |
| 95 | tests/libc_fake.cpp \ |
| 96 | tests/property_fake.cpp \ |
| 97 | tests/malloc_debug_config_tests.cpp \ |
| 98 | tests/malloc_debug_unit_tests.cpp \ |
| 99 | $(libc_malloc_debug_src_files) \ |
| 100 | |
| 101 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/tests |
| 102 | LOCAL_C_INCLUDES += bionic/libc |
| 103 | |
| 104 | LOCAL_SHARED_LIBRARIES := libbase |
| 105 | |
| 106 | LOCAL_CFLAGS := \ |
| 107 | -Wall \ |
| 108 | -Werror \ |
Christopher Ferris | 1e185a5 | 2016-01-25 17:23:38 -0800 | [diff] [blame] | 109 | -Wno-error=format-zero-length \ |
Christopher Ferris | 63860cb | 2015-11-16 17:30:32 -0800 | [diff] [blame] | 110 | |
| 111 | include $(BUILD_NATIVE_TEST) |