blob: 89e23ed111d76314b55c29e319646eb22b3cefe2 [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 \
30
31ubsan_rtl_cppflags := \
32 -fvisibility=hidden \
33 -fno-exceptions \
34 -std=c++11 \
35 -Wall \
36 -Werror \
37 -Wno-unused-parameter \
38 -Wno-non-virtual-dtor \
39
40ubsan_rtl_c_includes := \
41 external/compiler-rt/lib \
42
Pirama Arumuga Nainar259f7062015-05-06 11:49:53 -070043################################################################################
44# Target modules
45
Pirama Arumuga Nainar259f7062015-05-06 11:49:53 -070046include $(CLEAR_VARS)
47LOCAL_MODULE := libubsan
48LOCAL_CPP_EXTENSION := .cc
49LOCAL_C_INCLUDES := $(ubsan_rtl_c_includes)
50LOCAL_CPPFLAGS := $(ubsan_rtl_cppflags)
51LOCAL_SRC_FILES := $(ubsan_rtl_files)
52LOCAL_CXX_STL := none
Dan Albert237aaa62015-06-16 14:21:19 -070053LOCAL_SANITIZE := never
Stephen Hines2d6b7142015-10-15 14:18:57 -070054LOCAL_MODULE_TARGET_ARCH := arm arm64
Pirama Arumuga Nainar259f7062015-05-06 11:49:53 -070055LOCAL_MULTILIB := both
56include $(BUILD_STATIC_LIBRARY)
57
Pirama Arumuga Nainar259f7062015-05-06 11:49:53 -070058################################################################################
59# Host modules
60
Dan Albert92f9e2f2014-12-11 17:39:46 -080061ifneq ($(HOST_OS),darwin)
62
63include $(CLEAR_VARS)
Pirama Arumuga Nainar259f7062015-05-06 11:49:53 -070064LOCAL_MODULE := libubsan
65LOCAL_CPP_EXTENSION := .cc
66LOCAL_C_INCLUDES := $(ubsan_rtl_c_includes)
67LOCAL_CPPFLAGS := $(ubsan_rtl_cppflags) -fno-rtti
68LOCAL_SRC_FILES := $(ubsan_rtl_files)
69LOCAL_CXX_STL := none
Dan Albert237aaa62015-06-16 14:21:19 -070070LOCAL_SANITIZE := never
Pirama Arumuga Nainar259f7062015-05-06 11:49:53 -070071LOCAL_MULTILIB := both
72include $(BUILD_HOST_STATIC_LIBRARY)
73
74include $(CLEAR_VARS)
Dan Albert92f9e2f2014-12-11 17:39:46 -080075LOCAL_MODULE := libubsan_standalone
76LOCAL_CPP_EXTENSION := .cc
77LOCAL_C_INCLUDES := $(ubsan_rtl_c_includes)
78LOCAL_CPPFLAGS := $(ubsan_rtl_cppflags) -fno-rtti
79LOCAL_SRC_FILES := $(ubsan_rtl_files)
80LOCAL_WHOLE_STATIC_LIBRARIES := libsan
81LOCAL_CXX_STL := none
Dan Albert237aaa62015-06-16 14:21:19 -070082LOCAL_SANITIZE := never
Dan Albert92f9e2f2014-12-11 17:39:46 -080083LOCAL_MULTILIB := both
84include $(BUILD_HOST_STATIC_LIBRARY)
85
86include $(CLEAR_VARS)
Yabin Cui7e8a0452015-08-24 15:26:43 -070087LOCAL_MODULE := libubsan_cxx
88LOCAL_CPP_EXTENSION := .cc
89LOCAL_C_INCLUDES := $(ubsan_rtl_c_includes)
90LOCAL_CPPFLAGS := $(ubsan_rtl_cppflags)
91LOCAL_SRC_FILES := $(ubsan_cxx_rtl_files)
92LOCAL_SANITIZE := never
93LOCAL_MULTILIB := both
94include $(BUILD_HOST_STATIC_LIBRARY)
95
96include $(CLEAR_VARS)
Dan Albert92f9e2f2014-12-11 17:39:46 -080097LOCAL_MODULE := libubsan_standalone_cxx
98LOCAL_CPP_EXTENSION := .cc
99LOCAL_C_INCLUDES := $(ubsan_rtl_c_includes)
100LOCAL_CPPFLAGS := $(ubsan_rtl_cppflags)
101LOCAL_SRC_FILES := $(ubsan_cxx_rtl_files)
Dan Albert237aaa62015-06-16 14:21:19 -0700102LOCAL_SANITIZE := never
Dan Albert92f9e2f2014-12-11 17:39:46 -0800103LOCAL_MULTILIB := both
104include $(BUILD_HOST_STATIC_LIBRARY)
105
106endif