blob: a09c3229fff048836283527535f18d3adaa084ae [file] [log] [blame]
Dan Alberte0857352014-04-08 12:04:51 -07001#
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 := \
Dan Albert07bb9922014-10-13 10:55:46 -070020 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 Ivanov4d4cef82015-03-26 11:56:18 -070030 src/cxa_thread_atexit.cpp \
Dan Albert07bb9922014-10-13 10:55:46 -070031 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 Albert87a9be22014-07-02 16:46:09 -070039
40LLVM_UNWIND_SRC_FILES := \
Dan Albert07bb9922014-10-13 10:55:46 -070041 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 Alberte0857352014-04-08 12:04:51 -070048
Dan Albert07bb9922014-10-13 10:55:46 -070049LIBCXXABI_INCLUDES := \
50 $(LOCAL_PATH)/include/ \
51 external/libcxx/include/ \
Dan Alberte0857352014-04-08 12:04:51 -070052
53LIBCXXABI_RTTI_FLAG := -frtti
54LIBCXXABI_CPPFLAGS := \
Dan Albert07bb9922014-10-13 10:55:46 -070055 -std=c++11 \
56 -fexceptions \
Dan Alberte44dc772015-01-05 12:40:50 -080057 -Wall \
58 -Wextra \
59 -Wno-unused-function \
60 -Werror \
Dan Alberte0857352014-04-08 12:04:51 -070061
62include $(CLEAR_VARS)
Dan Albert07bb9922014-10-13 10:55:46 -070063LOCAL_MODULE := libunwind_llvm
Dan Alberte0857352014-04-08 12:04:51 -070064LOCAL_CLANG := true
Dan Albert87a9be22014-07-02 16:46:09 -070065LOCAL_SRC_FILES_arm := $(LLVM_UNWIND_SRC_FILES)
Dan Albert07bb9922014-10-13 10:55:46 -070066LOCAL_C_INCLUDES := $(LIBCXXABI_INCLUDES)
Dan Alberte0857352014-04-08 12:04:51 -070067LOCAL_CPPFLAGS := $(LIBCXXABI_CPPFLAGS)
Dan Albert2cf24ad2014-09-15 16:54:20 -070068LOCAL_CXX_STL := none
Chih-Hung Hsieh71a1be32014-10-04 00:00:56 -070069# src/Unwind/UnwindRegistersSave.S does not compile.
70LOCAL_CLANG_ASFLAGS_arm += -no-integrated-as
Dan Albert07bb9922014-10-13 10:55:46 -070071LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Dan Albert873f8582014-05-09 12:00:06 -070072include $(BUILD_STATIC_LIBRARY)
Dan Alberte0857352014-04-08 12:04:51 -070073
74include $(CLEAR_VARS)
Dan Albertab22a8f2014-05-02 18:19:59 -070075LOCAL_MODULE := libc++abi
Dan Alberte0857352014-04-08 12:04:51 -070076LOCAL_CLANG := true
77LOCAL_SRC_FILES := $(LIBCXXABI_SRC_FILES)
Dan Albert07bb9922014-10-13 10:55:46 -070078LOCAL_C_INCLUDES := $(LIBCXXABI_INCLUDES)
Dmitriy Ivanov4d4cef82015-03-26 11:56:18 -070079LOCAL_CPPFLAGS := $(LIBCXXABI_CPPFLAGS) -DHAVE___CXA_THREAD_ATEXIT_IMPL
Dan Albertf4ce0f12015-03-17 17:56:26 -070080LOCAL_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
Dan Albert07bb9922014-10-13 10:55:46 -070086LOCAL_CXX_STL := none
87LOCAL_RTTI_FLAG := $(LIBCXXABI_RTTI_FLAG)
Dan Albert07bb9922014-10-13 10:55:46 -070088LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Chih-Hung Hsiehe3e9a2a2014-10-07 15:45:29 -070089# 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
Dan Albert07bb9922014-10-13 10:55:46 -070099include $(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)
Dan Alberte0857352014-04-08 12:04:51 -0700106LOCAL_CPPFLAGS := $(LIBCXXABI_CPPFLAGS)
Dan Albert2cf24ad2014-09-15 16:54:20 -0700107LOCAL_CXX_STL := none
Tim Murray09437212014-04-21 13:51:01 -0700108
109ifeq ($(HOST_OS),darwin)
Dan Albert87a9be22014-07-02 16:46:09 -0700110LOCAL_SRC_FILES += $(LLVM_UNWIND_SRC_FILES) src/Unwind/Unwind_AppleExtras.cpp
Tim Murray09437212014-04-21 13:51:01 -0700111# 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
Dan Alberte0857352014-04-08 12:04:51 -0700117LOCAL_RTTI_FLAG := $(LIBCXXABI_RTTI_FLAG)
Brian Carlstromd5cc5152014-05-09 20:47:13 -0700118LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Ian Rogers20116852014-06-10 22:36:06 -0700119LOCAL_MULTILIB := both
Dan Albert873f8582014-05-09 12:00:06 -0700120include $(BUILD_HOST_STATIC_LIBRARY)