blob: 78ae40988e9553cf3fde21ec5a00b2733a8697b5 [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 Ferris723cf9b2017-01-19 20:08:48 -080033}
34
Christopher Ferrisf6d54312017-07-11 15:29:32 -070035cc_library {
36 name: "libunwindstack",
Christopher Ferris723cf9b2017-01-19 20:08:48 -080037 defaults: ["libunwindstack_flags"],
Christopher Ferrisd226a512017-07-14 10:37:19 -070038 export_include_dirs: ["include"],
Christopher Ferris723cf9b2017-01-19 20:08:48 -080039
40 srcs: [
41 "ArmExidx.cpp",
Christopher Ferris8642fcb2017-04-24 11:14:39 -070042 "DwarfCfa.cpp",
Christopher Ferris61d40972017-06-12 19:14:20 -070043 "DwarfDebugFrame.cpp",
44 "DwarfEhFrame.cpp",
Christopher Ferris72a6fa62017-03-21 12:41:17 -070045 "DwarfMemory.cpp",
Christopher Ferris55d22ef2017-04-04 10:41:31 -070046 "DwarfOp.cpp",
Christopher Ferris53a3c9b2017-05-10 18:34:15 -070047 "DwarfSection.cpp",
Christopher Ferris3958f802017-02-01 15:44:40 -080048 "Elf.cpp",
49 "ElfInterface.cpp",
50 "ElfInterfaceArm.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -080051 "Log.cpp",
Christopher Ferris0d7cf3e2017-04-19 15:42:19 -070052 "MapInfo.cpp",
Christopher Ferris09385e72017-04-05 13:25:04 -070053 "Maps.cpp",
Christopher Ferris3958f802017-02-01 15:44:40 -080054 "Memory.cpp",
Christopher Ferrisbae69f12017-06-28 14:51:54 -070055 "Regs.cpp",
Christopher Ferrise7ba4cc2017-04-04 14:06:58 -070056 "Symbols.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -080057 ],
58
Christopher Ferris2a25c4a2017-07-07 16:35:48 -070059 arch: {
60 x86: {
61 srcs: ["AsmGetRegsX86.S"],
62 },
63 x86_64: {
64 srcs: ["AsmGetRegsX86_64.S"],
65 },
66 },
67
Christopher Ferris723cf9b2017-01-19 20:08:48 -080068 shared_libs: [
69 "libbase",
70 "liblog",
Christopher Ferrisbae69f12017-06-28 14:51:54 -070071 "liblzma",
Christopher Ferris723cf9b2017-01-19 20:08:48 -080072 ],
73}
74
Christopher Ferris723cf9b2017-01-19 20:08:48 -080075//-------------------------------------------------------------------------
76// Unit Tests
77//-------------------------------------------------------------------------
Christopher Ferrisf6d54312017-07-11 15:29:32 -070078cc_test {
79 name: "libunwindstack_test",
Christopher Ferris723cf9b2017-01-19 20:08:48 -080080 defaults: ["libunwindstack_flags"],
81
82 srcs: [
83 "tests/ArmExidxDecodeTest.cpp",
84 "tests/ArmExidxExtractTest.cpp",
Christopher Ferris8642fcb2017-04-24 11:14:39 -070085 "tests/DwarfCfaLogTest.cpp",
86 "tests/DwarfCfaTest.cpp",
Christopher Ferris61d40972017-06-12 19:14:20 -070087 "tests/DwarfDebugFrameTest.cpp",
88 "tests/DwarfEhFrameTest.cpp",
Christopher Ferris72a6fa62017-03-21 12:41:17 -070089 "tests/DwarfMemoryTest.cpp",
Christopher Ferris55d22ef2017-04-04 10:41:31 -070090 "tests/DwarfOpLogTest.cpp",
91 "tests/DwarfOpTest.cpp",
Christopher Ferris53a3c9b2017-05-10 18:34:15 -070092 "tests/DwarfSectionTest.cpp",
93 "tests/DwarfSectionImplTest.cpp",
Christopher Ferris3958f802017-02-01 15:44:40 -080094 "tests/ElfInterfaceArmTest.cpp",
95 "tests/ElfInterfaceTest.cpp",
96 "tests/ElfTest.cpp",
Christopher Ferris570b76f2017-06-30 17:18:16 -070097 "tests/ElfTestUtils.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -080098 "tests/LogFake.cpp",
Christopher Ferris570b76f2017-06-30 17:18:16 -070099 "tests/MapInfoCreateMemoryTest.cpp",
100 "tests/MapInfoGetElfTest.cpp",
Christopher Ferris09385e72017-04-05 13:25:04 -0700101 "tests/MapsTest.cpp",
Christopher Ferrisf6d54312017-07-11 15:29:32 -0700102 "tests/MemoryBufferTest.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800103 "tests/MemoryFake.cpp",
104 "tests/MemoryFileTest.cpp",
105 "tests/MemoryLocalTest.cpp",
106 "tests/MemoryRangeTest.cpp",
107 "tests/MemoryRemoteTest.cpp",
Christopher Ferris9744fb22017-07-07 12:18:16 -0700108 "tests/MemoryTest.cpp",
Christopher Ferriseb4a6db2017-07-19 12:37:45 -0700109 "tests/RegsStepIfSignalHandlerTest.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800110 "tests/RegsTest.cpp",
Christopher Ferrise7ba4cc2017-04-04 14:06:58 -0700111 "tests/SymbolsTest.cpp",
Christopher Ferris2a25c4a2017-07-07 16:35:48 -0700112 "tests/UnwindTest.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 Ferrisf6d54312017-07-11 15:29:32 -0700124 "libunwindstack",
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800125 ],
126
Christopher Ferris53a3c9b2017-05-10 18:34:15 -0700127 static_libs: [
128 "libgmock",
129 ],
130
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800131 target: {
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800132 linux: {
133 host_ldlibs: [
134 "-lrt",
135 ],
136 },
137 },
Christopher Ferrisbae69f12017-06-28 14:51:54 -0700138
139 data: [
Christopher Ferris570b76f2017-06-30 17:18:16 -0700140 "tests/files/elf32.xz",
141 "tests/files/elf64.xz",
Christopher Ferrisbae69f12017-06-28 14:51:54 -0700142 ],
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800143}
144
Christopher Ferris3958f802017-02-01 15:44:40 -0800145//-------------------------------------------------------------------------
Christopher Ferrisb5d7a872017-07-12 15:40:52 -0700146// Tools
Christopher Ferris3958f802017-02-01 15:44:40 -0800147//-------------------------------------------------------------------------
148cc_defaults {
Christopher Ferrisb5d7a872017-07-12 15:40:52 -0700149 name: "libunwindstack_tools",
Christopher Ferris3958f802017-02-01 15:44:40 -0800150 defaults: ["libunwindstack_flags"],
151
152 shared_libs: [
153 "libunwindstack",
154 "libbase",
Christopher Ferrisbae69f12017-06-28 14:51:54 -0700155 "liblzma",
Christopher Ferris3958f802017-02-01 15:44:40 -0800156 ],
Christopher Ferrisb5d7a872017-07-12 15:40:52 -0700157}
Christopher Ferris3958f802017-02-01 15:44:40 -0800158
Christopher Ferrisb5d7a872017-07-12 15:40:52 -0700159cc_binary {
160 name: "unwind",
161 defaults: ["libunwindstack_tools"],
162
163 srcs: [
164 "tools/unwind.cpp",
Christopher Ferris3958f802017-02-01 15:44:40 -0800165 ],
Christopher Ferrisb5d7a872017-07-12 15:40:52 -0700166
167 target: {
168 linux: {
169 host_ldlibs: [
170 "-lrt",
171 ],
172 },
173 },
Christopher Ferris3958f802017-02-01 15:44:40 -0800174}
175
176cc_binary {
177 name: "unwind_info",
Christopher Ferrisb5d7a872017-07-12 15:40:52 -0700178 defaults: ["libunwindstack_tools"],
Christopher Ferris3958f802017-02-01 15:44:40 -0800179
180 srcs: [
Christopher Ferrisb5d7a872017-07-12 15:40:52 -0700181 "tools/unwind_info.cpp",
182 ],
183}
184
185cc_binary {
186 name: "unwind_symbols",
187 defaults: ["libunwindstack_tools"],
188
189 srcs: [
190 "tools/unwind_symbols.cpp",
Christopher Ferris3958f802017-02-01 15:44:40 -0800191 ],
192}
Christopher Ferrisbae69f12017-06-28 14:51:54 -0700193
194// Generates the elf data for use in the tests for .gnu_debugdata frames.
195// Once these files are generated, use the xz command to compress the data.
196cc_binary_host {
197 name: "gen_gnudebugdata",
Christopher Ferrisf6d54312017-07-11 15:29:32 -0700198 defaults: ["libunwindstack_flags"],
Christopher Ferrisbae69f12017-06-28 14:51:54 -0700199
200 srcs: [
201 "tests/GenGnuDebugdata.cpp",
202 ],
203}