Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 1 | // |
| 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 | |
| 17 | cc_defaults { |
| 18 | name: "libunwindstack_flags", |
| 19 | |
| 20 | host_supported: true, |
| 21 | |
| 22 | cflags: [ |
| 23 | "-Wall", |
| 24 | "-Werror", |
| 25 | "-Wextra", |
| 26 | ], |
Christopher Ferris | 01d5037 | 2017-01-30 13:45:16 -0800 | [diff] [blame] | 27 | |
| 28 | target: { |
| 29 | darwin: { |
| 30 | enabled: false, |
| 31 | }, |
Dan Willemsen | 0f04867 | 2017-09-19 17:53:12 -0700 | [diff] [blame] | 32 | linux_bionic: { |
| 33 | enabled: true, |
| 34 | }, |
Christopher Ferris | 01d5037 | 2017-01-30 13:45:16 -0800 | [diff] [blame] | 35 | }, |
Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 36 | } |
| 37 | |
Martin Stjernholm | a2cc893 | 2019-10-23 21:32:43 +0100 | [diff] [blame] | 38 | cc_defaults { |
| 39 | name: "libunwindstack_defaults", |
Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 40 | defaults: ["libunwindstack_flags"], |
Christopher Ferris | d226a51 | 2017-07-14 10:37:19 -0700 | [diff] [blame] | 41 | export_include_dirs: ["include"], |
Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 42 | |
| 43 | srcs: [ |
| 44 | "ArmExidx.cpp", |
David Srbecky | b9cc4fb | 2019-04-05 18:23:32 +0000 | [diff] [blame] | 45 | "DexFiles.cpp", |
Christopher Ferris | 8642fcb | 2017-04-24 11:14:39 -0700 | [diff] [blame] | 46 | "DwarfCfa.cpp", |
Christopher Ferris | c9dee84 | 2017-11-03 14:50:27 -0700 | [diff] [blame] | 47 | "DwarfEhFrameWithHdr.cpp", |
Christopher Ferris | 72a6fa6 | 2017-03-21 12:41:17 -0700 | [diff] [blame] | 48 | "DwarfMemory.cpp", |
Christopher Ferris | 55d22ef | 2017-04-04 10:41:31 -0700 | [diff] [blame] | 49 | "DwarfOp.cpp", |
Christopher Ferris | 53a3c9b | 2017-05-10 18:34:15 -0700 | [diff] [blame] | 50 | "DwarfSection.cpp", |
Christopher Ferris | 3958f80 | 2017-02-01 15:44:40 -0800 | [diff] [blame] | 51 | "Elf.cpp", |
| 52 | "ElfInterface.cpp", |
| 53 | "ElfInterfaceArm.cpp", |
Christopher Ferris | 56d0e07 | 2018-10-17 10:57:53 -0700 | [diff] [blame] | 54 | "Global.cpp", |
Christopher Ferris | 150db12 | 2017-12-20 18:49:01 -0800 | [diff] [blame] | 55 | "JitDebug.cpp", |
Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 56 | "Log.cpp", |
Christopher Ferris | 0d7cf3e | 2017-04-19 15:42:19 -0700 | [diff] [blame] | 57 | "MapInfo.cpp", |
Christopher Ferris | 09385e7 | 2017-04-05 13:25:04 -0700 | [diff] [blame] | 58 | "Maps.cpp", |
Christopher Ferris | 3958f80 | 2017-02-01 15:44:40 -0800 | [diff] [blame] | 59 | "Memory.cpp", |
Peter Collingbourne | c71e0a6 | 2020-04-07 14:04:46 -0700 | [diff] [blame] | 60 | "MemoryMte.cpp", |
Christopher Ferris | ca9a54b | 2018-04-05 11:15:00 -0700 | [diff] [blame] | 61 | "LocalUnwinder.cpp", |
Christopher Ferris | bae69f1 | 2017-06-28 14:51:54 -0700 | [diff] [blame] | 62 | "Regs.cpp", |
Christopher Ferris | d06001d | 2017-11-30 18:56:01 -0800 | [diff] [blame] | 63 | "RegsArm.cpp", |
| 64 | "RegsArm64.cpp", |
| 65 | "RegsX86.cpp", |
| 66 | "RegsX86_64.cpp", |
Douglas Leung | 61b1a1a | 2017-11-08 10:53:53 +0100 | [diff] [blame] | 67 | "RegsMips.cpp", |
| 68 | "RegsMips64.cpp", |
Christopher Ferris | b9de87f | 2017-09-20 13:37:24 -0700 | [diff] [blame] | 69 | "Unwinder.cpp", |
Christopher Ferris | e7ba4cc | 2017-04-04 14:06:58 -0700 | [diff] [blame] | 70 | "Symbols.cpp", |
Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 71 | ], |
| 72 | |
Josh Gao | e22701e | 2017-10-23 14:25:08 -0700 | [diff] [blame] | 73 | cflags: [ |
| 74 | "-Wexit-time-destructors", |
| 75 | ], |
| 76 | |
Christopher Ferris | 5f11851 | 2017-09-01 11:17:16 -0700 | [diff] [blame] | 77 | target: { |
Dan Willemsen | cd58088 | 2017-10-02 10:29:02 -0700 | [diff] [blame] | 78 | host: { |
Martin Stjernholm | 4a27a81 | 2020-04-23 16:49:12 +0100 | [diff] [blame] | 79 | // Always disable optimizations for host to make it easier to debug. |
Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 80 | cflags: [ |
| 81 | "-O0", |
| 82 | "-g", |
| 83 | ], |
Christopher Ferris | 5f11851 | 2017-09-01 11:17:16 -0700 | [diff] [blame] | 84 | }, |
Martin Stjernholm | 4a27a81 | 2020-04-23 16:49:12 +0100 | [diff] [blame] | 85 | android: { |
| 86 | header_libs: ["bionic_libc_platform_headers"], |
| 87 | product_variables: { |
| 88 | experimental_mte: { |
| 89 | cflags: ["-DANDROID_EXPERIMENTAL_MTE"], |
| 90 | }, |
| 91 | }, |
| 92 | }, |
| 93 | linux_bionic: { |
| 94 | header_libs: ["bionic_libc_platform_headers"], |
| 95 | product_variables: { |
| 96 | experimental_mte: { |
| 97 | cflags: ["-DANDROID_EXPERIMENTAL_MTE"], |
| 98 | }, |
| 99 | }, |
| 100 | }, |
Christopher Ferris | 5f11851 | 2017-09-01 11:17:16 -0700 | [diff] [blame] | 101 | }, |
| 102 | |
Christopher Ferris | 2a25c4a | 2017-07-07 16:35:48 -0700 | [diff] [blame] | 103 | arch: { |
| 104 | x86: { |
| 105 | srcs: ["AsmGetRegsX86.S"], |
| 106 | }, |
| 107 | x86_64: { |
| 108 | srcs: ["AsmGetRegsX86_64.S"], |
| 109 | }, |
| 110 | }, |
| 111 | |
Yabin Cui | 3841acc | 2018-05-10 17:19:12 -0700 | [diff] [blame] | 112 | static_libs: [ |
| 113 | "libprocinfo", |
| 114 | ], |
| 115 | |
Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 116 | shared_libs: [ |
| 117 | "libbase", |
| 118 | "liblog", |
Christopher Ferris | bae69f1 | 2017-06-28 14:51:54 -0700 | [diff] [blame] | 119 | "liblzma", |
Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 120 | ], |
| 121 | } |
| 122 | |
Martin Stjernholm | a2cc893 | 2019-10-23 21:32:43 +0100 | [diff] [blame] | 123 | cc_library { |
| 124 | name: "libunwindstack", |
| 125 | vendor_available: true, |
| 126 | recovery_available: true, |
Victor Khimenko | 7428c52 | 2020-06-18 22:01:13 +0200 | [diff] [blame] | 127 | // TODO(b/153609531): remove when no longer needed. |
| 128 | native_bridge_supported: true, |
Martin Stjernholm | a2cc893 | 2019-10-23 21:32:43 +0100 | [diff] [blame] | 129 | vndk: { |
| 130 | enabled: true, |
| 131 | support_system_process: true, |
| 132 | }, |
| 133 | defaults: ["libunwindstack_defaults"], |
Martin Stjernholm | a2cc893 | 2019-10-23 21:32:43 +0100 | [diff] [blame] | 134 | srcs: ["DexFile.cpp"], |
| 135 | cflags: ["-DDEXFILE_SUPPORT"], |
| 136 | shared_libs: ["libdexfile_support"], |
| 137 | |
| 138 | target: { |
| 139 | vendor: { |
| 140 | cflags: ["-UDEXFILE_SUPPORT"], |
| 141 | exclude_srcs: ["DexFile.cpp"], |
| 142 | exclude_shared_libs: ["libdexfile_support"], |
| 143 | }, |
| 144 | recovery: { |
| 145 | cflags: ["-UDEXFILE_SUPPORT"], |
| 146 | exclude_srcs: ["DexFile.cpp"], |
| 147 | exclude_shared_libs: ["libdexfile_support"], |
| 148 | }, |
Victor Khimenko | 7428c52 | 2020-06-18 22:01:13 +0200 | [diff] [blame] | 149 | native_bridge: { |
| 150 | cflags: ["-UDEXFILE_SUPPORT"], |
| 151 | exclude_srcs: ["DexFile.cpp"], |
| 152 | exclude_shared_libs: ["libdexfile_support"], |
| 153 | }, |
Martin Stjernholm | a2cc893 | 2019-10-23 21:32:43 +0100 | [diff] [blame] | 154 | }, |
Jiyong Park | 16a932a | 2020-04-28 18:22:23 +0900 | [diff] [blame] | 155 | |
| 156 | apex_available: [ |
| 157 | "//apex_available:platform", |
| 158 | "com.android.art.debug", |
| 159 | "com.android.art.release", |
| 160 | ], |
Martin Stjernholm | a2cc893 | 2019-10-23 21:32:43 +0100 | [diff] [blame] | 161 | } |
| 162 | |
| 163 | // Static library without DEX support to avoid dependencies on the ART APEX. |
| 164 | cc_library_static { |
| 165 | name: "libunwindstack_no_dex", |
| 166 | recovery_available: true, |
| 167 | defaults: ["libunwindstack_defaults"], |
| 168 | |
| 169 | visibility: [ |
Christopher Ferris | b05c472 | 2020-09-23 15:51:46 -0700 | [diff] [blame] | 170 | "//external/gwp_asan", |
Martin Stjernholm | a2cc893 | 2019-10-23 21:32:43 +0100 | [diff] [blame] | 171 | "//system/core/debuggerd", |
| 172 | "//system/core/init", |
| 173 | "//system/core/libbacktrace", |
| 174 | ], |
| 175 | apex_available: [ |
| 176 | "//apex_available:platform", |
| 177 | "com.android.runtime", |
| 178 | ], |
| 179 | } |
| 180 | |
Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 181 | //------------------------------------------------------------------------- |
| 182 | // Unit Tests |
| 183 | //------------------------------------------------------------------------- |
Christopher Ferris | ca9a54b | 2018-04-05 11:15:00 -0700 | [diff] [blame] | 184 | cc_test_library { |
| 185 | name: "libunwindstack_local", |
| 186 | defaults: ["libunwindstack_flags"], |
| 187 | srcs: ["tests/TestLocal.cpp"], |
| 188 | |
| 189 | cflags: [ |
| 190 | "-O0", |
| 191 | "-g", |
| 192 | ], |
| 193 | |
| 194 | shared_libs: [ |
| 195 | "libunwindstack", |
| 196 | ], |
Christopher Ferris | 7aba514 | 2019-09-03 10:18:42 -0700 | [diff] [blame] | 197 | relative_install_path: "libunwindstack_test", |
Christopher Ferris | ca9a54b | 2018-04-05 11:15:00 -0700 | [diff] [blame] | 198 | } |
| 199 | |
Christopher Ferris | 7aba514 | 2019-09-03 10:18:42 -0700 | [diff] [blame] | 200 | cc_defaults { |
| 201 | name: "libunwindstack_testlib_flags", |
Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 202 | defaults: ["libunwindstack_flags"], |
| 203 | |
| 204 | srcs: [ |
| 205 | "tests/ArmExidxDecodeTest.cpp", |
| 206 | "tests/ArmExidxExtractTest.cpp", |
David Srbecky | 18121dc | 2018-03-12 19:54:22 +0000 | [diff] [blame] | 207 | "tests/DexFileTest.cpp", |
| 208 | "tests/DexFilesTest.cpp", |
Christopher Ferris | 8642fcb | 2017-04-24 11:14:39 -0700 | [diff] [blame] | 209 | "tests/DwarfCfaLogTest.cpp", |
| 210 | "tests/DwarfCfaTest.cpp", |
Christopher Ferris | 61d4097 | 2017-06-12 19:14:20 -0700 | [diff] [blame] | 211 | "tests/DwarfDebugFrameTest.cpp", |
| 212 | "tests/DwarfEhFrameTest.cpp", |
Christopher Ferris | c9dee84 | 2017-11-03 14:50:27 -0700 | [diff] [blame] | 213 | "tests/DwarfEhFrameWithHdrTest.cpp", |
Christopher Ferris | 72a6fa6 | 2017-03-21 12:41:17 -0700 | [diff] [blame] | 214 | "tests/DwarfMemoryTest.cpp", |
Christopher Ferris | 55d22ef | 2017-04-04 10:41:31 -0700 | [diff] [blame] | 215 | "tests/DwarfOpLogTest.cpp", |
| 216 | "tests/DwarfOpTest.cpp", |
Christopher Ferris | 53a3c9b | 2017-05-10 18:34:15 -0700 | [diff] [blame] | 217 | "tests/DwarfSectionTest.cpp", |
| 218 | "tests/DwarfSectionImplTest.cpp", |
Christopher Ferris | 0b79ae1 | 2018-01-25 12:15:56 -0800 | [diff] [blame] | 219 | "tests/ElfCacheTest.cpp", |
Christopher Ferris | f6f691b | 2017-09-25 19:23:07 -0700 | [diff] [blame] | 220 | "tests/ElfFake.cpp", |
Christopher Ferris | 3958f80 | 2017-02-01 15:44:40 -0800 | [diff] [blame] | 221 | "tests/ElfInterfaceArmTest.cpp", |
| 222 | "tests/ElfInterfaceTest.cpp", |
| 223 | "tests/ElfTest.cpp", |
Christopher Ferris | 570b76f | 2017-06-30 17:18:16 -0700 | [diff] [blame] | 224 | "tests/ElfTestUtils.cpp", |
Christopher Ferris | ea8e7d1 | 2019-07-17 15:47:32 -0700 | [diff] [blame] | 225 | "tests/IsolatedSettings.cpp", |
Christopher Ferris | 150db12 | 2017-12-20 18:49:01 -0800 | [diff] [blame] | 226 | "tests/JitDebugTest.cpp", |
David Srbecky | f1932fd | 2019-09-16 22:36:55 +0100 | [diff] [blame] | 227 | "tests/LocalUpdatableMapsTest.cpp", |
Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 228 | "tests/LogFake.cpp", |
Christopher Ferris | 9d5712c | 2018-10-01 21:01:09 -0700 | [diff] [blame] | 229 | "tests/MapInfoCreateMemoryTest.cpp", |
Christopher Ferris | bf373ed | 2019-01-16 17:23:39 -0800 | [diff] [blame] | 230 | "tests/MapInfoGetBuildIDTest.cpp", |
Christopher Ferris | 570b76f | 2017-06-30 17:18:16 -0700 | [diff] [blame] | 231 | "tests/MapInfoGetElfTest.cpp", |
Christopher Ferris | b7de5f5 | 2017-12-01 21:37:37 -0800 | [diff] [blame] | 232 | "tests/MapInfoGetLoadBiasTest.cpp", |
Christopher Ferris | eb0772f | 2018-12-05 15:57:02 -0800 | [diff] [blame] | 233 | "tests/MapInfoTest.cpp", |
Christopher Ferris | 09385e7 | 2017-04-05 13:25:04 -0700 | [diff] [blame] | 234 | "tests/MapsTest.cpp", |
Christopher Ferris | f6d5431 | 2017-07-11 15:29:32 -0700 | [diff] [blame] | 235 | "tests/MemoryBufferTest.cpp", |
Christopher Ferris | ef64010 | 2018-11-14 15:36:45 -0800 | [diff] [blame] | 236 | "tests/MemoryCacheTest.cpp", |
Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 237 | "tests/MemoryFake.cpp", |
| 238 | "tests/MemoryFileTest.cpp", |
| 239 | "tests/MemoryLocalTest.cpp", |
Christopher Ferris | 6633b0c | 2018-04-03 16:03:28 -0700 | [diff] [blame] | 240 | "tests/MemoryOfflineBufferTest.cpp", |
Josh Gao | f4a94c4 | 2017-11-13 16:16:27 -0800 | [diff] [blame] | 241 | "tests/MemoryOfflineTest.cpp", |
Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 242 | "tests/MemoryRangeTest.cpp", |
Christopher Ferris | 9d5712c | 2018-10-01 21:01:09 -0700 | [diff] [blame] | 243 | "tests/MemoryRangesTest.cpp", |
Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 244 | "tests/MemoryRemoteTest.cpp", |
Christopher Ferris | 9744fb2 | 2017-07-07 12:18:16 -0700 | [diff] [blame] | 245 | "tests/MemoryTest.cpp", |
Peter Collingbourne | c71e0a6 | 2020-04-07 14:04:46 -0700 | [diff] [blame] | 246 | "tests/MemoryMteTest.cpp", |
Christopher Ferris | 2786608 | 2018-08-02 15:21:37 -0700 | [diff] [blame] | 247 | "tests/RegsInfoTest.cpp", |
Josh Gao | 6f580d8 | 2017-09-22 12:57:15 -0700 | [diff] [blame] | 248 | "tests/RegsIterateTest.cpp", |
Christopher Ferris | eb4a6db | 2017-07-19 12:37:45 -0700 | [diff] [blame] | 249 | "tests/RegsStepIfSignalHandlerTest.cpp", |
Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 250 | "tests/RegsTest.cpp", |
Christopher Ferris | e7ba4cc | 2017-04-04 14:06:58 -0700 | [diff] [blame] | 251 | "tests/SymbolsTest.cpp", |
Christopher Ferris | e1f7a63 | 2019-01-24 12:22:03 -0800 | [diff] [blame] | 252 | "tests/TestUtils.cpp", |
Christopher Ferris | c3d79f7 | 2017-11-28 19:14:54 -0800 | [diff] [blame] | 253 | "tests/UnwindOfflineTest.cpp", |
Christopher Ferris | 2a25c4a | 2017-07-07 16:35:48 -0700 | [diff] [blame] | 254 | "tests/UnwindTest.cpp", |
Christopher Ferris | f6f691b | 2017-09-25 19:23:07 -0700 | [diff] [blame] | 255 | "tests/UnwinderTest.cpp", |
Christopher Ferris | 7138232 | 2019-08-30 14:02:19 -0700 | [diff] [blame] | 256 | "tests/VerifyBionicTerminationTest.cpp", |
Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 257 | ], |
| 258 | |
| 259 | cflags: [ |
| 260 | "-O0", |
| 261 | "-g", |
| 262 | ], |
| 263 | |
| 264 | shared_libs: [ |
| 265 | "libbase", |
| 266 | "liblog", |
Christopher Ferris | bae69f1 | 2017-06-28 14:51:54 -0700 | [diff] [blame] | 267 | "liblzma", |
Christopher Ferris | f6d5431 | 2017-07-11 15:29:32 -0700 | [diff] [blame] | 268 | "libunwindstack", |
Martin Stjernholm | bb4f2b4 | 2018-12-19 14:28:33 +0000 | [diff] [blame] | 269 | "libdexfile_support", |
Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 270 | ], |
| 271 | |
Christopher Ferris | 53a3c9b | 2017-05-10 18:34:15 -0700 | [diff] [blame] | 272 | static_libs: [ |
| 273 | "libgmock", |
| 274 | ], |
| 275 | |
Elliott Hughes | 40fdf3f | 2018-04-27 16:12:06 -0700 | [diff] [blame] | 276 | test_suites: ["device-tests"], |
Christopher Ferris | bae69f1 | 2017-06-28 14:51:54 -0700 | [diff] [blame] | 277 | data: [ |
Christopher Ferris | 570b76f | 2017-06-30 17:18:16 -0700 | [diff] [blame] | 278 | "tests/files/elf32.xz", |
| 279 | "tests/files/elf64.xz", |
Yabin Cui | 11e96fe | 2018-03-14 18:16:22 -0700 | [diff] [blame] | 280 | "tests/files/offline/art_quick_osr_stub_arm/*", |
Christopher Ferris | 1a141a0 | 2018-01-24 08:52:47 -0800 | [diff] [blame] | 281 | "tests/files/offline/bad_eh_frame_hdr_arm64/*", |
| 282 | "tests/files/offline/debug_frame_first_x86/*", |
Christopher Ferris | 4cc36d2 | 2018-06-06 14:47:31 -0700 | [diff] [blame] | 283 | "tests/files/offline/debug_frame_load_bias_arm/*", |
Christopher Ferris | 5838e53 | 2019-10-21 18:59:42 -0700 | [diff] [blame] | 284 | "tests/files/offline/eh_frame_bias_x86/*", |
Christopher Ferris | e37e2d0 | 2018-02-09 15:57:39 -0800 | [diff] [blame] | 285 | "tests/files/offline/eh_frame_hdr_begin_x86_64/*", |
Christopher Ferris | 0f40a05 | 2020-01-22 12:17:06 -0800 | [diff] [blame] | 286 | "tests/files/offline/empty_arm64/*", |
Christopher Ferris | d49499d | 2019-06-10 18:37:32 -0700 | [diff] [blame] | 287 | "tests/files/offline/invalid_elf_offset_arm/*", |
Christopher Ferris | 5f5cb23 | 2018-02-05 13:07:06 -0800 | [diff] [blame] | 288 | "tests/files/offline/jit_debug_arm/*", |
| 289 | "tests/files/offline/jit_debug_x86/*", |
Yabin Cui | d5b22c5 | 2018-02-22 17:11:31 -0800 | [diff] [blame] | 290 | "tests/files/offline/jit_map_arm/*", |
Christopher Ferris | 5f5cb23 | 2018-02-05 13:07:06 -0800 | [diff] [blame] | 291 | "tests/files/offline/gnu_debugdata_arm/*", |
Christopher Ferris | 819f131 | 2019-10-03 13:35:48 -0700 | [diff] [blame] | 292 | "tests/files/offline/load_bias_different_section_bias_arm64/*", |
Florian Mayer | 249c90f | 2019-07-05 16:48:04 +0100 | [diff] [blame] | 293 | "tests/files/offline/load_bias_ro_rx_x86_64/*", |
Christopher Ferris | 239425b | 2018-05-17 18:37:38 -0700 | [diff] [blame] | 294 | "tests/files/offline/offset_arm/*", |
Christopher Ferris | 01040b1 | 2018-12-10 11:13:23 -0800 | [diff] [blame] | 295 | "tests/files/offline/shared_lib_in_apk_arm64/*", |
| 296 | "tests/files/offline/shared_lib_in_apk_memory_only_arm64/*", |
Christopher Ferris | 86f2d9d | 2019-03-12 15:17:36 -0700 | [diff] [blame] | 297 | "tests/files/offline/shared_lib_in_apk_single_map_arm64/*", |
Christopher Ferris | f0c82e7 | 2019-12-04 13:37:11 -0800 | [diff] [blame] | 298 | "tests/files/offline/signal_load_bias_arm/*", |
Ryan Prichard | 9b8f545 | 2020-09-30 18:31:05 -0700 | [diff] [blame] | 299 | "tests/files/offline/signal_fde_x86/*", |
| 300 | "tests/files/offline/signal_fde_x86_64/*", |
Christopher Ferris | 5f5cb23 | 2018-02-05 13:07:06 -0800 | [diff] [blame] | 301 | "tests/files/offline/straddle_arm/*", |
Christopher Ferris | c3d79f7 | 2017-11-28 19:14:54 -0800 | [diff] [blame] | 302 | "tests/files/offline/straddle_arm64/*", |
Christopher Ferris | bae69f1 | 2017-06-28 14:51:54 -0700 | [diff] [blame] | 303 | ], |
Peter Collingbourne | c71e0a6 | 2020-04-07 14:04:46 -0700 | [diff] [blame] | 304 | |
Martin Stjernholm | 4a27a81 | 2020-04-23 16:49:12 +0100 | [diff] [blame] | 305 | target: { |
| 306 | android: { |
| 307 | header_libs: ["bionic_libc_platform_headers"], |
| 308 | product_variables: { |
| 309 | experimental_mte: { |
| 310 | cflags: ["-DANDROID_EXPERIMENTAL_MTE"], |
| 311 | }, |
| 312 | }, |
| 313 | }, |
| 314 | linux_bionic: { |
| 315 | header_libs: ["bionic_libc_platform_headers"], |
| 316 | product_variables: { |
| 317 | experimental_mte: { |
| 318 | cflags: ["-DANDROID_EXPERIMENTAL_MTE"], |
| 319 | }, |
| 320 | }, |
Peter Collingbourne | c71e0a6 | 2020-04-07 14:04:46 -0700 | [diff] [blame] | 321 | }, |
| 322 | }, |
Christopher Ferris | 7aba514 | 2019-09-03 10:18:42 -0700 | [diff] [blame] | 323 | } |
| 324 | |
| 325 | cc_test { |
| 326 | name: "libunwindstack_test", |
| 327 | defaults: ["libunwindstack_testlib_flags"], |
| 328 | isolated: true, |
| 329 | |
| 330 | srcs: [ |
| 331 | "tests/LocalUnwinderTest.cpp", |
| 332 | ], |
Elliott Hughes | f6d7594 | 2018-06-06 10:48:41 -0700 | [diff] [blame] | 333 | required: [ |
| 334 | "libunwindstack_local", |
| 335 | ], |
Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 336 | } |
| 337 | |
Christopher Ferris | 7aba514 | 2019-09-03 10:18:42 -0700 | [diff] [blame] | 338 | // Skip LocalUnwinderTest until atest understands required properly. |
| 339 | cc_test { |
| 340 | name: "libunwindstack_unit_test", |
| 341 | defaults: ["libunwindstack_testlib_flags"], |
| 342 | isolated: true, |
| 343 | } |
| 344 | |
Christopher Ferris | 3958f80 | 2017-02-01 15:44:40 -0800 | [diff] [blame] | 345 | //------------------------------------------------------------------------- |
Dylan Katz | b62e324 | 2020-05-28 14:23:10 -0700 | [diff] [blame] | 346 | // Fuzzers |
| 347 | //------------------------------------------------------------------------- |
| 348 | cc_defaults { |
| 349 | name: "libunwindstack_fuzz_defaults", |
| 350 | host_supported: true, |
| 351 | defaults: ["libunwindstack_flags"], |
| 352 | cflags: [ |
| 353 | "-Wno-exit-time-destructors", |
| 354 | "-g", |
| 355 | ], |
| 356 | shared_libs: [ |
| 357 | "libbase", |
| 358 | "liblog", |
| 359 | "liblzma", |
| 360 | "libunwindstack", |
| 361 | "libdexfile_support", |
| 362 | ], |
| 363 | } |
| 364 | |
| 365 | cc_fuzz { |
| 366 | name: "libunwindstack_fuzz_unwinder", |
| 367 | defaults: ["libunwindstack_fuzz_defaults"], |
| 368 | srcs: [ |
| 369 | "tests/MemoryFake.cpp", |
| 370 | "tests/ElfFake.cpp", |
| 371 | "tests/fuzz/UnwinderComponentCreator.cpp", |
| 372 | "tests/fuzz/UnwinderFuzz.cpp", |
| 373 | ], |
| 374 | } |
| 375 | |
| 376 | //------------------------------------------------------------------------- |
Christopher Ferris | b5d7a87 | 2017-07-12 15:40:52 -0700 | [diff] [blame] | 377 | // Tools |
Christopher Ferris | 3958f80 | 2017-02-01 15:44:40 -0800 | [diff] [blame] | 378 | //------------------------------------------------------------------------- |
| 379 | cc_defaults { |
Christopher Ferris | b5d7a87 | 2017-07-12 15:40:52 -0700 | [diff] [blame] | 380 | name: "libunwindstack_tools", |
Christopher Ferris | 3958f80 | 2017-02-01 15:44:40 -0800 | [diff] [blame] | 381 | defaults: ["libunwindstack_flags"], |
| 382 | |
| 383 | shared_libs: [ |
| 384 | "libunwindstack", |
| 385 | "libbase", |
Christopher Ferris | bae69f1 | 2017-06-28 14:51:54 -0700 | [diff] [blame] | 386 | "liblzma", |
Christopher Ferris | 3958f80 | 2017-02-01 15:44:40 -0800 | [diff] [blame] | 387 | ], |
Andreas Gampe | 8ccbe42 | 2018-05-21 08:24:20 -0700 | [diff] [blame] | 388 | target: { |
| 389 | // Always disable optimizations for host to make it easier to debug. |
| 390 | host: { |
| 391 | cflags: [ |
| 392 | "-O0", |
| 393 | "-g", |
| 394 | ], |
| 395 | }, |
| 396 | }, |
Christopher Ferris | b5d7a87 | 2017-07-12 15:40:52 -0700 | [diff] [blame] | 397 | } |
Christopher Ferris | 3958f80 | 2017-02-01 15:44:40 -0800 | [diff] [blame] | 398 | |
Christopher Ferris | b5d7a87 | 2017-07-12 15:40:52 -0700 | [diff] [blame] | 399 | cc_binary { |
| 400 | name: "unwind", |
| 401 | defaults: ["libunwindstack_tools"], |
| 402 | |
| 403 | srcs: [ |
| 404 | "tools/unwind.cpp", |
Christopher Ferris | 3958f80 | 2017-02-01 15:44:40 -0800 | [diff] [blame] | 405 | ], |
Christopher Ferris | 3958f80 | 2017-02-01 15:44:40 -0800 | [diff] [blame] | 406 | } |
| 407 | |
| 408 | cc_binary { |
| 409 | name: "unwind_info", |
Christopher Ferris | b5d7a87 | 2017-07-12 15:40:52 -0700 | [diff] [blame] | 410 | defaults: ["libunwindstack_tools"], |
Christopher Ferris | 3958f80 | 2017-02-01 15:44:40 -0800 | [diff] [blame] | 411 | |
| 412 | srcs: [ |
Christopher Ferris | b5d7a87 | 2017-07-12 15:40:52 -0700 | [diff] [blame] | 413 | "tools/unwind_info.cpp", |
| 414 | ], |
| 415 | } |
| 416 | |
| 417 | cc_binary { |
| 418 | name: "unwind_symbols", |
| 419 | defaults: ["libunwindstack_tools"], |
| 420 | |
| 421 | srcs: [ |
| 422 | "tools/unwind_symbols.cpp", |
Christopher Ferris | 3958f80 | 2017-02-01 15:44:40 -0800 | [diff] [blame] | 423 | ], |
| 424 | } |
Christopher Ferris | bae69f1 | 2017-06-28 14:51:54 -0700 | [diff] [blame] | 425 | |
Christopher Ferris | 3dfd2ae | 2017-12-15 20:00:59 -0800 | [diff] [blame] | 426 | cc_binary { |
| 427 | name: "unwind_for_offline", |
| 428 | defaults: ["libunwindstack_tools"], |
| 429 | |
| 430 | srcs: [ |
| 431 | "tools/unwind_for_offline.cpp", |
| 432 | ], |
| 433 | } |
| 434 | |
Christopher Ferris | e37e2d0 | 2018-02-09 15:57:39 -0800 | [diff] [blame] | 435 | cc_binary { |
| 436 | name: "unwind_reg_info", |
| 437 | defaults: ["libunwindstack_tools"], |
| 438 | |
| 439 | srcs: [ |
| 440 | "tools/unwind_reg_info.cpp", |
| 441 | ], |
| 442 | } |
| 443 | |
Christopher Ferris | ef64010 | 2018-11-14 15:36:45 -0800 | [diff] [blame] | 444 | //------------------------------------------------------------------------- |
| 445 | // Benchmarks |
| 446 | //------------------------------------------------------------------------- |
| 447 | cc_benchmark { |
| 448 | name: "unwind_benchmarks", |
| 449 | host_supported: true, |
| 450 | defaults: ["libunwindstack_flags"], |
| 451 | |
| 452 | // Disable optimizations so that all of the calls are not optimized away. |
| 453 | cflags: [ |
| 454 | "-O0", |
| 455 | ], |
| 456 | |
| 457 | srcs: [ |
| 458 | "benchmarks/unwind_benchmarks.cpp", |
David Srbecky | a17c2b6 | 2020-04-14 16:59:27 +0100 | [diff] [blame] | 459 | "benchmarks/ElfBenchmark.cpp", |
Christopher Ferris | 175747f | 2020-05-04 13:46:09 -0700 | [diff] [blame] | 460 | "benchmarks/MapsBenchmark.cpp", |
Christopher Ferris | a9e1909 | 2020-04-14 11:59:15 -0700 | [diff] [blame] | 461 | "benchmarks/SymbolBenchmark.cpp", |
David Srbecky | a17c2b6 | 2020-04-14 16:59:27 +0100 | [diff] [blame] | 462 | "benchmarks/Utils.cpp", |
Christopher Ferris | a9e1909 | 2020-04-14 11:59:15 -0700 | [diff] [blame] | 463 | ], |
| 464 | |
| 465 | data: [ |
| 466 | "benchmarks/files/*", |
Christopher Ferris | ef64010 | 2018-11-14 15:36:45 -0800 | [diff] [blame] | 467 | ], |
| 468 | |
| 469 | shared_libs: [ |
Christopher Ferris | bf373ed | 2019-01-16 17:23:39 -0800 | [diff] [blame] | 470 | "libbase", |
Christopher Ferris | ef64010 | 2018-11-14 15:36:45 -0800 | [diff] [blame] | 471 | "libunwindstack", |
| 472 | ], |
Christopher Ferris | a9e1909 | 2020-04-14 11:59:15 -0700 | [diff] [blame] | 473 | |
| 474 | target: { |
| 475 | android: { |
| 476 | static_libs: [ |
| 477 | "libmeminfo", |
| 478 | "libprocinfo", |
| 479 | ], |
| 480 | }, |
| 481 | }, |
Christopher Ferris | ef64010 | 2018-11-14 15:36:45 -0800 | [diff] [blame] | 482 | } |
| 483 | |
Christopher Ferris | bae69f1 | 2017-06-28 14:51:54 -0700 | [diff] [blame] | 484 | // Generates the elf data for use in the tests for .gnu_debugdata frames. |
| 485 | // Once these files are generated, use the xz command to compress the data. |
| 486 | cc_binary_host { |
| 487 | name: "gen_gnudebugdata", |
Christopher Ferris | f6d5431 | 2017-07-11 15:29:32 -0700 | [diff] [blame] | 488 | defaults: ["libunwindstack_flags"], |
Christopher Ferris | bae69f1 | 2017-06-28 14:51:54 -0700 | [diff] [blame] | 489 | |
| 490 | srcs: [ |
| 491 | "tests/GenGnuDebugdata.cpp", |
| 492 | ], |
| 493 | } |
Dylan Katz | b62e324 | 2020-05-28 14:23:10 -0700 | [diff] [blame] | 494 | |