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 \ |
Evgenii Stepanov | 1b1b1ae | 2015-05-18 14:53:06 -0700 | [diff] [blame] | 105 | -fno-builtin |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 106 | |
| 107 | asan_test_files := \ |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 108 | tests/asan_globals_test.cc \ |
Stephen Hines | 7c98f2d | 2013-01-10 01:49:27 -0800 | [diff] [blame] | 109 | tests/asan_test.cc |
| 110 | |
| 111 | #tests/asan_noinst_test.cc \ |
| 112 | #tests/asan_test_main.cc \ |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 113 | |
| 114 | asan_test_cflags := \ |
Stephen Hines | 6a211c5 | 2014-07-21 00:49:56 -0700 | [diff] [blame] | 115 | -fsanitize-blacklist=external/compiler-rt/lib/asan/tests/asan_test.ignore \ |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 116 | -DASAN_LOW_MEMORY=1 \ |
| 117 | -DASAN_UAR=0 \ |
| 118 | -DASAN_NEEDS_SEGV=$(ASAN_NEEDS_SEGV) \ |
| 119 | -DASAN_HAS_EXCEPTIONS=$(ASAN_HAS_EXCEPTIONS) \ |
| 120 | -DASAN_HAS_BLACKLIST=1 \ |
Evgeniy Stepanov | e48a197 | 2012-03-29 18:09:56 +0400 | [diff] [blame] | 121 | -Wno-covered-switch-default \ |
Stephen Hines | 3a02de3 | 2013-05-03 18:10:06 -0700 | [diff] [blame] | 122 | -Wno-non-virtual-dtor \ |
Evgeniy Stepanov | e48a197 | 2012-03-29 18:09:56 +0400 | [diff] [blame] | 123 | -Wno-sign-compare \ |
| 124 | -Wno-unused-parameter \ |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 125 | -std=c++11 |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 126 | |
| 127 | |
| 128 | include $(CLEAR_VARS) |
| 129 | |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 130 | LOCAL_MODULE := libasan |
Dan Albert | ca8da89 | 2015-01-08 15:56:27 -0800 | [diff] [blame] | 131 | LOCAL_C_INCLUDES := \ |
| 132 | external/compiler-rt/lib \ |
| 133 | external/compiler-rt/include |
Evgeniy Stepanov | e48a197 | 2012-03-29 18:09:56 +0400 | [diff] [blame] | 134 | LOCAL_CFLAGS += $(asan_rtl_cflags) |
Stephen Hines | ff571e2 | 2013-03-05 23:44:58 -0800 | [diff] [blame] | 135 | LOCAL_SRC_FILES := asan_preinit.cc |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 136 | LOCAL_CPP_EXTENSION := .cc |
| 137 | LOCAL_CLANG := true |
Dan Albert | 237aaa6 | 2015-06-16 14:21:19 -0700 | [diff] [blame] | 138 | LOCAL_SANITIZE := never |
Stephen Hines | 2d6b714 | 2015-10-15 14:18:57 -0700 | [diff] [blame] | 139 | LOCAL_MODULE_TARGET_ARCH := arm arm64 |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 140 | include $(BUILD_STATIC_LIBRARY) |
| 141 | |
Evgenii Stepanov | 3f89dee | 2015-04-27 08:54:26 -0700 | [diff] [blame] | 142 | define build-asan-rt-shared-library |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 143 | |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 144 | include $(CLEAR_VARS) |
Evgenii Stepanov | 3f89dee | 2015-04-27 08:54:26 -0700 | [diff] [blame] | 145 | LOCAL_MODULE := $(1) |
| 146 | LOCAL_MULTILIB := $(2) |
Evgenii Stepanov | 78c814d | 2015-07-16 17:02:00 -0700 | [diff] [blame] | 147 | # This library must go on /system partition, even in SANITIZE_TARGET mode (when all libraries are |
| 148 | # installed on /data). That's because /data may not be available until vold does some magic and |
| 149 | # vold itself depends on this library. |
| 150 | LOCAL_MODULE_PATH_32 := $(TARGET_OUT)/lib |
| 151 | LOCAL_MODULE_PATH_64 := $(TARGET_OUT)/lib64 |
Evgenii Stepanov | 81f7b12 | 2015-05-05 10:27:14 -0700 | [diff] [blame] | 152 | # We need to unwind by frame pointers through a small portion of ASan runtime library code, |
| 153 | # and that only works with ARM, not with Thumb. |
| 154 | LOCAL_ARM_MODE := arm |
Shih-wei Liao | ed00338 | 2012-04-25 06:48:42 -0700 | [diff] [blame] | 155 | LOCAL_C_INCLUDES := \ |
Stephen Hines | 1f922a5 | 2012-09-10 20:14:46 -0700 | [diff] [blame] | 156 | external/compiler-rt/lib \ |
| 157 | external/compiler-rt/include |
Evgeniy Stepanov | e48a197 | 2012-03-29 18:09:56 +0400 | [diff] [blame] | 158 | LOCAL_CFLAGS += $(asan_rtl_cflags) |
Evgeniy Stepanov | d66dda0 | 2014-11-06 18:29:53 +0300 | [diff] [blame] | 159 | LOCAL_SRC_FILES := $(asan_rtl_files) $(asan_rtl_cxx_files) |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 160 | LOCAL_CPP_EXTENSION := .cc |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 161 | LOCAL_SHARED_LIBRARIES := liblog libc libdl |
Pirama Arumuga Nainar | 259f706 | 2015-05-06 11:49:53 -0700 | [diff] [blame] | 162 | LOCAL_STATIC_LIBRARIES := libcompiler_rt libubsan |
Evgenii Stepanov | a1c3898 | 2015-06-16 13:54:26 -0700 | [diff] [blame] | 163 | LOCAL_STATIC_LIBRARIES_arm := libunwind_llvm |
| 164 | LOCAL_LDFLAGS_arm := -Wl,--exclude-libs,libunwind_llvm.a |
Evgenii Stepanov | bc45c9e | 2015-04-27 17:12:13 -0700 | [diff] [blame] | 165 | # MacOS toolchain is out-of-date and does not support -z global. |
| 166 | # TODO: re-enable once the toolchain issue is fixed. |
| 167 | ifneq ($(HOST_OS),darwin) |
| 168 | LOCAL_LDFLAGS += -Wl,-z,global |
| 169 | endif |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 170 | LOCAL_CLANG := true |
Dan Albert | 237aaa6 | 2015-06-16 14:21:19 -0700 | [diff] [blame] | 171 | LOCAL_SANITIZE := never |
Stephen Hines | 2d6b714 | 2015-10-15 14:18:57 -0700 | [diff] [blame] | 172 | LOCAL_MODULE_TARGET_ARCH := arm arm64 |
Evgenii Stepanov | 657a67e | 2015-06-11 15:19:43 -0700 | [diff] [blame] | 173 | LOCAL_CXX_STL := none |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 174 | include $(BUILD_SHARED_LIBRARY) |
| 175 | |
Evgenii Stepanov | 3f89dee | 2015-04-27 08:54:26 -0700 | [diff] [blame] | 176 | endef |
| 177 | |
Stephen Hines | fef7bc7 | 2015-10-19 19:18:53 -0700 | [diff] [blame] | 178 | ifeq (true,$(FORCE_BUILD_SANITIZER_SHARED_OBJECTS)) |
Evgenii Stepanov | 3f89dee | 2015-04-27 08:54:26 -0700 | [diff] [blame] | 179 | ifdef 2ND_ADDRESS_SANITIZER_RUNTIME_LIBRARY |
| 180 | $(eval $(call build-asan-rt-shared-library,$(ADDRESS_SANITIZER_RUNTIME_LIBRARY),64)) |
| 181 | $(eval $(call build-asan-rt-shared-library,$(2ND_ADDRESS_SANITIZER_RUNTIME_LIBRARY),32)) |
| 182 | else |
| 183 | $(eval $(call build-asan-rt-shared-library,$(ADDRESS_SANITIZER_RUNTIME_LIBRARY),32)) |
| 184 | endif |
Stephen Hines | fef7bc7 | 2015-10-19 19:18:53 -0700 | [diff] [blame] | 185 | endif |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 186 | |
| 187 | include $(CLEAR_VARS) |
| 188 | |
| 189 | LOCAL_MODULE := asanwrapper |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 190 | LOCAL_SRC_FILES := asanwrapper.cc |
| 191 | LOCAL_CPP_EXTENSION := .cc |
Dan Albert | f56c2bd | 2014-07-29 10:46:24 -0700 | [diff] [blame] | 192 | LOCAL_CPPFLAGS := -std=c++11 |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 193 | LOCAL_SHARED_LIBRARIES += libc |
Dan Albert | 237aaa6 | 2015-06-16 14:21:19 -0700 | [diff] [blame] | 194 | LOCAL_SANITIZE := never |
Stephen Hines | 2d6b714 | 2015-10-15 14:18:57 -0700 | [diff] [blame] | 195 | LOCAL_MODULE_TARGET_ARCH := arm arm64 |
Dan Albert | 93f64d9 | 2014-10-18 17:25:26 -0700 | [diff] [blame] | 196 | LOCAL_CXX_STL := libc++ |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 197 | |
| 198 | include $(BUILD_EXECUTABLE) |
| 199 | |
Stephen Hines | f5011e3 | 2015-08-13 23:02:40 -0700 | [diff] [blame] | 200 | ifneq (true,$(SKIP_LLVM_TESTS)) |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 201 | |
| 202 | include $(CLEAR_VARS) |
| 203 | |
Evgeniy Stepanov | e48a197 | 2012-03-29 18:09:56 +0400 | [diff] [blame] | 204 | LOCAL_MODULE := libasan_noinst_test |
| 205 | LOCAL_MODULE_TAGS := tests |
| 206 | LOCAL_C_INCLUDES := \ |
Dan Albert | 93f64d9 | 2014-10-18 17:25:26 -0700 | [diff] [blame] | 207 | external/compiler-rt/include \ |
| 208 | external/compiler-rt/lib \ |
| 209 | external/compiler-rt/lib/asan/tests \ |
| 210 | external/compiler-rt/lib/sanitizer_common/tests |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 211 | LOCAL_CFLAGS += \ |
Stephen Hines | 86277eb | 2015-03-23 12:06:32 -0700 | [diff] [blame] | 212 | -Wno-non-virtual-dtor \ |
Dan Albert | 93f64d9 | 2014-10-18 17:25:26 -0700 | [diff] [blame] | 213 | -Wno-unused-parameter \ |
| 214 | -Wno-sign-compare \ |
| 215 | -DASAN_UAR=0 \ |
| 216 | -DASAN_HAS_BLACKLIST=1 \ |
| 217 | -DASAN_HAS_EXCEPTIONS=$(ASAN_HAS_EXCEPTIONS) \ |
Stephen Hines | 6d18623 | 2014-11-26 17:56:19 -0800 | [diff] [blame] | 218 | -DASAN_NEEDS_SEGV=$(ASAN_NEEDS_SEGV) \ |
| 219 | -std=c++11 |
Stephen Hines | 7c98f2d | 2013-01-10 01:49:27 -0800 | [diff] [blame] | 220 | 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] | 221 | LOCAL_CPP_EXTENSION := .cc |
| 222 | LOCAL_CLANG := true |
Dan Albert | 237aaa6 | 2015-06-16 14:21:19 -0700 | [diff] [blame] | 223 | LOCAL_SANITIZE := never |
Stephen Hines | 2d6b714 | 2015-10-15 14:18:57 -0700 | [diff] [blame] | 224 | LOCAL_MODULE_TARGET_ARCH := arm arm64 |
Dan Albert | 93f64d9 | 2014-10-18 17:25:26 -0700 | [diff] [blame] | 225 | LOCAL_CXX_STL := libc++ |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 226 | |
Dan Albert | 73bd2f7 | 2016-03-04 13:32:24 -0800 | [diff] [blame] | 227 | include $(BUILD_STATIC_TEST_LIBRARY) |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 228 | |
Evgeniy Stepanov | e48a197 | 2012-03-29 18:09:56 +0400 | [diff] [blame] | 229 | |
| 230 | include $(CLEAR_VARS) |
| 231 | |
| 232 | LOCAL_MODULE := asan_test |
| 233 | LOCAL_MODULE_TAGS := tests |
| 234 | LOCAL_C_INCLUDES := \ |
Dan Albert | 93f64d9 | 2014-10-18 17:25:26 -0700 | [diff] [blame] | 235 | external/compiler-rt/lib \ |
| 236 | external/compiler-rt/lib/asan/tests \ |
| 237 | external/compiler-rt/lib/sanitizer_common/tests |
Evgeniy Stepanov | e48a197 | 2012-03-29 18:09:56 +0400 | [diff] [blame] | 238 | LOCAL_CFLAGS += $(asan_test_cflags) |
| 239 | LOCAL_SRC_FILES := $(asan_test_files) |
| 240 | LOCAL_CPP_EXTENSION := .cc |
Dan Albert | 73bd2f7 | 2016-03-04 13:32:24 -0800 | [diff] [blame] | 241 | LOCAL_STATIC_LIBRARIES := libasan_noinst_test |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 242 | LOCAL_SHARED_LIBRARIES := libc |
Dan Albert | 237aaa6 | 2015-06-16 14:21:19 -0700 | [diff] [blame] | 243 | LOCAL_SANITIZE := address |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 244 | LOCAL_CLANG := true |
Stephen Hines | 2d6b714 | 2015-10-15 14:18:57 -0700 | [diff] [blame] | 245 | LOCAL_MODULE_TARGET_ARCH := arm arm64 |
Dan Albert | 93f64d9 | 2014-10-18 17:25:26 -0700 | [diff] [blame] | 246 | LOCAL_CXX_STL := libc++ |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 247 | |
Dan Albert | 73bd2f7 | 2016-03-04 13:32:24 -0800 | [diff] [blame] | 248 | include $(BUILD_NATIVE_TEST) |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 249 | |
Stephen Hines | f5011e3 | 2015-08-13 23:02:40 -0700 | [diff] [blame] | 250 | endif # SKIP_LLVM_TESTS |
| 251 | |
Dan Albert | 93f64d9 | 2014-10-18 17:25:26 -0700 | [diff] [blame] | 252 | ################################################################################ |
| 253 | # Host modules |
| 254 | |
Dan Albert | 329755b | 2014-10-20 17:43:44 -0700 | [diff] [blame] | 255 | ifneq ($(HOST_OS),darwin) |
Dan Albert | 93f64d9 | 2014-10-18 17:25:26 -0700 | [diff] [blame] | 256 | include $(CLEAR_VARS) |
| 257 | LOCAL_MODULE := libasan |
Dan Albert | 93f64d9 | 2014-10-18 17:25:26 -0700 | [diff] [blame] | 258 | LOCAL_C_INCLUDES := external/compiler-rt/lib external/compiler-rt/include |
| 259 | LOCAL_CFLAGS += $(asan_rtl_cflags) |
Evgeniy Stepanov | d66dda0 | 2014-11-06 18:29:53 +0300 | [diff] [blame] | 260 | LOCAL_SRC_FILES := $(asan_rtl_files) |
Dan Albert | 93f64d9 | 2014-10-18 17:25:26 -0700 | [diff] [blame] | 261 | LOCAL_CPP_EXTENSION := .cc |
| 262 | LOCAL_CLANG := true |
Dan Albert | f50197a | 2014-10-20 15:15:58 -0700 | [diff] [blame] | 263 | LOCAL_MULTILIB := both |
Dan Albert | 237aaa6 | 2015-06-16 14:21:19 -0700 | [diff] [blame] | 264 | LOCAL_SANITIZE := never |
Pirama Arumuga Nainar | 259f706 | 2015-05-06 11:49:53 -0700 | [diff] [blame] | 265 | LOCAL_WHOLE_STATIC_LIBRARIES := libubsan |
Dan Albert | 93f64d9 | 2014-10-18 17:25:26 -0700 | [diff] [blame] | 266 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 267 | |
| 268 | include $(CLEAR_VARS) |
Evgeniy Stepanov | d66dda0 | 2014-11-06 18:29:53 +0300 | [diff] [blame] | 269 | LOCAL_MODULE := libasan_cxx |
Evgeniy Stepanov | d66dda0 | 2014-11-06 18:29:53 +0300 | [diff] [blame] | 270 | LOCAL_C_INCLUDES := external/compiler-rt/lib external/compiler-rt/include |
| 271 | LOCAL_CFLAGS += $(asan_rtl_cflags) |
| 272 | LOCAL_SRC_FILES := $(asan_rtl_cxx_files) |
Dan Albert | 93f64d9 | 2014-10-18 17:25:26 -0700 | [diff] [blame] | 273 | LOCAL_CPP_EXTENSION := .cc |
Evgeniy Stepanov | d66dda0 | 2014-11-06 18:29:53 +0300 | [diff] [blame] | 274 | LOCAL_CLANG := true |
Dan Albert | f50197a | 2014-10-20 15:15:58 -0700 | [diff] [blame] | 275 | LOCAL_MULTILIB := both |
Dan Albert | 237aaa6 | 2015-06-16 14:21:19 -0700 | [diff] [blame] | 276 | LOCAL_SANITIZE := never |
Evgeniy Stepanov | d66dda0 | 2014-11-06 18:29:53 +0300 | [diff] [blame] | 277 | include $(BUILD_HOST_STATIC_LIBRARY) |
Dan Albert | 93f64d9 | 2014-10-18 17:25:26 -0700 | [diff] [blame] | 278 | |
Stephen Hines | f5011e3 | 2015-08-13 23:02:40 -0700 | [diff] [blame] | 279 | ifneq (true,$(SKIP_LLVM_TESTS)) |
| 280 | |
Dan Albert | 93f64d9 | 2014-10-18 17:25:26 -0700 | [diff] [blame] | 281 | include $(CLEAR_VARS) |
| 282 | LOCAL_MODULE := libasan_noinst_test |
| 283 | LOCAL_MODULE_TAGS := tests |
| 284 | LOCAL_C_INCLUDES := \ |
Dan Albert | 93f64d9 | 2014-10-18 17:25:26 -0700 | [diff] [blame] | 285 | external/compiler-rt/include \ |
| 286 | external/compiler-rt/lib \ |
| 287 | external/compiler-rt/lib/asan/tests \ |
| 288 | external/compiler-rt/lib/sanitizer_common/tests |
| 289 | LOCAL_CFLAGS += \ |
| 290 | -Wno-unused-parameter \ |
| 291 | -Wno-sign-compare \ |
| 292 | -DASAN_UAR=0 \ |
| 293 | -DASAN_HAS_BLACKLIST=1 \ |
| 294 | -DASAN_HAS_EXCEPTIONS=$(ASAN_HAS_EXCEPTIONS) \ |
Stephen Hines | 6d18623 | 2014-11-26 17:56:19 -0800 | [diff] [blame] | 295 | -DASAN_NEEDS_SEGV=$(ASAN_NEEDS_SEGV) \ |
| 296 | -std=c++11 |
Dan Albert | 93f64d9 | 2014-10-18 17:25:26 -0700 | [diff] [blame] | 297 | LOCAL_SRC_FILES := tests/asan_noinst_test.cc tests/asan_test_main.cc |
| 298 | LOCAL_CPP_EXTENSION := .cc |
| 299 | LOCAL_CLANG := true |
| 300 | LOCAL_CXX_STL := libc++ |
Dan Albert | f50197a | 2014-10-20 15:15:58 -0700 | [diff] [blame] | 301 | LOCAL_MULTILIB := both |
Dan Albert | 237aaa6 | 2015-06-16 14:21:19 -0700 | [diff] [blame] | 302 | LOCAL_SANITIZE := never |
Dan Albert | 73bd2f7 | 2016-03-04 13:32:24 -0800 | [diff] [blame] | 303 | include $(BUILD_HOST_STATIC_TEST_LIBRARY) |
Dan Albert | 93f64d9 | 2014-10-18 17:25:26 -0700 | [diff] [blame] | 304 | |
| 305 | include $(CLEAR_VARS) |
| 306 | LOCAL_MODULE := asan_test |
| 307 | LOCAL_MODULE_TAGS := tests |
| 308 | LOCAL_C_INCLUDES := \ |
Dan Albert | 93f64d9 | 2014-10-18 17:25:26 -0700 | [diff] [blame] | 309 | external/compiler-rt/lib \ |
| 310 | external/compiler-rt/lib/asan/tests \ |
| 311 | external/compiler-rt/lib/sanitizer_common/tests |
| 312 | LOCAL_CFLAGS += $(asan_test_cflags) |
| 313 | LOCAL_SRC_FILES := $(asan_test_files) |
| 314 | LOCAL_CPP_EXTENSION := .cc |
Dan Albert | 7e862da | 2014-11-09 00:50:03 -0800 | [diff] [blame] | 315 | LOCAL_STATIC_LIBRARIES := libasan_noinst_test |
Dan Albert | 237aaa6 | 2015-06-16 14:21:19 -0700 | [diff] [blame] | 316 | LOCAL_SANITIZE := address |
Dan Albert | 93f64d9 | 2014-10-18 17:25:26 -0700 | [diff] [blame] | 317 | LOCAL_CLANG := true |
| 318 | LOCAL_CXX_STL := libc++ |
Dan Albert | f50197a | 2014-10-20 15:15:58 -0700 | [diff] [blame] | 319 | LOCAL_MULTILIB := both |
Pirama Arumuga Nainar | cdce50b | 2015-07-01 12:26:56 -0700 | [diff] [blame] | 320 | LOCAL_LDLIBS := -lrt |
Ying Wang | eee80f9 | 2014-11-06 15:41:07 -0800 | [diff] [blame] | 321 | LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32 |
| 322 | LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64 |
Dan Albert | 7e862da | 2014-11-09 00:50:03 -0800 | [diff] [blame] | 323 | include $(BUILD_HOST_NATIVE_TEST) |
Stephen Hines | f5011e3 | 2015-08-13 23:02:40 -0700 | [diff] [blame] | 324 | endif # SKIP_LLVM_TESTS |
Dan Albert | 329755b | 2014-10-20 17:43:44 -0700 | [diff] [blame] | 325 | endif |