Yabin Cui | be1b933 | 2015-07-29 17:13:51 -0700 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2015 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 ($(HOST_OS),linux) |
| 21 | ifeq ($(HOST_ARCH),x86_64) |
| 22 | |
| 23 | tsan_rtl_files := \ |
| 24 | rtl/tsan_clock.cc \ |
| 25 | rtl/tsan_flags.cc \ |
| 26 | rtl/tsan_fd.cc \ |
| 27 | rtl/tsan_ignoreset.cc \ |
| 28 | rtl/tsan_interceptors.cc \ |
| 29 | rtl/tsan_interface_ann.cc \ |
| 30 | rtl/tsan_interface_atomic.cc \ |
| 31 | rtl/tsan_interface.cc \ |
| 32 | rtl/tsan_interface_java.cc \ |
| 33 | rtl/tsan_md5.cc \ |
| 34 | rtl/tsan_mman.cc \ |
| 35 | rtl/tsan_mutex.cc \ |
| 36 | rtl/tsan_mutexset.cc \ |
| 37 | rtl/tsan_report.cc \ |
| 38 | rtl/tsan_rtl.cc \ |
| 39 | rtl/tsan_rtl_mutex.cc \ |
| 40 | rtl/tsan_rtl_report.cc \ |
| 41 | rtl/tsan_rtl_thread.cc \ |
| 42 | rtl/tsan_stack_trace.cc \ |
| 43 | rtl/tsan_stat.cc \ |
| 44 | rtl/tsan_suppressions.cc \ |
| 45 | rtl/tsan_symbolize.cc \ |
| 46 | rtl/tsan_sync.cc \ |
| 47 | rtl/tsan_platform_linux.cc \ |
| 48 | rtl/tsan_rtl_amd64.S \ |
Yabin Cui | be1b933 | 2015-07-29 17:13:51 -0700 | [diff] [blame] | 49 | |
| 50 | tsan_rtl_cppflags := -std=c++11 -Wall -Werror -Wno-unused-parameter -Wno-non-virtual-dtor \ |
| 51 | -fno-rtti -fno-builtin |
| 52 | |
| 53 | tsan_rtl_c_includes := \ |
| 54 | $(LOCAL_PATH)/.. \ |
| 55 | |
| 56 | include $(CLEAR_VARS) |
| 57 | LOCAL_MODULE := libtsan |
| 58 | LOCAL_CPP_EXTENSION := .cc |
| 59 | LOCAL_C_INCLUDES := $(tsan_rtl_c_includes) |
| 60 | LOCAL_CPPFLAGS := $(tsan_rtl_cppflags) |
| 61 | LOCAL_SRC_FILES := $(tsan_rtl_files) |
| 62 | LOCAL_CXX_STL := none |
Yabin Cui | 6c5b3a5 | 2015-07-29 18:15:28 -0700 | [diff] [blame] | 63 | LOCAL_SANITIZE := never |
Yabin Cui | be1b933 | 2015-07-29 17:13:51 -0700 | [diff] [blame] | 64 | LOCAL_MULTILIB := 64 |
Yabin Cui | 7e8a045 | 2015-08-24 15:26:43 -0700 | [diff] [blame] | 65 | LOCAL_WHOLE_STATIC_LIBRARIES := libinterception libsan libubsan |
Yabin Cui | be1b933 | 2015-07-29 17:13:51 -0700 | [diff] [blame] | 66 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 67 | |
Yabin Cui | 7e8a045 | 2015-08-24 15:26:43 -0700 | [diff] [blame] | 68 | include $(CLEAR_VARS) |
| 69 | LOCAL_MODULE := libtsan_cxx |
| 70 | LOCAL_CPP_EXTENSION := .cc |
| 71 | LOCAL_C_INCLUDES = $(tsan_rtl_c_includes) |
| 72 | LOCAL_CPPFLAGS := $(tsan_rtl_cppflags) |
| 73 | LOCAL_SRC_FILES := rtl/tsan_new_delete.cc |
| 74 | LOCAL_CXX_STL := none |
| 75 | LOCAL_SANITIZE := never |
| 76 | LOCAL_MULTILIB := 64 |
| 77 | LOCAL_WHOLE_STATIC_LIBRARIES := libubsan_cxx |
| 78 | include $(BUILD_HOST_STATIC_LIBRARY) |
Yabin Cui | be1b933 | 2015-07-29 17:13:51 -0700 | [diff] [blame] | 79 | |
| 80 | tsan_unit_test_src_files := \ |
| 81 | tests/unit/tsan_clock_test.cc \ |
| 82 | tests/unit/tsan_dense_alloc_test.cc \ |
| 83 | tests/unit/tsan_flags_test.cc \ |
| 84 | tests/unit/tsan_mman_test.cc \ |
| 85 | tests/unit/tsan_mutex_test.cc \ |
| 86 | tests/unit/tsan_mutexset_test.cc \ |
| 87 | tests/unit/tsan_shadow_test.cc \ |
| 88 | tests/unit/tsan_stack_test.cc \ |
| 89 | tests/unit/tsan_sync_test.cc \ |
| 90 | tests/unit/tsan_unit_test_main.cc \ |
| 91 | tests/unit/tsan_vector_test.cc \ |
| 92 | |
| 93 | tsan_unit_test_c_includes := \ |
| 94 | $(LOCAL_PATH)/rtl \ |
| 95 | $(LOCAL_PATH)/.. \ |
| 96 | |
Stephen Hines | f5011e3 | 2015-08-13 23:02:40 -0700 | [diff] [blame] | 97 | ifneq (true,$(SKIP_LLVM_TESTS)) |
Dan Albert | 6de3e08 | 2015-08-14 23:35:15 -0700 | [diff] [blame] | 98 | ifndef SANITIZE_HOST |
Stephen Hines | f5011e3 | 2015-08-13 23:02:40 -0700 | [diff] [blame] | 99 | |
Yabin Cui | be1b933 | 2015-07-29 17:13:51 -0700 | [diff] [blame] | 100 | include $(CLEAR_VARS) |
| 101 | LOCAL_MODULE := libtsan_unit_test |
| 102 | LOCAL_CPP_EXTENSION := .cc |
| 103 | LOCAL_C_INCLUDES := $(tsan_unit_test_c_includes) |
| 104 | LOCAL_CPPFLAGS := $(tsan_rtl_cppflags) |
| 105 | LOCAL_SRC_FILES := $(tsan_unit_test_src_files) |
Yabin Cui | 6c5b3a5 | 2015-07-29 18:15:28 -0700 | [diff] [blame] | 106 | LOCAL_SANITIZE := never |
Yabin Cui | be1b933 | 2015-07-29 17:13:51 -0700 | [diff] [blame] | 107 | LOCAL_MULTILIB := 64 |
Stephen Hines | f5011e3 | 2015-08-13 23:02:40 -0700 | [diff] [blame] | 108 | LOCAL_STATIC_LIBRARIES := libtsan libubsan |
| 109 | LOCAL_LDLIBS := -lrt -ldl |
Yabin Cui | be1b933 | 2015-07-29 17:13:51 -0700 | [diff] [blame] | 110 | include $(BUILD_HOST_NATIVE_TEST) |
| 111 | |
| 112 | |
| 113 | tsan_rtl_test_src_files := \ |
| 114 | tests/rtl/tsan_bench.cc \ |
| 115 | tests/rtl/tsan_mop.cc \ |
| 116 | tests/rtl/tsan_mutex.cc \ |
| 117 | tests/rtl/tsan_posix.cc \ |
| 118 | tests/rtl/tsan_string.cc \ |
| 119 | tests/rtl/tsan_test_util_linux.cc \ |
| 120 | tests/rtl/tsan_test.cc \ |
| 121 | tests/rtl/tsan_thread.cc \ |
| 122 | |
| 123 | tsan_rtl_test_c_includes := \ |
| 124 | $(LOCAL_PATH)/rtl \ |
| 125 | $(LOCAL_PATH)/.. \ |
| 126 | |
| 127 | include $(CLEAR_VARS) |
| 128 | LOCAL_MODULE := libtsan_rtl_test |
| 129 | LOCAL_CPP_EXTENSION := .cc |
| 130 | LOCAL_C_INCLUDES := $(tsan_rtl_test_c_includes) |
| 131 | LOCAL_CPPFLAGS := $(tsan_rtl_cppflags) |
| 132 | LOCAL_SRC_FILES := $(tsan_rtl_test_src_files) |
Yabin Cui | 6c5b3a5 | 2015-07-29 18:15:28 -0700 | [diff] [blame] | 133 | LOCAL_SANITIZE := never |
Yabin Cui | be1b933 | 2015-07-29 17:13:51 -0700 | [diff] [blame] | 134 | LOCAL_MULTILIB := 64 |
Stephen Hines | f5011e3 | 2015-08-13 23:02:40 -0700 | [diff] [blame] | 135 | LOCAL_STATIC_LIBRARIES := libtsan libubsan |
| 136 | LOCAL_LDLIBS := -lrt -ldl |
Yabin Cui | be1b933 | 2015-07-29 17:13:51 -0700 | [diff] [blame] | 137 | include $(BUILD_HOST_NATIVE_TEST) |
| 138 | |
Dan Albert | 6de3e08 | 2015-08-14 23:35:15 -0700 | [diff] [blame] | 139 | endif # SANITIZE_HOST |
Stephen Hines | f5011e3 | 2015-08-13 23:02:40 -0700 | [diff] [blame] | 140 | endif # SKIP_LLVM_TESTS |
| 141 | |
Yabin Cui | be1b933 | 2015-07-29 17:13:51 -0700 | [diff] [blame] | 142 | endif # ifeq ($(HOST_ARCH),x86_64) |
Stephen Hines | f5011e3 | 2015-08-13 23:02:40 -0700 | [diff] [blame] | 143 | endif # ifeq ($(HOST_OS),linux) |