Dan Albert | e085735 | 2014-04-08 12:04:51 -0700 | [diff] [blame] | 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 | |
| 17 | LOCAL_PATH := $(call my-dir) |
| 18 | |
| 19 | LIBCXXABI_SRC_FILES := \ |
Dan Albert | 07bb992 | 2014-10-13 10:55:46 -0700 | [diff] [blame] | 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 \ |
Dmitriy Ivanov | 4d4cef8 | 2015-03-26 11:56:18 -0700 | [diff] [blame] | 30 | src/cxa_thread_atexit.cpp \ |
Dan Albert | 07bb992 | 2014-10-13 10:55:46 -0700 | [diff] [blame] | 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 \ |
Dan Albert | 87a9be2 | 2014-07-02 16:46:09 -0700 | [diff] [blame] | 39 | |
| 40 | LLVM_UNWIND_SRC_FILES := \ |
Dan Albert | 07bb992 | 2014-10-13 10:55:46 -0700 | [diff] [blame] | 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 \ |
Dan Albert | e085735 | 2014-04-08 12:04:51 -0700 | [diff] [blame] | 48 | |
Dan Albert | 07bb992 | 2014-10-13 10:55:46 -0700 | [diff] [blame] | 49 | LIBCXXABI_INCLUDES := \ |
| 50 | $(LOCAL_PATH)/include/ \ |
| 51 | external/libcxx/include/ \ |
Dan Albert | e085735 | 2014-04-08 12:04:51 -0700 | [diff] [blame] | 52 | |
| 53 | LIBCXXABI_RTTI_FLAG := -frtti |
| 54 | LIBCXXABI_CPPFLAGS := \ |
Dan Albert | 07bb992 | 2014-10-13 10:55:46 -0700 | [diff] [blame] | 55 | -std=c++11 \ |
| 56 | -fexceptions \ |
Dan Albert | e44dc77 | 2015-01-05 12:40:50 -0800 | [diff] [blame] | 57 | -Wall \ |
| 58 | -Wextra \ |
| 59 | -Wno-unused-function \ |
| 60 | -Werror \ |
Dan Albert | e085735 | 2014-04-08 12:04:51 -0700 | [diff] [blame] | 61 | |
| 62 | include $(CLEAR_VARS) |
Dan Albert | 07bb992 | 2014-10-13 10:55:46 -0700 | [diff] [blame] | 63 | LOCAL_MODULE := libunwind_llvm |
Dan Albert | e085735 | 2014-04-08 12:04:51 -0700 | [diff] [blame] | 64 | LOCAL_CLANG := true |
Dan Albert | 87a9be2 | 2014-07-02 16:46:09 -0700 | [diff] [blame] | 65 | LOCAL_SRC_FILES_arm := $(LLVM_UNWIND_SRC_FILES) |
Dan Albert | 07bb992 | 2014-10-13 10:55:46 -0700 | [diff] [blame] | 66 | LOCAL_C_INCLUDES := $(LIBCXXABI_INCLUDES) |
Dan Albert | e085735 | 2014-04-08 12:04:51 -0700 | [diff] [blame] | 67 | LOCAL_CPPFLAGS := $(LIBCXXABI_CPPFLAGS) |
Dan Albert | 2cf24ad | 2014-09-15 16:54:20 -0700 | [diff] [blame] | 68 | LOCAL_CXX_STL := none |
Chih-Hung Hsieh | 71a1be3 | 2014-10-04 00:00:56 -0700 | [diff] [blame] | 69 | # src/Unwind/UnwindRegistersSave.S does not compile. |
| 70 | LOCAL_CLANG_ASFLAGS_arm += -no-integrated-as |
Dan Albert | 07bb992 | 2014-10-13 10:55:46 -0700 | [diff] [blame] | 71 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Dan Albert | 873f858 | 2014-05-09 12:00:06 -0700 | [diff] [blame] | 72 | include $(BUILD_STATIC_LIBRARY) |
Dan Albert | e085735 | 2014-04-08 12:04:51 -0700 | [diff] [blame] | 73 | |
| 74 | include $(CLEAR_VARS) |
Dan Albert | ab22a8f | 2014-05-02 18:19:59 -0700 | [diff] [blame] | 75 | LOCAL_MODULE := libc++abi |
Dan Albert | e085735 | 2014-04-08 12:04:51 -0700 | [diff] [blame] | 76 | LOCAL_CLANG := true |
| 77 | LOCAL_SRC_FILES := $(LIBCXXABI_SRC_FILES) |
Dan Albert | 07bb992 | 2014-10-13 10:55:46 -0700 | [diff] [blame] | 78 | LOCAL_C_INCLUDES := $(LIBCXXABI_INCLUDES) |
Dmitriy Ivanov | 4d4cef8 | 2015-03-26 11:56:18 -0700 | [diff] [blame] | 79 | LOCAL_CPPFLAGS := $(LIBCXXABI_CPPFLAGS) -DHAVE___CXA_THREAD_ATEXIT_IMPL |
Dan Albert | f4ce0f1 | 2015-03-17 17:56:26 -0700 | [diff] [blame] | 80 | LOCAL_CPPFLAGS_arm := -DLIBCXXABI_USE_LLVM_UNWINDER=1 |
| 81 | LOCAL_CPPFLAGS_arm64 := -DLIBCXXABI_USE_LLVM_UNWINDER=0 |
| 82 | LOCAL_CPPFLAGS_mips := -DLIBCXXABI_USE_LLVM_UNWINDER=0 |
| 83 | LOCAL_CPPFLAGS_mips64 := -DLIBCXXABI_USE_LLVM_UNWINDER=0 |
| 84 | LOCAL_CPPFLAGS_x86 := -DLIBCXXABI_USE_LLVM_UNWINDER=0 |
| 85 | LOCAL_CPPFLAGS_x86_64 := -DLIBCXXABI_USE_LLVM_UNWINDER=0 |
Dan Albert | 07bb992 | 2014-10-13 10:55:46 -0700 | [diff] [blame] | 86 | LOCAL_CXX_STL := none |
| 87 | LOCAL_RTTI_FLAG := $(LIBCXXABI_RTTI_FLAG) |
Dan Albert | 07bb992 | 2014-10-13 10:55:46 -0700 | [diff] [blame] | 88 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Chih-Hung Hsieh | e3e9a2a | 2014-10-07 15:45:29 -0700 | [diff] [blame] | 89 | # src/Unwind/UnwindRegistersSave.S does not compile. |
| 90 | LOCAL_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. |
| 98 | LOCAL_CLANG_CFLAGS_arm += -no-integrated-as |
Dan Albert | 07bb992 | 2014-10-13 10:55:46 -0700 | [diff] [blame] | 99 | include $(BUILD_STATIC_LIBRARY) |
| 100 | |
| 101 | include $(CLEAR_VARS) |
| 102 | LOCAL_MODULE := libc++abi |
| 103 | LOCAL_CLANG := true |
| 104 | LOCAL_SRC_FILES := $(LIBCXXABI_SRC_FILES) |
| 105 | LOCAL_C_INCLUDES := $(LIBCXXABI_INCLUDES) |
Dan Albert | e085735 | 2014-04-08 12:04:51 -0700 | [diff] [blame] | 106 | LOCAL_CPPFLAGS := $(LIBCXXABI_CPPFLAGS) |
Dan Albert | 2cf24ad | 2014-09-15 16:54:20 -0700 | [diff] [blame] | 107 | LOCAL_CXX_STL := none |
Tim Murray | 0943721 | 2014-04-21 13:51:01 -0700 | [diff] [blame] | 108 | |
| 109 | ifeq ($(HOST_OS),darwin) |
Dan Albert | 87a9be2 | 2014-07-02 16:46:09 -0700 | [diff] [blame] | 110 | LOCAL_SRC_FILES += $(LLVM_UNWIND_SRC_FILES) src/Unwind/Unwind_AppleExtras.cpp |
Tim Murray | 0943721 | 2014-04-21 13:51:01 -0700 | [diff] [blame] | 111 | # libcxxabi really doesn't like the non-LLVM assembler on Darwin |
| 112 | LOCAL_ASFLAGS += -integrated-as |
| 113 | LOCAL_CFLAGS += -integrated-as |
| 114 | LOCAL_CPPFLAGS += -integrated-as |
| 115 | endif |
| 116 | |
Dan Albert | e085735 | 2014-04-08 12:04:51 -0700 | [diff] [blame] | 117 | LOCAL_RTTI_FLAG := $(LIBCXXABI_RTTI_FLAG) |
Brian Carlstrom | d5cc515 | 2014-05-09 20:47:13 -0700 | [diff] [blame] | 118 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Ian Rogers | 2011685 | 2014-06-10 22:36:06 -0700 | [diff] [blame] | 119 | LOCAL_MULTILIB := both |
Dan Albert | 873f858 | 2014-05-09 12:00:06 -0700 | [diff] [blame] | 120 | include $(BUILD_HOST_STATIC_LIBRARY) |