blob: a6044c88b1b6969278e127b92a69a0fa4ad61ffd [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"],
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
Christopher Ferris723cf9b2017-01-19 20:08:48 -080083//-------------------------------------------------------------------------
84// Unit Tests
85//-------------------------------------------------------------------------
Christopher Ferrisf6d54312017-07-11 15:29:32 -070086cc_test {
87 name: "libunwindstack_test",
Christopher Ferris723cf9b2017-01-19 20:08:48 -080088 defaults: ["libunwindstack_flags"],
89
90 srcs: [
91 "tests/ArmExidxDecodeTest.cpp",
92 "tests/ArmExidxExtractTest.cpp",
Christopher Ferris8642fcb2017-04-24 11:14:39 -070093 "tests/DwarfCfaLogTest.cpp",
94 "tests/DwarfCfaTest.cpp",
Christopher Ferris61d40972017-06-12 19:14:20 -070095 "tests/DwarfDebugFrameTest.cpp",
96 "tests/DwarfEhFrameTest.cpp",
Christopher Ferris72a6fa62017-03-21 12:41:17 -070097 "tests/DwarfMemoryTest.cpp",
Christopher Ferris55d22ef2017-04-04 10:41:31 -070098 "tests/DwarfOpLogTest.cpp",
99 "tests/DwarfOpTest.cpp",
Christopher Ferris53a3c9b2017-05-10 18:34:15 -0700100 "tests/DwarfSectionTest.cpp",
101 "tests/DwarfSectionImplTest.cpp",
Christopher Ferris3958f802017-02-01 15:44:40 -0800102 "tests/ElfInterfaceArmTest.cpp",
103 "tests/ElfInterfaceTest.cpp",
104 "tests/ElfTest.cpp",
Christopher Ferris570b76f2017-06-30 17:18:16 -0700105 "tests/ElfTestUtils.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800106 "tests/LogFake.cpp",
Christopher Ferris570b76f2017-06-30 17:18:16 -0700107 "tests/MapInfoCreateMemoryTest.cpp",
108 "tests/MapInfoGetElfTest.cpp",
Christopher Ferris09385e72017-04-05 13:25:04 -0700109 "tests/MapsTest.cpp",
Christopher Ferrisf6d54312017-07-11 15:29:32 -0700110 "tests/MemoryBufferTest.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800111 "tests/MemoryFake.cpp",
112 "tests/MemoryFileTest.cpp",
113 "tests/MemoryLocalTest.cpp",
114 "tests/MemoryRangeTest.cpp",
115 "tests/MemoryRemoteTest.cpp",
Christopher Ferris9744fb22017-07-07 12:18:16 -0700116 "tests/MemoryTest.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800117 "tests/RegsTest.cpp",
Christopher Ferrise7ba4cc2017-04-04 14:06:58 -0700118 "tests/SymbolsTest.cpp",
Christopher Ferris2a25c4a2017-07-07 16:35:48 -0700119 "tests/UnwindTest.cpp",
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800120 ],
121
122 cflags: [
123 "-O0",
124 "-g",
125 ],
126
127 shared_libs: [
128 "libbase",
129 "liblog",
Christopher Ferrisbae69f12017-06-28 14:51:54 -0700130 "liblzma",
Christopher Ferrisf6d54312017-07-11 15:29:32 -0700131 "libunwindstack",
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800132 ],
133
Christopher Ferris53a3c9b2017-05-10 18:34:15 -0700134 static_libs: [
135 "libgmock",
136 ],
137
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800138 target: {
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800139 linux: {
140 host_ldlibs: [
141 "-lrt",
142 ],
143 },
144 },
Christopher Ferrisbae69f12017-06-28 14:51:54 -0700145
146 data: [
Christopher Ferris570b76f2017-06-30 17:18:16 -0700147 "tests/files/elf32.xz",
148 "tests/files/elf64.xz",
Christopher Ferrisbae69f12017-06-28 14:51:54 -0700149 ],
Christopher Ferris723cf9b2017-01-19 20:08:48 -0800150}
151
Christopher Ferris3958f802017-02-01 15:44:40 -0800152//-------------------------------------------------------------------------
153// Utility Executables
154//-------------------------------------------------------------------------
155cc_defaults {
156 name: "libunwindstack_executables",
157 defaults: ["libunwindstack_flags"],
158
159 shared_libs: [
160 "libunwindstack",
161 "libbase",
Christopher Ferrisbae69f12017-06-28 14:51:54 -0700162 "liblzma",
Christopher Ferris3958f802017-02-01 15:44:40 -0800163 ],
164
165 static_libs: [
166 "liblog",
167 ],
Christopher Ferris3958f802017-02-01 15:44:40 -0800168}
169
170cc_binary {
171 name: "unwind_info",
172 defaults: ["libunwindstack_executables"],
173
174 srcs: [
175 "unwind_info.cpp",
176 ],
177}
Christopher Ferrisbae69f12017-06-28 14:51:54 -0700178
179// Generates the elf data for use in the tests for .gnu_debugdata frames.
180// Once these files are generated, use the xz command to compress the data.
181cc_binary_host {
182 name: "gen_gnudebugdata",
Christopher Ferrisf6d54312017-07-11 15:29:32 -0700183 defaults: ["libunwindstack_flags"],
Christopher Ferrisbae69f12017-06-28 14:51:54 -0700184
185 srcs: [
186 "tests/GenGnuDebugdata.cpp",
187 ],
188}