blob: 27221af138915ac5a69fee3813161e38bcf37f16 [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
34 multilib: {
35 lib32: {
36 suffix: "32",
37 },
38 lib64: {
39 suffix: "64",
40 },
41 },
Christopher Ferris723cf9b2017-01-19 20:08:48 -080042}
43
44cc_defaults {
45 name: "libunwindstack_common",
46 defaults: ["libunwindstack_flags"],
47
48 srcs: [
49 "ArmExidx.cpp",
Christopher Ferris8642fcb2017-04-24 11:14:39 -070050 "DwarfCfa.cpp",
Christopher Ferris61d40972017-06-12 19:14:20 -070051 "DwarfDebugFrame.cpp",
52 "DwarfEhFrame.cpp",
Christopher Ferris72a6fa62017-03-21 12:41:17 -070053 "DwarfMemory.cpp",
Christopher Ferris55d22ef2017-04-04 10:41:31 -070054 "DwarfOp.cpp",
Christopher Ferris53a3c9b2017-05-10 18:34:15 -070055 "DwarfSection.cpp",
Christopher Ferris3958f802017-02-01 15:44:40 -080056 "Elf.cpp",
57 "ElfInterface.cpp",
58 "ElfInterfaceArm.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -080059 "Log.cpp",
Christopher Ferris0d7cf3e2017-04-19 15:42:19 -070060 "MapInfo.cpp",
Christopher Ferris09385e72017-04-05 13:25:04 -070061 "Maps.cpp",
Christopher Ferris3958f802017-02-01 15:44:40 -080062 "Memory.cpp",
Christopher Ferrisbae69f12017-06-28 14:51:54 -070063 "Regs.cpp",
Christopher Ferrise7ba4cc2017-04-04 14:06:58 -070064 "Symbols.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -080065 ],
66
Christopher Ferris2a25c4a2017-07-07 16:35:48 -070067 arch: {
68 x86: {
69 srcs: ["AsmGetRegsX86.S"],
70 },
71 x86_64: {
72 srcs: ["AsmGetRegsX86_64.S"],
73 },
74 },
75
Christopher Ferris723cf9b2017-01-19 20:08:48 -080076 shared_libs: [
77 "libbase",
78 "liblog",
Christopher Ferrisbae69f12017-06-28 14:51:54 -070079 "liblzma",
Christopher Ferris723cf9b2017-01-19 20:08:48 -080080 ],
81}
82
83cc_library {
84 name: "libunwindstack",
85 defaults: ["libunwindstack_common"],
86}
87
Christopher Ferris723cf9b2017-01-19 20:08:48 -080088//-------------------------------------------------------------------------
89// Unit Tests
90//-------------------------------------------------------------------------
91cc_defaults {
92 name: "libunwindstack_test_common",
93 defaults: ["libunwindstack_flags"],
94
95 srcs: [
96 "tests/ArmExidxDecodeTest.cpp",
97 "tests/ArmExidxExtractTest.cpp",
Christopher Ferris8642fcb2017-04-24 11:14:39 -070098 "tests/DwarfCfaLogTest.cpp",
99 "tests/DwarfCfaTest.cpp",
Christopher Ferris61d40972017-06-12 19:14:20 -0700100 "tests/DwarfDebugFrameTest.cpp",
101 "tests/DwarfEhFrameTest.cpp",
Christopher Ferris72a6fa62017-03-21 12:41:17 -0700102 "tests/DwarfMemoryTest.cpp",
Christopher Ferris55d22ef2017-04-04 10:41:31 -0700103 "tests/DwarfOpLogTest.cpp",
104 "tests/DwarfOpTest.cpp",
Christopher Ferris53a3c9b2017-05-10 18:34:15 -0700105 "tests/DwarfSectionTest.cpp",
106 "tests/DwarfSectionImplTest.cpp",
Christopher Ferris3958f802017-02-01 15:44:40 -0800107 "tests/ElfInterfaceArmTest.cpp",
108 "tests/ElfInterfaceTest.cpp",
109 "tests/ElfTest.cpp",
Christopher Ferris570b76f2017-06-30 17:18:16 -0700110 "tests/ElfTestUtils.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800111 "tests/LogFake.cpp",
Christopher Ferris570b76f2017-06-30 17:18:16 -0700112 "tests/MapInfoCreateMemoryTest.cpp",
113 "tests/MapInfoGetElfTest.cpp",
Christopher Ferris09385e72017-04-05 13:25:04 -0700114 "tests/MapsTest.cpp",
Christopher Ferris9744fb22017-07-07 12:18:16 -0700115 "tests/MemoryBuffer.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800116 "tests/MemoryFake.cpp",
117 "tests/MemoryFileTest.cpp",
118 "tests/MemoryLocalTest.cpp",
119 "tests/MemoryRangeTest.cpp",
120 "tests/MemoryRemoteTest.cpp",
Christopher Ferris9744fb22017-07-07 12:18:16 -0700121 "tests/MemoryTest.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800122 "tests/RegsTest.cpp",
Christopher Ferrise7ba4cc2017-04-04 14:06:58 -0700123 "tests/SymbolsTest.cpp",
Christopher Ferris2a25c4a2017-07-07 16:35:48 -0700124 "tests/UnwindTest.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800125 ],
126
127 cflags: [
128 "-O0",
129 "-g",
130 ],
131
132 shared_libs: [
133 "libbase",
134 "liblog",
Christopher Ferrisbae69f12017-06-28 14:51:54 -0700135 "liblzma",
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800136 ],
137
Christopher Ferris53a3c9b2017-05-10 18:34:15 -0700138 static_libs: [
139 "libgmock",
140 ],
141
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800142 target: {
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800143 linux: {
144 host_ldlibs: [
145 "-lrt",
146 ],
147 },
148 },
149}
150
151// These unit tests run against the shared library.
152cc_test {
153 name: "libunwindstack_test",
154 defaults: ["libunwindstack_test_common"],
155
156 shared_libs: [
157 "libunwindstack",
158 ],
Christopher Ferrisbae69f12017-06-28 14:51:54 -0700159
160 data: [
Christopher Ferris570b76f2017-06-30 17:18:16 -0700161 "tests/files/elf32.xz",
162 "tests/files/elf64.xz",
Christopher Ferrisbae69f12017-06-28 14:51:54 -0700163 ],
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800164}
165
Christopher Ferris3958f802017-02-01 15:44:40 -0800166//-------------------------------------------------------------------------
167// Utility Executables
168//-------------------------------------------------------------------------
169cc_defaults {
170 name: "libunwindstack_executables",
171 defaults: ["libunwindstack_flags"],
172
173 shared_libs: [
174 "libunwindstack",
175 "libbase",
Christopher Ferrisbae69f12017-06-28 14:51:54 -0700176 "liblzma",
Christopher Ferris3958f802017-02-01 15:44:40 -0800177 ],
178
179 static_libs: [
180 "liblog",
181 ],
182
183 compile_multilib: "both",
184}
185
186cc_binary {
187 name: "unwind_info",
188 defaults: ["libunwindstack_executables"],
189
190 srcs: [
191 "unwind_info.cpp",
192 ],
193}
Christopher Ferrisbae69f12017-06-28 14:51:54 -0700194
195// Generates the elf data for use in the tests for .gnu_debugdata frames.
196// Once these files are generated, use the xz command to compress the data.
197cc_binary_host {
198 name: "gen_gnudebugdata",
199
200 cflags: [
201 "-Wall",
202 "-Werror",
203 "-Wextra",
204 ],
205
206 srcs: [
207 "tests/GenGnuDebugdata.cpp",
208 ],
Christopher Ferrisbfd62922017-06-28 20:44:48 -0700209
210 target: {
211 darwin: {
212 enabled: false,
213 },
214 },
Christopher Ferrisbae69f12017-06-28 14:51:54 -0700215}