blob: c42ae49805c19b20d041c3ca66fd8f3f405806e5 [file] [log] [blame]
Dan Willemsen2e1591b2016-07-12 17:20:18 -07001//
2// Copyright (C) 2014 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: "libbacktrace_common",
19
20 cflags: [
21 "-Wall",
22 "-Werror",
23 ],
Dan Willemsen2e1591b2016-07-12 17:20:18 -070024
Dan Willemsen2e1591b2016-07-12 17:20:18 -070025 target: {
Dan Willemsen2e1591b2016-07-12 17:20:18 -070026 darwin: {
27 enabled: false,
28 },
29 },
30
31 multilib: {
32 lib32: {
33 suffix: "32",
34 },
35 lib64: {
36 suffix: "64",
37 },
Elliott Hughesdc699a22018-02-16 17:58:14 -080038 },
Dan Willemsen2e1591b2016-07-12 17:20:18 -070039}
40
41libbacktrace_sources = [
42 "Backtrace.cpp",
43 "BacktraceCurrent.cpp",
44 "BacktracePtrace.cpp",
Dan Willemsen2e1591b2016-07-12 17:20:18 -070045 "ThreadEntry.cpp",
Christopher Ferris6f3981c2017-07-27 09:29:18 -070046 "UnwindStack.cpp",
47 "UnwindStackMap.cpp",
Dan Willemsen2e1591b2016-07-12 17:20:18 -070048]
49
Vijay Venkatraman8f2c28d2017-04-11 11:22:43 -070050cc_library_headers {
51 name: "libbacktrace_headers",
Steven Moreland4ad9d512017-04-13 21:01:40 -070052 vendor_available: true,
Jiyong Park612210c2018-04-27 21:48:43 +090053 recovery_available: true,
Vijay Venkatraman8f2c28d2017-04-11 11:22:43 -070054 export_include_dirs: ["include"],
55}
56
Dan Willemsen2e1591b2016-07-12 17:20:18 -070057cc_library {
58 name: "libbacktrace",
Jiyong Parkb7d92c42017-08-23 13:25:21 +090059 vendor_available: false,
Jiyong Parka0e75042018-05-24 14:11:00 +090060 recovery_available: true,
Justin Yun9ca92452017-07-31 15:41:10 +090061 vndk: {
62 enabled: true,
63 support_system_process: true,
64 },
Dan Willemsen2e1591b2016-07-12 17:20:18 -070065 defaults: ["libbacktrace_common"],
66 host_supported: true,
67
Josh Gaoe22701e2017-10-23 14:25:08 -070068 cflags: [
69 "-Wexit-time-destructors",
70 ],
71
Dan Willemsen2e1591b2016-07-12 17:20:18 -070072 srcs: [
73 "BacktraceMap.cpp",
74 ],
75
Vijay Venkatraman8f2c28d2017-04-11 11:22:43 -070076 export_include_dirs: ["include"],
77
Dan Willemsen2e1591b2016-07-12 17:20:18 -070078 target: {
79 darwin: {
80 enabled: true,
Christopher Tate69831122018-02-16 14:52:26 -080081 shared_libs: [
Elliott Hughesdc699a22018-02-16 17:58:14 -080082 "libbase",
83 ],
Dan Willemsen2e1591b2016-07-12 17:20:18 -070084 },
Dan Willemsenbdddcab2017-10-03 14:17:31 -070085 linux: {
Dan Willemsene0cd1e02017-03-15 15:23:36 -070086 srcs: libbacktrace_sources,
87
88 shared_libs: [
89 "libbase",
90 "liblog",
Christopher Ferris6f3981c2017-07-27 09:29:18 -070091 "libunwindstack",
Dan Willemsene0cd1e02017-03-15 15:23:36 -070092 ],
93
Yabin Cui3841acc2018-05-10 17:19:12 -070094 static_libs: [
Yabin Cui3841acc2018-05-10 17:19:12 -070095 "libprocinfo",
96 ],
Dan Willemsene0cd1e02017-03-15 15:23:36 -070097 },
Dan Willemsen2e1591b2016-07-12 17:20:18 -070098 android: {
Dan Willemsenbdddcab2017-10-03 14:17:31 -070099 static_libs: ["libasync_safe"],
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700100 },
Christopher Ferris0b06a592018-01-19 10:26:36 -0800101 vendor: {
Christopher Ferrisd70ea5e2018-01-30 19:47:24 -0800102 cflags: ["-DNO_LIBDEXFILE_SUPPORT"],
Elliott Hughesdc699a22018-02-16 17:58:14 -0800103 },
Jiyong Parka0e75042018-05-24 14:11:00 +0900104 recovery: {
105 cflags: ["-DNO_LIBDEXFILE_SUPPORT"],
Jiyong Parka0e75042018-05-24 14:11:00 +0900106 },
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700107 },
Christopher Ferris7d0aea92017-06-01 14:15:09 -0700108 whole_static_libs: ["libdemangle"],
Dan Willemsen2e1591b2016-07-12 17:20:18 -0700109}
110
111cc_library_shared {
112 name: "libbacktrace_test",
113 defaults: ["libbacktrace_common"],
114 host_supported: true,
115 strip: {
116 none: true,
117 },
118 cflags: ["-O0"],
Christopher Ferris5ea2c1f2017-03-23 14:55:01 -0700119 srcs: ["backtrace_testlib.cpp"],
Yabin Cui5d991bc2016-11-15 17:47:09 -0800120
Christopher Ferrisc8bec5a2017-12-11 17:44:33 -0800121 shared_libs: [
Elliott Hughesdc699a22018-02-16 17:58:14 -0800122 "libunwindstack",
Colin Crossda9bd592016-12-14 17:24:46 -0800123 ],
124}
125
126//-------------------------------------------------------------------------
127// The backtrace_test executable.
128//-------------------------------------------------------------------------
129cc_test {
130 name: "backtrace_test",
131 defaults: ["libbacktrace_common"],
132 host_supported: true,
133 srcs: [
134 "backtrace_offline_test.cpp",
135 "backtrace_test.cpp",
136 "GetPss.cpp",
Colin Crossda9bd592016-12-14 17:24:46 -0800137 ],
138
139 cflags: [
140 "-fno-builtin",
141 "-O0",
142 "-g",
143 ],
144
145 shared_libs: [
146 "libbacktrace_test",
147 "libbacktrace",
148 "libbase",
Colin Crossda9bd592016-12-14 17:24:46 -0800149 "liblog",
Christopher Ferris6f3981c2017-07-27 09:29:18 -0700150 "libunwindstack",
Colin Crossda9bd592016-12-14 17:24:46 -0800151 ],
152
153 group_static_libs: true,
154
Colin Crossda9bd592016-12-14 17:24:46 -0800155 target: {
156 android: {
157 cflags: ["-DENABLE_PSS_TESTS"],
158 shared_libs: [
Colin Crossda9bd592016-12-14 17:24:46 -0800159 "libutils",
160 ],
161 },
Dan Willemsen48529332017-10-02 10:38:16 -0700162 linux_glibc: {
Colin Crossda9bd592016-12-14 17:24:46 -0800163 static_libs: ["libutils"],
164 },
165 },
Christopher Ferris458cc662017-08-28 16:31:18 -0700166
Elliott Hughes40fdf3f2018-04-27 16:12:06 -0700167 test_suites: ["device-tests"],
Christopher Ferris458cc662017-08-28 16:31:18 -0700168 data: [
169 "testdata/arm/*",
170 "testdata/arm64/*",
171 "testdata/x86/*",
172 "testdata/x86_64/*",
173 ],
Elliott Hughes03d183a2018-05-03 10:06:45 -0700174 required: [
175 "libbacktrace_test",
176 ],
Colin Crossda9bd592016-12-14 17:24:46 -0800177}
Christopher Ferris60521c72017-08-18 15:10:53 -0700178
179cc_benchmark {
180 name: "backtrace_benchmarks",
181 defaults: ["libbacktrace_common"],
182
183 srcs: [
184 "backtrace_benchmarks.cpp",
Christopher Ferrise3286732017-12-07 17:41:18 -0800185 "backtrace_read_benchmarks.cpp",
Christopher Ferris60521c72017-08-18 15:10:53 -0700186 ],
187
188 shared_libs: [
189 "libbacktrace",
190 "libbase",
Josh Gaob9670bb2017-10-25 15:12:24 -0700191 "libunwindstack",
Christopher Ferris60521c72017-08-18 15:10:53 -0700192 ],
193}