| Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 1 | // | 
|  | 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 |  | 
|  | 17 | cc_defaults { | 
|  | 18 | name: "libbacktrace_common", | 
|  | 19 |  | 
|  | 20 | cflags: [ | 
|  | 21 | "-Wall", | 
|  | 22 | "-Werror", | 
|  | 23 | ], | 
| Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 24 |  | 
| Colin Cross | da9bd59 | 2016-12-14 17:24:46 -0800 | [diff] [blame] | 25 | // The latest clang (r230699) does not allow SP/PC to be declared in inline asm lists. | 
| Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 26 | clang_cflags: ["-Wno-inline-asm"], | 
|  | 27 |  | 
| Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 28 | include_dirs: ["external/libunwind/include/tdep"], | 
|  | 29 |  | 
| Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 30 | target: { | 
| Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 31 | darwin: { | 
|  | 32 | enabled: false, | 
|  | 33 | }, | 
|  | 34 | }, | 
|  | 35 |  | 
|  | 36 | multilib: { | 
|  | 37 | lib32: { | 
|  | 38 | suffix: "32", | 
|  | 39 | }, | 
|  | 40 | lib64: { | 
|  | 41 | suffix: "64", | 
|  | 42 | }, | 
| Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 43 | }, | 
| Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 44 | } | 
|  | 45 |  | 
|  | 46 | libbacktrace_sources = [ | 
|  | 47 | "Backtrace.cpp", | 
|  | 48 | "BacktraceCurrent.cpp", | 
|  | 49 | "BacktracePtrace.cpp", | 
|  | 50 | "thread_utils.c", | 
|  | 51 | "ThreadEntry.cpp", | 
| Christopher Ferris | 6f3981c | 2017-07-27 09:29:18 -0700 | [diff] [blame] | 52 | "UnwindStack.cpp", | 
|  | 53 | "UnwindStackMap.cpp", | 
| Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 54 | ] | 
|  | 55 |  | 
| Vijay Venkatraman | 8f2c28d | 2017-04-11 11:22:43 -0700 | [diff] [blame] | 56 | cc_library_headers { | 
|  | 57 | name: "libbacktrace_headers", | 
| Steven Moreland | 4ad9d51 | 2017-04-13 21:01:40 -0700 | [diff] [blame] | 58 | vendor_available: true, | 
| Vijay Venkatraman | 8f2c28d | 2017-04-11 11:22:43 -0700 | [diff] [blame] | 59 | export_include_dirs: ["include"], | 
|  | 60 | } | 
|  | 61 |  | 
| Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 62 | cc_library { | 
|  | 63 | name: "libbacktrace", | 
| Jiyong Park | b7d92c4 | 2017-08-23 13:25:21 +0900 | [diff] [blame] | 64 | vendor_available: false, | 
| Justin Yun | 9ca9245 | 2017-07-31 15:41:10 +0900 | [diff] [blame] | 65 | vndk: { | 
|  | 66 | enabled: true, | 
|  | 67 | support_system_process: true, | 
|  | 68 | }, | 
| Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 69 | defaults: ["libbacktrace_common"], | 
|  | 70 | host_supported: true, | 
|  | 71 |  | 
| Josh Gao | e22701e | 2017-10-23 14:25:08 -0700 | [diff] [blame] | 72 | cflags: [ | 
|  | 73 | "-Wexit-time-destructors", | 
|  | 74 | ], | 
|  | 75 |  | 
| Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 76 | srcs: [ | 
|  | 77 | "BacktraceMap.cpp", | 
|  | 78 | ], | 
|  | 79 |  | 
| Vijay Venkatraman | 8f2c28d | 2017-04-11 11:22:43 -0700 | [diff] [blame] | 80 | export_include_dirs: ["include"], | 
|  | 81 |  | 
| Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 82 | target: { | 
|  | 83 | darwin: { | 
|  | 84 | enabled: true, | 
| Christopher Tate | 6983112 | 2018-02-16 14:52:26 -0800 | [diff] [blame] | 85 | shared_libs: [ | 
| Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 86 | "libbase", | 
|  | 87 | ], | 
| Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 88 | }, | 
| Dan Willemsen | bdddcab | 2017-10-03 14:17:31 -0700 | [diff] [blame] | 89 | linux: { | 
| Dan Willemsen | e0cd1e0 | 2017-03-15 15:23:36 -0700 | [diff] [blame] | 90 | srcs: libbacktrace_sources, | 
|  | 91 |  | 
|  | 92 | shared_libs: [ | 
|  | 93 | "libbase", | 
|  | 94 | "liblog", | 
|  | 95 | "libunwind", | 
| Christopher Ferris | 6f3981c | 2017-07-27 09:29:18 -0700 | [diff] [blame] | 96 | "libunwindstack", | 
| Christopher Ferris | 0b06a59 | 2018-01-19 10:26:36 -0800 | [diff] [blame] | 97 | "libdexfile", | 
| Dan Willemsen | e0cd1e0 | 2017-03-15 15:23:36 -0700 | [diff] [blame] | 98 | ], | 
|  | 99 |  | 
|  | 100 | static_libs: ["libcutils"], | 
| Christopher Ferris | 0b06a59 | 2018-01-19 10:26:36 -0800 | [diff] [blame] | 101 |  | 
|  | 102 | // libdexfile will eventually properly export headers, for now | 
|  | 103 | // include these directly. | 
|  | 104 | include_dirs: [ | 
|  | 105 | "art/runtime", | 
|  | 106 | ], | 
|  | 107 |  | 
| Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 108 | header_libs: ["jni_headers"], | 
| Dan Willemsen | e0cd1e0 | 2017-03-15 15:23:36 -0700 | [diff] [blame] | 109 | }, | 
| Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 110 | android: { | 
| Dan Willemsen | bdddcab | 2017-10-03 14:17:31 -0700 | [diff] [blame] | 111 | static_libs: ["libasync_safe"], | 
| Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 112 | }, | 
| Christopher Ferris | 0b06a59 | 2018-01-19 10:26:36 -0800 | [diff] [blame] | 113 | vendor: { | 
| Christopher Ferris | d70ea5e | 2018-01-30 19:47:24 -0800 | [diff] [blame] | 114 | cflags: ["-DNO_LIBDEXFILE_SUPPORT"], | 
| Christopher Ferris | 0b06a59 | 2018-01-19 10:26:36 -0800 | [diff] [blame] | 115 | exclude_shared_libs: ["libdexfile"], | 
| Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 116 | }, | 
| Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 117 | }, | 
| Christopher Ferris | 7d0aea9 | 2017-06-01 14:15:09 -0700 | [diff] [blame] | 118 | whole_static_libs: ["libdemangle"], | 
| Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 119 | } | 
|  | 120 |  | 
|  | 121 | cc_library_shared { | 
|  | 122 | name: "libbacktrace_test", | 
|  | 123 | defaults: ["libbacktrace_common"], | 
|  | 124 | host_supported: true, | 
|  | 125 | strip: { | 
|  | 126 | none: true, | 
|  | 127 | }, | 
|  | 128 | cflags: ["-O0"], | 
| Christopher Ferris | 5ea2c1f | 2017-03-23 14:55:01 -0700 | [diff] [blame] | 129 | srcs: ["backtrace_testlib.cpp"], | 
| Yabin Cui | 5d991bc | 2016-11-15 17:47:09 -0800 | [diff] [blame] | 130 |  | 
| Christopher Ferris | c8bec5a | 2017-12-11 17:44:33 -0800 | [diff] [blame] | 131 | shared_libs: [ | 
| Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 132 | "libunwindstack", | 
| Colin Cross | da9bd59 | 2016-12-14 17:24:46 -0800 | [diff] [blame] | 133 | ], | 
|  | 134 | } | 
|  | 135 |  | 
|  | 136 | //------------------------------------------------------------------------- | 
|  | 137 | // The backtrace_test executable. | 
|  | 138 | //------------------------------------------------------------------------- | 
|  | 139 | cc_test { | 
|  | 140 | name: "backtrace_test", | 
|  | 141 | defaults: ["libbacktrace_common"], | 
|  | 142 | host_supported: true, | 
|  | 143 | srcs: [ | 
|  | 144 | "backtrace_offline_test.cpp", | 
|  | 145 | "backtrace_test.cpp", | 
|  | 146 | "GetPss.cpp", | 
|  | 147 | "thread_utils.c", | 
|  | 148 | ], | 
|  | 149 |  | 
|  | 150 | cflags: [ | 
|  | 151 | "-fno-builtin", | 
|  | 152 | "-O0", | 
|  | 153 | "-g", | 
|  | 154 | ], | 
|  | 155 |  | 
|  | 156 | shared_libs: [ | 
|  | 157 | "libbacktrace_test", | 
|  | 158 | "libbacktrace", | 
| Christopher Ferris | 0b06a59 | 2018-01-19 10:26:36 -0800 | [diff] [blame] | 159 | "libdexfile", | 
| Colin Cross | da9bd59 | 2016-12-14 17:24:46 -0800 | [diff] [blame] | 160 | "libbase", | 
|  | 161 | "libcutils", | 
|  | 162 | "liblog", | 
| Christopher Ferris | 6f3981c | 2017-07-27 09:29:18 -0700 | [diff] [blame] | 163 | "libunwindstack", | 
| Colin Cross | da9bd59 | 2016-12-14 17:24:46 -0800 | [diff] [blame] | 164 | ], | 
|  | 165 |  | 
|  | 166 | group_static_libs: true, | 
|  | 167 |  | 
| Colin Cross | da9bd59 | 2016-12-14 17:24:46 -0800 | [diff] [blame] | 168 | target: { | 
|  | 169 | android: { | 
|  | 170 | cflags: ["-DENABLE_PSS_TESTS"], | 
|  | 171 | shared_libs: [ | 
| Colin Cross | da9bd59 | 2016-12-14 17:24:46 -0800 | [diff] [blame] | 172 | "libutils", | 
|  | 173 | ], | 
|  | 174 | }, | 
| Dan Willemsen | 4852933 | 2017-10-02 10:38:16 -0700 | [diff] [blame] | 175 | linux_glibc: { | 
| Colin Cross | da9bd59 | 2016-12-14 17:24:46 -0800 | [diff] [blame] | 176 | static_libs: ["libutils"], | 
|  | 177 | }, | 
|  | 178 | }, | 
| Christopher Ferris | 458cc66 | 2017-08-28 16:31:18 -0700 | [diff] [blame] | 179 |  | 
| Christopher Ferris | 0b06a59 | 2018-01-19 10:26:36 -0800 | [diff] [blame] | 180 | // libdexfile will eventually properly export headers, for now | 
|  | 181 | // include these directly. | 
|  | 182 | include_dirs: [ | 
|  | 183 | "art/runtime", | 
|  | 184 | ], | 
|  | 185 |  | 
| Christopher Ferris | 458cc66 | 2017-08-28 16:31:18 -0700 | [diff] [blame] | 186 | data: [ | 
|  | 187 | "testdata/arm/*", | 
|  | 188 | "testdata/arm64/*", | 
|  | 189 | "testdata/x86/*", | 
|  | 190 | "testdata/x86_64/*", | 
|  | 191 | ], | 
| Colin Cross | da9bd59 | 2016-12-14 17:24:46 -0800 | [diff] [blame] | 192 | } | 
| Christopher Ferris | 60521c7 | 2017-08-18 15:10:53 -0700 | [diff] [blame] | 193 |  | 
|  | 194 | cc_benchmark { | 
|  | 195 | name: "backtrace_benchmarks", | 
|  | 196 | defaults: ["libbacktrace_common"], | 
|  | 197 |  | 
|  | 198 | srcs: [ | 
|  | 199 | "backtrace_benchmarks.cpp", | 
| Christopher Ferris | e328673 | 2017-12-07 17:41:18 -0800 | [diff] [blame] | 200 | "backtrace_read_benchmarks.cpp", | 
| Christopher Ferris | 60521c7 | 2017-08-18 15:10:53 -0700 | [diff] [blame] | 201 | ], | 
|  | 202 |  | 
|  | 203 | shared_libs: [ | 
|  | 204 | "libbacktrace", | 
|  | 205 | "libbase", | 
| Josh Gao | b9670bb | 2017-10-25 15:12:24 -0700 | [diff] [blame] | 206 | "libunwindstack", | 
| Christopher Ferris | 60521c7 | 2017-08-18 15:10:53 -0700 | [diff] [blame] | 207 | ], | 
|  | 208 | } |