Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2012 The Android Open Source Project |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | # |
| 16 | # |
| 17 | |
| 18 | LOCAL_PATH:= $(call my-dir) |
| 19 | |
| 20 | ifeq ($(TARGET_ARCH),arm) |
| 21 | |
| 22 | ASAN_NEEDS_SEGV=0 |
| 23 | ASAN_HAS_EXCEPTIONS=1 |
| 24 | ASAN_FLEXIBLE_MAPPING_AND_OFFSET=0 |
| 25 | |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 26 | asan_rtl_files := \ |
| 27 | asan_rtl.cc \ |
| 28 | asan_allocator.cc \ |
| 29 | asan_globals.cc \ |
| 30 | asan_interceptors.cc \ |
| 31 | asan_linux.cc \ |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 32 | asan_malloc_linux.cc \ |
| 33 | asan_malloc_mac.cc \ |
Shih-wei Liao | ed00338 | 2012-04-25 06:48:42 -0700 | [diff] [blame] | 34 | asan_new_delete.cc \ |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 35 | asan_poisoning.cc \ |
| 36 | asan_posix.cc \ |
Stephen Hines | 6490f0d | 2012-08-23 03:01:53 -0700 | [diff] [blame] | 37 | asan_report.cc \ |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 38 | asan_stack.cc \ |
| 39 | asan_stats.cc \ |
| 40 | asan_thread.cc \ |
Shih-wei Liao | 5158404 | 2012-08-05 17:31:51 -0700 | [diff] [blame] | 41 | asan_thread_registry.cc \ |
| 42 | ../interception/interception_linux.cc \ |
| 43 | ../sanitizer_common/sanitizer_allocator.cc \ |
| 44 | ../sanitizer_common/sanitizer_common.cc \ |
Stephen Hines | 6490f0d | 2012-08-23 03:01:53 -0700 | [diff] [blame] | 45 | ../sanitizer_common/sanitizer_flags.cc \ |
Shih-wei Liao | 5158404 | 2012-08-05 17:31:51 -0700 | [diff] [blame] | 46 | ../sanitizer_common/sanitizer_libc.cc \ |
| 47 | ../sanitizer_common/sanitizer_linux.cc \ |
| 48 | ../sanitizer_common/sanitizer_posix.cc \ |
| 49 | ../sanitizer_common/sanitizer_printf.cc \ |
Stephen Hines | 1f922a5 | 2012-09-10 20:14:46 -0700 | [diff] [blame] | 50 | ../sanitizer_common/sanitizer_stacktrace.cc \ |
Stephen Hines | 6490f0d | 2012-08-23 03:01:53 -0700 | [diff] [blame] | 51 | ../sanitizer_common/sanitizer_symbolizer.cc \ |
| 52 | ../sanitizer_common/sanitizer_symbolizer_linux.cc \ |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 53 | |
| 54 | asan_rtl_cflags := \ |
| 55 | -fvisibility=hidden \ |
| 56 | -fno-exceptions \ |
| 57 | -DASAN_LOW_MEMORY=1 \ |
| 58 | -DASAN_NEEDS_SEGV=$(ASAN_NEEDS_SEGV) \ |
| 59 | -DASAN_HAS_EXCEPTIONS=$(ASAN_HAS_EXCEPTIONS) \ |
| 60 | -DASAN_FLEXIBLE_MAPPING_AND_OFFSET=$(ASAN_FLEXIBLE_MAPPING_AND_OFFSET) \ |
| 61 | -Wno-covered-switch-default \ |
Evgeniy Stepanov | e48a197 | 2012-03-29 18:09:56 +0400 | [diff] [blame] | 62 | -Wno-sign-compare \ |
| 63 | -Wno-unused-parameter \ |
| 64 | -D__WORDSIZE=32 |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 65 | |
| 66 | asan_test_files := \ |
| 67 | tests/asan_test.cc \ |
| 68 | tests/asan_globals_test.cc \ |
Stephen Hines | 6490f0d | 2012-08-23 03:01:53 -0700 | [diff] [blame] | 69 | tests/asan_break_optimization.cc |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 70 | |
| 71 | asan_test_cflags := \ |
Evgeniy Stepanov | e48a197 | 2012-03-29 18:09:56 +0400 | [diff] [blame] | 72 | -mllvm -asan-blacklist=external/compiler-rt/lib/asan/tests/asan_test.ignore \ |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 73 | -DASAN_LOW_MEMORY=1 \ |
| 74 | -DASAN_UAR=0 \ |
| 75 | -DASAN_NEEDS_SEGV=$(ASAN_NEEDS_SEGV) \ |
| 76 | -DASAN_HAS_EXCEPTIONS=$(ASAN_HAS_EXCEPTIONS) \ |
| 77 | -DASAN_HAS_BLACKLIST=1 \ |
Evgeniy Stepanov | e48a197 | 2012-03-29 18:09:56 +0400 | [diff] [blame] | 78 | -Wno-covered-switch-default \ |
| 79 | -Wno-sign-compare \ |
| 80 | -Wno-unused-parameter \ |
| 81 | -D__WORDSIZE=32 |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 82 | |
| 83 | |
| 84 | include $(CLEAR_VARS) |
| 85 | |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 86 | LOCAL_MODULE := libasan |
| 87 | LOCAL_MODULE_TAGS := optional |
Stephen Hines | 1f922a5 | 2012-09-10 20:14:46 -0700 | [diff] [blame] | 88 | LOCAL_C_INCLUDES := bionic external/compiler-rt/lib external/compiler-rt/include |
Evgeniy Stepanov | e48a197 | 2012-03-29 18:09:56 +0400 | [diff] [blame] | 89 | LOCAL_CFLAGS += $(asan_rtl_cflags) |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 90 | LOCAL_SRC_FILES := asan_android_stub.cc |
| 91 | LOCAL_CPP_EXTENSION := .cc |
| 92 | LOCAL_CLANG := true |
Stephen Hines | 97ac43c | 2013-01-18 17:46:14 -0800 | [diff] [blame^] | 93 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 94 | include $(BUILD_STATIC_LIBRARY) |
| 95 | |
| 96 | |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 97 | include $(CLEAR_VARS) |
| 98 | |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 99 | LOCAL_MODULE := libasan_preload |
Evgeniy Stepanov | e48a197 | 2012-03-29 18:09:56 +0400 | [diff] [blame] | 100 | LOCAL_MODULE_TAGS := eng |
Shih-wei Liao | ed00338 | 2012-04-25 06:48:42 -0700 | [diff] [blame] | 101 | LOCAL_C_INCLUDES := \ |
| 102 | bionic \ |
Stephen Hines | 1f922a5 | 2012-09-10 20:14:46 -0700 | [diff] [blame] | 103 | external/compiler-rt/lib \ |
| 104 | external/compiler-rt/include |
Evgeniy Stepanov | e48a197 | 2012-03-29 18:09:56 +0400 | [diff] [blame] | 105 | LOCAL_CFLAGS += $(asan_rtl_cflags) |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 106 | LOCAL_SRC_FILES := $(asan_rtl_files) |
| 107 | LOCAL_CPP_EXTENSION := .cc |
Evgeniy Stepanov | 08f6fe2 | 2012-10-18 19:25:42 +0400 | [diff] [blame] | 108 | LOCAL_SHARED_LIBRARIES := libc libdl |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 109 | LOCAL_CLANG := true |
Stephen Hines | 97ac43c | 2013-01-18 17:46:14 -0800 | [diff] [blame^] | 110 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 111 | include $(BUILD_SHARED_LIBRARY) |
| 112 | |
| 113 | |
| 114 | include $(CLEAR_VARS) |
| 115 | |
| 116 | LOCAL_MODULE := asanwrapper |
Evgeniy Stepanov | e48a197 | 2012-03-29 18:09:56 +0400 | [diff] [blame] | 117 | LOCAL_MODULE_TAGS := eng |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 118 | LOCAL_C_INCLUDES := \ |
| 119 | bionic \ |
| 120 | external/stlport/stlport |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 121 | LOCAL_SRC_FILES := asanwrapper.cc |
| 122 | LOCAL_CPP_EXTENSION := .cc |
| 123 | LOCAL_SHARED_LIBRARIES := libstlport libc |
Stephen Hines | 97ac43c | 2013-01-18 17:46:14 -0800 | [diff] [blame^] | 124 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 125 | |
| 126 | include $(BUILD_EXECUTABLE) |
| 127 | |
| 128 | |
| 129 | include $(CLEAR_VARS) |
| 130 | |
Evgeniy Stepanov | e48a197 | 2012-03-29 18:09:56 +0400 | [diff] [blame] | 131 | LOCAL_MODULE := libasan_noinst_test |
| 132 | LOCAL_MODULE_TAGS := tests |
| 133 | LOCAL_C_INCLUDES := \ |
| 134 | bionic \ |
| 135 | external/stlport/stlport \ |
Shih-wei Liao | 5158404 | 2012-08-05 17:31:51 -0700 | [diff] [blame] | 136 | external/gtest/include \ |
Stephen Hines | 1f922a5 | 2012-09-10 20:14:46 -0700 | [diff] [blame] | 137 | external/compiler-rt/include \ |
Shih-wei Liao | 5158404 | 2012-08-05 17:31:51 -0700 | [diff] [blame] | 138 | external/compiler-rt/lib |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 139 | LOCAL_CFLAGS += \ |
Evgeniy Stepanov | e48a197 | 2012-03-29 18:09:56 +0400 | [diff] [blame] | 140 | -Wno-unused-parameter \ |
| 141 | -Wno-sign-compare \ |
Stephen Hines | 1f922a5 | 2012-09-10 20:14:46 -0700 | [diff] [blame] | 142 | -DASAN_UAR=0 \ |
| 143 | -DASAN_HAS_BLACKLIST=1 \ |
Evgeniy Stepanov | e48a197 | 2012-03-29 18:09:56 +0400 | [diff] [blame] | 144 | -D__WORDSIZE=32 |
| 145 | LOCAL_SRC_FILES := tests/asan_noinst_test.cc |
| 146 | LOCAL_CPP_EXTENSION := .cc |
| 147 | LOCAL_CLANG := true |
Stephen Hines | 97ac43c | 2013-01-18 17:46:14 -0800 | [diff] [blame^] | 148 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Evgeniy Stepanov | e48a197 | 2012-03-29 18:09:56 +0400 | [diff] [blame] | 149 | include $(BUILD_STATIC_LIBRARY) |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 150 | |
Evgeniy Stepanov | e48a197 | 2012-03-29 18:09:56 +0400 | [diff] [blame] | 151 | |
| 152 | include $(CLEAR_VARS) |
| 153 | |
| 154 | LOCAL_MODULE := asan_test |
| 155 | LOCAL_MODULE_TAGS := tests |
| 156 | LOCAL_C_INCLUDES := \ |
| 157 | bionic \ |
| 158 | external/stlport/stlport \ |
Shih-wei Liao | 5158404 | 2012-08-05 17:31:51 -0700 | [diff] [blame] | 159 | external/gtest/include \ |
| 160 | external/compiler-rt/lib |
Evgeniy Stepanov | e48a197 | 2012-03-29 18:09:56 +0400 | [diff] [blame] | 161 | LOCAL_CFLAGS += $(asan_test_cflags) |
| 162 | LOCAL_SRC_FILES := $(asan_test_files) |
| 163 | LOCAL_CPP_EXTENSION := .cc |
| 164 | LOCAL_STATIC_LIBRARIES := libgtest libasan_noinst_test |
| 165 | LOCAL_SHARED_LIBRARIES := libc libstlport |
| 166 | LOCAL_ADDRESS_SANITIZER := true |
Stephen Hines | 97ac43c | 2013-01-18 17:46:14 -0800 | [diff] [blame^] | 167 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 168 | |
| 169 | include $(BUILD_EXECUTABLE) |
| 170 | |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 171 | endif # ifeq($(TARGET_ARCH),arm) |