blob: b4a6cbad097434b5165f728da1354191347eac3c [file] [log] [blame]
Christopher Ferris723cf9b2017-01-19 20:08:48 -08001//
2// Copyright (C) 2017 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
17cc_defaults {
18 name: "libunwindstack_flags",
19
20 host_supported: true,
21
22 cflags: [
23 "-Wall",
24 "-Werror",
25 "-Wextra",
26 ],
Christopher Ferris01d50372017-01-30 13:45:16 -080027
28 target: {
29 darwin: {
30 enabled: false,
31 },
32 },
Christopher Ferris723cf9b2017-01-19 20:08:48 -080033}
34
Christopher Ferrisf6d54312017-07-11 15:29:32 -070035cc_library {
36 name: "libunwindstack",
Christopher Ferris6f3981c2017-07-27 09:29:18 -070037 vendor_available: true,
Justin Yun73bd4f02017-08-04 17:33:54 +090038 vndk: {
39 enabled: true,
40 support_system_process: true,
41 },
Christopher Ferris723cf9b2017-01-19 20:08:48 -080042 defaults: ["libunwindstack_flags"],
Christopher Ferrisd226a512017-07-14 10:37:19 -070043 export_include_dirs: ["include"],
Christopher Ferris723cf9b2017-01-19 20:08:48 -080044
45 srcs: [
46 "ArmExidx.cpp",
Christopher Ferris8642fcb2017-04-24 11:14:39 -070047 "DwarfCfa.cpp",
Christopher Ferris61d40972017-06-12 19:14:20 -070048 "DwarfDebugFrame.cpp",
49 "DwarfEhFrame.cpp",
Christopher Ferris72a6fa62017-03-21 12:41:17 -070050 "DwarfMemory.cpp",
Christopher Ferris55d22ef2017-04-04 10:41:31 -070051 "DwarfOp.cpp",
Christopher Ferris53a3c9b2017-05-10 18:34:15 -070052 "DwarfSection.cpp",
Christopher Ferris3958f802017-02-01 15:44:40 -080053 "Elf.cpp",
54 "ElfInterface.cpp",
55 "ElfInterfaceArm.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -080056 "Log.cpp",
Christopher Ferris0d7cf3e2017-04-19 15:42:19 -070057 "MapInfo.cpp",
Christopher Ferris09385e72017-04-05 13:25:04 -070058 "Maps.cpp",
Christopher Ferris3958f802017-02-01 15:44:40 -080059 "Memory.cpp",
Christopher Ferrisbae69f12017-06-28 14:51:54 -070060 "Regs.cpp",
Christopher Ferrise7ba4cc2017-04-04 14:06:58 -070061 "Symbols.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -080062 ],
63
Christopher Ferris2a25c4a2017-07-07 16:35:48 -070064 arch: {
65 x86: {
66 srcs: ["AsmGetRegsX86.S"],
67 },
68 x86_64: {
69 srcs: ["AsmGetRegsX86_64.S"],
70 },
71 },
72
Christopher Ferris723cf9b2017-01-19 20:08:48 -080073 shared_libs: [
74 "libbase",
75 "liblog",
Christopher Ferrisbae69f12017-06-28 14:51:54 -070076 "liblzma",
Christopher Ferris723cf9b2017-01-19 20:08:48 -080077 ],
78}
79
Christopher Ferris723cf9b2017-01-19 20:08:48 -080080//-------------------------------------------------------------------------
81// Unit Tests
82//-------------------------------------------------------------------------
Christopher Ferrisf6d54312017-07-11 15:29:32 -070083cc_test {
84 name: "libunwindstack_test",
Christopher Ferris723cf9b2017-01-19 20:08:48 -080085 defaults: ["libunwindstack_flags"],
86
87 srcs: [
88 "tests/ArmExidxDecodeTest.cpp",
89 "tests/ArmExidxExtractTest.cpp",
Christopher Ferris8642fcb2017-04-24 11:14:39 -070090 "tests/DwarfCfaLogTest.cpp",
91 "tests/DwarfCfaTest.cpp",
Christopher Ferris61d40972017-06-12 19:14:20 -070092 "tests/DwarfDebugFrameTest.cpp",
93 "tests/DwarfEhFrameTest.cpp",
Christopher Ferris72a6fa62017-03-21 12:41:17 -070094 "tests/DwarfMemoryTest.cpp",
Christopher Ferris55d22ef2017-04-04 10:41:31 -070095 "tests/DwarfOpLogTest.cpp",
96 "tests/DwarfOpTest.cpp",
Christopher Ferris53a3c9b2017-05-10 18:34:15 -070097 "tests/DwarfSectionTest.cpp",
98 "tests/DwarfSectionImplTest.cpp",
Christopher Ferris3958f802017-02-01 15:44:40 -080099 "tests/ElfInterfaceArmTest.cpp",
100 "tests/ElfInterfaceTest.cpp",
101 "tests/ElfTest.cpp",
Christopher Ferris570b76f2017-06-30 17:18:16 -0700102 "tests/ElfTestUtils.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800103 "tests/LogFake.cpp",
Christopher Ferris570b76f2017-06-30 17:18:16 -0700104 "tests/MapInfoCreateMemoryTest.cpp",
105 "tests/MapInfoGetElfTest.cpp",
Christopher Ferris09385e72017-04-05 13:25:04 -0700106 "tests/MapsTest.cpp",
Christopher Ferrisf6d54312017-07-11 15:29:32 -0700107 "tests/MemoryBufferTest.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800108 "tests/MemoryFake.cpp",
109 "tests/MemoryFileTest.cpp",
110 "tests/MemoryLocalTest.cpp",
111 "tests/MemoryRangeTest.cpp",
112 "tests/MemoryRemoteTest.cpp",
Christopher Ferris9744fb22017-07-07 12:18:16 -0700113 "tests/MemoryTest.cpp",
Christopher Ferriseb4a6db2017-07-19 12:37:45 -0700114 "tests/RegsStepIfSignalHandlerTest.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800115 "tests/RegsTest.cpp",
Christopher Ferrise7ba4cc2017-04-04 14:06:58 -0700116 "tests/SymbolsTest.cpp",
Christopher Ferris2a25c4a2017-07-07 16:35:48 -0700117 "tests/UnwindTest.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800118 ],
119
120 cflags: [
121 "-O0",
122 "-g",
123 ],
124
125 shared_libs: [
126 "libbase",
127 "liblog",
Christopher Ferrisbae69f12017-06-28 14:51:54 -0700128 "liblzma",
Christopher Ferrisf6d54312017-07-11 15:29:32 -0700129 "libunwindstack",
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800130 ],
131
Christopher Ferris53a3c9b2017-05-10 18:34:15 -0700132 static_libs: [
133 "libgmock",
134 ],
135
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800136 target: {
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800137 linux: {
138 host_ldlibs: [
139 "-lrt",
140 ],
141 },
142 },
Christopher Ferrisbae69f12017-06-28 14:51:54 -0700143
144 data: [
Christopher Ferris570b76f2017-06-30 17:18:16 -0700145 "tests/files/elf32.xz",
146 "tests/files/elf64.xz",
Christopher Ferrisbae69f12017-06-28 14:51:54 -0700147 ],
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800148}
149
Christopher Ferris3958f802017-02-01 15:44:40 -0800150//-------------------------------------------------------------------------
Christopher Ferrisb5d7a872017-07-12 15:40:52 -0700151// Tools
Christopher Ferris3958f802017-02-01 15:44:40 -0800152//-------------------------------------------------------------------------
153cc_defaults {
Christopher Ferrisb5d7a872017-07-12 15:40:52 -0700154 name: "libunwindstack_tools",
Christopher Ferris3958f802017-02-01 15:44:40 -0800155 defaults: ["libunwindstack_flags"],
156
157 shared_libs: [
158 "libunwindstack",
159 "libbase",
Christopher Ferrisbae69f12017-06-28 14:51:54 -0700160 "liblzma",
Christopher Ferris3958f802017-02-01 15:44:40 -0800161 ],
Christopher Ferrisb5d7a872017-07-12 15:40:52 -0700162}
Christopher Ferris3958f802017-02-01 15:44:40 -0800163
Christopher Ferrisb5d7a872017-07-12 15:40:52 -0700164cc_binary {
165 name: "unwind",
166 defaults: ["libunwindstack_tools"],
167
168 srcs: [
169 "tools/unwind.cpp",
Christopher Ferris3958f802017-02-01 15:44:40 -0800170 ],
Christopher Ferrisb5d7a872017-07-12 15:40:52 -0700171
172 target: {
173 linux: {
174 host_ldlibs: [
175 "-lrt",
176 ],
177 },
178 },
Christopher Ferris3958f802017-02-01 15:44:40 -0800179}
180
181cc_binary {
182 name: "unwind_info",
Christopher Ferrisb5d7a872017-07-12 15:40:52 -0700183 defaults: ["libunwindstack_tools"],
Christopher Ferris3958f802017-02-01 15:44:40 -0800184
185 srcs: [
Christopher Ferrisb5d7a872017-07-12 15:40:52 -0700186 "tools/unwind_info.cpp",
187 ],
188}
189
190cc_binary {
191 name: "unwind_symbols",
192 defaults: ["libunwindstack_tools"],
193
194 srcs: [
195 "tools/unwind_symbols.cpp",
Christopher Ferris3958f802017-02-01 15:44:40 -0800196 ],
197}
Christopher Ferrisbae69f12017-06-28 14:51:54 -0700198
199// Generates the elf data for use in the tests for .gnu_debugdata frames.
200// Once these files are generated, use the xz command to compress the data.
201cc_binary_host {
202 name: "gen_gnudebugdata",
Christopher Ferrisf6d54312017-07-11 15:29:32 -0700203 defaults: ["libunwindstack_flags"],
Christopher Ferrisbae69f12017-06-28 14:51:54 -0700204
205 srcs: [
206 "tests/GenGnuDebugdata.cpp",
207 ],
208}