1LOCAL_DIR := $(GET_LOCAL_DIR)
2
3MODULE := $(LOCAL_DIR)
4
5LIBCXXABI_DIR = external/libcxxabi
6
7MODULE_LICENSES += $(LIBCXXABI_DIR)/NOTICE
8
9MODULE_EXPORT_INCLUDES += $(LIBCXXABI_DIR)/include
10
11MODULE_SDK_HEADER_INSTALL_DIR := c++/v1
12
13# Internal libcxxabi build requires std::unexpected_handler to be defined, even
14# though it is removed as of C++17. Building with LIBCPP_BUILDING_LIBRARY
15# includes this required non-spec definition in the build.
16MODULE_CPPFLAGS += -D_LIBCPP_BUILDING_LIBRARY
17
18# The way we define LIBCPP_BUILDING_LIBRARY above conflicts with a definition in
19# the fallback allocator. The resulting error is safe to ignore.
20MODULE_COMPILEFLAGS += -Wno-macro-redefined
21
22MODULE_COMPILEFLAGS += -D_LIBCXXABI_BUILDING_LIBRARY -D_LIBCXXABI_HAS_NO_THREADS
23
24# Required if compiling without exceptions.
25MODULE_COMPILEFLAGS += -D_LIBCXXABI_NO_EXCEPTIONS
26
27# Required if compiling without RTTI, but also helps binary size.
28MODULE_COMPILEFLAGS += -DLIBCXXABI_SILENT_TERMINATE
29
30MODULE_SRCS := \
31	$(LIBCXXABI_DIR)/src/cxa_aux_runtime.cpp \
32	$(LIBCXXABI_DIR)/src/cxa_default_handlers.cpp \
33	$(LIBCXXABI_DIR)/src/cxa_demangle.cpp \
34	$(LIBCXXABI_DIR)/src/cxa_exception_storage.cpp \
35	$(LIBCXXABI_DIR)/src/cxa_guard.cpp \
36	$(LIBCXXABI_DIR)/src/cxa_handlers.cpp \
37	$(LIBCXXABI_DIR)/src/cxa_unexpected.cpp \
38	$(LIBCXXABI_DIR)/src/cxa_vector.cpp \
39	$(LIBCXXABI_DIR)/src/cxa_virtual.cpp \
40	$(LIBCXXABI_DIR)/src/stdlib_exception.cpp \
41	$(LIBCXXABI_DIR)/src/stdlib_stdexcept.cpp \
42	$(LIBCXXABI_DIR)/src/stdlib_typeinfo.cpp \
43	$(LIBCXXABI_DIR)/src/abort_message.cpp \
44	$(LIBCXXABI_DIR)/src/fallback_malloc.cpp \
45
46# Exceptions disabled
47MODULE_SRCS += \
48        $(LIBCXXABI_DIR)/src/cxa_noexception.cpp \
49
50# Files that do not compile without exceptions
51# $(LIBCXXABI_DIR)/src/cxa_exception.cpp \
52# $(LIBCXXABI_DIR)/src/cxa_personality.cpp \
53
54# Files that do not compile without RTTI
55# $(LIBCXXABI_DIR)/src/private_typeinfo.cpp \
56
57MODULE_LIBRARY_DEPS := \
58	trusty/user/base/lib/libstdc++-trusty
59
60include make/library.mk
61