blob: 0e483f08747f43e219257b57d7c8a16385a372e5 [file] [log] [blame]
Yabin Cuibe1b9332015-07-29 17:13:51 -07001#
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
18LOCAL_PATH:= $(call my-dir)
19
20ifeq ($(HOST_OS),linux)
21ifeq ($(HOST_ARCH),x86_64)
22
23tsan_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 \
Pirama Arumuga Nainar799172d2016-03-03 15:50:30 -080048 rtl/tsan_platform_posix.cc \
Yabin Cuibe1b9332015-07-29 17:13:51 -070049 rtl/tsan_rtl_amd64.S \
Yabin Cuibe1b9332015-07-29 17:13:51 -070050
51tsan_rtl_cppflags := -std=c++11 -Wall -Werror -Wno-unused-parameter -Wno-non-virtual-dtor \
52 -fno-rtti -fno-builtin
53
54tsan_rtl_c_includes := \
55 $(LOCAL_PATH)/.. \
56
57include $(CLEAR_VARS)
58LOCAL_MODULE := libtsan
59LOCAL_CPP_EXTENSION := .cc
60LOCAL_C_INCLUDES := $(tsan_rtl_c_includes)
61LOCAL_CPPFLAGS := $(tsan_rtl_cppflags)
62LOCAL_SRC_FILES := $(tsan_rtl_files)
63LOCAL_CXX_STL := none
Yabin Cui6c5b3a52015-07-29 18:15:28 -070064LOCAL_SANITIZE := never
Yabin Cuibe1b9332015-07-29 17:13:51 -070065LOCAL_MULTILIB := 64
Yabin Cui7e8a0452015-08-24 15:26:43 -070066LOCAL_WHOLE_STATIC_LIBRARIES := libinterception libsan libubsan
Yabin Cuibe1b9332015-07-29 17:13:51 -070067include $(BUILD_HOST_STATIC_LIBRARY)
68
Yabin Cui7e8a0452015-08-24 15:26:43 -070069include $(CLEAR_VARS)
70LOCAL_MODULE := libtsan_cxx
71LOCAL_CPP_EXTENSION := .cc
72LOCAL_C_INCLUDES = $(tsan_rtl_c_includes)
73LOCAL_CPPFLAGS := $(tsan_rtl_cppflags)
74LOCAL_SRC_FILES := rtl/tsan_new_delete.cc
75LOCAL_CXX_STL := none
76LOCAL_SANITIZE := never
77LOCAL_MULTILIB := 64
78LOCAL_WHOLE_STATIC_LIBRARIES := libubsan_cxx
79include $(BUILD_HOST_STATIC_LIBRARY)
Yabin Cuibe1b9332015-07-29 17:13:51 -070080
81tsan_unit_test_src_files := \
82 tests/unit/tsan_clock_test.cc \
83 tests/unit/tsan_dense_alloc_test.cc \
84 tests/unit/tsan_flags_test.cc \
85 tests/unit/tsan_mman_test.cc \
86 tests/unit/tsan_mutex_test.cc \
87 tests/unit/tsan_mutexset_test.cc \
88 tests/unit/tsan_shadow_test.cc \
89 tests/unit/tsan_stack_test.cc \
90 tests/unit/tsan_sync_test.cc \
91 tests/unit/tsan_unit_test_main.cc \
92 tests/unit/tsan_vector_test.cc \
93
94tsan_unit_test_c_includes := \
95 $(LOCAL_PATH)/rtl \
96 $(LOCAL_PATH)/.. \
97
Stephen Hinesf5011e32015-08-13 23:02:40 -070098ifneq (true,$(SKIP_LLVM_TESTS))
Dan Albert6de3e082015-08-14 23:35:15 -070099ifndef SANITIZE_HOST
Stephen Hinesf5011e32015-08-13 23:02:40 -0700100
Yabin Cuibe1b9332015-07-29 17:13:51 -0700101include $(CLEAR_VARS)
102LOCAL_MODULE := libtsan_unit_test
103LOCAL_CPP_EXTENSION := .cc
104LOCAL_C_INCLUDES := $(tsan_unit_test_c_includes)
105LOCAL_CPPFLAGS := $(tsan_rtl_cppflags)
106LOCAL_SRC_FILES := $(tsan_unit_test_src_files)
Yabin Cui6c5b3a52015-07-29 18:15:28 -0700107LOCAL_SANITIZE := never
Yabin Cuibe1b9332015-07-29 17:13:51 -0700108LOCAL_MULTILIB := 64
Stephen Hinesf5011e32015-08-13 23:02:40 -0700109LOCAL_STATIC_LIBRARIES := libtsan libubsan
110LOCAL_LDLIBS := -lrt -ldl
Yabin Cuibe1b9332015-07-29 17:13:51 -0700111include $(BUILD_HOST_NATIVE_TEST)
112
113
114tsan_rtl_test_src_files := \
115 tests/rtl/tsan_bench.cc \
116 tests/rtl/tsan_mop.cc \
117 tests/rtl/tsan_mutex.cc \
118 tests/rtl/tsan_posix.cc \
119 tests/rtl/tsan_string.cc \
Pirama Arumuga Nainar799172d2016-03-03 15:50:30 -0800120 tests/rtl/tsan_test_util_posix.cc \
Yabin Cuibe1b9332015-07-29 17:13:51 -0700121 tests/rtl/tsan_test.cc \
122 tests/rtl/tsan_thread.cc \
123
124tsan_rtl_test_c_includes := \
125 $(LOCAL_PATH)/rtl \
126 $(LOCAL_PATH)/.. \
127
128include $(CLEAR_VARS)
129LOCAL_MODULE := libtsan_rtl_test
130LOCAL_CPP_EXTENSION := .cc
131LOCAL_C_INCLUDES := $(tsan_rtl_test_c_includes)
132LOCAL_CPPFLAGS := $(tsan_rtl_cppflags)
133LOCAL_SRC_FILES := $(tsan_rtl_test_src_files)
Yabin Cui6c5b3a52015-07-29 18:15:28 -0700134LOCAL_SANITIZE := never
Yabin Cuibe1b9332015-07-29 17:13:51 -0700135LOCAL_MULTILIB := 64
Stephen Hinesf5011e32015-08-13 23:02:40 -0700136LOCAL_STATIC_LIBRARIES := libtsan libubsan
137LOCAL_LDLIBS := -lrt -ldl
Yabin Cuibe1b9332015-07-29 17:13:51 -0700138include $(BUILD_HOST_NATIVE_TEST)
139
Dan Albert6de3e082015-08-14 23:35:15 -0700140endif # SANITIZE_HOST
Stephen Hinesf5011e32015-08-13 23:02:40 -0700141endif # SKIP_LLVM_TESTS
142
Yabin Cuibe1b9332015-07-29 17:13:51 -0700143endif # ifeq ($(HOST_ARCH),x86_64)
Stephen Hinesf5011e32015-08-13 23:02:40 -0700144endif # ifeq ($(HOST_OS),linux)