blob: 04c4cfa55f451753c9700ad8e99687eba513c4d0 [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 Ferriseb4a6db2017-07-19 12:37:45 -0700118 "tests/RegsStepIfSignalHandlerTest.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800119 "tests/RegsTest.cpp",
Christopher Ferrise7ba4cc2017-04-04 14:06:58 -0700120 "tests/SymbolsTest.cpp",
Christopher Ferris2a25c4a2017-07-07 16:35:48 -0700121 "tests/UnwindTest.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800122 ],
123
124 cflags: [
125 "-O0",
126 "-g",
127 ],
128
129 shared_libs: [
130 "libbase",
131 "liblog",
Christopher Ferrisbae69f12017-06-28 14:51:54 -0700132 "liblzma",
Christopher Ferrisf6d54312017-07-11 15:29:32 -0700133 "libunwindstack",
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800134 ],
135
Christopher Ferris53a3c9b2017-05-10 18:34:15 -0700136 static_libs: [
137 "libgmock",
138 ],
139
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800140 target: {
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800141 linux: {
142 host_ldlibs: [
143 "-lrt",
144 ],
145 },
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//-------------------------------------------------------------------------
Christopher Ferrisb5d7a872017-07-12 15:40:52 -0700155// Tools
Christopher Ferris3958f802017-02-01 15:44:40 -0800156//-------------------------------------------------------------------------
157cc_defaults {
Christopher Ferrisb5d7a872017-07-12 15:40:52 -0700158 name: "libunwindstack_tools",
Christopher Ferris3958f802017-02-01 15:44:40 -0800159 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 ],
Christopher Ferrisb5d7a872017-07-12 15:40:52 -0700166}
Christopher Ferris3958f802017-02-01 15:44:40 -0800167
Christopher Ferrisb5d7a872017-07-12 15:40:52 -0700168cc_binary {
169 name: "unwind",
170 defaults: ["libunwindstack_tools"],
171
172 srcs: [
173 "tools/unwind.cpp",
Christopher Ferris3958f802017-02-01 15:44:40 -0800174 ],
Christopher Ferrisb5d7a872017-07-12 15:40:52 -0700175
176 target: {
177 linux: {
178 host_ldlibs: [
179 "-lrt",
180 ],
181 },
182 },
Christopher Ferris3958f802017-02-01 15:44:40 -0800183}
184
185cc_binary {
186 name: "unwind_info",
Christopher Ferrisb5d7a872017-07-12 15:40:52 -0700187 defaults: ["libunwindstack_tools"],
Christopher Ferris3958f802017-02-01 15:44:40 -0800188
189 srcs: [
Christopher Ferrisb5d7a872017-07-12 15:40:52 -0700190 "tools/unwind_info.cpp",
191 ],
192}
193
194cc_binary {
195 name: "unwind_symbols",
196 defaults: ["libunwindstack_tools"],
197
198 srcs: [
199 "tools/unwind_symbols.cpp",
Christopher Ferris3958f802017-02-01 15:44:40 -0800200 ],
201}
Christopher Ferrisbae69f12017-06-28 14:51:54 -0700202
203// Generates the elf data for use in the tests for .gnu_debugdata frames.
204// Once these files are generated, use the xz command to compress the data.
205cc_binary_host {
206 name: "gen_gnudebugdata",
Christopher Ferrisf6d54312017-07-11 15:29:32 -0700207 defaults: ["libunwindstack_flags"],
Christopher Ferrisbae69f12017-06-28 14:51:54 -0700208
209 srcs: [
210 "tests/GenGnuDebugdata.cpp",
211 ],
212}