Dan Albert | 92f9e2f | 2014-12-11 17:39:46 -0800 | [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 | ubsan_rtl_files := \ |
| 21 | ubsan_diag.cc \ |
| 22 | ubsan_init.cc \ |
| 23 | ubsan_flags.cc \ |
| 24 | ubsan_handlers.cc \ |
| 25 | ubsan_value.cc \ |
| 26 | |
| 27 | ubsan_cxx_rtl_files := \ |
| 28 | ubsan_handlers_cxx.cc \ |
| 29 | ubsan_type_hash.cc \ |
Pirama Arumuga Nainar | 799172d | 2016-03-03 15:50:30 -0800 | [diff] [blame^] | 30 | ubsan_type_hash_itanium.cc \ |
| 31 | ubsan_type_hash_win.cc \ |
Dan Albert | 92f9e2f | 2014-12-11 17:39:46 -0800 | [diff] [blame] | 32 | |
| 33 | ubsan_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 | |
| 42 | ubsan_rtl_c_includes := \ |
| 43 | external/compiler-rt/lib \ |
| 44 | |
Pirama Arumuga Nainar | 259f706 | 2015-05-06 11:49:53 -0700 | [diff] [blame] | 45 | ################################################################################ |
| 46 | # Target modules |
| 47 | |
Pirama Arumuga Nainar | 259f706 | 2015-05-06 11:49:53 -0700 | [diff] [blame] | 48 | include $(CLEAR_VARS) |
| 49 | LOCAL_MODULE := libubsan |
| 50 | LOCAL_CPP_EXTENSION := .cc |
| 51 | LOCAL_C_INCLUDES := $(ubsan_rtl_c_includes) |
| 52 | LOCAL_CPPFLAGS := $(ubsan_rtl_cppflags) |
| 53 | LOCAL_SRC_FILES := $(ubsan_rtl_files) |
Pirama Arumuga Nainar | 799172d | 2016-03-03 15:50:30 -0800 | [diff] [blame^] | 54 | LOCAL_NDK_STL_VARIANT := none |
| 55 | LOCAL_SDK_VERSION := 19 |
Dan Albert | 237aaa6 | 2015-06-16 14:21:19 -0700 | [diff] [blame] | 56 | LOCAL_SANITIZE := never |
Pirama Arumuga Nainar | 799172d | 2016-03-03 15:50:30 -0800 | [diff] [blame^] | 57 | LOCAL_MODULE_TARGET_ARCH := arm arm64 x86 |
Pirama Arumuga Nainar | 259f706 | 2015-05-06 11:49:53 -0700 | [diff] [blame] | 58 | LOCAL_MULTILIB := both |
| 59 | include $(BUILD_STATIC_LIBRARY) |
| 60 | |
Pirama Arumuga Nainar | 259f706 | 2015-05-06 11:49:53 -0700 | [diff] [blame] | 61 | ################################################################################ |
| 62 | # Host modules |
| 63 | |
Dan Albert | 92f9e2f | 2014-12-11 17:39:46 -0800 | [diff] [blame] | 64 | ifneq ($(HOST_OS),darwin) |
| 65 | |
| 66 | include $(CLEAR_VARS) |
Pirama Arumuga Nainar | 259f706 | 2015-05-06 11:49:53 -0700 | [diff] [blame] | 67 | LOCAL_MODULE := libubsan |
| 68 | LOCAL_CPP_EXTENSION := .cc |
| 69 | LOCAL_C_INCLUDES := $(ubsan_rtl_c_includes) |
| 70 | LOCAL_CPPFLAGS := $(ubsan_rtl_cppflags) -fno-rtti |
| 71 | LOCAL_SRC_FILES := $(ubsan_rtl_files) |
| 72 | LOCAL_CXX_STL := none |
Dan Albert | 237aaa6 | 2015-06-16 14:21:19 -0700 | [diff] [blame] | 73 | LOCAL_SANITIZE := never |
Pirama Arumuga Nainar | 259f706 | 2015-05-06 11:49:53 -0700 | [diff] [blame] | 74 | LOCAL_MULTILIB := both |
| 75 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 76 | |
| 77 | include $(CLEAR_VARS) |
Dan Albert | 92f9e2f | 2014-12-11 17:39:46 -0800 | [diff] [blame] | 78 | LOCAL_MODULE := libubsan_standalone |
| 79 | LOCAL_CPP_EXTENSION := .cc |
| 80 | LOCAL_C_INCLUDES := $(ubsan_rtl_c_includes) |
| 81 | LOCAL_CPPFLAGS := $(ubsan_rtl_cppflags) -fno-rtti |
| 82 | LOCAL_SRC_FILES := $(ubsan_rtl_files) |
| 83 | LOCAL_WHOLE_STATIC_LIBRARIES := libsan |
| 84 | LOCAL_CXX_STL := none |
Dan Albert | 237aaa6 | 2015-06-16 14:21:19 -0700 | [diff] [blame] | 85 | LOCAL_SANITIZE := never |
Dan Albert | 92f9e2f | 2014-12-11 17:39:46 -0800 | [diff] [blame] | 86 | LOCAL_MULTILIB := both |
| 87 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 88 | |
| 89 | include $(CLEAR_VARS) |
Yabin Cui | 7e8a045 | 2015-08-24 15:26:43 -0700 | [diff] [blame] | 90 | LOCAL_MODULE := libubsan_cxx |
| 91 | LOCAL_CPP_EXTENSION := .cc |
| 92 | LOCAL_C_INCLUDES := $(ubsan_rtl_c_includes) |
| 93 | LOCAL_CPPFLAGS := $(ubsan_rtl_cppflags) |
| 94 | LOCAL_SRC_FILES := $(ubsan_cxx_rtl_files) |
| 95 | LOCAL_SANITIZE := never |
| 96 | LOCAL_MULTILIB := both |
| 97 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 98 | |
| 99 | include $(CLEAR_VARS) |
Dan Albert | 92f9e2f | 2014-12-11 17:39:46 -0800 | [diff] [blame] | 100 | LOCAL_MODULE := libubsan_standalone_cxx |
| 101 | LOCAL_CPP_EXTENSION := .cc |
| 102 | LOCAL_C_INCLUDES := $(ubsan_rtl_c_includes) |
| 103 | LOCAL_CPPFLAGS := $(ubsan_rtl_cppflags) |
| 104 | LOCAL_SRC_FILES := $(ubsan_cxx_rtl_files) |
Dan Albert | 237aaa6 | 2015-06-16 14:21:19 -0700 | [diff] [blame] | 105 | LOCAL_SANITIZE := never |
Dan Albert | 92f9e2f | 2014-12-11 17:39:46 -0800 | [diff] [blame] | 106 | LOCAL_MULTILIB := both |
| 107 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 108 | |
| 109 | endif |