1*344aa361SAndroid Build Coastguard Worker# 2*344aa361SAndroid Build Coastguard Worker# Copyright (c) 2022, Google, Inc. All rights reserved 3*344aa361SAndroid Build Coastguard Worker# 4*344aa361SAndroid Build Coastguard Worker# Permission is hereby granted, free of charge, to any person obtaining 5*344aa361SAndroid Build Coastguard Worker# a copy of this software and associated documentation files 6*344aa361SAndroid Build Coastguard Worker# (the "Software"), to deal in the Software without restriction, 7*344aa361SAndroid Build Coastguard Worker# including without limitation the rights to use, copy, modify, merge, 8*344aa361SAndroid Build Coastguard Worker# publish, distribute, sublicense, and/or sell copies of the Software, 9*344aa361SAndroid Build Coastguard Worker# and to permit persons to whom the Software is furnished to do so, 10*344aa361SAndroid Build Coastguard Worker# subject to the following conditions: 11*344aa361SAndroid Build Coastguard Worker# 12*344aa361SAndroid Build Coastguard Worker# The above copyright notice and this permission notice shall be 13*344aa361SAndroid Build Coastguard Worker# included in all copies or substantial portions of the Software. 14*344aa361SAndroid Build Coastguard Worker# 15*344aa361SAndroid Build Coastguard Worker# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16*344aa361SAndroid Build Coastguard Worker# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17*344aa361SAndroid Build Coastguard Worker# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18*344aa361SAndroid Build Coastguard Worker# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19*344aa361SAndroid Build Coastguard Worker# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20*344aa361SAndroid Build Coastguard Worker# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21*344aa361SAndroid Build Coastguard Worker# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22*344aa361SAndroid Build Coastguard Worker# 23*344aa361SAndroid Build Coastguard Worker 24*344aa361SAndroid Build Coastguard WorkerLOCAL_DIR := $(GET_LOCAL_DIR) 25*344aa361SAndroid Build Coastguard Worker 26*344aa361SAndroid Build Coastguard WorkerMODULE := $(LOCAL_DIR) 27*344aa361SAndroid Build Coastguard Worker 28*344aa361SAndroid Build Coastguard WorkerLIBCXXABI_DIR = external/libcxxabi 29*344aa361SAndroid Build Coastguard Worker 30*344aa361SAndroid Build Coastguard WorkerGLOBAL_INCLUDES += $(LIBCXXABI_DIR)/include 31*344aa361SAndroid Build Coastguard Worker 32*344aa361SAndroid Build Coastguard Worker# Internal libcxxabi build requires std::unexpected_handler to be defined, even 33*344aa361SAndroid Build Coastguard Worker# though it is removed as of C++17. Building with LIBCPP_BUILDING_LIBRARY 34*344aa361SAndroid Build Coastguard Worker# includes this required non-spec definition in the build. 35*344aa361SAndroid Build Coastguard WorkerMODULE_CPPFLAGS += -D_LIBCPP_BUILDING_LIBRARY 36*344aa361SAndroid Build Coastguard Worker 37*344aa361SAndroid Build Coastguard Worker# The way we define LIBCPP_BUILDING_LIBRARY above conflicts with a definition in 38*344aa361SAndroid Build Coastguard Worker# the fallback allocator. The resulting error is safe to ignore. 39*344aa361SAndroid Build Coastguard WorkerMODULE_COMPILEFLAGS += -Wno-macro-redefined 40*344aa361SAndroid Build Coastguard Worker 41*344aa361SAndroid Build Coastguard WorkerMODULE_COMPILEFLAGS += -D_LIBCXXABI_BUILDING_LIBRARY -D_LIBCXXABI_HAS_NO_THREADS 42*344aa361SAndroid Build Coastguard Worker 43*344aa361SAndroid Build Coastguard Worker# Required if compiling without exceptions. 44*344aa361SAndroid Build Coastguard WorkerMODULE_COMPILEFLAGS += -D_LIBCXXABI_NO_EXCEPTIONS 45*344aa361SAndroid Build Coastguard Worker 46*344aa361SAndroid Build Coastguard Worker# Required if compiling without RTTI, but also helps binary size. 47*344aa361SAndroid Build Coastguard WorkerMODULE_COMPILEFLAGS += -DLIBCXXABI_SILENT_TERMINATE 48*344aa361SAndroid Build Coastguard Worker 49*344aa361SAndroid Build Coastguard WorkerMODULE_SRCS := \ 50*344aa361SAndroid Build Coastguard Worker $(LIBCXXABI_DIR)/src/cxa_aux_runtime.cpp \ 51*344aa361SAndroid Build Coastguard Worker $(LIBCXXABI_DIR)/src/cxa_default_handlers.cpp \ 52*344aa361SAndroid Build Coastguard Worker $(LIBCXXABI_DIR)/src/cxa_demangle.cpp \ 53*344aa361SAndroid Build Coastguard Worker $(LIBCXXABI_DIR)/src/cxa_exception_storage.cpp \ 54*344aa361SAndroid Build Coastguard Worker $(LIBCXXABI_DIR)/src/cxa_guard.cpp \ 55*344aa361SAndroid Build Coastguard Worker $(LIBCXXABI_DIR)/src/cxa_handlers.cpp \ 56*344aa361SAndroid Build Coastguard Worker $(LIBCXXABI_DIR)/src/cxa_unexpected.cpp \ 57*344aa361SAndroid Build Coastguard Worker $(LIBCXXABI_DIR)/src/cxa_vector.cpp \ 58*344aa361SAndroid Build Coastguard Worker $(LIBCXXABI_DIR)/src/stdlib_exception.cpp \ 59*344aa361SAndroid Build Coastguard Worker $(LIBCXXABI_DIR)/src/stdlib_stdexcept.cpp \ 60*344aa361SAndroid Build Coastguard Worker $(LIBCXXABI_DIR)/src/stdlib_typeinfo.cpp \ 61*344aa361SAndroid Build Coastguard Worker $(LIBCXXABI_DIR)/src/abort_message.cpp \ 62*344aa361SAndroid Build Coastguard Worker $(LIBCXXABI_DIR)/src/fallback_malloc.cpp \ 63*344aa361SAndroid Build Coastguard Worker 64*344aa361SAndroid Build Coastguard Worker# Exceptions disabled 65*344aa361SAndroid Build Coastguard WorkerMODULE_SRCS += \ 66*344aa361SAndroid Build Coastguard Worker $(LIBCXXABI_DIR)/src/cxa_noexception.cpp \ 67*344aa361SAndroid Build Coastguard Worker 68*344aa361SAndroid Build Coastguard Worker# Files that do not compile without exceptions 69*344aa361SAndroid Build Coastguard Worker# $(LIBCXXABI_DIR)/src/cxa_exception.cpp \ 70*344aa361SAndroid Build Coastguard Worker# $(LIBCXXABI_DIR)/src/cxa_personality.cpp \ 71*344aa361SAndroid Build Coastguard Worker 72*344aa361SAndroid Build Coastguard Worker# Files that do not compile without RTTI 73*344aa361SAndroid Build Coastguard Worker# $(LIBCXXABI_DIR)/src/private_typeinfo.cpp \ 74*344aa361SAndroid Build Coastguard Worker 75*344aa361SAndroid Build Coastguard WorkerMODULE_DEPS := \ 76*344aa361SAndroid Build Coastguard Worker trusty/kernel/lib/libcxx-trusty 77*344aa361SAndroid Build Coastguard Worker 78*344aa361SAndroid Build Coastguard Workerinclude make/module.mk 79