blob: 0ea62e8f9d35caee04048b201d946ef9df8715bb [file] [log] [blame]
Serban Constantinescu98eabc72016-08-16 14:33:45 +01001// 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 Duffin1d441a72019-07-08 15:20:52 +010054package {
55 default_visibility: ["//visibility:private"],
56}
57
Serban Constantinescu98eabc72016-08-16 14:33:45 +010058cc_defaults {
59 name: "vixl-common",
60 host_supported: true,
Serban Constantinescu98eabc72016-08-16 14:33:45 +010061 clang_cflags: ["-Wimplicit-fallthrough"],
Chih-Hung Hsieh5652ef32017-09-29 11:33:41 -070062 cflags: [
63 "-Wall",
64 "-Werror",
65 ],
Serban Constantinescu98eabc72016-08-16 14:33:45 +010066 cppflags: [
67 "-DVIXL_GENERATE_SIMULATOR_INSTRUCTIONS_VALUE=0",
Serban Constantinescu98eabc72016-08-16 14:33:45 +010068 "-Wextra",
Serban Constantinescu98eabc72016-08-16 14:33:45 +010069 "-fdiagnostics-show-option",
70 "-Wredundant-decls",
71 "-Wunreachable-code",
Serban Constantinescu98eabc72016-08-16 14:33:45 +010072 "-pedantic",
Serban Constantinescu98eabc72016-08-16 14:33:45 +010073
74 // Explicitly enable the write-strings warning. VIXL uses
75 // const correctly when handling string constants.
76 "-Wwrite-strings",
Vladimir Marko9b007712018-04-26 16:04:44 +010077
Evgeny Astigeevich39f60172019-10-31 11:48:28 +000078 // Explicitly disable 'missing-return' warnings because a lot of them are false positive.
79 // VIXL often creates stubs and compile-time configurations with things like
80 // VIXL_UNIMPLEMENTED(). Properly satisfying -Wmissing-noreturn requires that functions are
81 // annotated at their _declarations_, which means #ifdefs in header files.
82 // Conditional compilation in headers can result in incorrect behaviour when
83 // libvixl.so is built with different flags than the code using it. Disabling this
84 // warning allows VIXL to simplify the headers, and should make VIXL more robust.
85 "-Wno-missing-noreturn",
86
Vladimir Marko9b007712018-04-26 16:04:44 +010087 "-DVIXL_CODE_BUFFER_MALLOC",
Serban Constantinescu98eabc72016-08-16 14:33:45 +010088 ],
Serban Constantinescu98eabc72016-08-16 14:33:45 +010089 native_coverage: false,
90 sanitize: {
91 recover: ["shift-exponent"],
92 },
93}
94
Roland Levillain9c53ca62018-10-31 19:51:43 +000095art_cc_defaults {
Serban Constantinescu98eabc72016-08-16 14:33:45 +010096 name: "vixl-arm",
97 defaults: ["vixl-common"],
Roland Levillain9c53ca62018-10-31 19:51:43 +000098 codegen: {
99 arm: {
100 srcs: ["src/aarch32/*.cc"],
101 cppflags: [
102 "-DVIXL_INCLUDE_TARGET_T32",
103 ],
104 },
105 },
Serban Constantinescu98eabc72016-08-16 14:33:45 +0100106}
107
Roland Levillain9c53ca62018-10-31 19:51:43 +0000108art_cc_defaults {
Serban Constantinescu98eabc72016-08-16 14:33:45 +0100109 name: "vixl-arm64",
110 defaults: ["vixl-common"],
Roland Levillain9c53ca62018-10-31 19:51:43 +0000111 codegen: {
112 arm64: {
113 srcs: ["src/aarch64/*.cc"],
114 cppflags: [
115 "-DVIXL_INCLUDE_SIMULATOR_AARCH64",
116 "-DVIXL_INCLUDE_TARGET_A64",
117 ],
Paul Duffin56af64d2019-07-08 15:19:49 +0100118 },
Roland Levillain9c53ca62018-10-31 19:51:43 +0000119 },
Serban Constantinescu98eabc72016-08-16 14:33:45 +0100120}
121
122cc_defaults {
123 name: "vixl-debug",
124 defaults: ["vixl-common"],
125 cppflags: [
126 "-DVIXL_DEBUG",
127 "-UNDEBUG",
128
129 "-O2",
130 "-ggdb3",
131 ],
132}
133
134cc_defaults {
135 name: "vixl-release",
136 defaults: ["vixl-common"],
137 cppflags: [
138 "-O3",
139 ],
140}
141
Paul Duffin1d441a72019-07-08 15:20:52 +0100142libvixl_visibility = [
143 "//art:__subpackages__",
144]
145
Paul Duffind1a83472019-07-12 15:30:36 +0100146// Defaults for the libvixl[d] libraries
147cc_defaults {
148 name: "libvixl-defaults",
149 srcs: ["src/*.cc"],
150 export_include_dirs: ["src"],
151}
152
Roland Levillain9c53ca62018-10-31 19:51:43 +0000153art_cc_library {
154 name: "libvixl",
Paul Duffin1d441a72019-07-08 15:20:52 +0100155 visibility: libvixl_visibility,
Pirama Arumuga Nainar67fa1c72018-04-18 23:03:04 -0700156 defaults: [
Paul Duffind1a83472019-07-12 15:30:36 +0100157 "libvixl-defaults",
Pirama Arumuga Nainar67fa1c72018-04-18 23:03:04 -0700158 "vixl-release",
Roland Levillain9c53ca62018-10-31 19:51:43 +0000159 "vixl-arm",
Pirama Arumuga Nainar67fa1c72018-04-18 23:03:04 -0700160 "vixl-arm64",
161 "dex2oat-pgo-defaults",
162 ],
Pirama Arumuga Nainar9048d872018-01-04 11:18:07 -0800163
Yi Kongf6111722018-04-06 14:10:43 -0700164 target: {
165 android: {
166 lto: {
Paul Duffin56af64d2019-07-08 15:19:49 +0100167 thin: true,
Yi Kongf6111722018-04-06 14:10:43 -0700168 },
169 },
170 },
Jiyong Park5c997a02020-04-28 18:22:11 +0900171
172 apex_available: [
173 "com.android.art.debug",
174 "com.android.art.release",
175 ],
Serban Constantinescu98eabc72016-08-16 14:33:45 +0100176}
177
Roland Levillain9c53ca62018-10-31 19:51:43 +0000178art_cc_library {
179 name: "libvixld",
Paul Duffin1d441a72019-07-08 15:20:52 +0100180 visibility: libvixl_visibility,
Pirama Arumuga Nainar67fa1c72018-04-18 23:03:04 -0700181 defaults: [
Paul Duffind1a83472019-07-12 15:30:36 +0100182 "libvixl-defaults",
Roland Levillain9c53ca62018-10-31 19:51:43 +0000183 "vixl-debug",
Pirama Arumuga Nainar67fa1c72018-04-18 23:03:04 -0700184 "vixl-arm",
Roland Levillain9c53ca62018-10-31 19:51:43 +0000185 "vixl-arm64",
Pirama Arumuga Nainar67fa1c72018-04-18 23:03:04 -0700186 ],
Jiyong Park5c997a02020-04-28 18:22:11 +0900187
188 apex_available: [
189 "com.android.art.release",
190 "com.android.art.debug",
191 ],
Serban Constantinescu98eabc72016-08-16 14:33:45 +0100192}
193
194//######## VIXL HOST TESTS #########
195//
196// We only support 64bit host builds for now.
197// To run all the tests: vixl-test-runner --run_all
198//
Dan Willemsen7168b852017-10-06 11:27:01 -0700199cc_test_host {
Serban Constantinescu98eabc72016-08-16 14:33:45 +0100200 name: "vixl-test-runner",
Dan Willemsen7168b852017-10-06 11:27:01 -0700201 gtest: false,
Paul Duffin56af64d2019-07-08 15:19:49 +0100202 defaults: [
203 "vixl-debug",
204 "vixl-arm",
205 "vixl-arm64",
206 ],
Paul Duffind1a83472019-07-12 15:30:36 +0100207 local_include_dirs: [
208 "test",
209 ],
Serban Constantinescu98eabc72016-08-16 14:33:45 +0100210 srcs: [
211 "test/*.cc",
212 "test/aarch32/*.cc",
213 "test/aarch64/*.cc",
214 ],
Paul Duffind1a83472019-07-12 15:30:36 +0100215 static_libs: [
216 "libvixld",
217 ],
Dan Willemsen7168b852017-10-06 11:27:01 -0700218 data: [
219 "test/test-trace-reference/*",
220 ],
Serban Constantinescu98eabc72016-08-16 14:33:45 +0100221 enabled: false,
222 target: {
Dan Willemsenbe06b802017-10-02 10:41:10 -0700223 linux_glibc_x86_64: {
Serban Constantinescu98eabc72016-08-16 14:33:45 +0100224 enabled: true,
225 },
226 },
227}