blob: 5445f6ec90bf29dcf29c9cbd9badcaa964fbfc4d [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
67 shared_libs: [
68 "libbase",
69 "liblog",
Christopher Ferrisbae69f12017-06-28 14:51:54 -070070 "liblzma",
Christopher Ferris723cf9b2017-01-19 20:08:48 -080071 ],
72}
73
74cc_library {
75 name: "libunwindstack",
76 defaults: ["libunwindstack_common"],
77}
78
Christopher Ferris723cf9b2017-01-19 20:08:48 -080079//-------------------------------------------------------------------------
80// Unit Tests
81//-------------------------------------------------------------------------
82cc_defaults {
83 name: "libunwindstack_test_common",
84 defaults: ["libunwindstack_flags"],
85
86 srcs: [
87 "tests/ArmExidxDecodeTest.cpp",
88 "tests/ArmExidxExtractTest.cpp",
Christopher Ferris8642fcb2017-04-24 11:14:39 -070089 "tests/DwarfCfaLogTest.cpp",
90 "tests/DwarfCfaTest.cpp",
Christopher Ferris61d40972017-06-12 19:14:20 -070091 "tests/DwarfDebugFrameTest.cpp",
92 "tests/DwarfEhFrameTest.cpp",
Christopher Ferris72a6fa62017-03-21 12:41:17 -070093 "tests/DwarfMemoryTest.cpp",
Christopher Ferris55d22ef2017-04-04 10:41:31 -070094 "tests/DwarfOpLogTest.cpp",
95 "tests/DwarfOpTest.cpp",
Christopher Ferris53a3c9b2017-05-10 18:34:15 -070096 "tests/DwarfSectionTest.cpp",
97 "tests/DwarfSectionImplTest.cpp",
Christopher Ferris3958f802017-02-01 15:44:40 -080098 "tests/ElfInterfaceArmTest.cpp",
99 "tests/ElfInterfaceTest.cpp",
100 "tests/ElfTest.cpp",
Christopher Ferris570b76f2017-06-30 17:18:16 -0700101 "tests/ElfTestUtils.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800102 "tests/LogFake.cpp",
Christopher Ferris570b76f2017-06-30 17:18:16 -0700103 "tests/MapInfoCreateMemoryTest.cpp",
104 "tests/MapInfoGetElfTest.cpp",
Christopher Ferris09385e72017-04-05 13:25:04 -0700105 "tests/MapsTest.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800106 "tests/MemoryFake.cpp",
107 "tests/MemoryFileTest.cpp",
108 "tests/MemoryLocalTest.cpp",
109 "tests/MemoryRangeTest.cpp",
110 "tests/MemoryRemoteTest.cpp",
111 "tests/RegsTest.cpp",
Christopher Ferrise7ba4cc2017-04-04 14:06:58 -0700112 "tests/SymbolsTest.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800113 ],
114
115 cflags: [
116 "-O0",
117 "-g",
118 ],
119
120 shared_libs: [
121 "libbase",
122 "liblog",
Christopher Ferrisbae69f12017-06-28 14:51:54 -0700123 "liblzma",
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800124 ],
125
Christopher Ferris53a3c9b2017-05-10 18:34:15 -0700126 static_libs: [
127 "libgmock",
128 ],
129
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800130 target: {
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800131 linux: {
132 host_ldlibs: [
133 "-lrt",
134 ],
135 },
136 },
137}
138
139// These unit tests run against the shared library.
140cc_test {
141 name: "libunwindstack_test",
142 defaults: ["libunwindstack_test_common"],
143
144 shared_libs: [
145 "libunwindstack",
146 ],
Christopher Ferrisbae69f12017-06-28 14:51:54 -0700147
148 data: [
Christopher Ferris570b76f2017-06-30 17:18:16 -0700149 "tests/files/elf32.xz",
150 "tests/files/elf64.xz",
Christopher Ferrisbae69f12017-06-28 14:51:54 -0700151 ],
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800152}
153
Christopher Ferris3958f802017-02-01 15:44:40 -0800154//-------------------------------------------------------------------------
155// Utility Executables
156//-------------------------------------------------------------------------
157cc_defaults {
158 name: "libunwindstack_executables",
159 defaults: ["libunwindstack_flags"],
160
161 shared_libs: [
162 "libunwindstack",
163 "libbase",
Christopher Ferrisbae69f12017-06-28 14:51:54 -0700164 "liblzma",
Christopher Ferris3958f802017-02-01 15:44:40 -0800165 ],
166
167 static_libs: [
168 "liblog",
169 ],
170
171 compile_multilib: "both",
172}
173
174cc_binary {
175 name: "unwind_info",
176 defaults: ["libunwindstack_executables"],
177
178 srcs: [
179 "unwind_info.cpp",
180 ],
181}
Christopher Ferrisbae69f12017-06-28 14:51:54 -0700182
183// Generates the elf data for use in the tests for .gnu_debugdata frames.
184// Once these files are generated, use the xz command to compress the data.
185cc_binary_host {
186 name: "gen_gnudebugdata",
187
188 cflags: [
189 "-Wall",
190 "-Werror",
191 "-Wextra",
192 ],
193
194 srcs: [
195 "tests/GenGnuDebugdata.cpp",
196 ],
Christopher Ferrisbfd62922017-06-28 20:44:48 -0700197
198 target: {
199 darwin: {
200 enabled: false,
201 },
202 },
Christopher Ferrisbae69f12017-06-28 14:51:54 -0700203}