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 | }, |
| 32 | }, |
Christopher Ferris | 3958f80 | 2017-02-01 15:44:40 -0800 | [diff] [blame] | 33 | |
Christopher Ferris | 3517fe0 | 2017-07-11 15:06:19 -0700 | [diff] [blame] | 34 | arch: { |
| 35 | mips: { |
| 36 | enabled: false, |
| 37 | }, |
| 38 | mips64: { |
| 39 | enabled: false, |
| 40 | }, |
| 41 | }, |
Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 42 | } |
| 43 | |
Christopher Ferris | f6d5431 | 2017-07-11 15:29:32 -0700 | [diff] [blame] | 44 | cc_library { |
| 45 | name: "libunwindstack", |
Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 46 | defaults: ["libunwindstack_flags"], |
Christopher Ferris | d226a51 | 2017-07-14 10:37:19 -0700 | [diff] [blame^] | 47 | export_include_dirs: ["include"], |
Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 48 | |
| 49 | srcs: [ |
| 50 | "ArmExidx.cpp", |
Christopher Ferris | 8642fcb | 2017-04-24 11:14:39 -0700 | [diff] [blame] | 51 | "DwarfCfa.cpp", |
Christopher Ferris | 61d4097 | 2017-06-12 19:14:20 -0700 | [diff] [blame] | 52 | "DwarfDebugFrame.cpp", |
| 53 | "DwarfEhFrame.cpp", |
Christopher Ferris | 72a6fa6 | 2017-03-21 12:41:17 -0700 | [diff] [blame] | 54 | "DwarfMemory.cpp", |
Christopher Ferris | 55d22ef | 2017-04-04 10:41:31 -0700 | [diff] [blame] | 55 | "DwarfOp.cpp", |
Christopher Ferris | 53a3c9b | 2017-05-10 18:34:15 -0700 | [diff] [blame] | 56 | "DwarfSection.cpp", |
Christopher Ferris | 3958f80 | 2017-02-01 15:44:40 -0800 | [diff] [blame] | 57 | "Elf.cpp", |
| 58 | "ElfInterface.cpp", |
| 59 | "ElfInterfaceArm.cpp", |
Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 60 | "Log.cpp", |
Christopher Ferris | 0d7cf3e | 2017-04-19 15:42:19 -0700 | [diff] [blame] | 61 | "MapInfo.cpp", |
Christopher Ferris | 09385e7 | 2017-04-05 13:25:04 -0700 | [diff] [blame] | 62 | "Maps.cpp", |
Christopher Ferris | 3958f80 | 2017-02-01 15:44:40 -0800 | [diff] [blame] | 63 | "Memory.cpp", |
Christopher Ferris | bae69f1 | 2017-06-28 14:51:54 -0700 | [diff] [blame] | 64 | "Regs.cpp", |
Christopher Ferris | e7ba4cc | 2017-04-04 14:06:58 -0700 | [diff] [blame] | 65 | "Symbols.cpp", |
Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 66 | ], |
| 67 | |
Christopher Ferris | 2a25c4a | 2017-07-07 16:35:48 -0700 | [diff] [blame] | 68 | arch: { |
| 69 | x86: { |
| 70 | srcs: ["AsmGetRegsX86.S"], |
| 71 | }, |
| 72 | x86_64: { |
| 73 | srcs: ["AsmGetRegsX86_64.S"], |
| 74 | }, |
| 75 | }, |
| 76 | |
Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 77 | shared_libs: [ |
| 78 | "libbase", |
| 79 | "liblog", |
Christopher Ferris | bae69f1 | 2017-06-28 14:51:54 -0700 | [diff] [blame] | 80 | "liblzma", |
Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 81 | ], |
| 82 | } |
| 83 | |
Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 84 | //------------------------------------------------------------------------- |
| 85 | // Unit Tests |
| 86 | //------------------------------------------------------------------------- |
Christopher Ferris | f6d5431 | 2017-07-11 15:29:32 -0700 | [diff] [blame] | 87 | cc_test { |
| 88 | name: "libunwindstack_test", |
Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 89 | defaults: ["libunwindstack_flags"], |
| 90 | |
| 91 | srcs: [ |
| 92 | "tests/ArmExidxDecodeTest.cpp", |
| 93 | "tests/ArmExidxExtractTest.cpp", |
Christopher Ferris | 8642fcb | 2017-04-24 11:14:39 -0700 | [diff] [blame] | 94 | "tests/DwarfCfaLogTest.cpp", |
| 95 | "tests/DwarfCfaTest.cpp", |
Christopher Ferris | 61d4097 | 2017-06-12 19:14:20 -0700 | [diff] [blame] | 96 | "tests/DwarfDebugFrameTest.cpp", |
| 97 | "tests/DwarfEhFrameTest.cpp", |
Christopher Ferris | 72a6fa6 | 2017-03-21 12:41:17 -0700 | [diff] [blame] | 98 | "tests/DwarfMemoryTest.cpp", |
Christopher Ferris | 55d22ef | 2017-04-04 10:41:31 -0700 | [diff] [blame] | 99 | "tests/DwarfOpLogTest.cpp", |
| 100 | "tests/DwarfOpTest.cpp", |
Christopher Ferris | 53a3c9b | 2017-05-10 18:34:15 -0700 | [diff] [blame] | 101 | "tests/DwarfSectionTest.cpp", |
| 102 | "tests/DwarfSectionImplTest.cpp", |
Christopher Ferris | 3958f80 | 2017-02-01 15:44:40 -0800 | [diff] [blame] | 103 | "tests/ElfInterfaceArmTest.cpp", |
| 104 | "tests/ElfInterfaceTest.cpp", |
| 105 | "tests/ElfTest.cpp", |
Christopher Ferris | 570b76f | 2017-06-30 17:18:16 -0700 | [diff] [blame] | 106 | "tests/ElfTestUtils.cpp", |
Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 107 | "tests/LogFake.cpp", |
Christopher Ferris | 570b76f | 2017-06-30 17:18:16 -0700 | [diff] [blame] | 108 | "tests/MapInfoCreateMemoryTest.cpp", |
| 109 | "tests/MapInfoGetElfTest.cpp", |
Christopher Ferris | 09385e7 | 2017-04-05 13:25:04 -0700 | [diff] [blame] | 110 | "tests/MapsTest.cpp", |
Christopher Ferris | f6d5431 | 2017-07-11 15:29:32 -0700 | [diff] [blame] | 111 | "tests/MemoryBufferTest.cpp", |
Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 112 | "tests/MemoryFake.cpp", |
| 113 | "tests/MemoryFileTest.cpp", |
| 114 | "tests/MemoryLocalTest.cpp", |
| 115 | "tests/MemoryRangeTest.cpp", |
| 116 | "tests/MemoryRemoteTest.cpp", |
Christopher Ferris | 9744fb2 | 2017-07-07 12:18:16 -0700 | [diff] [blame] | 117 | "tests/MemoryTest.cpp", |
Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 118 | "tests/RegsTest.cpp", |
Christopher Ferris | e7ba4cc | 2017-04-04 14:06:58 -0700 | [diff] [blame] | 119 | "tests/SymbolsTest.cpp", |
Christopher Ferris | 2a25c4a | 2017-07-07 16:35:48 -0700 | [diff] [blame] | 120 | "tests/UnwindTest.cpp", |
Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 121 | ], |
| 122 | |
| 123 | cflags: [ |
| 124 | "-O0", |
| 125 | "-g", |
| 126 | ], |
| 127 | |
| 128 | shared_libs: [ |
| 129 | "libbase", |
| 130 | "liblog", |
Christopher Ferris | bae69f1 | 2017-06-28 14:51:54 -0700 | [diff] [blame] | 131 | "liblzma", |
Christopher Ferris | f6d5431 | 2017-07-11 15:29:32 -0700 | [diff] [blame] | 132 | "libunwindstack", |
Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 133 | ], |
| 134 | |
Christopher Ferris | 53a3c9b | 2017-05-10 18:34:15 -0700 | [diff] [blame] | 135 | static_libs: [ |
| 136 | "libgmock", |
| 137 | ], |
| 138 | |
Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 139 | target: { |
Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 140 | linux: { |
| 141 | host_ldlibs: [ |
| 142 | "-lrt", |
| 143 | ], |
| 144 | }, |
| 145 | }, |
Christopher Ferris | bae69f1 | 2017-06-28 14:51:54 -0700 | [diff] [blame] | 146 | |
| 147 | data: [ |
Christopher Ferris | 570b76f | 2017-06-30 17:18:16 -0700 | [diff] [blame] | 148 | "tests/files/elf32.xz", |
| 149 | "tests/files/elf64.xz", |
Christopher Ferris | bae69f1 | 2017-06-28 14:51:54 -0700 | [diff] [blame] | 150 | ], |
Christopher Ferris | 723cf9b | 2017-01-19 20:08:48 -0800 | [diff] [blame] | 151 | } |
| 152 | |
Christopher Ferris | 3958f80 | 2017-02-01 15:44:40 -0800 | [diff] [blame] | 153 | //------------------------------------------------------------------------- |
Christopher Ferris | b5d7a87 | 2017-07-12 15:40:52 -0700 | [diff] [blame] | 154 | // Tools |
Christopher Ferris | 3958f80 | 2017-02-01 15:44:40 -0800 | [diff] [blame] | 155 | //------------------------------------------------------------------------- |
| 156 | cc_defaults { |
Christopher Ferris | b5d7a87 | 2017-07-12 15:40:52 -0700 | [diff] [blame] | 157 | name: "libunwindstack_tools", |
Christopher Ferris | 3958f80 | 2017-02-01 15:44:40 -0800 | [diff] [blame] | 158 | defaults: ["libunwindstack_flags"], |
| 159 | |
| 160 | shared_libs: [ |
| 161 | "libunwindstack", |
| 162 | "libbase", |
Christopher Ferris | bae69f1 | 2017-06-28 14:51:54 -0700 | [diff] [blame] | 163 | "liblzma", |
Christopher Ferris | 3958f80 | 2017-02-01 15:44:40 -0800 | [diff] [blame] | 164 | ], |
Christopher Ferris | b5d7a87 | 2017-07-12 15:40:52 -0700 | [diff] [blame] | 165 | } |
Christopher Ferris | 3958f80 | 2017-02-01 15:44:40 -0800 | [diff] [blame] | 166 | |
Christopher Ferris | b5d7a87 | 2017-07-12 15:40:52 -0700 | [diff] [blame] | 167 | cc_binary { |
| 168 | name: "unwind", |
| 169 | defaults: ["libunwindstack_tools"], |
| 170 | |
| 171 | srcs: [ |
| 172 | "tools/unwind.cpp", |
Christopher Ferris | 3958f80 | 2017-02-01 15:44:40 -0800 | [diff] [blame] | 173 | ], |
Christopher Ferris | b5d7a87 | 2017-07-12 15:40:52 -0700 | [diff] [blame] | 174 | |
| 175 | target: { |
| 176 | linux: { |
| 177 | host_ldlibs: [ |
| 178 | "-lrt", |
| 179 | ], |
| 180 | }, |
| 181 | }, |
Christopher Ferris | 3958f80 | 2017-02-01 15:44:40 -0800 | [diff] [blame] | 182 | } |
| 183 | |
| 184 | cc_binary { |
| 185 | name: "unwind_info", |
Christopher Ferris | b5d7a87 | 2017-07-12 15:40:52 -0700 | [diff] [blame] | 186 | defaults: ["libunwindstack_tools"], |
Christopher Ferris | 3958f80 | 2017-02-01 15:44:40 -0800 | [diff] [blame] | 187 | |
| 188 | srcs: [ |
Christopher Ferris | b5d7a87 | 2017-07-12 15:40:52 -0700 | [diff] [blame] | 189 | "tools/unwind_info.cpp", |
| 190 | ], |
| 191 | } |
| 192 | |
| 193 | cc_binary { |
| 194 | name: "unwind_symbols", |
| 195 | defaults: ["libunwindstack_tools"], |
| 196 | |
| 197 | srcs: [ |
| 198 | "tools/unwind_symbols.cpp", |
Christopher Ferris | 3958f80 | 2017-02-01 15:44:40 -0800 | [diff] [blame] | 199 | ], |
| 200 | } |
Christopher Ferris | bae69f1 | 2017-06-28 14:51:54 -0700 | [diff] [blame] | 201 | |
| 202 | // Generates the elf data for use in the tests for .gnu_debugdata frames. |
| 203 | // Once these files are generated, use the xz command to compress the data. |
| 204 | cc_binary_host { |
| 205 | name: "gen_gnudebugdata", |
Christopher Ferris | f6d5431 | 2017-07-11 15:29:32 -0700 | [diff] [blame] | 206 | defaults: ["libunwindstack_flags"], |
Christopher Ferris | bae69f1 | 2017-06-28 14:51:54 -0700 | [diff] [blame] | 207 | |
| 208 | srcs: [ |
| 209 | "tests/GenGnuDebugdata.cpp", |
| 210 | ], |
| 211 | } |