1// 2// Copyright (C) 2014 The Android Open Source Project 3// 4// Licensed under the Apache License, Version 2.0 (the "License"); 5// you may not use this file except in compliance with the License. 6// You may obtain a copy of the License at 7// 8// http://www.apache.org/licenses/LICENSE-2.0 9// 10// Unless required by applicable law or agreed to in writing, software 11// distributed under the License is distributed on an "AS IS" BASIS, 12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13// See the License for the specific language governing permissions and 14// limitations under the License. 15// 16 17package { 18 // See: http://go/android-license-faq 19 // A large-scale-change added 'default_applicable_licenses' to import 20 // all of the 'license_kinds' from "art_license" 21 // to get the below license kinds: 22 // SPDX-license-identifier-Apache-2.0 23 // SPDX-license-identifier-BSD 24 default_applicable_licenses: ["art_license"], 25} 26 27cc_library { 28 name: "libsigchain", 29 defaults: ["art_defaults"], 30 visibility: [ 31 "//frameworks/base/cmds/app_process", 32 ], 33 // Make libsigchain symbols global, so that an app library which 34 // is loaded in a classloader linker namespace looks for 35 // libsigchain symbols before libc. 36 // -z,global marks the binary with the DF_1_GLOBAL flag which puts the symbols 37 // in the global group. It does not affect their visibilities like the version 38 // script does. 39 ldflags: ["-Wl,-z,global"], 40 41 host_supported: true, 42 target: { 43 linux: { 44 srcs: ["sigchain.cc"], 45 }, 46 47 darwin: { 48 srcs: ["sigchain_fake.cc"], 49 }, 50 51 android: { 52 static_libs: ["libasync_safe"], 53 }, 54 }, 55 56 export_include_dirs: ["."], 57 apex_available: [ 58 "com.android.art", 59 "com.android.art.debug", 60 ], 61 stubs: { 62 symbol_file: "libsigchain.map.txt", 63 versions: ["1"], 64 }, 65} 66 67// Create a fake version of libsigchain which expose the necessary symbols 68// but throws when called. This can be used to get static binaries which don't 69// need the real functionality of the sig chain but need to please the linker. 70cc_library_static { 71 name: "libsigchain_fake", 72 host_supported: true, 73 defaults: ["art_defaults"], 74 srcs: ["sigchain_fake.cc"], 75 target: { 76 android: { 77 static_libs: ["libasync_safe"], 78 }, 79 }, 80 81 export_include_dirs: ["."], 82} 83 84art_cc_defaults { 85 name: "art_sigchain_tests_defaults", 86 srcs: ["sigchain_test.cc"], 87 shared_libs: ["libsigchain"], 88} 89 90// Version of ART gtest `art_sigchain_tests` bundled with the ART APEX on target. 91// TODO(b/192274705): Remove this module when the migration to standalone ART gtests is complete. 92art_cc_test { 93 name: "art_sigchain_tests", 94 defaults: [ 95 "art_gtest_defaults", 96 "art_sigchain_tests_defaults", 97 ], 98} 99 100// Standalone version of ART gtest `art_sigchain_tests`, not bundled with the ART APEX on target. 101art_cc_test { 102 name: "art_standalone_sigchain_tests", 103 defaults: [ 104 "art_standalone_gtest_defaults", 105 "art_sigchain_tests_defaults", 106 ], 107} 108