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 | |
| 54 | cc_defaults { |
| 55 | name: "vixl-common", |
| 56 | host_supported: true, |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 57 | srcs: ["src/*.cc"], |
| 58 | clang_cflags: ["-Wimplicit-fallthrough"], |
Chih-Hung Hsieh | 5652ef3 | 2017-09-29 11:33:41 -0700 | [diff] [blame] | 59 | cflags: [ |
| 60 | "-Wall", |
| 61 | "-Werror", |
| 62 | ], |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 63 | cppflags: [ |
| 64 | "-DVIXL_GENERATE_SIMULATOR_INSTRUCTIONS_VALUE=0", |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 65 | "-Wextra", |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 66 | "-fdiagnostics-show-option", |
| 67 | "-Wredundant-decls", |
| 68 | "-Wunreachable-code", |
| 69 | "-Wmissing-noreturn", |
| 70 | "-pedantic", |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 71 | |
| 72 | // Explicitly enable the write-strings warning. VIXL uses |
| 73 | // const correctly when handling string constants. |
| 74 | "-Wwrite-strings", |
Vladimir Marko | 00bfaca | 2018-04-26 16:04:44 +0100 | [diff] [blame] | 75 | |
| 76 | // As we can load both libvixl-arm.so and libvixl-arm64.so in the |
| 77 | // same process, and some functions are emitted in both libraries, |
| 78 | // flags for selecting implementation details for these functions |
| 79 | // must be shared to emit identical code. Otherwise we can get |
| 80 | // undefined behavior, especially with link-time optimization. |
| 81 | // b/64359573 |
| 82 | "-DVIXL_CODE_BUFFER_MALLOC", |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 83 | ], |
| 84 | local_include_dirs: ["src"], |
| 85 | native_coverage: false, |
| 86 | sanitize: { |
| 87 | recover: ["shift-exponent"], |
| 88 | }, |
| 89 | } |
| 90 | |
| 91 | cc_defaults { |
| 92 | name: "vixl-arm", |
| 93 | defaults: ["vixl-common"], |
Scott Wakeling | 5767b11 | 2016-12-22 09:43:20 +0000 | [diff] [blame] | 94 | cppflags: [ |
Scott Wakeling | 25e9a7a | 2017-01-23 15:51:39 +0000 | [diff] [blame] | 95 | "-DVIXL_INCLUDE_TARGET_T32", |
Scott Wakeling | 5767b11 | 2016-12-22 09:43:20 +0000 | [diff] [blame] | 96 | ], |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 97 | srcs: ["src/aarch32/*.cc"], |
| 98 | } |
| 99 | |
| 100 | cc_defaults { |
| 101 | name: "vixl-arm64", |
| 102 | defaults: ["vixl-common"], |
Scott Wakeling | 5767b11 | 2016-12-22 09:43:20 +0000 | [diff] [blame] | 103 | cppflags: [ |
| 104 | "-DVIXL_INCLUDE_SIMULATOR_AARCH64", |
Scott Wakeling | 25e9a7a | 2017-01-23 15:51:39 +0000 | [diff] [blame] | 105 | "-DVIXL_INCLUDE_TARGET_A64", |
Scott Wakeling | 5767b11 | 2016-12-22 09:43:20 +0000 | [diff] [blame] | 106 | ], |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 107 | srcs: ["src/aarch64/*.cc"], |
| 108 | } |
| 109 | |
| 110 | cc_defaults { |
| 111 | name: "vixl-debug", |
| 112 | defaults: ["vixl-common"], |
| 113 | cppflags: [ |
| 114 | "-DVIXL_DEBUG", |
| 115 | "-UNDEBUG", |
| 116 | |
| 117 | "-O2", |
| 118 | "-ggdb3", |
| 119 | ], |
| 120 | } |
| 121 | |
| 122 | cc_defaults { |
| 123 | name: "vixl-release", |
| 124 | defaults: ["vixl-common"], |
| 125 | cppflags: [ |
| 126 | "-O3", |
| 127 | ], |
| 128 | } |
| 129 | |
| 130 | cc_library { |
| 131 | name: "libvixl-arm64", |
Pirama Arumuga Nainar | ff08785 | 2018-04-18 23:03:04 -0700 | [diff] [blame] | 132 | defaults: [ |
| 133 | "vixl-release", |
| 134 | "vixl-arm64", |
| 135 | "dex2oat-pgo-defaults", |
| 136 | ], |
Justin Yun | 5a5a179 | 2017-07-24 15:19:44 +0900 | [diff] [blame] | 137 | vendor_available: true, |
| 138 | vndk: { |
| 139 | enabled: true, |
| 140 | }, |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 141 | } |
| 142 | |
| 143 | cc_library { |
| 144 | name: "libvixld-arm64", |
| 145 | defaults: ["vixl-debug", "vixl-arm64"], |
| 146 | } |
| 147 | |
| 148 | cc_library { |
| 149 | name: "libvixl-arm", |
Pirama Arumuga Nainar | ff08785 | 2018-04-18 23:03:04 -0700 | [diff] [blame] | 150 | defaults: [ |
| 151 | "vixl-release", |
| 152 | "vixl-arm", |
| 153 | "dex2oat-pgo-defaults", |
| 154 | ], |
Justin Yun | 5a5a179 | 2017-07-24 15:19:44 +0900 | [diff] [blame] | 155 | vendor_available: true, |
| 156 | vndk: { |
| 157 | enabled: true, |
| 158 | }, |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 159 | } |
| 160 | |
| 161 | cc_library { |
| 162 | name: "libvixld-arm", |
| 163 | defaults: ["vixl-debug", "vixl-arm"], |
| 164 | } |
| 165 | |
| 166 | //######## VIXL HOST TESTS ######### |
| 167 | // |
| 168 | // We only support 64bit host builds for now. |
| 169 | // To run all the tests: vixl-test-runner --run_all |
| 170 | // |
Dan Willemsen | 7168b85 | 2017-10-06 11:27:01 -0700 | [diff] [blame] | 171 | cc_test_host { |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 172 | name: "vixl-test-runner", |
Dan Willemsen | 7168b85 | 2017-10-06 11:27:01 -0700 | [diff] [blame] | 173 | gtest: false, |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 174 | defaults: ["vixl-debug", "vixl-arm", "vixl-arm64"], |
| 175 | local_include_dirs: ["test"], |
| 176 | srcs: [ |
| 177 | "test/*.cc", |
| 178 | "test/aarch32/*.cc", |
| 179 | "test/aarch64/*.cc", |
| 180 | ], |
Dan Willemsen | 7168b85 | 2017-10-06 11:27:01 -0700 | [diff] [blame] | 181 | data: [ |
| 182 | "test/test-trace-reference/*", |
| 183 | ], |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 184 | enabled: false, |
| 185 | target: { |
Dan Willemsen | be06b80 | 2017-10-02 10:41:10 -0700 | [diff] [blame] | 186 | linux_glibc_x86_64: { |
Serban Constantinescu | 98eabc7 | 2016-08-16 14:33:45 +0100 | [diff] [blame] | 187 | enabled: true, |
| 188 | }, |
| 189 | }, |
| 190 | } |