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 | # ============================================================== |
| 14 | # libc_malloc_debug.so |
| 15 | # ============================================================== |
| 16 | include $(CLEAR_VARS) |
| 17 | |
| 18 | LOCAL_MODULE := libc_malloc_debug |
| 19 | |
| 20 | LOCAL_SRC_FILES := \ |
| 21 | $(libc_malloc_debug_src_files) \ |
| 22 | backtrace.cpp \ |
| 23 | MapData.cpp \ |
| 24 | |
| 25 | LOCAL_CXX_STL := none |
| 26 | |
| 27 | # Only need this for arm since libc++ uses its own unwind code that |
| 28 | # doesn't mix with the other default unwind code. |
| 29 | LOCAL_STATIC_LIBRARIES_arm := libunwind_llvm |
| 30 | |
| 31 | LOCAL_STATIC_LIBRARIES += libc++abi libc++_static libc_logging |
| 32 | LOCAL_LDFLAGS_32 := -Wl,--version-script,$(LOCAL_PATH)/exported32.map |
| 33 | LOCAL_LDFLAGS_64 := -Wl,--version-script,$(LOCAL_PATH)/exported64.map |
| 34 | LOCAL_ALLOW_UNDEFINED_SYMBOLS := true |
| 35 | LOCAL_C_INCLUDES += bionic/libc |
| 36 | |
| 37 | LOCAL_SANITIZE := never |
| 38 | LOCAL_NATIVE_COVERAGE := false |
| 39 | |
Christopher Ferris | f2b67b8 | 2016-01-25 14:36:34 -0800 | [diff] [blame] | 40 | # -Wno-error=format-zero-length needed for gcc to compile. |
Christopher Ferris | 63860cb | 2015-11-16 17:30:32 -0800 | [diff] [blame] | 41 | LOCAL_CFLAGS := \ |
| 42 | -Wall \ |
| 43 | -Werror \ |
| 44 | -fno-stack-protector \ |
Christopher Ferris | f2b67b8 | 2016-01-25 14:36:34 -0800 | [diff] [blame] | 45 | -Wno-error=format-zero-length \ |
Christopher Ferris | 63860cb | 2015-11-16 17:30:32 -0800 | [diff] [blame] | 46 | |
| 47 | include $(BUILD_SHARED_LIBRARY) |
| 48 | |
| 49 | # ============================================================== |
| 50 | # Unit Tests |
| 51 | # ============================================================== |
| 52 | include $(CLEAR_VARS) |
| 53 | |
| 54 | LOCAL_MODULE := malloc_debug_unit_tests |
| 55 | LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32 |
| 56 | LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64 |
| 57 | |
| 58 | LOCAL_SRC_FILES := \ |
| 59 | tests/backtrace_fake.cpp \ |
| 60 | tests/log_fake.cpp \ |
| 61 | tests/libc_fake.cpp \ |
| 62 | tests/property_fake.cpp \ |
| 63 | tests/malloc_debug_config_tests.cpp \ |
| 64 | tests/malloc_debug_unit_tests.cpp \ |
| 65 | $(libc_malloc_debug_src_files) \ |
| 66 | |
| 67 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/tests |
| 68 | LOCAL_C_INCLUDES += bionic/libc |
| 69 | |
| 70 | LOCAL_SHARED_LIBRARIES := libbase |
| 71 | |
| 72 | LOCAL_CFLAGS := \ |
| 73 | -Wall \ |
| 74 | -Werror \ |
Christopher Ferris | 1e185a5 | 2016-01-25 17:23:38 -0800 | [diff] [blame^] | 75 | -Wno-error=format-zero-length \ |
Christopher Ferris | 63860cb | 2015-11-16 17:30:32 -0800 | [diff] [blame] | 76 | |
| 77 | include $(BUILD_NATIVE_TEST) |