blob: b3dd7e278e83d68ba076ce3eb53d7596f19c729d [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 Stjernholme017bb02021-03-17 10:55:25 +000052 static_libs: ["libasync_safe"],
Colin Cross1f7f3bd2016-07-27 10:12:38 -070053 },
54 },
Colin Cross616f4002019-05-29 21:39:14 -070055
56 export_include_dirs: ["."],
Jiyong Park066dd9022019-12-19 02:11:59 +000057 apex_available: [
Martin Stjernholm3e9abfc2020-10-09 22:17:51 +010058 "com.android.art",
Jiyong Park066dd9022019-12-19 02:11:59 +000059 "com.android.art.debug",
Jiyong Park066dd9022019-12-19 02:11:59 +000060 ],
Nicolas Geoffrayaded1392021-03-05 09:54:10 +000061 stubs: {
62 symbol_file: "libsigchain.map.txt",
63 versions: ["1"],
64 },
Colin Cross1f7f3bd2016-07-27 10:12:38 -070065}
66
David Srbeckyd3ee9022020-07-27 16:05:38 +010067// Create a fake version of libsigchain which expose the necessary symbols
Colin Cross1f7f3bd2016-07-27 10:12:38 -070068// 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 {
David Srbeckyd3ee9022020-07-27 16:05:38 +010071 name: "libsigchain_fake",
Colin Cross1f7f3bd2016-07-27 10:12:38 -070072 host_supported: true,
73 defaults: ["art_defaults"],
David Srbeckyd3ee9022020-07-27 16:05:38 +010074 srcs: ["sigchain_fake.cc"],
Colin Cross1f7f3bd2016-07-27 10:12:38 -070075 target: {
Colin Cross1f7f3bd2016-07-27 10:12:38 -070076 android: {
Martin Stjernholme017bb02021-03-17 10:55:25 +000077 static_libs: ["libasync_safe"],
Colin Cross1f7f3bd2016-07-27 10:12:38 -070078 },
79 },
Colin Cross616f4002019-05-29 21:39:14 -070080
81 export_include_dirs: ["."],
Colin Cross1f7f3bd2016-07-27 10:12:38 -070082}
Josh Gao1eac77e2018-02-26 15:54:41 -080083
84art_cc_test {
85 name: "art_sigchain_tests",
86 defaults: [
87 "art_gtest_defaults",
88 ],
89 srcs: ["sigchain_test.cc"],
Martin Stjernholme017bb02021-03-17 10:55:25 +000090 shared_libs: ["libsigchain"],
Josh Gao1eac77e2018-02-26 15:54:41 -080091}