blob: a5af0a06a5d0572a7ea6ca34574ca9b28f29d3c1 [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 Ferris3958f802017-02-01 15:44:40 -080033
Christopher Ferris3517fe02017-07-11 15:06:19 -070034 arch: {
35 mips: {
36 enabled: false,
37 },
38 mips64: {
39 enabled: false,
40 },
41 },
42
Christopher Ferris3958f802017-02-01 15:44:40 -080043 multilib: {
44 lib32: {
45 suffix: "32",
46 },
47 lib64: {
48 suffix: "64",
49 },
50 },
Christopher Ferris723cf9b2017-01-19 20:08:48 -080051}
52
53cc_defaults {
54 name: "libunwindstack_common",
55 defaults: ["libunwindstack_flags"],
56
57 srcs: [
58 "ArmExidx.cpp",
Christopher Ferris8642fcb2017-04-24 11:14:39 -070059 "DwarfCfa.cpp",
Christopher Ferris61d40972017-06-12 19:14:20 -070060 "DwarfDebugFrame.cpp",
61 "DwarfEhFrame.cpp",
Christopher Ferris72a6fa62017-03-21 12:41:17 -070062 "DwarfMemory.cpp",
Christopher Ferris55d22ef2017-04-04 10:41:31 -070063 "DwarfOp.cpp",
Christopher Ferris53a3c9b2017-05-10 18:34:15 -070064 "DwarfSection.cpp",
Christopher Ferris3958f802017-02-01 15:44:40 -080065 "Elf.cpp",
66 "ElfInterface.cpp",
67 "ElfInterfaceArm.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -080068 "Log.cpp",
Christopher Ferris0d7cf3e2017-04-19 15:42:19 -070069 "MapInfo.cpp",
Christopher Ferris09385e72017-04-05 13:25:04 -070070 "Maps.cpp",
Christopher Ferris3958f802017-02-01 15:44:40 -080071 "Memory.cpp",
Christopher Ferrisbae69f12017-06-28 14:51:54 -070072 "Regs.cpp",
Christopher Ferrise7ba4cc2017-04-04 14:06:58 -070073 "Symbols.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -080074 ],
75
Christopher Ferris2a25c4a2017-07-07 16:35:48 -070076 arch: {
77 x86: {
78 srcs: ["AsmGetRegsX86.S"],
79 },
80 x86_64: {
81 srcs: ["AsmGetRegsX86_64.S"],
82 },
83 },
84
Christopher Ferris723cf9b2017-01-19 20:08:48 -080085 shared_libs: [
86 "libbase",
87 "liblog",
Christopher Ferrisbae69f12017-06-28 14:51:54 -070088 "liblzma",
Christopher Ferris723cf9b2017-01-19 20:08:48 -080089 ],
90}
91
92cc_library {
93 name: "libunwindstack",
94 defaults: ["libunwindstack_common"],
95}
96
Christopher Ferris723cf9b2017-01-19 20:08:48 -080097//-------------------------------------------------------------------------
98// Unit Tests
99//-------------------------------------------------------------------------
100cc_defaults {
101 name: "libunwindstack_test_common",
102 defaults: ["libunwindstack_flags"],
103
104 srcs: [
105 "tests/ArmExidxDecodeTest.cpp",
106 "tests/ArmExidxExtractTest.cpp",
Christopher Ferris8642fcb2017-04-24 11:14:39 -0700107 "tests/DwarfCfaLogTest.cpp",
108 "tests/DwarfCfaTest.cpp",
Christopher Ferris61d40972017-06-12 19:14:20 -0700109 "tests/DwarfDebugFrameTest.cpp",
110 "tests/DwarfEhFrameTest.cpp",
Christopher Ferris72a6fa62017-03-21 12:41:17 -0700111 "tests/DwarfMemoryTest.cpp",
Christopher Ferris55d22ef2017-04-04 10:41:31 -0700112 "tests/DwarfOpLogTest.cpp",
113 "tests/DwarfOpTest.cpp",
Christopher Ferris53a3c9b2017-05-10 18:34:15 -0700114 "tests/DwarfSectionTest.cpp",
115 "tests/DwarfSectionImplTest.cpp",
Christopher Ferris3958f802017-02-01 15:44:40 -0800116 "tests/ElfInterfaceArmTest.cpp",
117 "tests/ElfInterfaceTest.cpp",
118 "tests/ElfTest.cpp",
Christopher Ferris570b76f2017-06-30 17:18:16 -0700119 "tests/ElfTestUtils.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800120 "tests/LogFake.cpp",
Christopher Ferris570b76f2017-06-30 17:18:16 -0700121 "tests/MapInfoCreateMemoryTest.cpp",
122 "tests/MapInfoGetElfTest.cpp",
Christopher Ferris09385e72017-04-05 13:25:04 -0700123 "tests/MapsTest.cpp",
Christopher Ferris9744fb22017-07-07 12:18:16 -0700124 "tests/MemoryBuffer.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800125 "tests/MemoryFake.cpp",
126 "tests/MemoryFileTest.cpp",
127 "tests/MemoryLocalTest.cpp",
128 "tests/MemoryRangeTest.cpp",
129 "tests/MemoryRemoteTest.cpp",
Christopher Ferris9744fb22017-07-07 12:18:16 -0700130 "tests/MemoryTest.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800131 "tests/RegsTest.cpp",
Christopher Ferrise7ba4cc2017-04-04 14:06:58 -0700132 "tests/SymbolsTest.cpp",
Christopher Ferris2a25c4a2017-07-07 16:35:48 -0700133 "tests/UnwindTest.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800134 ],
135
136 cflags: [
137 "-O0",
138 "-g",
139 ],
140
141 shared_libs: [
142 "libbase",
143 "liblog",
Christopher Ferrisbae69f12017-06-28 14:51:54 -0700144 "liblzma",
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800145 ],
146
Christopher Ferris53a3c9b2017-05-10 18:34:15 -0700147 static_libs: [
148 "libgmock",
149 ],
150
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800151 target: {
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800152 linux: {
153 host_ldlibs: [
154 "-lrt",
155 ],
156 },
157 },
158}
159
160// These unit tests run against the shared library.
161cc_test {
162 name: "libunwindstack_test",
163 defaults: ["libunwindstack_test_common"],
164
165 shared_libs: [
166 "libunwindstack",
167 ],
Christopher Ferrisbae69f12017-06-28 14:51:54 -0700168
169 data: [
Christopher Ferris570b76f2017-06-30 17:18:16 -0700170 "tests/files/elf32.xz",
171 "tests/files/elf64.xz",
Christopher Ferrisbae69f12017-06-28 14:51:54 -0700172 ],
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800173}
174
Christopher Ferris3958f802017-02-01 15:44:40 -0800175//-------------------------------------------------------------------------
176// Utility Executables
177//-------------------------------------------------------------------------
178cc_defaults {
179 name: "libunwindstack_executables",
180 defaults: ["libunwindstack_flags"],
181
182 shared_libs: [
183 "libunwindstack",
184 "libbase",
Christopher Ferrisbae69f12017-06-28 14:51:54 -0700185 "liblzma",
Christopher Ferris3958f802017-02-01 15:44:40 -0800186 ],
187
188 static_libs: [
189 "liblog",
190 ],
191
192 compile_multilib: "both",
193}
194
195cc_binary {
196 name: "unwind_info",
197 defaults: ["libunwindstack_executables"],
198
199 srcs: [
200 "unwind_info.cpp",
201 ],
202}
Christopher Ferrisbae69f12017-06-28 14:51:54 -0700203
204// Generates the elf data for use in the tests for .gnu_debugdata frames.
205// Once these files are generated, use the xz command to compress the data.
206cc_binary_host {
207 name: "gen_gnudebugdata",
208
209 cflags: [
210 "-Wall",
211 "-Werror",
212 "-Wextra",
213 ],
214
215 srcs: [
216 "tests/GenGnuDebugdata.cpp",
217 ],
Christopher Ferrisbfd62922017-06-28 20:44:48 -0700218
219 target: {
220 darwin: {
221 enabled: false,
222 },
223 },
Christopher Ferrisbae69f12017-06-28 14:51:54 -0700224}