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