xref: /aosp_15_r20/art/tools/Android.bp (revision 795d594fd825385562da6b089ea9b2033f3abf5a)
1*795d594fSAndroid Build Coastguard Worker//
2*795d594fSAndroid Build Coastguard Worker// Copyright (C) 2018 The Android Open Source Project
3*795d594fSAndroid Build Coastguard Worker//
4*795d594fSAndroid Build Coastguard Worker// Licensed under the Apache License, Version 2.0 (the "License");
5*795d594fSAndroid Build Coastguard Worker// you may not use this file except in compliance with the License.
6*795d594fSAndroid Build Coastguard Worker// You may obtain a copy of the License at
7*795d594fSAndroid Build Coastguard Worker//
8*795d594fSAndroid Build Coastguard Worker//      http://www.apache.org/licenses/LICENSE-2.0
9*795d594fSAndroid Build Coastguard Worker//
10*795d594fSAndroid Build Coastguard Worker// Unless required by applicable law or agreed to in writing, software
11*795d594fSAndroid Build Coastguard Worker// distributed under the License is distributed on an "AS IS" BASIS,
12*795d594fSAndroid Build Coastguard Worker// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*795d594fSAndroid Build Coastguard Worker// See the License for the specific language governing permissions and
14*795d594fSAndroid Build Coastguard Worker// limitations under the License.
15*795d594fSAndroid Build Coastguard Worker//
16*795d594fSAndroid Build Coastguard Worker
17*795d594fSAndroid Build Coastguard Workerpackage {
18*795d594fSAndroid Build Coastguard Worker    // See: http://go/android-license-faq
19*795d594fSAndroid Build Coastguard Worker    // A large-scale-change added 'default_applicable_licenses' to import
20*795d594fSAndroid Build Coastguard Worker    // all of the 'license_kinds' from "art_license"
21*795d594fSAndroid Build Coastguard Worker    // to get the below license kinds:
22*795d594fSAndroid Build Coastguard Worker    //   SPDX-license-identifier-Apache-2.0
23*795d594fSAndroid Build Coastguard Worker    default_applicable_licenses: ["art_license"],
24*795d594fSAndroid Build Coastguard Worker    default_team: "trendy_team_art_performance",
25*795d594fSAndroid Build Coastguard Worker}
26*795d594fSAndroid Build Coastguard Worker
27*795d594fSAndroid Build Coastguard Workerpython_binary_host {
28*795d594fSAndroid Build Coastguard Worker    name: "generate_operator_out",
29*795d594fSAndroid Build Coastguard Worker    srcs: [
30*795d594fSAndroid Build Coastguard Worker        "generate_operator_out.py",
31*795d594fSAndroid Build Coastguard Worker    ],
32*795d594fSAndroid Build Coastguard Worker}
33*795d594fSAndroid Build Coastguard Worker
34*795d594fSAndroid Build Coastguard Workercc_binary {
35*795d594fSAndroid Build Coastguard Worker    name: "art_boot",
36*795d594fSAndroid Build Coastguard Worker    defaults: ["art_defaults"],
37*795d594fSAndroid Build Coastguard Worker    srcs: ["art_boot.cc"],
38*795d594fSAndroid Build Coastguard Worker    shared_libs: ["libbase"],
39*795d594fSAndroid Build Coastguard Worker    apex_available: [
40*795d594fSAndroid Build Coastguard Worker        "com.android.art",
41*795d594fSAndroid Build Coastguard Worker        "com.android.art.debug",
42*795d594fSAndroid Build Coastguard Worker    ],
43*795d594fSAndroid Build Coastguard Worker}
44*795d594fSAndroid Build Coastguard Worker
45*795d594fSAndroid Build Coastguard Worker// Copy the art shell script to the host and target's bin directory
46*795d594fSAndroid Build Coastguard Workersh_binary {
47*795d594fSAndroid Build Coastguard Worker    name: "art-script",
48*795d594fSAndroid Build Coastguard Worker
49*795d594fSAndroid Build Coastguard Worker    host_supported: true,
50*795d594fSAndroid Build Coastguard Worker    src: "art",
51*795d594fSAndroid Build Coastguard Worker    filename_from_src: true,
52*795d594fSAndroid Build Coastguard Worker    target: {
53*795d594fSAndroid Build Coastguard Worker        host: {
54*795d594fSAndroid Build Coastguard Worker            // On device we require the ART APEX, but its Soong module name may
55*795d594fSAndroid Build Coastguard Worker            // be different depending on branch, and it's always present anyway,
56*795d594fSAndroid Build Coastguard Worker            // so we leave it out.
57*795d594fSAndroid Build Coastguard Worker            required: [
58*795d594fSAndroid Build Coastguard Worker                "dalvikvm",
59*795d594fSAndroid Build Coastguard Worker                "dex2oat",
60*795d594fSAndroid Build Coastguard Worker            ],
61*795d594fSAndroid Build Coastguard Worker        },
62*795d594fSAndroid Build Coastguard Worker        darwin: {
63*795d594fSAndroid Build Coastguard Worker            enabled: false,
64*795d594fSAndroid Build Coastguard Worker        },
65*795d594fSAndroid Build Coastguard Worker        windows: {
66*795d594fSAndroid Build Coastguard Worker            // When the module is enabled globally in the soong_config_variables
67*795d594fSAndroid Build Coastguard Worker            // stanza above, it gets enabled on windows too. Hence we need to
68*795d594fSAndroid Build Coastguard Worker            // disable it explicitly.
69*795d594fSAndroid Build Coastguard Worker            // TODO(b/172480617): Clean up with that.
70*795d594fSAndroid Build Coastguard Worker            enabled: false,
71*795d594fSAndroid Build Coastguard Worker        },
72*795d594fSAndroid Build Coastguard Worker    },
73*795d594fSAndroid Build Coastguard Worker}
74*795d594fSAndroid Build Coastguard Worker
75*795d594fSAndroid Build Coastguard Workersh_binary {
76*795d594fSAndroid Build Coastguard Worker    name: "dex2oat-script",
77*795d594fSAndroid Build Coastguard Worker    host_supported: true,
78*795d594fSAndroid Build Coastguard Worker    src: "dex2oat_wrapper",
79*795d594fSAndroid Build Coastguard Worker    filename_from_src: true,
80*795d594fSAndroid Build Coastguard Worker    target: {
81*795d594fSAndroid Build Coastguard Worker        host: {
82*795d594fSAndroid Build Coastguard Worker            // On device we require the ART APEX, but its Soong module name may
83*795d594fSAndroid Build Coastguard Worker            // be different depending on branch, and it's always present anyway,
84*795d594fSAndroid Build Coastguard Worker            // so we leave it out.
85*795d594fSAndroid Build Coastguard Worker            required: [
86*795d594fSAndroid Build Coastguard Worker                "dex2oat",
87*795d594fSAndroid Build Coastguard Worker            ],
88*795d594fSAndroid Build Coastguard Worker        },
89*795d594fSAndroid Build Coastguard Worker        darwin: {
90*795d594fSAndroid Build Coastguard Worker            enabled: false,
91*795d594fSAndroid Build Coastguard Worker        },
92*795d594fSAndroid Build Coastguard Worker    },
93*795d594fSAndroid Build Coastguard Worker}
94*795d594fSAndroid Build Coastguard Worker
95*795d594fSAndroid Build Coastguard Workercc_genrule {
96*795d594fSAndroid Build Coastguard Worker    name: "check_cfi",
97*795d594fSAndroid Build Coastguard Worker
98*795d594fSAndroid Build Coastguard Worker    tool_files: [
99*795d594fSAndroid Build Coastguard Worker        "check_cfi.py",
100*795d594fSAndroid Build Coastguard Worker    ],
101*795d594fSAndroid Build Coastguard Worker    tools: [
102*795d594fSAndroid Build Coastguard Worker        "llvm-dwarfdump",
103*795d594fSAndroid Build Coastguard Worker        "llvm-objdump",
104*795d594fSAndroid Build Coastguard Worker    ],
105*795d594fSAndroid Build Coastguard Worker    srcs: [
106*795d594fSAndroid Build Coastguard Worker        ":libart-unstripped",
107*795d594fSAndroid Build Coastguard Worker    ],
108*795d594fSAndroid Build Coastguard Worker    out: [
109*795d594fSAndroid Build Coastguard Worker        "check_cfi.txt",
110*795d594fSAndroid Build Coastguard Worker    ],
111*795d594fSAndroid Build Coastguard Worker    cmd: "$(location check_cfi.py) " +
112*795d594fSAndroid Build Coastguard Worker        "--dwarfdump $(location llvm-dwarfdump) " +
113*795d594fSAndroid Build Coastguard Worker        "--objdump $(location llvm-objdump) " +
114*795d594fSAndroid Build Coastguard Worker        "--out $(out) $(in)",
115*795d594fSAndroid Build Coastguard Worker
116*795d594fSAndroid Build Coastguard Worker    target: {
117*795d594fSAndroid Build Coastguard Worker        windows: {
118*795d594fSAndroid Build Coastguard Worker            // When the module is enabled globally in the soong_config_variables
119*795d594fSAndroid Build Coastguard Worker            // stanza above, it gets enabled on windows too. Hence we need to
120*795d594fSAndroid Build Coastguard Worker            // disable it explicitly.
121*795d594fSAndroid Build Coastguard Worker            // TODO(b/172480617): Clean up with that.
122*795d594fSAndroid Build Coastguard Worker            enabled: false,
123*795d594fSAndroid Build Coastguard Worker        },
124*795d594fSAndroid Build Coastguard Worker    },
125*795d594fSAndroid Build Coastguard Worker}
126