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