Christopher Ferris | 1c82a52 | 2013-10-01 12:38:42 -0700 | [diff] [blame] | 1 | LOCAL_PATH := $(call my-dir) |
| 2 | |
| 3 | libunwind_cflags := \ |
| 4 | -DHAVE_CONFIG_H \ |
| 5 | -DNDEBUG \ |
| 6 | -D_GNU_SOURCE \ |
Christopher Ferris | 9fc75e8 | 2014-01-26 21:39:06 -0800 | [diff] [blame^] | 7 | -Wno-unused-parameter \ |
| 8 | |
| 9 | ifeq ($(TARGET_ARCH),arm64) |
| 10 | LIBUNWIND_ARCH := aarch64 |
| 11 | else |
| 12 | LIBUNWIND_ARCH := $(TARGET_ARCH) |
| 13 | endif |
Christopher Ferris | 1c82a52 | 2013-10-01 12:38:42 -0700 | [diff] [blame] | 14 | |
| 15 | libunwind_includes := \ |
| 16 | $(LOCAL_PATH)/src \ |
| 17 | $(LOCAL_PATH)/include \ |
Christopher Ferris | 9fc75e8 | 2014-01-26 21:39:06 -0800 | [diff] [blame^] | 18 | $(LOCAL_PATH)/include/tdep-$(LIBUNWIND_ARCH) \ |
Christopher Ferris | 1c82a52 | 2013-10-01 12:38:42 -0700 | [diff] [blame] | 19 | |
| 20 | include $(CLEAR_VARS) |
| 21 | |
| 22 | LOCAL_MODULE := libunwind |
| 23 | |
| 24 | LOCAL_CFLAGS += $(libunwind_cflags) |
| 25 | LOCAL_C_INCLUDES := $(libunwind_includes) |
| 26 | |
| 27 | LOCAL_SRC_FILES := \ |
| 28 | src/mi/init.c \ |
| 29 | src/mi/flush_cache.c \ |
| 30 | src/mi/mempool.c \ |
| 31 | src/mi/strerror.c \ |
| 32 | src/mi/backtrace.c \ |
| 33 | src/mi/dyn-cancel.c \ |
| 34 | src/mi/dyn-info-list.c \ |
| 35 | src/mi/dyn-register.c \ |
Christopher Ferris | 16b95a6 | 2014-01-22 16:07:26 -0800 | [diff] [blame] | 36 | src/mi/maps.c \ |
Christopher Ferris | 1c82a52 | 2013-10-01 12:38:42 -0700 | [diff] [blame] | 37 | src/mi/Ldyn-extract.c \ |
| 38 | src/mi/Lfind_dynamic_proc_info.c \ |
| 39 | src/mi/Lget_proc_info_by_ip.c \ |
| 40 | src/mi/Lget_proc_name.c \ |
| 41 | src/mi/Lput_dynamic_unwind_info.c \ |
| 42 | src/mi/Ldestroy_addr_space.c \ |
| 43 | src/mi/Lget_reg.c \ |
| 44 | src/mi/Lset_reg.c \ |
| 45 | src/mi/Lget_fpreg.c \ |
| 46 | src/mi/Lset_fpreg.c \ |
| 47 | src/mi/Lset_caching_policy.c \ |
| 48 | src/mi/Gdyn-extract.c \ |
| 49 | src/mi/Gdyn-remote.c \ |
| 50 | src/mi/Gfind_dynamic_proc_info.c \ |
| 51 | src/mi/Gget_accessors.c \ |
| 52 | src/mi/Gget_proc_info_by_ip.c \ |
| 53 | src/mi/Gget_proc_name.c \ |
| 54 | src/mi/Gput_dynamic_unwind_info.c \ |
| 55 | src/mi/Gdestroy_addr_space.c \ |
| 56 | src/mi/Gget_reg.c \ |
| 57 | src/mi/Gset_reg.c \ |
| 58 | src/mi/Gget_fpreg.c \ |
| 59 | src/mi/Gset_fpreg.c \ |
| 60 | src/mi/Gset_caching_policy.c \ |
| 61 | src/dwarf/Lexpr.c \ |
| 62 | src/dwarf/Lfde.c \ |
| 63 | src/dwarf/Lparser.c \ |
| 64 | src/dwarf/Lpe.c \ |
| 65 | src/dwarf/Lstep.c \ |
| 66 | src/dwarf/Lfind_proc_info-lsb.c \ |
| 67 | src/dwarf/Lfind_unwind_table.c \ |
| 68 | src/dwarf/Gexpr.c \ |
| 69 | src/dwarf/Gfde.c \ |
| 70 | src/dwarf/Gfind_proc_info-lsb.c \ |
| 71 | src/dwarf/Gfind_unwind_table.c \ |
| 72 | src/dwarf/Gparser.c \ |
| 73 | src/dwarf/Gpe.c \ |
| 74 | src/dwarf/Gstep.c \ |
| 75 | src/dwarf/global.c \ |
Christopher Ferris | 1c82a52 | 2013-10-01 12:38:42 -0700 | [diff] [blame] | 76 | src/os-linux.c \ |
| 77 | |
Christopher Ferris | 9fc75e8 | 2014-01-26 21:39:06 -0800 | [diff] [blame^] | 78 | ifeq ($(TARGET_IS_64_BIT),true) |
Christopher Ferris | 1c82a52 | 2013-10-01 12:38:42 -0700 | [diff] [blame] | 79 | LOCAL_SRC_FILES += \ |
Christopher Ferris | 9fc75e8 | 2014-01-26 21:39:06 -0800 | [diff] [blame^] | 80 | src/elf64.c |
| 81 | else |
| 82 | LOCAL_SRC_FILES += \ |
| 83 | src/elf32.c |
| 84 | endif |
| 85 | |
| 86 | # Arch specific source files. |
| 87 | LOCAL_SRC_FILES += \ |
| 88 | src/$(LIBUNWIND_ARCH)/is_fpreg.c \ |
| 89 | src/$(LIBUNWIND_ARCH)/regname.c \ |
| 90 | src/$(LIBUNWIND_ARCH)/Gcreate_addr_space.c \ |
| 91 | src/$(LIBUNWIND_ARCH)/Gget_proc_info.c \ |
| 92 | src/$(LIBUNWIND_ARCH)/Gget_save_loc.c \ |
| 93 | src/$(LIBUNWIND_ARCH)/Gglobal.c \ |
| 94 | src/$(LIBUNWIND_ARCH)/Ginit.c \ |
| 95 | src/$(LIBUNWIND_ARCH)/Ginit_local.c \ |
| 96 | src/$(LIBUNWIND_ARCH)/Ginit_remote.c \ |
| 97 | src/$(LIBUNWIND_ARCH)/Gregs.c \ |
| 98 | src/$(LIBUNWIND_ARCH)/Gresume.c \ |
| 99 | src/$(LIBUNWIND_ARCH)/Gstep.c \ |
| 100 | src/$(LIBUNWIND_ARCH)/Lcreate_addr_space.c \ |
| 101 | src/$(LIBUNWIND_ARCH)/Lget_proc_info.c \ |
| 102 | src/$(LIBUNWIND_ARCH)/Lget_save_loc.c \ |
| 103 | src/$(LIBUNWIND_ARCH)/Lglobal.c \ |
| 104 | src/$(LIBUNWIND_ARCH)/Linit.c \ |
| 105 | src/$(LIBUNWIND_ARCH)/Linit_local.c \ |
| 106 | src/$(LIBUNWIND_ARCH)/Linit_remote.c \ |
| 107 | src/$(LIBUNWIND_ARCH)/Lregs.c \ |
| 108 | src/$(LIBUNWIND_ARCH)/Lresume.c \ |
| 109 | src/$(LIBUNWIND_ARCH)/Lstep.c \ |
| 110 | |
| 111 | ifeq ($(LIBUNWIND_ARCH),arm) |
| 112 | LOCAL_SRC_FILES += \ |
Christopher Ferris | 1c82a52 | 2013-10-01 12:38:42 -0700 | [diff] [blame] | 113 | src/arm/getcontext.S \ |
Christopher Ferris | 1c82a52 | 2013-10-01 12:38:42 -0700 | [diff] [blame] | 114 | src/arm/Gis_signal_frame.c \ |
Christopher Ferris | 1c82a52 | 2013-10-01 12:38:42 -0700 | [diff] [blame] | 115 | src/arm/Gex_tables.c \ |
Christopher Ferris | 1c82a52 | 2013-10-01 12:38:42 -0700 | [diff] [blame] | 116 | src/arm/Lis_signal_frame.c \ |
Christopher Ferris | 1c82a52 | 2013-10-01 12:38:42 -0700 | [diff] [blame] | 117 | src/arm/Lex_tables.c \ |
| 118 | |
| 119 | endif # arm |
| 120 | |
Christopher Ferris | 9fc75e8 | 2014-01-26 21:39:06 -0800 | [diff] [blame^] | 121 | ifeq ($(LIBUNWIND_ARCH),aarch64) |
Christopher Ferris | 1c82a52 | 2013-10-01 12:38:42 -0700 | [diff] [blame] | 122 | LOCAL_SRC_FILES += \ |
Christopher Ferris | 9fc75e8 | 2014-01-26 21:39:06 -0800 | [diff] [blame^] | 123 | src/aarch64/Gis_signal_frame.c \ |
| 124 | src/aarch64/Lis_signal_frame.c \ |
| 125 | |
| 126 | endif # arm64 |
| 127 | |
| 128 | ifeq ($(LIBUNWIND_ARCH),mips) |
| 129 | LOCAL_SRC_FILES += \ |
Christopher Ferris | 1c82a52 | 2013-10-01 12:38:42 -0700 | [diff] [blame] | 130 | src/mips/getcontext-android.S \ |
Christopher Ferris | 1c82a52 | 2013-10-01 12:38:42 -0700 | [diff] [blame] | 131 | src/mips/Gis_signal_frame.c \ |
Christopher Ferris | 1c82a52 | 2013-10-01 12:38:42 -0700 | [diff] [blame] | 132 | src/mips/Lis_signal_frame.c \ |
Christopher Ferris | 1c82a52 | 2013-10-01 12:38:42 -0700 | [diff] [blame] | 133 | |
| 134 | endif # mips |
| 135 | |
Christopher Ferris | 9fc75e8 | 2014-01-26 21:39:06 -0800 | [diff] [blame^] | 136 | ifeq ($(LIBUNWIND_ARCH),x86) |
Christopher Ferris | 1c82a52 | 2013-10-01 12:38:42 -0700 | [diff] [blame] | 137 | LOCAL_SRC_FILES += \ |
Christopher Ferris | 1c82a52 | 2013-10-01 12:38:42 -0700 | [diff] [blame] | 138 | src/x86/getcontext-linux.S \ |
Christopher Ferris | 1c82a52 | 2013-10-01 12:38:42 -0700 | [diff] [blame] | 139 | src/x86/Gos-linux.c \ |
Christopher Ferris | 1c82a52 | 2013-10-01 12:38:42 -0700 | [diff] [blame] | 140 | src/x86/Los-linux.c \ |
| 141 | |
| 142 | endif # x86 |
| 143 | |
| 144 | LOCAL_SHARED_LIBRARIES := \ |
| 145 | libdl \ |
| 146 | |
Christopher Ferris | 836d915 | 2013-12-02 12:27:30 -0800 | [diff] [blame] | 147 | LOCAL_ADDITIONAL_DEPENDENCIES := \ |
| 148 | $(LOCAL_PATH)/Android.mk \ |
| 149 | |
Christopher Ferris | 1c82a52 | 2013-10-01 12:38:42 -0700 | [diff] [blame] | 150 | include $(BUILD_SHARED_LIBRARY) |
| 151 | |
| 152 | include $(CLEAR_VARS) |
| 153 | |
| 154 | LOCAL_MODULE := libunwind-ptrace |
| 155 | |
| 156 | LOCAL_CFLAGS += $(libunwind_cflags) |
| 157 | LOCAL_C_INCLUDES := $(libunwind_includes) |
| 158 | |
| 159 | # Files needed to trace running processes. |
| 160 | LOCAL_SRC_FILES += \ |
| 161 | src/ptrace/_UPT_elf.c \ |
| 162 | src/ptrace/_UPT_accessors.c \ |
| 163 | src/ptrace/_UPT_access_fpreg.c \ |
| 164 | src/ptrace/_UPT_access_mem.c \ |
| 165 | src/ptrace/_UPT_access_reg.c \ |
| 166 | src/ptrace/_UPT_create.c \ |
| 167 | src/ptrace/_UPT_destroy.c \ |
| 168 | src/ptrace/_UPT_find_proc_info.c \ |
| 169 | src/ptrace/_UPT_get_dyn_info_list_addr.c \ |
| 170 | src/ptrace/_UPT_put_unwind_info.c \ |
| 171 | src/ptrace/_UPT_get_proc_name.c \ |
| 172 | src/ptrace/_UPT_reg_offset.c \ |
| 173 | src/ptrace/_UPT_resume.c \ |
| 174 | |
| 175 | LOCAL_SHARED_LIBRARIES := \ |
| 176 | libunwind \ |
| 177 | |
Christopher Ferris | 836d915 | 2013-12-02 12:27:30 -0800 | [diff] [blame] | 178 | LOCAL_ADDITIONAL_DEPENDENCIES := \ |
| 179 | $(LOCAL_PATH)/Android.mk \ |
| 180 | |
Christopher Ferris | 1c82a52 | 2013-10-01 12:38:42 -0700 | [diff] [blame] | 181 | include $(BUILD_SHARED_LIBRARY) |