1*795d594fSAndroid Build Coastguard Worker// 2*795d594fSAndroid Build Coastguard Worker// Copyright (C) 2016 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 Workercc_defaults { 28*795d594fSAndroid Build Coastguard Worker name: "profman-defaults", 29*795d594fSAndroid Build Coastguard Worker host_supported: true, 30*795d594fSAndroid Build Coastguard Worker defaults: ["art_defaults"], 31*795d594fSAndroid Build Coastguard Worker srcs: [ 32*795d594fSAndroid Build Coastguard Worker "boot_image_profile.cc", 33*795d594fSAndroid Build Coastguard Worker "profman.cc", 34*795d594fSAndroid Build Coastguard Worker "profile_assistant.cc", 35*795d594fSAndroid Build Coastguard Worker "inline_cache_format_util.cc", 36*795d594fSAndroid Build Coastguard Worker ], 37*795d594fSAndroid Build Coastguard Worker header_libs: ["profman_headers"], 38*795d594fSAndroid Build Coastguard Worker 39*795d594fSAndroid Build Coastguard Worker target: { 40*795d594fSAndroid Build Coastguard Worker android: { 41*795d594fSAndroid Build Coastguard Worker compile_multilib: "first", 42*795d594fSAndroid Build Coastguard Worker shared_libs: [ 43*795d594fSAndroid Build Coastguard Worker "libbase", 44*795d594fSAndroid Build Coastguard Worker ], 45*795d594fSAndroid Build Coastguard Worker }, 46*795d594fSAndroid Build Coastguard Worker host: { 47*795d594fSAndroid Build Coastguard Worker whole_static_libs: [ 48*795d594fSAndroid Build Coastguard Worker "libbase", 49*795d594fSAndroid Build Coastguard Worker ], 50*795d594fSAndroid Build Coastguard Worker }, 51*795d594fSAndroid Build Coastguard Worker darwin: { 52*795d594fSAndroid Build Coastguard Worker enabled: true, 53*795d594fSAndroid Build Coastguard Worker }, 54*795d594fSAndroid Build Coastguard Worker }, 55*795d594fSAndroid Build Coastguard Worker} 56*795d594fSAndroid Build Coastguard Worker 57*795d594fSAndroid Build Coastguard Worker// Collect all the static defaults and build a host-only static library, which 58*795d594fSAndroid Build Coastguard Worker// is then used for the (mostly) static host profman binary. 59*795d594fSAndroid Build Coastguard Workerart_cc_library_static { 60*795d594fSAndroid Build Coastguard Worker name: "libprofman_static", 61*795d594fSAndroid Build Coastguard Worker device_supported: false, 62*795d594fSAndroid Build Coastguard Worker host_supported: true, 63*795d594fSAndroid Build Coastguard Worker defaults: [ 64*795d594fSAndroid Build Coastguard Worker "art_defaults", 65*795d594fSAndroid Build Coastguard Worker "libartbase_static_defaults", 66*795d594fSAndroid Build Coastguard Worker "libdexfile_static_defaults", 67*795d594fSAndroid Build Coastguard Worker "libprofile_static_defaults", 68*795d594fSAndroid Build Coastguard Worker ], 69*795d594fSAndroid Build Coastguard Worker target: { 70*795d594fSAndroid Build Coastguard Worker darwin: { 71*795d594fSAndroid Build Coastguard Worker enabled: true, 72*795d594fSAndroid Build Coastguard Worker }, 73*795d594fSAndroid Build Coastguard Worker }, 74*795d594fSAndroid Build Coastguard Worker} 75*795d594fSAndroid Build Coastguard Worker 76*795d594fSAndroid Build Coastguard Workerart_cc_library_static { 77*795d594fSAndroid Build Coastguard Worker name: "libprofmand_static", 78*795d594fSAndroid Build Coastguard Worker device_supported: false, 79*795d594fSAndroid Build Coastguard Worker host_supported: true, 80*795d594fSAndroid Build Coastguard Worker defaults: [ 81*795d594fSAndroid Build Coastguard Worker "art_debug_defaults", 82*795d594fSAndroid Build Coastguard Worker "libartbased_static_defaults", 83*795d594fSAndroid Build Coastguard Worker "libdexfiled_static_defaults", 84*795d594fSAndroid Build Coastguard Worker "libprofiled_static_defaults", 85*795d594fSAndroid Build Coastguard Worker ], 86*795d594fSAndroid Build Coastguard Worker target: { 87*795d594fSAndroid Build Coastguard Worker darwin: { 88*795d594fSAndroid Build Coastguard Worker enabled: true, 89*795d594fSAndroid Build Coastguard Worker }, 90*795d594fSAndroid Build Coastguard Worker }, 91*795d594fSAndroid Build Coastguard Worker} 92*795d594fSAndroid Build Coastguard Worker 93*795d594fSAndroid Build Coastguard Workerart_cc_binary { 94*795d594fSAndroid Build Coastguard Worker name: "profman", 95*795d594fSAndroid Build Coastguard Worker defaults: ["profman-defaults"], 96*795d594fSAndroid Build Coastguard Worker target: { 97*795d594fSAndroid Build Coastguard Worker android: { 98*795d594fSAndroid Build Coastguard Worker shared_libs: [ 99*795d594fSAndroid Build Coastguard Worker "libartbase", 100*795d594fSAndroid Build Coastguard Worker "libdexfile#impl", 101*795d594fSAndroid Build Coastguard Worker "libprofile", 102*795d594fSAndroid Build Coastguard Worker ], 103*795d594fSAndroid Build Coastguard Worker }, 104*795d594fSAndroid Build Coastguard Worker host: { 105*795d594fSAndroid Build Coastguard Worker // Make the host binary static, except for system libraries. This 106*795d594fSAndroid Build Coastguard Worker // avoids having to bundle host dynamic libs in prebuilts. 107*795d594fSAndroid Build Coastguard Worker static_libs: ["libprofman_static"], 108*795d594fSAndroid Build Coastguard Worker stl: "c++_static", 109*795d594fSAndroid Build Coastguard Worker 110*795d594fSAndroid Build Coastguard Worker }, 111*795d594fSAndroid Build Coastguard Worker }, 112*795d594fSAndroid Build Coastguard Worker apex_available: [ 113*795d594fSAndroid Build Coastguard Worker "com.android.art", 114*795d594fSAndroid Build Coastguard Worker "com.android.art.debug", 115*795d594fSAndroid Build Coastguard Worker "test_broken_com.android.art", 116*795d594fSAndroid Build Coastguard Worker ], 117*795d594fSAndroid Build Coastguard Worker} 118*795d594fSAndroid Build Coastguard Worker 119*795d594fSAndroid Build Coastguard Workerart_cc_binary { 120*795d594fSAndroid Build Coastguard Worker name: "profmand", 121*795d594fSAndroid Build Coastguard Worker defaults: [ 122*795d594fSAndroid Build Coastguard Worker "art_debug_defaults", 123*795d594fSAndroid Build Coastguard Worker "profman-defaults", 124*795d594fSAndroid Build Coastguard Worker ], 125*795d594fSAndroid Build Coastguard Worker target: { 126*795d594fSAndroid Build Coastguard Worker android: { 127*795d594fSAndroid Build Coastguard Worker shared_libs: [ 128*795d594fSAndroid Build Coastguard Worker "libartbased", 129*795d594fSAndroid Build Coastguard Worker "libdexfiled#impl", 130*795d594fSAndroid Build Coastguard Worker "libprofiled", 131*795d594fSAndroid Build Coastguard Worker ], 132*795d594fSAndroid Build Coastguard Worker }, 133*795d594fSAndroid Build Coastguard Worker host: { 134*795d594fSAndroid Build Coastguard Worker // Make the host binary static, except for system libraries. This 135*795d594fSAndroid Build Coastguard Worker // avoids having to bundle host dynamic libs in prebuilts. 136*795d594fSAndroid Build Coastguard Worker static_libs: ["libprofmand_static"], 137*795d594fSAndroid Build Coastguard Worker stl: "c++_static", 138*795d594fSAndroid Build Coastguard Worker 139*795d594fSAndroid Build Coastguard Worker }, 140*795d594fSAndroid Build Coastguard Worker }, 141*795d594fSAndroid Build Coastguard Worker apex_available: [ 142*795d594fSAndroid Build Coastguard Worker "com.android.art.debug", 143*795d594fSAndroid Build Coastguard Worker ], 144*795d594fSAndroid Build Coastguard Worker} 145*795d594fSAndroid Build Coastguard Worker 146*795d594fSAndroid Build Coastguard Workerart_cc_binary { 147*795d594fSAndroid Build Coastguard Worker name: "profmans", 148*795d594fSAndroid Build Coastguard Worker defaults: [ 149*795d594fSAndroid Build Coastguard Worker "profman-defaults", 150*795d594fSAndroid Build Coastguard Worker "libprofile_static_defaults", 151*795d594fSAndroid Build Coastguard Worker "libdexfile_static_defaults", 152*795d594fSAndroid Build Coastguard Worker "libartbase_static_defaults", 153*795d594fSAndroid Build Coastguard Worker ], 154*795d594fSAndroid Build Coastguard Worker host_supported: true, 155*795d594fSAndroid Build Coastguard Worker device_supported: false, 156*795d594fSAndroid Build Coastguard Worker target: { 157*795d594fSAndroid Build Coastguard Worker darwin: { 158*795d594fSAndroid Build Coastguard Worker enabled: false, 159*795d594fSAndroid Build Coastguard Worker }, 160*795d594fSAndroid Build Coastguard Worker windows: { 161*795d594fSAndroid Build Coastguard Worker enabled: true, 162*795d594fSAndroid Build Coastguard Worker cflags: ["-Wno-thread-safety"], 163*795d594fSAndroid Build Coastguard Worker }, 164*795d594fSAndroid Build Coastguard Worker }, 165*795d594fSAndroid Build Coastguard Worker} 166*795d594fSAndroid Build Coastguard Worker 167*795d594fSAndroid Build Coastguard Workercc_library_headers { 168*795d594fSAndroid Build Coastguard Worker name: "profman_headers", 169*795d594fSAndroid Build Coastguard Worker defaults: ["art_defaults"], 170*795d594fSAndroid Build Coastguard Worker export_include_dirs: ["include"], 171*795d594fSAndroid Build Coastguard Worker host_supported: true, 172*795d594fSAndroid Build Coastguard Worker target: { 173*795d594fSAndroid Build Coastguard Worker darwin: { 174*795d594fSAndroid Build Coastguard Worker enabled: false, 175*795d594fSAndroid Build Coastguard Worker }, 176*795d594fSAndroid Build Coastguard Worker windows: { 177*795d594fSAndroid Build Coastguard Worker enabled: true, 178*795d594fSAndroid Build Coastguard Worker }, 179*795d594fSAndroid Build Coastguard Worker }, 180*795d594fSAndroid Build Coastguard Worker apex_available: [ 181*795d594fSAndroid Build Coastguard Worker "com.android.art", 182*795d594fSAndroid Build Coastguard Worker "com.android.art.debug", 183*795d594fSAndroid Build Coastguard Worker ], 184*795d594fSAndroid Build Coastguard Worker} 185*795d594fSAndroid Build Coastguard Worker 186*795d594fSAndroid Build Coastguard Workerart_cc_defaults { 187*795d594fSAndroid Build Coastguard Worker name: "art_profman_tests_defaults", 188*795d594fSAndroid Build Coastguard Worker device_common_data: [ 189*795d594fSAndroid Build Coastguard Worker ":art-gtest-jars-ProfileTestMultiDex", 190*795d594fSAndroid Build Coastguard Worker ], 191*795d594fSAndroid Build Coastguard Worker header_libs: ["profman_headers"], 192*795d594fSAndroid Build Coastguard Worker tidy_timeout_srcs: ["profile_assistant_test.cc"], 193*795d594fSAndroid Build Coastguard Worker srcs: ["profile_assistant_test.cc"], 194*795d594fSAndroid Build Coastguard Worker} 195*795d594fSAndroid Build Coastguard Worker 196*795d594fSAndroid Build Coastguard Worker// Version of ART gtest `art_profman_tests` bundled with the ART APEX on target. 197*795d594fSAndroid Build Coastguard Worker// TODO(b/192274705): Remove this module when the migration to standalone ART gtests is complete. 198*795d594fSAndroid Build Coastguard Workerart_cc_test { 199*795d594fSAndroid Build Coastguard Worker name: "art_profman_tests", 200*795d594fSAndroid Build Coastguard Worker defaults: [ 201*795d594fSAndroid Build Coastguard Worker "art_gtest_defaults", 202*795d594fSAndroid Build Coastguard Worker "art_profman_tests_defaults", 203*795d594fSAndroid Build Coastguard Worker ], 204*795d594fSAndroid Build Coastguard Worker target: { 205*795d594fSAndroid Build Coastguard Worker host: { 206*795d594fSAndroid Build Coastguard Worker required: ["profmand"], 207*795d594fSAndroid Build Coastguard Worker }, 208*795d594fSAndroid Build Coastguard Worker }, 209*795d594fSAndroid Build Coastguard Worker} 210*795d594fSAndroid Build Coastguard Worker 211*795d594fSAndroid Build Coastguard Worker// Standalone version of ART gtest `art_profman_tests`, not bundled with the ART APEX on target. 212*795d594fSAndroid Build Coastguard Workerart_cc_test { 213*795d594fSAndroid Build Coastguard Worker name: "art_standalone_profman_tests", 214*795d594fSAndroid Build Coastguard Worker defaults: [ 215*795d594fSAndroid Build Coastguard Worker "art_standalone_gtest_defaults", 216*795d594fSAndroid Build Coastguard Worker "art_profman_tests_defaults", 217*795d594fSAndroid Build Coastguard Worker ], 218*795d594fSAndroid Build Coastguard Worker data: [":generate-boot-image"], 219*795d594fSAndroid Build Coastguard Worker target: { 220*795d594fSAndroid Build Coastguard Worker host: { 221*795d594fSAndroid Build Coastguard Worker required: ["profman"], 222*795d594fSAndroid Build Coastguard Worker }, 223*795d594fSAndroid Build Coastguard Worker }, 224*795d594fSAndroid Build Coastguard Worker test_config_template: "art_standalone_profman_tests.xml", 225*795d594fSAndroid Build Coastguard Worker} 226