Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 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 | |
Bob Badour | 9150de6 | 2021-02-26 03:22:24 -0800 | [diff] [blame] | 17 | package { |
| 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 Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 27 | cc_library { |
| 28 | name: "libsigchain", |
Martin Stjernholm | b4abe0a | 2019-05-17 19:22:55 +0100 | [diff] [blame] | 29 | defaults: ["art_defaults"], |
| 30 | visibility: [ |
Martin Stjernholm | b4abe0a | 2019-05-17 19:22:55 +0100 | [diff] [blame] | 31 | "//frameworks/base/cmds/app_process", |
| 32 | ], |
Nicolas Geoffray | aded139 | 2021-03-05 09:54:10 +0000 | [diff] [blame] | 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"], |
Josh Gao | d32d79d | 2018-02-26 14:29:25 -0800 | [diff] [blame] | 40 | |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 41 | host_supported: true, |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 42 | target: { |
Josh Gao | d32d79d | 2018-02-26 14:29:25 -0800 | [diff] [blame] | 43 | linux: { |
Nicolas Geoffray | aded139 | 2021-03-05 09:54:10 +0000 | [diff] [blame] | 44 | srcs: ["sigchain.cc"], |
Josh Gao | d32d79d | 2018-02-26 14:29:25 -0800 | [diff] [blame] | 45 | }, |
| 46 | |
| 47 | darwin: { |
David Srbecky | d3ee902 | 2020-07-27 16:05:38 +0100 | [diff] [blame] | 48 | srcs: ["sigchain_fake.cc"], |
Josh Gao | d32d79d | 2018-02-26 14:29:25 -0800 | [diff] [blame] | 49 | }, |
| 50 | |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 51 | android: { |
Martin Stjernholm | e017bb0 | 2021-03-17 10:55:25 +0000 | [diff] [blame] | 52 | static_libs: ["libasync_safe"], |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 53 | }, |
| 54 | }, |
Colin Cross | 616f400 | 2019-05-29 21:39:14 -0700 | [diff] [blame] | 55 | |
| 56 | export_include_dirs: ["."], |
Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 57 | apex_available: [ |
Martin Stjernholm | 3e9abfc | 2020-10-09 22:17:51 +0100 | [diff] [blame] | 58 | "com.android.art", |
Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 59 | "com.android.art.debug", |
Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 60 | ], |
Nicolas Geoffray | aded139 | 2021-03-05 09:54:10 +0000 | [diff] [blame] | 61 | stubs: { |
| 62 | symbol_file: "libsigchain.map.txt", |
| 63 | versions: ["1"], |
| 64 | }, |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 65 | } |
| 66 | |
David Srbecky | d3ee902 | 2020-07-27 16:05:38 +0100 | [diff] [blame] | 67 | // Create a fake version of libsigchain which expose the necessary symbols |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 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. |
| 70 | cc_library_static { |
David Srbecky | d3ee902 | 2020-07-27 16:05:38 +0100 | [diff] [blame] | 71 | name: "libsigchain_fake", |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 72 | host_supported: true, |
| 73 | defaults: ["art_defaults"], |
David Srbecky | d3ee902 | 2020-07-27 16:05:38 +0100 | [diff] [blame] | 74 | srcs: ["sigchain_fake.cc"], |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 75 | target: { |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 76 | android: { |
Martin Stjernholm | e017bb0 | 2021-03-17 10:55:25 +0000 | [diff] [blame] | 77 | static_libs: ["libasync_safe"], |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 78 | }, |
| 79 | }, |
Colin Cross | 616f400 | 2019-05-29 21:39:14 -0700 | [diff] [blame] | 80 | |
| 81 | export_include_dirs: ["."], |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 82 | } |
Josh Gao | 1eac77e | 2018-02-26 15:54:41 -0800 | [diff] [blame] | 83 | |
| 84 | art_cc_test { |
| 85 | name: "art_sigchain_tests", |
| 86 | defaults: [ |
| 87 | "art_gtest_defaults", |
| 88 | ], |
| 89 | srcs: ["sigchain_test.cc"], |
Martin Stjernholm | e017bb0 | 2021-03-17 10:55:25 +0000 | [diff] [blame] | 90 | shared_libs: ["libsigchain"], |
Josh Gao | 1eac77e | 2018-02-26 15:54:41 -0800 | [diff] [blame] | 91 | } |