Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 1 | // Copyright (C) 2016 The Android Open Source Project |
| 2 | // All rights reserved. |
| 3 | // |
| 4 | // Redistribution and use in source and binary forms, with or without |
| 5 | // modification, are permitted provided that the following conditions |
| 6 | // are met: |
| 7 | // * Redistributions of source code must retain the above copyright |
| 8 | // notice, this list of conditions and the following disclaimer. |
| 9 | // * Redistributions in binary form must reproduce the above copyright |
| 10 | // notice, this list of conditions and the following disclaimer in |
| 11 | // the documentation and/or other materials provided with the |
| 12 | // distribution. |
| 13 | // |
| 14 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 15 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 16 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 17 | // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
| 18 | // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
| 19 | // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
| 20 | // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS |
| 21 | // OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED |
| 22 | // AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| 23 | // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
| 24 | // OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 25 | // SUCH DAMAGE. |
| 26 | // |
| 27 | // |
| 28 | // Copyright (c) 2016 VIXL authors |
| 29 | // All rights reserved. |
| 30 | // |
| 31 | // Redistribution and use in source and binary forms, with or without |
| 32 | // modification, are permitted provided that the following conditions |
| 33 | // are met: |
| 34 | // 1. Redistributions of source code must retain the above copyright |
| 35 | // notice, this list of conditions and the following disclaimer. |
| 36 | // 2. Redistributions in binary form must reproduce the above copyright |
| 37 | // notice, this list of conditions and the following disclaimer in the |
| 38 | // documentation and/or other materials provided with the distribution. |
| 39 | // 3. The name of the company may not be used to endorse or promote |
| 40 | // products derived from this software without specific prior written |
| 41 | // permission. |
| 42 | // |
| 43 | // THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED |
| 44 | // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
| 45 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
| 46 | // IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 47 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED |
| 48 | // TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 49 | // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
| 50 | // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
| 51 | // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 52 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 53 | |
Paul Duffin | 1d441a7 | 2019-07-08 15:20:52 +0100 | [diff] [blame] | 54 | package { |
| 55 | default_visibility: ["//visibility:private"], |
Bob Badour | cd42a2b | 2021-02-12 21:41:48 -0800 | [diff] [blame] | 56 | default_applicable_licenses: ["external_vixl_license"], |
| 57 | } |
| 58 | |
| 59 | // Added automatically by a large-scale-change |
| 60 | // See: http://go/android-license-faq |
| 61 | license { |
| 62 | name: "external_vixl_license", |
| 63 | visibility: [":__subpackages__"], |
| 64 | license_kinds: [ |
| 65 | "SPDX-license-identifier-BSD", |
| 66 | ], |
| 67 | license_text: [ |
| 68 | "LICENCE", |
| 69 | ], |
Paul Duffin | 1d441a7 | 2019-07-08 15:20:52 +0100 | [diff] [blame] | 70 | } |
| 71 | |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 72 | cc_defaults { |
| 73 | name: "vixl-common", |
| 74 | host_supported: true, |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 75 | clang_cflags: ["-Wimplicit-fallthrough"], |
Chih-Hung Hsieh | 5652ef3 | 2017-09-29 11:33:41 -0700 | [diff] [blame] | 76 | cflags: [ |
| 77 | "-Wall", |
| 78 | "-Werror", |
| 79 | ], |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 80 | cppflags: [ |
| 81 | "-DVIXL_GENERATE_SIMULATOR_INSTRUCTIONS_VALUE=0", |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 82 | "-Wextra", |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 83 | "-fdiagnostics-show-option", |
| 84 | "-Wredundant-decls", |
| 85 | "-Wunreachable-code", |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 86 | "-pedantic", |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 87 | |
| 88 | // Explicitly enable the write-strings warning. VIXL uses |
| 89 | // const correctly when handling string constants. |
| 90 | "-Wwrite-strings", |
Vladimir Marko | 9b00771 | 2018-04-26 16:04:44 +0100 | [diff] [blame] | 91 | |
Evgeny Astigeevich | 39f6017 | 2019-10-31 11:48:28 +0000 | [diff] [blame] | 92 | // Explicitly disable 'missing-return' warnings because a lot of them are false positive. |
| 93 | // VIXL often creates stubs and compile-time configurations with things like |
| 94 | // VIXL_UNIMPLEMENTED(). Properly satisfying -Wmissing-noreturn requires that functions are |
| 95 | // annotated at their _declarations_, which means #ifdefs in header files. |
| 96 | // Conditional compilation in headers can result in incorrect behaviour when |
| 97 | // libvixl.so is built with different flags than the code using it. Disabling this |
| 98 | // warning allows VIXL to simplify the headers, and should make VIXL more robust. |
| 99 | "-Wno-missing-noreturn", |
| 100 | |
Vladimir Marko | 9b00771 | 2018-04-26 16:04:44 +0100 | [diff] [blame] | 101 | "-DVIXL_CODE_BUFFER_MALLOC", |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 102 | ], |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 103 | native_coverage: false, |
| 104 | sanitize: { |
| 105 | recover: ["shift-exponent"], |
| 106 | }, |
| 107 | } |
| 108 | |
Roland Levillain | 9c53ca6 | 2018-10-31 19:51:43 +0000 | [diff] [blame] | 109 | art_cc_defaults { |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 110 | name: "vixl-arm", |
| 111 | defaults: ["vixl-common"], |
Roland Levillain | 9c53ca6 | 2018-10-31 19:51:43 +0000 | [diff] [blame] | 112 | codegen: { |
| 113 | arm: { |
| 114 | srcs: ["src/aarch32/*.cc"], |
| 115 | cppflags: [ |
| 116 | "-DVIXL_INCLUDE_TARGET_T32", |
| 117 | ], |
| 118 | }, |
| 119 | }, |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 120 | } |
| 121 | |
Roland Levillain | 9c53ca6 | 2018-10-31 19:51:43 +0000 | [diff] [blame] | 122 | art_cc_defaults { |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 123 | name: "vixl-arm64", |
| 124 | defaults: ["vixl-common"], |
Roland Levillain | 9c53ca6 | 2018-10-31 19:51:43 +0000 | [diff] [blame] | 125 | codegen: { |
| 126 | arm64: { |
| 127 | srcs: ["src/aarch64/*.cc"], |
| 128 | cppflags: [ |
| 129 | "-DVIXL_INCLUDE_SIMULATOR_AARCH64", |
| 130 | "-DVIXL_INCLUDE_TARGET_A64", |
| 131 | ], |
Paul Duffin | 56af64d | 2019-07-08 15:19:49 +0100 | [diff] [blame] | 132 | }, |
Roland Levillain | 9c53ca6 | 2018-10-31 19:51:43 +0000 | [diff] [blame] | 133 | }, |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 134 | } |
| 135 | |
| 136 | cc_defaults { |
| 137 | name: "vixl-debug", |
| 138 | defaults: ["vixl-common"], |
| 139 | cppflags: [ |
| 140 | "-DVIXL_DEBUG", |
| 141 | "-UNDEBUG", |
| 142 | |
| 143 | "-O2", |
| 144 | "-ggdb3", |
| 145 | ], |
| 146 | } |
| 147 | |
| 148 | cc_defaults { |
| 149 | name: "vixl-release", |
| 150 | defaults: ["vixl-common"], |
| 151 | cppflags: [ |
| 152 | "-O3", |
| 153 | ], |
| 154 | } |
| 155 | |
Paul Duffin | 1d441a7 | 2019-07-08 15:20:52 +0100 | [diff] [blame] | 156 | libvixl_visibility = [ |
| 157 | "//art:__subpackages__", |
| 158 | ] |
| 159 | |
Paul Duffin | d1a8347 | 2019-07-12 15:30:36 +0100 | [diff] [blame] | 160 | // Defaults for the libvixl[d] libraries |
| 161 | cc_defaults { |
| 162 | name: "libvixl-defaults", |
| 163 | srcs: ["src/*.cc"], |
| 164 | export_include_dirs: ["src"], |
Nicolas Geoffray | c918719 | 2021-03-03 21:56:54 +0000 | [diff] [blame] | 165 | min_sdk_version: "S", |
Paul Duffin | d1a8347 | 2019-07-12 15:30:36 +0100 | [diff] [blame] | 166 | } |
| 167 | |
Roland Levillain | 9c53ca6 | 2018-10-31 19:51:43 +0000 | [diff] [blame] | 168 | art_cc_library { |
| 169 | name: "libvixl", |
Paul Duffin | 1d441a7 | 2019-07-08 15:20:52 +0100 | [diff] [blame] | 170 | visibility: libvixl_visibility, |
Pirama Arumuga Nainar | 67fa1c7 | 2018-04-18 23:03:04 -0700 | [diff] [blame] | 171 | defaults: [ |
Paul Duffin | d1a8347 | 2019-07-12 15:30:36 +0100 | [diff] [blame] | 172 | "libvixl-defaults", |
Pirama Arumuga Nainar | 67fa1c7 | 2018-04-18 23:03:04 -0700 | [diff] [blame] | 173 | "vixl-release", |
Roland Levillain | 9c53ca6 | 2018-10-31 19:51:43 +0000 | [diff] [blame] | 174 | "vixl-arm", |
Pirama Arumuga Nainar | 67fa1c7 | 2018-04-18 23:03:04 -0700 | [diff] [blame] | 175 | "vixl-arm64", |
| 176 | "dex2oat-pgo-defaults", |
| 177 | ], |
Pirama Arumuga Nainar | 9048d87 | 2018-01-04 11:18:07 -0800 | [diff] [blame] | 178 | |
Yi Kong | f611172 | 2018-04-06 14:10:43 -0700 | [diff] [blame] | 179 | target: { |
| 180 | android: { |
| 181 | lto: { |
Paul Duffin | 56af64d | 2019-07-08 15:19:49 +0100 | [diff] [blame] | 182 | thin: true, |
Yi Kong | f611172 | 2018-04-06 14:10:43 -0700 | [diff] [blame] | 183 | }, |
| 184 | }, |
| 185 | }, |
Jiyong Park | 5c997a0 | 2020-04-28 18:22:11 +0900 | [diff] [blame] | 186 | |
| 187 | apex_available: [ |
Martin Stjernholm | 6032882 | 2020-10-12 15:11:13 +0100 | [diff] [blame] | 188 | "com.android.art", |
Jiyong Park | 5c997a0 | 2020-04-28 18:22:11 +0900 | [diff] [blame] | 189 | "com.android.art.debug", |
Jiyong Park | 5c997a0 | 2020-04-28 18:22:11 +0900 | [diff] [blame] | 190 | ], |
Vladimir Marko | 07f3653 | 2021-05-06 10:35:31 +0000 | [diff] [blame] | 191 | |
| 192 | static: { |
| 193 | cflags: [ |
| 194 | "-fvisibility=hidden", |
| 195 | ], |
| 196 | }, |
| 197 | shared: { |
| 198 | cflags: [ |
| 199 | "-fvisibility=protected", |
| 200 | ], |
| 201 | }, |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 202 | } |
| 203 | |
Roland Levillain | 9c53ca6 | 2018-10-31 19:51:43 +0000 | [diff] [blame] | 204 | art_cc_library { |
| 205 | name: "libvixld", |
Paul Duffin | 1d441a7 | 2019-07-08 15:20:52 +0100 | [diff] [blame] | 206 | visibility: libvixl_visibility, |
Pirama Arumuga Nainar | 67fa1c7 | 2018-04-18 23:03:04 -0700 | [diff] [blame] | 207 | defaults: [ |
Paul Duffin | d1a8347 | 2019-07-12 15:30:36 +0100 | [diff] [blame] | 208 | "libvixl-defaults", |
Roland Levillain | 9c53ca6 | 2018-10-31 19:51:43 +0000 | [diff] [blame] | 209 | "vixl-debug", |
Pirama Arumuga Nainar | 67fa1c7 | 2018-04-18 23:03:04 -0700 | [diff] [blame] | 210 | "vixl-arm", |
Roland Levillain | 9c53ca6 | 2018-10-31 19:51:43 +0000 | [diff] [blame] | 211 | "vixl-arm64", |
Pirama Arumuga Nainar | 67fa1c7 | 2018-04-18 23:03:04 -0700 | [diff] [blame] | 212 | ], |
Jiyong Park | 5c997a0 | 2020-04-28 18:22:11 +0900 | [diff] [blame] | 213 | |
| 214 | apex_available: [ |
Martin Stjernholm | 6032882 | 2020-10-12 15:11:13 +0100 | [diff] [blame] | 215 | "com.android.art", |
Jiyong Park | 5c997a0 | 2020-04-28 18:22:11 +0900 | [diff] [blame] | 216 | "com.android.art.debug", |
| 217 | ], |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 218 | } |
| 219 | |
| 220 | //######## VIXL HOST TESTS ######### |
| 221 | // |
| 222 | // We only support 64bit host builds for now. |
| 223 | // To run all the tests: vixl-test-runner --run_all |
| 224 | // |
Dan Willemsen | 7168b85 | 2017-10-06 11:27:01 -0700 | [diff] [blame] | 225 | cc_test_host { |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 226 | name: "vixl-test-runner", |
Dan Willemsen | 7168b85 | 2017-10-06 11:27:01 -0700 | [diff] [blame] | 227 | gtest: false, |
Paul Duffin | 56af64d | 2019-07-08 15:19:49 +0100 | [diff] [blame] | 228 | defaults: [ |
| 229 | "vixl-debug", |
| 230 | "vixl-arm", |
| 231 | "vixl-arm64", |
| 232 | ], |
Paul Duffin | d1a8347 | 2019-07-12 15:30:36 +0100 | [diff] [blame] | 233 | local_include_dirs: [ |
| 234 | "test", |
| 235 | ], |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 236 | srcs: [ |
| 237 | "test/*.cc", |
| 238 | "test/aarch32/*.cc", |
| 239 | "test/aarch64/*.cc", |
| 240 | ], |
Paul Duffin | d1a8347 | 2019-07-12 15:30:36 +0100 | [diff] [blame] | 241 | static_libs: [ |
| 242 | "libvixld", |
| 243 | ], |
Dan Willemsen | 7168b85 | 2017-10-06 11:27:01 -0700 | [diff] [blame] | 244 | data: [ |
| 245 | "test/test-trace-reference/*", |
| 246 | ], |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 247 | enabled: false, |
| 248 | target: { |
Dan Willemsen | be06b80 | 2017-10-02 10:41:10 -0700 | [diff] [blame] | 249 | linux_glibc_x86_64: { |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 250 | enabled: true, |
| 251 | }, |
Colin Cross | 4608911 | 2022-03-08 15:12:51 -0800 | [diff] [blame] | 252 | linux_musl_x86_64: { |
| 253 | enabled: true, |
| 254 | }, |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 255 | }, |
| 256 | } |