1# 2# Copyright (C) 2014 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 17LOCAL_PATH := $(call my-dir) 18 19LIBCXXABI_SRC_FILES := \ 20 src/abort_message.cpp \ 21 src/cxa_aux_runtime.cpp \ 22 src/cxa_default_handlers.cpp \ 23 src/cxa_demangle.cpp \ 24 src/cxa_exception.cpp \ 25 src/cxa_exception_storage.cpp \ 26 src/cxa_guard.cpp \ 27 src/cxa_handlers.cpp \ 28 src/cxa_new_delete.cpp \ 29 src/cxa_personality.cpp \ 30 src/cxa_thread_atexit.cpp \ 31 src/cxa_unexpected.cpp \ 32 src/cxa_vector.cpp \ 33 src/cxa_virtual.cpp \ 34 src/exception.cpp \ 35 src/fallback_malloc.ipp \ 36 src/private_typeinfo.cpp \ 37 src/stdexcept.cpp \ 38 src/typeinfo.cpp \ 39 40LLVM_UNWIND_SRC_FILES := \ 41 src/Unwind/libunwind.cpp \ 42 src/Unwind/Unwind-EHABI.cpp \ 43 src/Unwind/Unwind-sjlj.c \ 44 src/Unwind/UnwindLevel1-gcc-ext.c \ 45 src/Unwind/UnwindLevel1.c \ 46 src/Unwind/UnwindRegistersSave.S \ 47 src/Unwind/UnwindRegistersRestore.S \ 48 49LIBCXXABI_INCLUDES := \ 50 $(LOCAL_PATH)/include/ \ 51 external/libcxx/include/ \ 52 53LIBCXXABI_RTTI_FLAG := -frtti 54LIBCXXABI_CPPFLAGS := \ 55 -std=c++11 \ 56 -fexceptions \ 57 -Wall \ 58 -Wextra \ 59 -Wno-unused-function \ 60 -Werror \ 61 62include $(CLEAR_VARS) 63LOCAL_MODULE := libunwind_llvm 64LOCAL_CLANG := true 65LOCAL_SRC_FILES_arm := $(LLVM_UNWIND_SRC_FILES) 66LOCAL_C_INCLUDES := $(LIBCXXABI_INCLUDES) 67LOCAL_CPPFLAGS := $(LIBCXXABI_CPPFLAGS) 68LOCAL_CXX_STL := none 69# src/Unwind/UnwindRegistersSave.S does not compile. 70LOCAL_CLANG_ASFLAGS_arm += -no-integrated-as 71LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk 72include $(BUILD_STATIC_LIBRARY) 73 74include $(CLEAR_VARS) 75LOCAL_MODULE := libc++abi 76LOCAL_CLANG := true 77LOCAL_SRC_FILES := $(LIBCXXABI_SRC_FILES) 78LOCAL_C_INCLUDES := $(LIBCXXABI_INCLUDES) 79LOCAL_CPPFLAGS := $(LIBCXXABI_CPPFLAGS) -DHAVE___CXA_THREAD_ATEXIT_IMPL 80LOCAL_CPPFLAGS_arm := -DLIBCXXABI_USE_LLVM_UNWINDER=1 81LOCAL_CPPFLAGS_arm64 := -DLIBCXXABI_USE_LLVM_UNWINDER=0 82LOCAL_CPPFLAGS_mips := -DLIBCXXABI_USE_LLVM_UNWINDER=0 83LOCAL_CPPFLAGS_mips64 := -DLIBCXXABI_USE_LLVM_UNWINDER=0 84LOCAL_CPPFLAGS_x86 := -DLIBCXXABI_USE_LLVM_UNWINDER=0 85LOCAL_CPPFLAGS_x86_64 := -DLIBCXXABI_USE_LLVM_UNWINDER=0 86LOCAL_CXX_STL := none 87LOCAL_RTTI_FLAG := $(LIBCXXABI_RTTI_FLAG) 88LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk 89# src/Unwind/UnwindRegistersSave.S does not compile. 90LOCAL_CLANG_ASFLAGS_arm += -no-integrated-as 91# When src/cxa_exception.cpp is compiled with Clang assembler 92# __cxa_end_cleanup_impl, although marked as used, was discarded 93# since it is used only in embedded assembly code. 94# This caused the following warning when linking libc++.so: 95# libc++_static.a(cxa_exception.o)(.text.__cxa_end_cleanup+0x2): 96# warning: relocation refers to discarded section 97# See also http://llvm.org/bugs/show_bug.cgi?id=21292. 98LOCAL_CLANG_CFLAGS_arm += -no-integrated-as 99include $(BUILD_STATIC_LIBRARY) 100 101include $(CLEAR_VARS) 102LOCAL_MODULE := libc++abi 103LOCAL_CLANG := true 104LOCAL_SRC_FILES := $(LIBCXXABI_SRC_FILES) 105LOCAL_C_INCLUDES := $(LIBCXXABI_INCLUDES) 106LOCAL_CPPFLAGS := $(LIBCXXABI_CPPFLAGS) 107LOCAL_CXX_STL := none 108 109ifeq ($(HOST_OS),darwin) 110LOCAL_SRC_FILES += $(LLVM_UNWIND_SRC_FILES) src/Unwind/Unwind_AppleExtras.cpp 111# libcxxabi really doesn't like the non-LLVM assembler on Darwin 112LOCAL_ASFLAGS += -integrated-as 113LOCAL_CFLAGS += -integrated-as 114LOCAL_CPPFLAGS += -integrated-as 115endif 116 117LOCAL_RTTI_FLAG := $(LIBCXXABI_RTTI_FLAG) 118LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk 119LOCAL_MULTILIB := both 120include $(BUILD_HOST_STATIC_LIBRARY) 121