blob: 757e5b008bf04f4cab29259afb5abf0cb92868a4 [file] [log] [blame]
Dan Albert92f9e2f2014-12-11 17:39:46 -08001#
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
20ubsan_rtl_files := \
21 ubsan_diag.cc \
22 ubsan_init.cc \
23 ubsan_flags.cc \
24 ubsan_handlers.cc \
25 ubsan_value.cc \
26
27ubsan_cxx_rtl_files := \
28 ubsan_handlers_cxx.cc \
29 ubsan_type_hash.cc \
Pirama Arumuga Nainar799172d2016-03-03 15:50:30 -080030 ubsan_type_hash_itanium.cc \
31 ubsan_type_hash_win.cc \
Dan Albert92f9e2f2014-12-11 17:39:46 -080032
33ubsan_rtl_cppflags := \
34 -fvisibility=hidden \
35 -fno-exceptions \
36 -std=c++11 \
37 -Wall \
38 -Werror \
39 -Wno-unused-parameter \
40 -Wno-non-virtual-dtor \
41
42ubsan_rtl_c_includes := \
43 external/compiler-rt/lib \
44
Pirama Arumuga Nainar259f7062015-05-06 11:49:53 -070045################################################################################
46# Target modules
47
Pirama Arumuga Nainar259f7062015-05-06 11:49:53 -070048include $(CLEAR_VARS)
49LOCAL_MODULE := libubsan
50LOCAL_CPP_EXTENSION := .cc
51LOCAL_C_INCLUDES := $(ubsan_rtl_c_includes)
52LOCAL_CPPFLAGS := $(ubsan_rtl_cppflags)
53LOCAL_SRC_FILES := $(ubsan_rtl_files)
Pirama Arumuga Nainar799172d2016-03-03 15:50:30 -080054LOCAL_NDK_STL_VARIANT := none
55LOCAL_SDK_VERSION := 19
Dan Albert237aaa62015-06-16 14:21:19 -070056LOCAL_SANITIZE := never
Pirama Arumuga Nainar799172d2016-03-03 15:50:30 -080057LOCAL_MODULE_TARGET_ARCH := arm arm64 x86
Pirama Arumuga Nainar259f7062015-05-06 11:49:53 -070058LOCAL_MULTILIB := both
59include $(BUILD_STATIC_LIBRARY)
60
Pirama Arumuga Nainar259f7062015-05-06 11:49:53 -070061################################################################################
62# Host modules
63
Dan Albert92f9e2f2014-12-11 17:39:46 -080064ifneq ($(HOST_OS),darwin)
65
66include $(CLEAR_VARS)
Pirama Arumuga Nainar259f7062015-05-06 11:49:53 -070067LOCAL_MODULE := libubsan
68LOCAL_CPP_EXTENSION := .cc
69LOCAL_C_INCLUDES := $(ubsan_rtl_c_includes)
70LOCAL_CPPFLAGS := $(ubsan_rtl_cppflags) -fno-rtti
71LOCAL_SRC_FILES := $(ubsan_rtl_files)
72LOCAL_CXX_STL := none
Dan Albert237aaa62015-06-16 14:21:19 -070073LOCAL_SANITIZE := never
Pirama Arumuga Nainar259f7062015-05-06 11:49:53 -070074LOCAL_MULTILIB := both
75include $(BUILD_HOST_STATIC_LIBRARY)
76
77include $(CLEAR_VARS)
Dan Albert92f9e2f2014-12-11 17:39:46 -080078LOCAL_MODULE := libubsan_standalone
79LOCAL_CPP_EXTENSION := .cc
80LOCAL_C_INCLUDES := $(ubsan_rtl_c_includes)
81LOCAL_CPPFLAGS := $(ubsan_rtl_cppflags) -fno-rtti
82LOCAL_SRC_FILES := $(ubsan_rtl_files)
83LOCAL_WHOLE_STATIC_LIBRARIES := libsan
84LOCAL_CXX_STL := none
Dan Albert237aaa62015-06-16 14:21:19 -070085LOCAL_SANITIZE := never
Dan Albert92f9e2f2014-12-11 17:39:46 -080086LOCAL_MULTILIB := both
87include $(BUILD_HOST_STATIC_LIBRARY)
88
89include $(CLEAR_VARS)
Yabin Cui7e8a0452015-08-24 15:26:43 -070090LOCAL_MODULE := libubsan_cxx
91LOCAL_CPP_EXTENSION := .cc
92LOCAL_C_INCLUDES := $(ubsan_rtl_c_includes)
93LOCAL_CPPFLAGS := $(ubsan_rtl_cppflags)
94LOCAL_SRC_FILES := $(ubsan_cxx_rtl_files)
95LOCAL_SANITIZE := never
96LOCAL_MULTILIB := both
97include $(BUILD_HOST_STATIC_LIBRARY)
98
99include $(CLEAR_VARS)
Dan Albert92f9e2f2014-12-11 17:39:46 -0800100LOCAL_MODULE := libubsan_standalone_cxx
101LOCAL_CPP_EXTENSION := .cc
102LOCAL_C_INCLUDES := $(ubsan_rtl_c_includes)
103LOCAL_CPPFLAGS := $(ubsan_rtl_cppflags)
104LOCAL_SRC_FILES := $(ubsan_cxx_rtl_files)
Dan Albert237aaa62015-06-16 14:21:19 -0700105LOCAL_SANITIZE := never
Dan Albert92f9e2f2014-12-11 17:39:46 -0800106LOCAL_MULTILIB := both
107include $(BUILD_HOST_STATIC_LIBRARY)
108
109endif