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 | b747b7a | 2021-11-03 18:40:17 +0000 | [diff] [blame] | 52 | header_libs: ["bionic_libc_platform_headers"], |
Martin Stjernholm | e017bb0 | 2021-03-17 10:55:25 +0000 | [diff] [blame] | 53 | static_libs: ["libasync_safe"], |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 54 | }, |
Martin Stjernholm | b747b7a | 2021-11-03 18:40:17 +0000 | [diff] [blame] | 55 | |
| 56 | linux_bionic: { |
| 57 | header_libs: ["bionic_libc_platform_headers"], |
| 58 | }, |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 59 | }, |
Colin Cross | 616f400 | 2019-05-29 21:39:14 -0700 | [diff] [blame] | 60 | |
| 61 | export_include_dirs: ["."], |
Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 62 | apex_available: [ |
Martin Stjernholm | 3e9abfc | 2020-10-09 22:17:51 +0100 | [diff] [blame] | 63 | "com.android.art", |
Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 64 | "com.android.art.debug", |
Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 65 | ], |
Nicolas Geoffray | aded139 | 2021-03-05 09:54:10 +0000 | [diff] [blame] | 66 | stubs: { |
| 67 | symbol_file: "libsigchain.map.txt", |
| 68 | versions: ["1"], |
| 69 | }, |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 70 | } |
| 71 | |
David Srbecky | d3ee902 | 2020-07-27 16:05:38 +0100 | [diff] [blame] | 72 | // Create a fake version of libsigchain which expose the necessary symbols |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 73 | // 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. |
| 75 | cc_library_static { |
David Srbecky | d3ee902 | 2020-07-27 16:05:38 +0100 | [diff] [blame] | 76 | name: "libsigchain_fake", |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 77 | host_supported: true, |
| 78 | defaults: ["art_defaults"], |
David Srbecky | d3ee902 | 2020-07-27 16:05:38 +0100 | [diff] [blame] | 79 | srcs: ["sigchain_fake.cc"], |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 80 | target: { |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 81 | android: { |
Martin Stjernholm | e017bb0 | 2021-03-17 10:55:25 +0000 | [diff] [blame] | 82 | static_libs: ["libasync_safe"], |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 83 | }, |
| 84 | }, |
Colin Cross | 616f400 | 2019-05-29 21:39:14 -0700 | [diff] [blame] | 85 | |
| 86 | export_include_dirs: ["."], |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 87 | } |
Josh Gao | 1eac77e | 2018-02-26 15:54:41 -0800 | [diff] [blame] | 88 | |
Roland Levillain | f040914 | 2021-03-22 15:45:03 +0000 | [diff] [blame] | 89 | art_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 Gao | 1eac77e | 2018-02-26 15:54:41 -0800 | [diff] [blame] | 97 | art_cc_test { |
| 98 | name: "art_sigchain_tests", |
| 99 | defaults: [ |
| 100 | "art_gtest_defaults", |
Roland Levillain | f040914 | 2021-03-22 15:45:03 +0000 | [diff] [blame] | 101 | "art_sigchain_tests_defaults", |
Josh Gao | 1eac77e | 2018-02-26 15:54:41 -0800 | [diff] [blame] | 102 | ], |
Roland Levillain | f040914 | 2021-03-22 15:45:03 +0000 | [diff] [blame] | 103 | } |
| 104 | |
| 105 | // Standalone version of ART gtest `art_sigchain_tests`, not bundled with the ART APEX on target. |
| 106 | art_cc_test { |
| 107 | name: "art_standalone_sigchain_tests", |
| 108 | defaults: [ |
| 109 | "art_standalone_gtest_defaults", |
| 110 | "art_sigchain_tests_defaults", |
| 111 | ], |
Josh Gao | 1eac77e | 2018-02-26 15:54:41 -0800 | [diff] [blame] | 112 | } |