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