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 | |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 20 | ASAN_NEEDS_SEGV=0 |
| 21 | ASAN_HAS_EXCEPTIONS=1 |
| 22 | ASAN_FLEXIBLE_MAPPING_AND_OFFSET=0 |
| 23 | |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 24 | asan_rtl_files := \ |
Stephen Hines | 6d18623 | 2014-11-26 17:56:19 -0800 | [diff] [blame] | 25 | asan_activation.cc \ |
Stephen Hines | 86277eb | 2015-03-23 12:06:32 -0700 | [diff] [blame] | 26 | asan_allocator.cc \ |
Stephen Hines | 6d18623 | 2014-11-26 17:56:19 -0800 | [diff] [blame] | 27 | asan_fake_stack.cc \ |
Stephen Hines | 86277eb | 2015-03-23 12:06:32 -0700 | [diff] [blame] | 28 | asan_flags.cc \ |
Stephen Hines | 6d18623 | 2014-11-26 17:56:19 -0800 | [diff] [blame] | 29 | asan_globals.cc \ |
| 30 | asan_interceptors.cc \ |
| 31 | asan_linux.cc \ |
| 32 | asan_mac.cc \ |
| 33 | asan_malloc_linux.cc \ |
| 34 | asan_malloc_mac.cc \ |
| 35 | asan_malloc_win.cc \ |
Stephen Hines | 6d18623 | 2014-11-26 17:56:19 -0800 | [diff] [blame] | 36 | asan_poisoning.cc \ |
| 37 | asan_posix.cc \ |
| 38 | asan_report.cc \ |
| 39 | asan_rtl.cc \ |
| 40 | asan_stack.cc \ |
| 41 | asan_stats.cc \ |
Stephen Hines | 86277eb | 2015-03-23 12:06:32 -0700 | [diff] [blame] | 42 | asan_suppressions.cc \ |
Stephen Hines | 6d18623 | 2014-11-26 17:56:19 -0800 | [diff] [blame] | 43 | asan_thread.cc \ |
| 44 | asan_win.cc \ |
| 45 | ../interception/interception_linux.cc \ |
| 46 | ../lsan/lsan_common.cc \ |
| 47 | ../lsan/lsan_common_linux.cc \ |
| 48 | ../sanitizer_common/sanitizer_allocator.cc \ |
| 49 | ../sanitizer_common/sanitizer_common.cc \ |
| 50 | ../sanitizer_common/sanitizer_common_libcdep.cc \ |
| 51 | ../sanitizer_common/sanitizer_coverage_libcdep.cc \ |
| 52 | ../sanitizer_common/sanitizer_coverage_mapping_libcdep.cc \ |
| 53 | ../sanitizer_common/sanitizer_deadlock_detector1.cc \ |
| 54 | ../sanitizer_common/sanitizer_deadlock_detector2.cc \ |
| 55 | ../sanitizer_common/sanitizer_flags.cc \ |
Stephen Hines | 86277eb | 2015-03-23 12:06:32 -0700 | [diff] [blame] | 56 | ../sanitizer_common/sanitizer_flag_parser.cc \ |
Stephen Hines | 6d18623 | 2014-11-26 17:56:19 -0800 | [diff] [blame] | 57 | ../sanitizer_common/sanitizer_libc.cc \ |
| 58 | ../sanitizer_common/sanitizer_libignore.cc \ |
| 59 | ../sanitizer_common/sanitizer_linux.cc \ |
| 60 | ../sanitizer_common/sanitizer_linux_libcdep.cc \ |
| 61 | ../sanitizer_common/sanitizer_mac.cc \ |
| 62 | ../sanitizer_common/sanitizer_persistent_allocator.cc \ |
| 63 | ../sanitizer_common/sanitizer_platform_limits_linux.cc \ |
| 64 | ../sanitizer_common/sanitizer_platform_limits_posix.cc \ |
| 65 | ../sanitizer_common/sanitizer_posix.cc \ |
| 66 | ../sanitizer_common/sanitizer_posix_libcdep.cc \ |
| 67 | ../sanitizer_common/sanitizer_printf.cc \ |
| 68 | ../sanitizer_common/sanitizer_procmaps_common.cc \ |
| 69 | ../sanitizer_common/sanitizer_procmaps_freebsd.cc \ |
| 70 | ../sanitizer_common/sanitizer_procmaps_linux.cc \ |
| 71 | ../sanitizer_common/sanitizer_procmaps_mac.cc \ |
| 72 | ../sanitizer_common/sanitizer_stackdepot.cc \ |
| 73 | ../sanitizer_common/sanitizer_stacktrace.cc \ |
| 74 | ../sanitizer_common/sanitizer_stacktrace_libcdep.cc \ |
| 75 | ../sanitizer_common/sanitizer_stacktrace_printer.cc \ |
| 76 | ../sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc \ |
| 77 | ../sanitizer_common/sanitizer_suppressions.cc \ |
| 78 | ../sanitizer_common/sanitizer_symbolizer.cc \ |
| 79 | ../sanitizer_common/sanitizer_symbolizer_libbacktrace.cc \ |
| 80 | ../sanitizer_common/sanitizer_symbolizer_libcdep.cc \ |
| 81 | ../sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc \ |
Pirama Arumuga Nainar | 7c91505 | 2015-04-08 08:58:29 -0700 | [diff] [blame] | 82 | ../sanitizer_common/sanitizer_symbolizer_process_libcdep.cc \ |
Stephen Hines | 6d18623 | 2014-11-26 17:56:19 -0800 | [diff] [blame] | 83 | ../sanitizer_common/sanitizer_symbolizer_win.cc \ |
| 84 | ../sanitizer_common/sanitizer_thread_registry.cc \ |
| 85 | ../sanitizer_common/sanitizer_tls_get_addr.cc \ |
| 86 | ../sanitizer_common/sanitizer_unwind_posix_libcdep.cc \ |
| 87 | ../sanitizer_common/sanitizer_win.cc \ |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 88 | |
Evgeniy Stepanov | d66dda0 | 2014-11-06 18:29:53 +0300 | [diff] [blame] | 89 | asan_rtl_cxx_files := \ |
| 90 | asan_new_delete.cc \ |
| 91 | |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 92 | asan_rtl_cflags := \ |
| 93 | -fvisibility=hidden \ |
| 94 | -fno-exceptions \ |
| 95 | -DASAN_LOW_MEMORY=1 \ |
| 96 | -DASAN_NEEDS_SEGV=$(ASAN_NEEDS_SEGV) \ |
| 97 | -DASAN_HAS_EXCEPTIONS=$(ASAN_HAS_EXCEPTIONS) \ |
| 98 | -DASAN_FLEXIBLE_MAPPING_AND_OFFSET=$(ASAN_FLEXIBLE_MAPPING_AND_OFFSET) \ |
| 99 | -Wno-covered-switch-default \ |
Stephen Hines | 3a02de3 | 2013-05-03 18:10:06 -0700 | [diff] [blame] | 100 | -Wno-non-virtual-dtor \ |
Evgeniy Stepanov | e48a197 | 2012-03-29 18:09:56 +0400 | [diff] [blame] | 101 | -Wno-sign-compare \ |
| 102 | -Wno-unused-parameter \ |
Dan Albert | 28b72ed | 2015-04-28 11:42:19 -0700 | [diff] [blame] | 103 | -std=c++11 \ |
| 104 | -fno-rtti \ |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 105 | |
| 106 | asan_test_files := \ |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 107 | tests/asan_globals_test.cc \ |
Stephen Hines | 7c98f2d | 2013-01-10 01:49:27 -0800 | [diff] [blame] | 108 | tests/asan_test.cc |
| 109 | |
| 110 | #tests/asan_noinst_test.cc \ |
| 111 | #tests/asan_test_main.cc \ |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 112 | |
| 113 | asan_test_cflags := \ |
Stephen Hines | 6a211c5 | 2014-07-21 00:49:56 -0700 | [diff] [blame] | 114 | -fsanitize-blacklist=external/compiler-rt/lib/asan/tests/asan_test.ignore \ |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 115 | -DASAN_LOW_MEMORY=1 \ |
| 116 | -DASAN_UAR=0 \ |
| 117 | -DASAN_NEEDS_SEGV=$(ASAN_NEEDS_SEGV) \ |
| 118 | -DASAN_HAS_EXCEPTIONS=$(ASAN_HAS_EXCEPTIONS) \ |
| 119 | -DASAN_HAS_BLACKLIST=1 \ |
Evgeniy Stepanov | e48a197 | 2012-03-29 18:09:56 +0400 | [diff] [blame] | 120 | -Wno-covered-switch-default \ |
Stephen Hines | 3a02de3 | 2013-05-03 18:10:06 -0700 | [diff] [blame] | 121 | -Wno-non-virtual-dtor \ |
Evgeniy Stepanov | e48a197 | 2012-03-29 18:09:56 +0400 | [diff] [blame] | 122 | -Wno-sign-compare \ |
| 123 | -Wno-unused-parameter \ |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 124 | -std=c++11 |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 125 | |
| 126 | |
Dan Albert | 93f64d9 | 2014-10-18 17:25:26 -0700 | [diff] [blame] | 127 | ifeq ($(TARGET_ARCH),arm) |
| 128 | |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 129 | include $(CLEAR_VARS) |
| 130 | |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 131 | LOCAL_MODULE := libasan |
Dan Albert | ca8da89 | 2015-01-08 15:56:27 -0800 | [diff] [blame] | 132 | LOCAL_C_INCLUDES := \ |
| 133 | external/compiler-rt/lib \ |
| 134 | external/compiler-rt/include |
Evgeniy Stepanov | e48a197 | 2012-03-29 18:09:56 +0400 | [diff] [blame] | 135 | LOCAL_CFLAGS += $(asan_rtl_cflags) |
Stephen Hines | ff571e2 | 2013-03-05 23:44:58 -0800 | [diff] [blame] | 136 | LOCAL_SRC_FILES := asan_preinit.cc |
| 137 | #LOCAL_SRC_FILES := asan_android_stub.cc asan_preinit.cc |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 138 | LOCAL_CPP_EXTENSION := .cc |
| 139 | LOCAL_CLANG := true |
Stephen Hines | 97ac43c | 2013-01-18 17:46:14 -0800 | [diff] [blame] | 140 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Dan Albert | d92fd09 | 2014-10-16 23:10:08 -0700 | [diff] [blame] | 141 | LOCAL_ADDRESS_SANITIZER := false |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 142 | include $(BUILD_STATIC_LIBRARY) |
| 143 | |
Evgenii Stepanov | 3f89dee | 2015-04-27 08:54:26 -0700 | [diff] [blame] | 144 | define build-asan-rt-shared-library |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 145 | |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 146 | include $(CLEAR_VARS) |
Evgenii Stepanov | 3f89dee | 2015-04-27 08:54:26 -0700 | [diff] [blame] | 147 | LOCAL_MODULE := $(1) |
| 148 | LOCAL_MULTILIB := $(2) |
Evgenii Stepanov | 81f7b12 | 2015-05-05 10:27:14 -0700 | [diff] [blame^] | 149 | # We need to unwind by frame pointers through a small portion of ASan runtime library code, |
| 150 | # and that only works with ARM, not with Thumb. |
| 151 | LOCAL_ARM_MODE := arm |
Shih-wei Liao | ed00338 | 2012-04-25 06:48:42 -0700 | [diff] [blame] | 152 | LOCAL_C_INCLUDES := \ |
Stephen Hines | 1f922a5 | 2012-09-10 20:14:46 -0700 | [diff] [blame] | 153 | external/compiler-rt/lib \ |
| 154 | external/compiler-rt/include |
Evgeniy Stepanov | e48a197 | 2012-03-29 18:09:56 +0400 | [diff] [blame] | 155 | LOCAL_CFLAGS += $(asan_rtl_cflags) |
Evgeniy Stepanov | d66dda0 | 2014-11-06 18:29:53 +0300 | [diff] [blame] | 156 | LOCAL_SRC_FILES := $(asan_rtl_files) $(asan_rtl_cxx_files) |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 157 | LOCAL_CPP_EXTENSION := .cc |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 158 | LOCAL_SHARED_LIBRARIES := liblog libc libdl |
Dan Albert | a442448 | 2014-10-17 10:32:45 -0700 | [diff] [blame] | 159 | LOCAL_STATIC_LIBRARIES := libcompiler_rt |
Evgenii Stepanov | bc45c9e | 2015-04-27 17:12:13 -0700 | [diff] [blame] | 160 | # MacOS toolchain is out-of-date and does not support -z global. |
| 161 | # TODO: re-enable once the toolchain issue is fixed. |
| 162 | ifneq ($(HOST_OS),darwin) |
| 163 | LOCAL_LDFLAGS += -Wl,-z,global |
| 164 | endif |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 165 | LOCAL_CLANG := true |
Dan Albert | d92fd09 | 2014-10-16 23:10:08 -0700 | [diff] [blame] | 166 | LOCAL_ADDRESS_SANITIZER := false |
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 | include $(BUILD_SHARED_LIBRARY) |
| 169 | |
Evgenii Stepanov | 3f89dee | 2015-04-27 08:54:26 -0700 | [diff] [blame] | 170 | endef |
| 171 | |
| 172 | ifdef 2ND_ADDRESS_SANITIZER_RUNTIME_LIBRARY |
| 173 | $(eval $(call build-asan-rt-shared-library,$(ADDRESS_SANITIZER_RUNTIME_LIBRARY),64)) |
| 174 | $(eval $(call build-asan-rt-shared-library,$(2ND_ADDRESS_SANITIZER_RUNTIME_LIBRARY),32)) |
| 175 | else |
| 176 | $(eval $(call build-asan-rt-shared-library,$(ADDRESS_SANITIZER_RUNTIME_LIBRARY),32)) |
| 177 | endif |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 178 | |
| 179 | include $(CLEAR_VARS) |
| 180 | |
| 181 | LOCAL_MODULE := asanwrapper |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 182 | LOCAL_SRC_FILES := asanwrapper.cc |
| 183 | LOCAL_CPP_EXTENSION := .cc |
Dan Albert | f56c2bd | 2014-07-29 10:46:24 -0700 | [diff] [blame] | 184 | LOCAL_CPPFLAGS := -std=c++11 |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 185 | LOCAL_SHARED_LIBRARIES += libc |
Dan Albert | d92fd09 | 2014-10-16 23:10:08 -0700 | [diff] [blame] | 186 | LOCAL_ADDRESS_SANITIZER := false |
Stephen Hines | 97ac43c | 2013-01-18 17:46:14 -0800 | [diff] [blame] | 187 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Dan Albert | 93f64d9 | 2014-10-18 17:25:26 -0700 | [diff] [blame] | 188 | LOCAL_CXX_STL := libc++ |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 189 | |
| 190 | include $(BUILD_EXECUTABLE) |
| 191 | |
| 192 | |
| 193 | include $(CLEAR_VARS) |
| 194 | |
Evgeniy Stepanov | e48a197 | 2012-03-29 18:09:56 +0400 | [diff] [blame] | 195 | LOCAL_MODULE := libasan_noinst_test |
| 196 | LOCAL_MODULE_TAGS := tests |
| 197 | LOCAL_C_INCLUDES := \ |
Dan Albert | 93f64d9 | 2014-10-18 17:25:26 -0700 | [diff] [blame] | 198 | external/gtest/include \ |
| 199 | external/compiler-rt/include \ |
| 200 | external/compiler-rt/lib \ |
| 201 | external/compiler-rt/lib/asan/tests \ |
| 202 | external/compiler-rt/lib/sanitizer_common/tests |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 203 | LOCAL_CFLAGS += \ |
Stephen Hines | 86277eb | 2015-03-23 12:06:32 -0700 | [diff] [blame] | 204 | -Wno-non-virtual-dtor \ |
Dan Albert | 93f64d9 | 2014-10-18 17:25:26 -0700 | [diff] [blame] | 205 | -Wno-unused-parameter \ |
| 206 | -Wno-sign-compare \ |
| 207 | -DASAN_UAR=0 \ |
| 208 | -DASAN_HAS_BLACKLIST=1 \ |
| 209 | -DASAN_HAS_EXCEPTIONS=$(ASAN_HAS_EXCEPTIONS) \ |
Stephen Hines | 6d18623 | 2014-11-26 17:56:19 -0800 | [diff] [blame] | 210 | -DASAN_NEEDS_SEGV=$(ASAN_NEEDS_SEGV) \ |
| 211 | -std=c++11 |
Stephen Hines | 7c98f2d | 2013-01-10 01:49:27 -0800 | [diff] [blame] | 212 | LOCAL_SRC_FILES := tests/asan_noinst_test.cc tests/asan_test_main.cc |
Evgeniy Stepanov | e48a197 | 2012-03-29 18:09:56 +0400 | [diff] [blame] | 213 | LOCAL_CPP_EXTENSION := .cc |
| 214 | LOCAL_CLANG := true |
Dan Albert | d92fd09 | 2014-10-16 23:10:08 -0700 | [diff] [blame] | 215 | LOCAL_ADDRESS_SANITIZER := false |
Stephen Hines | 97ac43c | 2013-01-18 17:46:14 -0800 | [diff] [blame] | 216 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Dan Albert | 93f64d9 | 2014-10-18 17:25:26 -0700 | [diff] [blame] | 217 | LOCAL_CXX_STL := libc++ |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 218 | |
Evgeniy Stepanov | e48a197 | 2012-03-29 18:09:56 +0400 | [diff] [blame] | 219 | include $(BUILD_STATIC_LIBRARY) |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 220 | |
Evgeniy Stepanov | e48a197 | 2012-03-29 18:09:56 +0400 | [diff] [blame] | 221 | |
| 222 | include $(CLEAR_VARS) |
| 223 | |
| 224 | LOCAL_MODULE := asan_test |
| 225 | LOCAL_MODULE_TAGS := tests |
| 226 | LOCAL_C_INCLUDES := \ |
Dan Albert | 93f64d9 | 2014-10-18 17:25:26 -0700 | [diff] [blame] | 227 | external/gtest/include \ |
| 228 | external/compiler-rt/lib \ |
| 229 | external/compiler-rt/lib/asan/tests \ |
| 230 | external/compiler-rt/lib/sanitizer_common/tests |
Evgeniy Stepanov | e48a197 | 2012-03-29 18:09:56 +0400 | [diff] [blame] | 231 | LOCAL_CFLAGS += $(asan_test_cflags) |
| 232 | LOCAL_SRC_FILES := $(asan_test_files) |
| 233 | LOCAL_CPP_EXTENSION := .cc |
Dan Albert | 303c8fb | 2014-11-15 15:10:23 -0800 | [diff] [blame] | 234 | LOCAL_STATIC_LIBRARIES := libgtest libasan_noinst_test |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 235 | LOCAL_SHARED_LIBRARIES := libc |
Evgeniy Stepanov | e48a197 | 2012-03-29 18:09:56 +0400 | [diff] [blame] | 236 | LOCAL_ADDRESS_SANITIZER := true |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 237 | LOCAL_CLANG := true |
Stephen Hines | 97ac43c | 2013-01-18 17:46:14 -0800 | [diff] [blame] | 238 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Dan Albert | 93f64d9 | 2014-10-18 17:25:26 -0700 | [diff] [blame] | 239 | LOCAL_CXX_STL := libc++ |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 240 | |
| 241 | include $(BUILD_EXECUTABLE) |
| 242 | |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 243 | endif # ifeq($(TARGET_ARCH),arm) |
Dan Albert | 93f64d9 | 2014-10-18 17:25:26 -0700 | [diff] [blame] | 244 | |
| 245 | ################################################################################ |
| 246 | # Host modules |
| 247 | |
Dan Albert | 329755b | 2014-10-20 17:43:44 -0700 | [diff] [blame] | 248 | ifneq ($(HOST_OS),darwin) |
Dan Albert | 93f64d9 | 2014-10-18 17:25:26 -0700 | [diff] [blame] | 249 | include $(CLEAR_VARS) |
| 250 | LOCAL_MODULE := libasan |
Dan Albert | 93f64d9 | 2014-10-18 17:25:26 -0700 | [diff] [blame] | 251 | LOCAL_C_INCLUDES := external/compiler-rt/lib external/compiler-rt/include |
| 252 | LOCAL_CFLAGS += $(asan_rtl_cflags) |
Evgeniy Stepanov | d66dda0 | 2014-11-06 18:29:53 +0300 | [diff] [blame] | 253 | LOCAL_SRC_FILES := $(asan_rtl_files) |
Dan Albert | 93f64d9 | 2014-10-18 17:25:26 -0700 | [diff] [blame] | 254 | LOCAL_CPP_EXTENSION := .cc |
| 255 | LOCAL_CLANG := true |
Dan Albert | f50197a | 2014-10-20 15:15:58 -0700 | [diff] [blame] | 256 | LOCAL_MULTILIB := both |
Dan Albert | 93f64d9 | 2014-10-18 17:25:26 -0700 | [diff] [blame] | 257 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Dan Albert | a7f893a | 2014-10-31 16:18:55 -0700 | [diff] [blame] | 258 | LOCAL_ADDRESS_SANITIZER := false |
Dan Albert | 93f64d9 | 2014-10-18 17:25:26 -0700 | [diff] [blame] | 259 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 260 | |
| 261 | include $(CLEAR_VARS) |
Evgeniy Stepanov | d66dda0 | 2014-11-06 18:29:53 +0300 | [diff] [blame] | 262 | LOCAL_MODULE := libasan_cxx |
Evgeniy Stepanov | d66dda0 | 2014-11-06 18:29:53 +0300 | [diff] [blame] | 263 | LOCAL_C_INCLUDES := external/compiler-rt/lib external/compiler-rt/include |
| 264 | LOCAL_CFLAGS += $(asan_rtl_cflags) |
| 265 | LOCAL_SRC_FILES := $(asan_rtl_cxx_files) |
Dan Albert | 93f64d9 | 2014-10-18 17:25:26 -0700 | [diff] [blame] | 266 | LOCAL_CPP_EXTENSION := .cc |
Evgeniy Stepanov | d66dda0 | 2014-11-06 18:29:53 +0300 | [diff] [blame] | 267 | LOCAL_CLANG := true |
Dan Albert | f50197a | 2014-10-20 15:15:58 -0700 | [diff] [blame] | 268 | LOCAL_MULTILIB := both |
Dan Albert | 93f64d9 | 2014-10-18 17:25:26 -0700 | [diff] [blame] | 269 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Dan Albert | a7f893a | 2014-10-31 16:18:55 -0700 | [diff] [blame] | 270 | LOCAL_ADDRESS_SANITIZER := false |
Evgeniy Stepanov | d66dda0 | 2014-11-06 18:29:53 +0300 | [diff] [blame] | 271 | include $(BUILD_HOST_STATIC_LIBRARY) |
Dan Albert | 93f64d9 | 2014-10-18 17:25:26 -0700 | [diff] [blame] | 272 | |
| 273 | include $(CLEAR_VARS) |
| 274 | LOCAL_MODULE := libasan_noinst_test |
| 275 | LOCAL_MODULE_TAGS := tests |
| 276 | LOCAL_C_INCLUDES := \ |
| 277 | external/gtest/include \ |
| 278 | external/compiler-rt/include \ |
| 279 | external/compiler-rt/lib \ |
| 280 | external/compiler-rt/lib/asan/tests \ |
| 281 | external/compiler-rt/lib/sanitizer_common/tests |
| 282 | LOCAL_CFLAGS += \ |
| 283 | -Wno-unused-parameter \ |
| 284 | -Wno-sign-compare \ |
| 285 | -DASAN_UAR=0 \ |
| 286 | -DASAN_HAS_BLACKLIST=1 \ |
| 287 | -DASAN_HAS_EXCEPTIONS=$(ASAN_HAS_EXCEPTIONS) \ |
Stephen Hines | 6d18623 | 2014-11-26 17:56:19 -0800 | [diff] [blame] | 288 | -DASAN_NEEDS_SEGV=$(ASAN_NEEDS_SEGV) \ |
| 289 | -std=c++11 |
Dan Albert | 93f64d9 | 2014-10-18 17:25:26 -0700 | [diff] [blame] | 290 | LOCAL_SRC_FILES := tests/asan_noinst_test.cc tests/asan_test_main.cc |
| 291 | LOCAL_CPP_EXTENSION := .cc |
| 292 | LOCAL_CLANG := true |
| 293 | LOCAL_CXX_STL := libc++ |
Dan Albert | f50197a | 2014-10-20 15:15:58 -0700 | [diff] [blame] | 294 | LOCAL_MULTILIB := both |
Dan Albert | 93f64d9 | 2014-10-18 17:25:26 -0700 | [diff] [blame] | 295 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Dan Albert | a7f893a | 2014-10-31 16:18:55 -0700 | [diff] [blame] | 296 | LOCAL_ADDRESS_SANITIZER := false |
Dan Albert | 93f64d9 | 2014-10-18 17:25:26 -0700 | [diff] [blame] | 297 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 298 | |
| 299 | include $(CLEAR_VARS) |
| 300 | LOCAL_MODULE := asan_test |
| 301 | LOCAL_MODULE_TAGS := tests |
| 302 | LOCAL_C_INCLUDES := \ |
Dan Albert | 93f64d9 | 2014-10-18 17:25:26 -0700 | [diff] [blame] | 303 | external/compiler-rt/lib \ |
| 304 | external/compiler-rt/lib/asan/tests \ |
| 305 | external/compiler-rt/lib/sanitizer_common/tests |
| 306 | LOCAL_CFLAGS += $(asan_test_cflags) |
| 307 | LOCAL_SRC_FILES := $(asan_test_files) |
| 308 | LOCAL_CPP_EXTENSION := .cc |
Dan Albert | 7e862da | 2014-11-09 00:50:03 -0800 | [diff] [blame] | 309 | LOCAL_STATIC_LIBRARIES := libasan_noinst_test |
Dan Albert | 93f64d9 | 2014-10-18 17:25:26 -0700 | [diff] [blame] | 310 | LOCAL_ADDRESS_SANITIZER := true |
| 311 | LOCAL_CLANG := true |
| 312 | LOCAL_CXX_STL := libc++ |
Dan Albert | f50197a | 2014-10-20 15:15:58 -0700 | [diff] [blame] | 313 | LOCAL_MULTILIB := both |
Ying Wang | eee80f9 | 2014-11-06 15:41:07 -0800 | [diff] [blame] | 314 | LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32 |
| 315 | LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64 |
Dan Albert | 93f64d9 | 2014-10-18 17:25:26 -0700 | [diff] [blame] | 316 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Dan Albert | 7e862da | 2014-11-09 00:50:03 -0800 | [diff] [blame] | 317 | include $(BUILD_HOST_NATIVE_TEST) |
Dan Albert | 329755b | 2014-10-20 17:43:44 -0700 | [diff] [blame] | 318 | endif |