• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2013 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#      http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15LOCAL_PATH := $(call my-dir)
16
17LIBDWFL_SRC_FILES := \
18    core-file.c \
19    cu.c \
20    derelocate.c \
21    dwfl_addrdie.c \
22    dwfl_addrdwarf.c \
23    dwfl_addrmodule.c \
24    dwfl_begin.c \
25    dwfl_build_id_find_debuginfo.c \
26    dwfl_build_id_find_elf.c \
27    dwfl_cumodule.c \
28    dwfl_dwarf_line.c \
29    dwfl_end.c \
30    dwfl_error.c \
31    dwfl_frame.c \
32    dwfl_frame_pc.c \
33    dwfl_frame_regs.c \
34    dwfl_getdwarf.c \
35    dwfl_getmodules.c \
36    dwfl_getsrc.c \
37    dwfl_getsrclines.c \
38    dwfl_line_comp_dir.c \
39    dwfl_linecu.c \
40    dwfl_lineinfo.c \
41    dwfl_linemodule.c \
42    dwfl_module_addrdie.c \
43    dwfl_module_addrname.c \
44    dwfl_module_addrsym.c \
45    dwfl_module_build_id.c \
46    dwfl_module.c \
47    dwfl_module_dwarf_cfi.c \
48    dwfl_module_eh_cfi.c \
49    dwfl_module_getdwarf.c \
50    dwfl_module_getelf.c \
51    dwfl_module_getsrc.c \
52    dwfl_module_getsrc_file.c \
53    dwfl_module_getsym.c \
54    dwfl_module_info.c \
55    dwfl_module_nextcu.c \
56    dwfl_module_register_names.c \
57    dwfl_module_report_build_id.c \
58    dwfl_module_return_value_location.c \
59    dwfl_nextcu.c \
60    dwfl_onesrcline.c \
61    dwfl_report_elf.c \
62    dwfl_segment_report_module.c \
63    dwfl_validate_address.c \
64    dwfl_version.c \
65    elf-from-memory.c \
66    find-debuginfo.c \
67    frame_unwind.c \
68    gzip.c \
69    image-header.c \
70    libdwfl_crc32.c \
71    libdwfl_crc32_file.c \
72    lines.c \
73    link_map.c \
74    linux-core-attach.c \
75    linux-kernel-modules.c \
76    linux-pid-attach.c \
77    linux-proc-maps.c \
78    offline.c \
79    open.c \
80    relocate.c \
81    segment.c \
82
83
84ifeq ($(HOST_OS),linux)
85
86#
87# host libdwfl
88#
89
90include $(CLEAR_VARS)
91
92# Clang has no nested functions.
93LOCAL_CLANG := false
94
95LOCAL_SRC_FILES := $(LIBDWFL_SRC_FILES)
96
97LOCAL_C_INCLUDES := \
98	$(LOCAL_PATH)/.. \
99	$(LOCAL_PATH)/../lib \
100	$(LOCAL_PATH)/../libdwelf \
101	$(LOCAL_PATH)/../libdwfl \
102	$(LOCAL_PATH)/../libebl \
103	$(LOCAL_PATH)/../libdw \
104	$(LOCAL_PATH)/../libelf
105
106LOCAL_CFLAGS += -DHAVE_CONFIG_H -std=gnu99 -D_GNU_SOURCE
107
108# to suppress the "pointer of type ‘void *’ used in arithmetic" warning
109LOCAL_CFLAGS += -Wno-pointer-arith
110
111# Asserts are not compiled, so some debug variables appear unused. Rather than
112# fix, we prefer to turn off the warning locally.
113LOCAL_CFLAGS += -Wno-unused-but-set-variable
114
115# Similar to the above. To stay in line with upstream, ignore the warning.
116LOCAL_CFLAGS += -Wno-unused-variable
117
118LOCAL_MODULE:= libdwfl
119
120LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
121
122LOCAL_STATIC_LIBRARIES := libz
123
124include $(BUILD_HOST_STATIC_LIBRARY)
125
126endif # linux
127
128#
129# target libdwfl
130#
131
132include $(CLEAR_VARS)
133
134# Clang has no nested functions.
135LOCAL_CLANG := false
136
137# b/25642296, local __thread variable does not work with arm64 clang/llvm.
138LOCAL_CLANG_arm64 := false
139
140LOCAL_SRC_FILES := $(LIBDWFL_SRC_FILES)
141
142LOCAL_C_INCLUDES := \
143	$(LOCAL_PATH)/.. \
144	$(LOCAL_PATH)/../lib \
145	$(LOCAL_PATH)/../libdwelf \
146	$(LOCAL_PATH)/../libdwfl \
147	$(LOCAL_PATH)/../libebl \
148	$(LOCAL_PATH)/../libdw \
149	$(LOCAL_PATH)/../libelf
150
151LOCAL_C_INCLUDES += $(LOCAL_PATH)/../bionic-fixup
152
153LOCAL_CFLAGS += -include $(LOCAL_PATH)/../bionic-fixup/AndroidFixup.h
154
155LOCAL_CFLAGS += -DHAVE_CONFIG_H -std=gnu99 -D_GNU_SOURCE -Werror
156
157# to suppress the "pointer of type ‘void *’ used in arithmetic" warning
158LOCAL_CFLAGS += -Wno-pointer-arith
159
160# See above.
161LOCAL_CFLAGS += -Wno-unused-but-set-variable
162LOCAL_CFLAGS += -Wno-unused-variable
163
164LOCAL_MODULE:= libdwfl
165
166LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
167
168LOCAL_STATIC_LIBRARIES := libz
169
170include $(BUILD_STATIC_LIBRARY)
171