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 \ |
| 40 | -fno-stack-protector \ |
| 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 += \ |
| 62 | libc_malloc_debug_backtrace \ |
| 63 | libc_logging \ |
| 64 | |
Christopher Ferris | 63860cb | 2015-11-16 17:30:32 -0800 | [diff] [blame] | 65 | LOCAL_LDFLAGS_32 := -Wl,--version-script,$(LOCAL_PATH)/exported32.map |
| 66 | LOCAL_LDFLAGS_64 := -Wl,--version-script,$(LOCAL_PATH)/exported64.map |
| 67 | LOCAL_ALLOW_UNDEFINED_SYMBOLS := true |
| 68 | LOCAL_C_INCLUDES += bionic/libc |
| 69 | |
| 70 | LOCAL_SANITIZE := never |
| 71 | LOCAL_NATIVE_COVERAGE := false |
| 72 | |
Christopher Ferris | f2b67b8 | 2016-01-25 14:36:34 -0800 | [diff] [blame] | 73 | # -Wno-error=format-zero-length needed for gcc to compile. |
Christopher Ferris | 63860cb | 2015-11-16 17:30:32 -0800 | [diff] [blame] | 74 | LOCAL_CFLAGS := \ |
| 75 | -Wall \ |
| 76 | -Werror \ |
| 77 | -fno-stack-protector \ |
Christopher Ferris | f2b67b8 | 2016-01-25 14:36:34 -0800 | [diff] [blame] | 78 | -Wno-error=format-zero-length \ |
Christopher Ferris | 63860cb | 2015-11-16 17:30:32 -0800 | [diff] [blame] | 79 | |
| 80 | include $(BUILD_SHARED_LIBRARY) |
| 81 | |
| 82 | # ============================================================== |
| 83 | # Unit Tests |
| 84 | # ============================================================== |
| 85 | include $(CLEAR_VARS) |
| 86 | |
| 87 | LOCAL_MODULE := malloc_debug_unit_tests |
| 88 | LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32 |
| 89 | LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64 |
| 90 | |
| 91 | LOCAL_SRC_FILES := \ |
| 92 | tests/backtrace_fake.cpp \ |
| 93 | tests/log_fake.cpp \ |
| 94 | tests/libc_fake.cpp \ |
| 95 | tests/property_fake.cpp \ |
| 96 | tests/malloc_debug_config_tests.cpp \ |
| 97 | tests/malloc_debug_unit_tests.cpp \ |
| 98 | $(libc_malloc_debug_src_files) \ |
| 99 | |
| 100 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/tests |
| 101 | LOCAL_C_INCLUDES += bionic/libc |
| 102 | |
| 103 | LOCAL_SHARED_LIBRARIES := libbase |
| 104 | |
| 105 | LOCAL_CFLAGS := \ |
| 106 | -Wall \ |
| 107 | -Werror \ |
Christopher Ferris | 1e185a5 | 2016-01-25 17:23:38 -0800 | [diff] [blame] | 108 | -Wno-error=format-zero-length \ |
Christopher Ferris | 63860cb | 2015-11-16 17:30:32 -0800 | [diff] [blame] | 109 | |
| 110 | include $(BUILD_NATIVE_TEST) |