• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
54cc_defaults {
55    name: "vixl-common",
56    host_supported: true,
57    clang: true,
58    srcs: ["src/*.cc"],
59    clang_cflags: ["-Wimplicit-fallthrough"],
60    cppflags: [
61        "-DVIXL_GENERATE_SIMULATOR_INSTRUCTIONS_VALUE=0",
62        "-Wall",
63        "-Wextra",
64        "-Werror",
65        "-fdiagnostics-show-option",
66        "-Wredundant-decls",
67        "-Wunreachable-code",
68        "-Wmissing-noreturn",
69        "-pedantic",
70        "-std=c++11",
71
72        // Explicitly enable the write-strings warning. VIXL uses
73        // const correctly when handling string constants.
74        "-Wwrite-strings",
75    ],
76    local_include_dirs: ["src"],
77    native_coverage: false,
78    sanitize: {
79        recover: ["shift-exponent"],
80    },
81}
82
83cc_defaults {
84    name: "vixl-arm",
85    defaults: ["vixl-common"],
86    cppflags: [
87        "-DVIXL_CODE_BUFFER_MALLOC",
88        "-DVIXL_INCLUDE_TARGET_T32",
89        ],
90    srcs: ["src/aarch32/*.cc"],
91}
92
93cc_defaults {
94    name: "vixl-arm64",
95    defaults: ["vixl-common"],
96    cppflags: [
97        "-DVIXL_INCLUDE_SIMULATOR_AARCH64",
98        "-DVIXL_CODE_BUFFER_MMAP",
99        "-DVIXL_INCLUDE_TARGET_A64",
100        ],
101    srcs: ["src/aarch64/*.cc"],
102}
103
104cc_defaults {
105    name: "vixl-debug",
106    defaults: ["vixl-common"],
107    cppflags: [
108        "-DVIXL_DEBUG",
109        "-UNDEBUG",
110
111        "-O2",
112        "-ggdb3",
113    ],
114}
115
116cc_defaults {
117    name: "vixl-release",
118    defaults: ["vixl-common"],
119    cppflags: [
120        "-O3",
121    ],
122}
123
124cc_library {
125    name: "libvixl-arm64",
126    defaults: ["vixl-release", "vixl-arm64"],
127    vendor_available: true,
128    vndk: {
129        enabled: true,
130    },
131}
132
133cc_library {
134    name: "libvixld-arm64",
135    defaults: ["vixl-debug", "vixl-arm64"],
136}
137
138cc_library {
139    name: "libvixl-arm",
140    defaults: ["vixl-release", "vixl-arm"],
141    vendor_available: true,
142    vndk: {
143        enabled: true,
144    },
145}
146
147cc_library {
148    name: "libvixld-arm",
149    defaults: ["vixl-debug", "vixl-arm"],
150}
151
152//######## VIXL HOST TESTS #########
153//
154// We only support 64bit host builds for now.
155// To run all the tests: vixl-test-runner --run_all
156//
157cc_binary_host {
158    name: "vixl-test-runner",
159    static_executable: true,
160    defaults: ["vixl-debug", "vixl-arm", "vixl-arm64"],
161    local_include_dirs: ["test"],
162    srcs: [
163        "test/*.cc",
164        "test/aarch32/*.cc",
165        "test/aarch64/*.cc",
166    ],
167    enabled: false,
168    target: {
169        linux_x86_64: {
170            enabled: true,
171        },
172    },
173}
174