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"], |
| 56 | } |
| 57 | |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 58 | cc_defaults { |
| 59 | name: "vixl-common", |
| 60 | host_supported: true, |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 61 | srcs: ["src/*.cc"], |
| 62 | clang_cflags: ["-Wimplicit-fallthrough"], |
Chih-Hung Hsieh | 5652ef3 | 2017-09-29 11:33:41 -0700 | [diff] [blame] | 63 | cflags: [ |
| 64 | "-Wall", |
| 65 | "-Werror", |
| 66 | ], |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 67 | cppflags: [ |
| 68 | "-DVIXL_GENERATE_SIMULATOR_INSTRUCTIONS_VALUE=0", |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 69 | "-Wextra", |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 70 | "-fdiagnostics-show-option", |
| 71 | "-Wredundant-decls", |
| 72 | "-Wunreachable-code", |
| 73 | "-Wmissing-noreturn", |
| 74 | "-pedantic", |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 75 | |
| 76 | // Explicitly enable the write-strings warning. VIXL uses |
| 77 | // const correctly when handling string constants. |
| 78 | "-Wwrite-strings", |
Vladimir Marko | 9b00771 | 2018-04-26 16:04:44 +0100 | [diff] [blame] | 79 | |
Vladimir Marko | 9b00771 | 2018-04-26 16:04:44 +0100 | [diff] [blame] | 80 | "-DVIXL_CODE_BUFFER_MALLOC", |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 81 | ], |
| 82 | local_include_dirs: ["src"], |
| 83 | native_coverage: false, |
| 84 | sanitize: { |
| 85 | recover: ["shift-exponent"], |
| 86 | }, |
| 87 | } |
| 88 | |
Roland Levillain | 9c53ca6 | 2018-10-31 19:51:43 +0000 | [diff] [blame] | 89 | art_cc_defaults { |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 90 | name: "vixl-arm", |
| 91 | defaults: ["vixl-common"], |
Roland Levillain | 9c53ca6 | 2018-10-31 19:51:43 +0000 | [diff] [blame] | 92 | codegen: { |
| 93 | arm: { |
| 94 | srcs: ["src/aarch32/*.cc"], |
| 95 | cppflags: [ |
| 96 | "-DVIXL_INCLUDE_TARGET_T32", |
| 97 | ], |
| 98 | }, |
| 99 | }, |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 100 | } |
| 101 | |
Roland Levillain | 9c53ca6 | 2018-10-31 19:51:43 +0000 | [diff] [blame] | 102 | art_cc_defaults { |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 103 | name: "vixl-arm64", |
| 104 | defaults: ["vixl-common"], |
Roland Levillain | 9c53ca6 | 2018-10-31 19:51:43 +0000 | [diff] [blame] | 105 | codegen: { |
| 106 | arm64: { |
| 107 | srcs: ["src/aarch64/*.cc"], |
| 108 | cppflags: [ |
| 109 | "-DVIXL_INCLUDE_SIMULATOR_AARCH64", |
| 110 | "-DVIXL_INCLUDE_TARGET_A64", |
| 111 | ], |
Paul Duffin | 56af64d | 2019-07-08 15:19:49 +0100 | [diff] [blame] | 112 | }, |
Roland Levillain | 9c53ca6 | 2018-10-31 19:51:43 +0000 | [diff] [blame] | 113 | }, |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 114 | } |
| 115 | |
| 116 | cc_defaults { |
| 117 | name: "vixl-debug", |
| 118 | defaults: ["vixl-common"], |
| 119 | cppflags: [ |
| 120 | "-DVIXL_DEBUG", |
| 121 | "-UNDEBUG", |
| 122 | |
| 123 | "-O2", |
| 124 | "-ggdb3", |
| 125 | ], |
| 126 | } |
| 127 | |
| 128 | cc_defaults { |
| 129 | name: "vixl-release", |
| 130 | defaults: ["vixl-common"], |
| 131 | cppflags: [ |
| 132 | "-O3", |
| 133 | ], |
| 134 | } |
| 135 | |
Paul Duffin | 1d441a7 | 2019-07-08 15:20:52 +0100 | [diff] [blame^] | 136 | libvixl_visibility = [ |
| 137 | "//art:__subpackages__", |
| 138 | ] |
| 139 | |
Roland Levillain | 9c53ca6 | 2018-10-31 19:51:43 +0000 | [diff] [blame] | 140 | art_cc_library { |
| 141 | name: "libvixl", |
Paul Duffin | 1d441a7 | 2019-07-08 15:20:52 +0100 | [diff] [blame^] | 142 | visibility: libvixl_visibility, |
Pirama Arumuga Nainar | 67fa1c7 | 2018-04-18 23:03:04 -0700 | [diff] [blame] | 143 | defaults: [ |
| 144 | "vixl-release", |
Roland Levillain | 9c53ca6 | 2018-10-31 19:51:43 +0000 | [diff] [blame] | 145 | "vixl-arm", |
Pirama Arumuga Nainar | 67fa1c7 | 2018-04-18 23:03:04 -0700 | [diff] [blame] | 146 | "vixl-arm64", |
| 147 | "dex2oat-pgo-defaults", |
| 148 | ], |
Pirama Arumuga Nainar | 9048d87 | 2018-01-04 11:18:07 -0800 | [diff] [blame] | 149 | |
Yi Kong | f611172 | 2018-04-06 14:10:43 -0700 | [diff] [blame] | 150 | target: { |
| 151 | android: { |
| 152 | lto: { |
Paul Duffin | 56af64d | 2019-07-08 15:19:49 +0100 | [diff] [blame] | 153 | thin: true, |
Yi Kong | f611172 | 2018-04-06 14:10:43 -0700 | [diff] [blame] | 154 | }, |
| 155 | }, |
| 156 | }, |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 157 | } |
| 158 | |
Roland Levillain | 9c53ca6 | 2018-10-31 19:51:43 +0000 | [diff] [blame] | 159 | art_cc_library { |
| 160 | name: "libvixld", |
Paul Duffin | 1d441a7 | 2019-07-08 15:20:52 +0100 | [diff] [blame^] | 161 | visibility: libvixl_visibility, |
Pirama Arumuga Nainar | 67fa1c7 | 2018-04-18 23:03:04 -0700 | [diff] [blame] | 162 | defaults: [ |
Roland Levillain | 9c53ca6 | 2018-10-31 19:51:43 +0000 | [diff] [blame] | 163 | "vixl-debug", |
Pirama Arumuga Nainar | 67fa1c7 | 2018-04-18 23:03:04 -0700 | [diff] [blame] | 164 | "vixl-arm", |
Roland Levillain | 9c53ca6 | 2018-10-31 19:51:43 +0000 | [diff] [blame] | 165 | "vixl-arm64", |
Pirama Arumuga Nainar | 67fa1c7 | 2018-04-18 23:03:04 -0700 | [diff] [blame] | 166 | ], |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 167 | } |
| 168 | |
| 169 | //######## VIXL HOST TESTS ######### |
| 170 | // |
| 171 | // We only support 64bit host builds for now. |
| 172 | // To run all the tests: vixl-test-runner --run_all |
| 173 | // |
Dan Willemsen | 7168b85 | 2017-10-06 11:27:01 -0700 | [diff] [blame] | 174 | cc_test_host { |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 175 | name: "vixl-test-runner", |
Dan Willemsen | 7168b85 | 2017-10-06 11:27:01 -0700 | [diff] [blame] | 176 | gtest: false, |
Paul Duffin | 56af64d | 2019-07-08 15:19:49 +0100 | [diff] [blame] | 177 | defaults: [ |
| 178 | "vixl-debug", |
| 179 | "vixl-arm", |
| 180 | "vixl-arm64", |
| 181 | ], |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 182 | local_include_dirs: ["test"], |
| 183 | srcs: [ |
| 184 | "test/*.cc", |
| 185 | "test/aarch32/*.cc", |
| 186 | "test/aarch64/*.cc", |
| 187 | ], |
Dan Willemsen | 7168b85 | 2017-10-06 11:27:01 -0700 | [diff] [blame] | 188 | data: [ |
| 189 | "test/test-trace-reference/*", |
| 190 | ], |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 191 | enabled: false, |
| 192 | target: { |
Dan Willemsen | be06b80 | 2017-10-02 10:41:10 -0700 | [diff] [blame] | 193 | linux_glibc_x86_64: { |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 194 | enabled: true, |
| 195 | }, |
| 196 | }, |
| 197 | } |