blob: ee874dc0b75b4ca9df8ad226d565744579789f9d [file] [log] [blame]
Colin Cross1f7f3bd2016-07-27 10:12:38 -07001//
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
Bob Badour9150de62021-02-26 03:22:24 -080017package {
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
Colin Cross1f7f3bd2016-07-27 10:12:38 -070027cc_library {
28 name: "libsigchain",
Martin Stjernholmb4abe0a2019-05-17 19:22:55 +010029 defaults: ["art_defaults"],
30 visibility: [
Martin Stjernholmb4abe0a2019-05-17 19:22:55 +010031 "//frameworks/base/cmds/app_process",
32 ],
Nicolas Geoffrayaded1392021-03-05 09:54:10 +000033 // 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"],
Josh Gaod32d79d2018-02-26 14:29:25 -080040
Colin Cross1f7f3bd2016-07-27 10:12:38 -070041 host_supported: true,
Colin Cross1f7f3bd2016-07-27 10:12:38 -070042 target: {
Josh Gaod32d79d2018-02-26 14:29:25 -080043 linux: {
Nicolas Geoffrayaded1392021-03-05 09:54:10 +000044 srcs: ["sigchain.cc"],
Josh Gaod32d79d2018-02-26 14:29:25 -080045 },
46
47 darwin: {
David Srbeckyd3ee9022020-07-27 16:05:38 +010048 srcs: ["sigchain_fake.cc"],
Josh Gaod32d79d2018-02-26 14:29:25 -080049 },
50
Colin Cross1f7f3bd2016-07-27 10:12:38 -070051 android: {
Martin Stjernholmb747b7a2021-11-03 18:40:17 +000052 header_libs: ["bionic_libc_platform_headers"],
Martin Stjernholme017bb02021-03-17 10:55:25 +000053 static_libs: ["libasync_safe"],
Colin Cross1f7f3bd2016-07-27 10:12:38 -070054 },
Martin Stjernholmb747b7a2021-11-03 18:40:17 +000055
56 linux_bionic: {
57 header_libs: ["bionic_libc_platform_headers"],
58 },
Colin Cross1f7f3bd2016-07-27 10:12:38 -070059 },
Colin Cross616f4002019-05-29 21:39:14 -070060
61 export_include_dirs: ["."],
Jiyong Park066dd9022019-12-19 02:11:59 +000062 apex_available: [
Martin Stjernholm3e9abfc2020-10-09 22:17:51 +010063 "com.android.art",
Jiyong Park066dd9022019-12-19 02:11:59 +000064 "com.android.art.debug",
Jiyong Park066dd9022019-12-19 02:11:59 +000065 ],
Nicolas Geoffrayaded1392021-03-05 09:54:10 +000066 stubs: {
67 symbol_file: "libsigchain.map.txt",
68 versions: ["1"],
69 },
Colin Cross1f7f3bd2016-07-27 10:12:38 -070070}
71
David Srbeckyd3ee9022020-07-27 16:05:38 +010072// Create a fake version of libsigchain which expose the necessary symbols
Colin Cross1f7f3bd2016-07-27 10:12:38 -070073// but throws when called. This can be used to get static binaries which don't
74// need the real functionality of the sig chain but need to please the linker.
75cc_library_static {
David Srbeckyd3ee9022020-07-27 16:05:38 +010076 name: "libsigchain_fake",
Colin Cross1f7f3bd2016-07-27 10:12:38 -070077 host_supported: true,
78 defaults: ["art_defaults"],
David Srbeckyd3ee9022020-07-27 16:05:38 +010079 srcs: ["sigchain_fake.cc"],
Colin Cross1f7f3bd2016-07-27 10:12:38 -070080 target: {
Colin Cross1f7f3bd2016-07-27 10:12:38 -070081 android: {
Martin Stjernholme017bb02021-03-17 10:55:25 +000082 static_libs: ["libasync_safe"],
Colin Cross1f7f3bd2016-07-27 10:12:38 -070083 },
84 },
Colin Cross616f4002019-05-29 21:39:14 -070085
86 export_include_dirs: ["."],
Colin Cross1f7f3bd2016-07-27 10:12:38 -070087}
Josh Gao1eac77e2018-02-26 15:54:41 -080088
Roland Levillainf0409142021-03-22 15:45:03 +000089art_cc_defaults {
90 name: "art_sigchain_tests_defaults",
91 srcs: ["sigchain_test.cc"],
92 shared_libs: ["libsigchain"],
93}
94
95// Version of ART gtest `art_sigchain_tests` bundled with the ART APEX on target.
96// TODO(b/192274705): Remove this module when the migration to standalone ART gtests is complete.
Josh Gao1eac77e2018-02-26 15:54:41 -080097art_cc_test {
98 name: "art_sigchain_tests",
99 defaults: [
100 "art_gtest_defaults",
Roland Levillainf0409142021-03-22 15:45:03 +0000101 "art_sigchain_tests_defaults",
Josh Gao1eac77e2018-02-26 15:54:41 -0800102 ],
Roland Levillainf0409142021-03-22 15:45:03 +0000103}
104
105// Standalone version of ART gtest `art_sigchain_tests`, not bundled with the ART APEX on target.
106art_cc_test {
107 name: "art_standalone_sigchain_tests",
108 defaults: [
109 "art_standalone_gtest_defaults",
110 "art_sigchain_tests_defaults",
111 ],
Josh Gao1eac77e2018-02-26 15:54:41 -0800112}