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 | |
| 17 | cc_library { |
| 18 | name: "libsigchain", |
Josh Gao | d32d79d | 2018-02-26 14:29:25 -0800 | [diff] [blame] | 19 | cpp_std: "gnu++17", |
| 20 | |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 21 | host_supported: true, |
| 22 | defaults: ["art_defaults"], |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 23 | target: { |
Josh Gao | d32d79d | 2018-02-26 14:29:25 -0800 | [diff] [blame] | 24 | linux: { |
| 25 | shared: { |
| 26 | srcs: ["sigchain_dummy.cc"], |
| 27 | }, |
| 28 | static: { |
| 29 | srcs: ["sigchain.cc"], |
| 30 | }, |
| 31 | }, |
| 32 | |
| 33 | darwin: { |
| 34 | srcs: ["sigchain_dummy.cc"], |
| 35 | }, |
| 36 | |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 37 | android: { |
Josh Gao | cca6fc0 | 2018-03-12 16:37:21 -0700 | [diff] [blame] | 38 | whole_static_libs: ["libasync_safe"], |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 39 | }, |
| 40 | }, |
Andreas Gampe | 89b8584 | 2017-05-10 09:47:55 -0700 | [diff] [blame] | 41 | // Sigchainlib is whole-statically linked into binaries. For Android.mk-based binaries, |
| 42 | // this will drag ASAN symbols into the binary, even for modules using LOCAL_SANITIZE := never. |
| 43 | // So disable sanitization for now. b/38456126 |
| 44 | sanitize: { |
| 45 | never: true, |
| 46 | }, |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 47 | } |
| 48 | |
| 49 | // Create a dummy version of libsigchain which expose the necessary symbols |
| 50 | // but throws when called. This can be used to get static binaries which don't |
| 51 | // need the real functionality of the sig chain but need to please the linker. |
| 52 | cc_library_static { |
| 53 | name: "libsigchain_dummy", |
| 54 | host_supported: true, |
| 55 | defaults: ["art_defaults"], |
| 56 | srcs: ["sigchain_dummy.cc"], |
| 57 | target: { |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 58 | android: { |
Josh Gao | cca6fc0 | 2018-03-12 16:37:21 -0700 | [diff] [blame] | 59 | whole_static_libs: ["libasync_safe"], |
Colin Cross | 1f7f3bd | 2016-07-27 10:12:38 -0700 | [diff] [blame] | 60 | }, |
| 61 | }, |
| 62 | } |
Josh Gao | 1eac77e | 2018-02-26 15:54:41 -0800 | [diff] [blame] | 63 | |
| 64 | art_cc_test { |
| 65 | name: "art_sigchain_tests", |
| 66 | defaults: [ |
| 67 | "art_gtest_defaults", |
| 68 | ], |
| 69 | srcs: ["sigchain_test.cc"], |
| 70 | whole_static_libs: ["libsigchain"], |
| 71 | } |