blob: 94f0f8ed310a0ca8588b2c8b1e66c663e03e53e2 [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 },
Christopher Ferris723cf9b2017-01-19 20:08:48 -080042}
43
Christopher Ferrisf6d54312017-07-11 15:29:32 -070044cc_library {
45 name: "libunwindstack",
Christopher Ferris723cf9b2017-01-19 20:08:48 -080046 defaults: ["libunwindstack_flags"],
Christopher Ferrisd226a512017-07-14 10:37:19 -070047 export_include_dirs: ["include"],
Christopher Ferris723cf9b2017-01-19 20:08:48 -080048
49 srcs: [
50 "ArmExidx.cpp",
Christopher Ferris8642fcb2017-04-24 11:14:39 -070051 "DwarfCfa.cpp",
Christopher Ferris61d40972017-06-12 19:14:20 -070052 "DwarfDebugFrame.cpp",
53 "DwarfEhFrame.cpp",
Christopher Ferris72a6fa62017-03-21 12:41:17 -070054 "DwarfMemory.cpp",
Christopher Ferris55d22ef2017-04-04 10:41:31 -070055 "DwarfOp.cpp",
Christopher Ferris53a3c9b2017-05-10 18:34:15 -070056 "DwarfSection.cpp",
Christopher Ferris3958f802017-02-01 15:44:40 -080057 "Elf.cpp",
58 "ElfInterface.cpp",
59 "ElfInterfaceArm.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -080060 "Log.cpp",
Christopher Ferris0d7cf3e2017-04-19 15:42:19 -070061 "MapInfo.cpp",
Christopher Ferris09385e72017-04-05 13:25:04 -070062 "Maps.cpp",
Christopher Ferris3958f802017-02-01 15:44:40 -080063 "Memory.cpp",
Christopher Ferrisbae69f12017-06-28 14:51:54 -070064 "Regs.cpp",
Christopher Ferrise7ba4cc2017-04-04 14:06:58 -070065 "Symbols.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -080066 ],
67
Christopher Ferris2a25c4a2017-07-07 16:35:48 -070068 arch: {
69 x86: {
70 srcs: ["AsmGetRegsX86.S"],
71 },
72 x86_64: {
73 srcs: ["AsmGetRegsX86_64.S"],
74 },
75 },
76
Christopher Ferris723cf9b2017-01-19 20:08:48 -080077 shared_libs: [
78 "libbase",
79 "liblog",
Christopher Ferrisbae69f12017-06-28 14:51:54 -070080 "liblzma",
Christopher Ferris723cf9b2017-01-19 20:08:48 -080081 ],
82}
83
Christopher Ferris723cf9b2017-01-19 20:08:48 -080084//-------------------------------------------------------------------------
85// Unit Tests
86//-------------------------------------------------------------------------
Christopher Ferrisf6d54312017-07-11 15:29:32 -070087cc_test {
88 name: "libunwindstack_test",
Christopher Ferris723cf9b2017-01-19 20:08:48 -080089 defaults: ["libunwindstack_flags"],
90
91 srcs: [
92 "tests/ArmExidxDecodeTest.cpp",
93 "tests/ArmExidxExtractTest.cpp",
Christopher Ferris8642fcb2017-04-24 11:14:39 -070094 "tests/DwarfCfaLogTest.cpp",
95 "tests/DwarfCfaTest.cpp",
Christopher Ferris61d40972017-06-12 19:14:20 -070096 "tests/DwarfDebugFrameTest.cpp",
97 "tests/DwarfEhFrameTest.cpp",
Christopher Ferris72a6fa62017-03-21 12:41:17 -070098 "tests/DwarfMemoryTest.cpp",
Christopher Ferris55d22ef2017-04-04 10:41:31 -070099 "tests/DwarfOpLogTest.cpp",
100 "tests/DwarfOpTest.cpp",
Christopher Ferris53a3c9b2017-05-10 18:34:15 -0700101 "tests/DwarfSectionTest.cpp",
102 "tests/DwarfSectionImplTest.cpp",
Christopher Ferris3958f802017-02-01 15:44:40 -0800103 "tests/ElfInterfaceArmTest.cpp",
104 "tests/ElfInterfaceTest.cpp",
105 "tests/ElfTest.cpp",
Christopher Ferris570b76f2017-06-30 17:18:16 -0700106 "tests/ElfTestUtils.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800107 "tests/LogFake.cpp",
Christopher Ferris570b76f2017-06-30 17:18:16 -0700108 "tests/MapInfoCreateMemoryTest.cpp",
109 "tests/MapInfoGetElfTest.cpp",
Christopher Ferris09385e72017-04-05 13:25:04 -0700110 "tests/MapsTest.cpp",
Christopher Ferrisf6d54312017-07-11 15:29:32 -0700111 "tests/MemoryBufferTest.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800112 "tests/MemoryFake.cpp",
113 "tests/MemoryFileTest.cpp",
114 "tests/MemoryLocalTest.cpp",
115 "tests/MemoryRangeTest.cpp",
116 "tests/MemoryRemoteTest.cpp",
Christopher Ferris9744fb22017-07-07 12:18:16 -0700117 "tests/MemoryTest.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800118 "tests/RegsTest.cpp",
Christopher Ferrise7ba4cc2017-04-04 14:06:58 -0700119 "tests/SymbolsTest.cpp",
Christopher Ferris2a25c4a2017-07-07 16:35:48 -0700120 "tests/UnwindTest.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800121 ],
122
123 cflags: [
124 "-O0",
125 "-g",
126 ],
127
128 shared_libs: [
129 "libbase",
130 "liblog",
Christopher Ferrisbae69f12017-06-28 14:51:54 -0700131 "liblzma",
Christopher Ferrisf6d54312017-07-11 15:29:32 -0700132 "libunwindstack",
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800133 ],
134
Christopher Ferris53a3c9b2017-05-10 18:34:15 -0700135 static_libs: [
136 "libgmock",
137 ],
138
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800139 target: {
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800140 linux: {
141 host_ldlibs: [
142 "-lrt",
143 ],
144 },
145 },
Christopher Ferrisbae69f12017-06-28 14:51:54 -0700146
147 data: [
Christopher Ferris570b76f2017-06-30 17:18:16 -0700148 "tests/files/elf32.xz",
149 "tests/files/elf64.xz",
Christopher Ferrisbae69f12017-06-28 14:51:54 -0700150 ],
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800151}
152
Christopher Ferris3958f802017-02-01 15:44:40 -0800153//-------------------------------------------------------------------------
Christopher Ferrisb5d7a872017-07-12 15:40:52 -0700154// Tools
Christopher Ferris3958f802017-02-01 15:44:40 -0800155//-------------------------------------------------------------------------
156cc_defaults {
Christopher Ferrisb5d7a872017-07-12 15:40:52 -0700157 name: "libunwindstack_tools",
Christopher Ferris3958f802017-02-01 15:44:40 -0800158 defaults: ["libunwindstack_flags"],
159
160 shared_libs: [
161 "libunwindstack",
162 "libbase",
Christopher Ferrisbae69f12017-06-28 14:51:54 -0700163 "liblzma",
Christopher Ferris3958f802017-02-01 15:44:40 -0800164 ],
Christopher Ferrisb5d7a872017-07-12 15:40:52 -0700165}
Christopher Ferris3958f802017-02-01 15:44:40 -0800166
Christopher Ferrisb5d7a872017-07-12 15:40:52 -0700167cc_binary {
168 name: "unwind",
169 defaults: ["libunwindstack_tools"],
170
171 srcs: [
172 "tools/unwind.cpp",
Christopher Ferris3958f802017-02-01 15:44:40 -0800173 ],
Christopher Ferrisb5d7a872017-07-12 15:40:52 -0700174
175 target: {
176 linux: {
177 host_ldlibs: [
178 "-lrt",
179 ],
180 },
181 },
Christopher Ferris3958f802017-02-01 15:44:40 -0800182}
183
184cc_binary {
185 name: "unwind_info",
Christopher Ferrisb5d7a872017-07-12 15:40:52 -0700186 defaults: ["libunwindstack_tools"],
Christopher Ferris3958f802017-02-01 15:44:40 -0800187
188 srcs: [
Christopher Ferrisb5d7a872017-07-12 15:40:52 -0700189 "tools/unwind_info.cpp",
190 ],
191}
192
193cc_binary {
194 name: "unwind_symbols",
195 defaults: ["libunwindstack_tools"],
196
197 srcs: [
198 "tools/unwind_symbols.cpp",
Christopher Ferris3958f802017-02-01 15:44:40 -0800199 ],
200}
Christopher Ferrisbae69f12017-06-28 14:51:54 -0700201
202// Generates the elf data for use in the tests for .gnu_debugdata frames.
203// Once these files are generated, use the xz command to compress the data.
204cc_binary_host {
205 name: "gen_gnudebugdata",
Christopher Ferrisf6d54312017-07-11 15:29:32 -0700206 defaults: ["libunwindstack_flags"],
Christopher Ferrisbae69f12017-06-28 14:51:54 -0700207
208 srcs: [
209 "tests/GenGnuDebugdata.cpp",
210 ],
211}