2024-01-06 08:04:30 +00:00
|
|
|
#-*-mode:makefile-gmake;indent-tabs-mode:t;tab-width:8;coding:utf-8-*-┐
|
|
|
|
#── vi: set noet ft=make ts=8 sw=8 fenc=utf-8 :vi ────────────────────┘
|
|
|
|
|
|
|
|
PKGS += THIRD_PARTY_LIBUNWIND
|
|
|
|
|
|
|
|
THIRD_PARTY_LIBUNWIND_ARTIFACTS += THIRD_PARTY_LIBUNWIND_A
|
|
|
|
THIRD_PARTY_LIBUNWIND = $(THIRD_PARTY_LIBUNWIND_A_DEPS) $(THIRD_PARTY_LIBUNWIND_A)
|
|
|
|
THIRD_PARTY_LIBUNWIND_A = o/$(MODE)/third_party/libunwind/libunwind.a
|
|
|
|
|
|
|
|
THIRD_PARTY_LIBUNWIND_A_INCS = \
|
|
|
|
third_party/libunwind/include/unwind_arm_ehabi.h \
|
|
|
|
third_party/libunwind/include/unwind_itanium.h \
|
|
|
|
third_party/libunwind/AddressSpace.hpp \
|
|
|
|
third_party/libunwind/FrameHeaderCache.hpp \
|
|
|
|
third_party/libunwind/RWMutex.hpp \
|
|
|
|
third_party/libunwind/UnwindCursor.hpp
|
|
|
|
|
|
|
|
THIRD_PARTY_LIBUNWIND_A_HDRS = \
|
|
|
|
third_party/libunwind/include/mach-o/compact_unwind_encoding.h \
|
|
|
|
third_party/libunwind/include/__libunwind_config.h \
|
|
|
|
third_party/libunwind/include/libunwind.h \
|
|
|
|
third_party/libunwind/include/unwind.h \
|
2024-08-31 03:12:26 +00:00
|
|
|
third_party/libunwind/assembly.h \
|
2024-01-06 08:04:30 +00:00
|
|
|
third_party/libunwind/config.h \
|
|
|
|
third_party/libunwind/cet_unwind.h \
|
|
|
|
third_party/libunwind/dwarf2.h \
|
|
|
|
third_party/libunwind/libunwind_ext.h \
|
|
|
|
third_party/libunwind/CompactUnwinder.hpp \
|
|
|
|
third_party/libunwind/DwarfInstructions.hpp \
|
|
|
|
third_party/libunwind/DwarfParser.hpp \
|
|
|
|
third_party/libunwind/EHHeaderParser.hpp \
|
|
|
|
third_party/libunwind/Registers.hpp \
|
|
|
|
third_party/libunwind/Unwind-EHABI.h
|
|
|
|
|
|
|
|
THIRD_PARTY_LIBUNWIND_A_SRCS_CC = \
|
|
|
|
third_party/libunwind/libunwind.cc
|
|
|
|
|
|
|
|
THIRD_PARTY_LIBUNWIND_A_SRCS_C = \
|
|
|
|
third_party/libunwind/UnwindLevel1-gcc-ext.c \
|
2024-01-29 23:45:10 +00:00
|
|
|
third_party/libunwind/UnwindLevel1.c \
|
|
|
|
third_party/libunwind/gcc_personality_v0.c
|
2024-01-06 08:04:30 +00:00
|
|
|
|
2024-08-31 03:12:26 +00:00
|
|
|
THIRD_PARTY_LIBUNWIND_A_SRCS_S = \
|
|
|
|
third_party/libunwind/UnwindRegistersRestore.S \
|
|
|
|
third_party/libunwind/UnwindRegistersSave.S \
|
|
|
|
|
2024-01-06 08:04:30 +00:00
|
|
|
THIRD_PARTY_LIBUNWIND_A_SRCS = \
|
|
|
|
$(THIRD_PARTY_LIBUNWIND_A_SRCS_C) \
|
2024-08-31 03:12:26 +00:00
|
|
|
$(THIRD_PARTY_LIBUNWIND_A_SRCS_CC) \
|
|
|
|
$(THIRD_PARTY_LIBUNWIND_A_SRCS_S) \
|
2024-01-06 08:04:30 +00:00
|
|
|
|
|
|
|
THIRD_PARTY_LIBUNWIND_A_OBJS = \
|
|
|
|
$(THIRD_PARTY_LIBUNWIND_A_SRCS_C:%.c=o/$(MODE)/%.o) \
|
2024-08-31 03:12:26 +00:00
|
|
|
$(THIRD_PARTY_LIBUNWIND_A_SRCS_CC:%.cc=o/$(MODE)/%.o) \
|
|
|
|
$(THIRD_PARTY_LIBUNWIND_A_SRCS_S:%.S=o/$(MODE)/%.o) \
|
2024-01-06 08:04:30 +00:00
|
|
|
|
|
|
|
THIRD_PARTY_LIBUNWIND_A_CHECKS = \
|
|
|
|
$(THIRD_PARTY_LIBUNWIND_A).pkg \
|
|
|
|
$(THIRD_PARTY_LIBUNWIND_A_HDRS:%=o/$(MODE)/%.okk)
|
|
|
|
|
|
|
|
THIRD_PARTY_LIBUNWIND_A_DIRECTDEPS = \
|
|
|
|
LIBC_CALLS \
|
|
|
|
LIBC_INTRIN \
|
2024-08-31 03:12:26 +00:00
|
|
|
LIBC_STDIO \
|
|
|
|
LIBC_MEM \
|
|
|
|
LIBC_THREAD \
|
2024-01-06 08:04:30 +00:00
|
|
|
|
|
|
|
THIRD_PARTY_LIBUNWIND_A_DEPS := \
|
|
|
|
$(call uniq,$(foreach x,$(THIRD_PARTY_LIBUNWIND_A_DIRECTDEPS),$($(x))))
|
|
|
|
|
|
|
|
$(THIRD_PARTY_LIBUNWIND_A): \
|
|
|
|
third_party/libunwind/ \
|
|
|
|
$(THIRD_PARTY_LIBUNWIND_A).pkg \
|
|
|
|
$(THIRD_PARTY_LIBUNWIND_A_OBJS)
|
|
|
|
|
|
|
|
$(THIRD_PARTY_LIBUNWIND_A).pkg: \
|
|
|
|
$(THIRD_PARTY_LIBUNWIND_A_OBJS) \
|
|
|
|
$(foreach x,$(THIRD_PARTY_LIBUNWIND_A_DIRECTDEPS),$($(x)_A).pkg)
|
|
|
|
|
2024-01-29 05:57:40 +00:00
|
|
|
$(THIRD_PARTY_LIBUNWIND_A_OBJS): private \
|
2024-06-05 08:31:21 +00:00
|
|
|
COPTS += \
|
2024-01-29 23:45:10 +00:00
|
|
|
-fexceptions \
|
2024-01-29 05:57:40 +00:00
|
|
|
-fno-sanitize=all \
|
2024-01-06 08:04:30 +00:00
|
|
|
-ffunction-sections \
|
|
|
|
-fdata-sections \
|
2024-08-31 03:12:26 +00:00
|
|
|
-D_LIBUNWIND_USE_DLADDR=0 \
|
|
|
|
-D_LIBUNWIND_IS_BAREMETAL=1 \
|
|
|
|
|
|
|
|
# avoid cyclic dependency on libcxxabi
|
|
|
|
o/$(MODE)/third_party/libunwind/libunwind.o: \
|
|
|
|
COPTS += \
|
|
|
|
-fno-rtti \
|
|
|
|
|
|
|
|
o/$(MODE)/third_party/libunwind/UnwindRegistersRestore.o: third_party/libunwind/UnwindRegistersRestore.S
|
|
|
|
@$(COMPILE) -AOBJECTIFY.S $(OBJECTIFY.S) $(OUTPUT_OPTION) -c $<
|
|
|
|
o/$(MODE)/third_party/libunwind/UnwindRegistersSave.o: third_party/libunwind/UnwindRegistersSave.S
|
|
|
|
@$(COMPILE) -AOBJECTIFY.S $(OBJECTIFY.S) $(OUTPUT_OPTION) -c $<
|
|
|
|
|
|
|
|
$(THIRD_PARTY_LIBUNWIND_A_OBJS): third_party/libunwind/BUILD.mk
|
2024-01-06 08:04:30 +00:00
|
|
|
|
|
|
|
THIRD_PARTY_LIBUNWIND_LIBS = $(foreach x,$(THIRD_PARTY_LIBUNWIND_ARTIFACTS),$($(x)))
|
|
|
|
THIRD_PARTY_LIBUNWIND_SRCS = $(foreach x,$(THIRD_PARTY_LIBUNWIND_ARTIFACTS),$($(x)_SRCS))
|
|
|
|
THIRD_PARTY_LIBUNWIND_HDRS = $(foreach x,$(THIRD_PARTY_LIBUNWIND_ARTIFACTS),$($(x)_HDRS))
|
|
|
|
THIRD_PARTY_LIBUNWIND_INCS = $(foreach x,$(THIRD_PARTY_LIBUNWIND_ARTIFACTS),$($(x)_INCS))
|
|
|
|
THIRD_PARTY_LIBUNWIND_CHECKS = $(foreach x,$(THIRD_PARTY_LIBUNWIND_ARTIFACTS),$($(x)_CHECKS))
|
|
|
|
THIRD_PARTY_LIBUNWIND_OBJS = $(foreach x,$(THIRD_PARTY_LIBUNWIND_ARTIFACTS),$($(x)_OBJS))
|
|
|
|
|
|
|
|
.PHONY: o/$(MODE)/third_party/libunwind
|
|
|
|
o/$(MODE)/third_party/libunwind: \
|
|
|
|
$(THIRD_PARTY_LIBUNWIND_CHECKS) \
|
|
|
|
$(THIRD_PARTY_LIBUNWIND_A)
|