Dan Willemsen | f7cc91b | 2016-09-13 16:35:00 -0700 | [diff] [blame] | 1 | // Copyright (C) 2009 The Android Open Source Project |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
Bob Badour | 28383df | 2021-02-03 23:56:34 -0800 | [diff] [blame] | 15 | package { |
| 16 | default_applicable_licenses: ["system_libhwbinder_license"], |
| 17 | } |
| 18 | |
| 19 | // Added automatically by a large-scale-change |
| 20 | // http://go/android-license-faq |
| 21 | license { |
| 22 | name: "system_libhwbinder_license", |
| 23 | visibility: [":__subpackages__"], |
| 24 | license_kinds: [ |
| 25 | "SPDX-license-identifier-Apache-2.0", |
| 26 | ], |
| 27 | license_text: [ |
| 28 | "NOTICE", |
| 29 | ], |
| 30 | } |
| 31 | |
Steven Moreland | 76ad7c5 | 2020-07-29 23:00:51 +0000 | [diff] [blame] | 32 | cc_library_headers { |
| 33 | name: "libhwbinder_headers", |
| 34 | export_include_dirs: ["include"], |
| 35 | host_supported: true, |
| 36 | recovery_available: true, |
| 37 | vendor_available: true, |
Justin Yun | 2f57140 | 2020-11-11 19:24:19 +0900 | [diff] [blame] | 38 | product_available: true, |
Steven Moreland | 76ad7c5 | 2020-07-29 23:00:51 +0000 | [diff] [blame] | 39 | // TODO(b/153609531): remove when no longer needed. |
| 40 | native_bridge_supported: true, |
| 41 | apex_available: [ |
| 42 | "//apex_available:platform", |
| 43 | "//apex_available:anyapex", |
| 44 | ], |
| 45 | min_sdk_version: "29", |
| 46 | } |
| 47 | |
Yi Kong | 1a8beb6 | 2018-04-03 12:15:58 -0700 | [diff] [blame] | 48 | cc_defaults { |
| 49 | name: "libhwbinder_defaults", |
Steven Moreland | 09a8725 | 2019-06-17 17:18:02 -0700 | [diff] [blame] | 50 | |
Steven Moreland | 76ad7c5 | 2020-07-29 23:00:51 +0000 | [diff] [blame] | 51 | header_libs: ["libhwbinder_headers"], |
| 52 | export_header_lib_headers: ["libhwbinder_headers"], |
Dan Willemsen | f7cc91b | 2016-09-13 16:35:00 -0700 | [diff] [blame] | 53 | |
Dan Willemsen | f7cc91b | 2016-09-13 16:35:00 -0700 | [diff] [blame] | 54 | sanitize: { |
| 55 | misc_undefined: ["integer"], |
| 56 | }, |
| 57 | srcs: [ |
| 58 | "Binder.cpp", |
Yifan Hong | 1e118d2 | 2017-01-12 14:42:28 -0800 | [diff] [blame] | 59 | "BpHwBinder.cpp", |
Dan Willemsen | f7cc91b | 2016-09-13 16:35:00 -0700 | [diff] [blame] | 60 | "BufferedTextOutput.cpp", |
| 61 | "Debug.cpp", |
| 62 | "IInterface.cpp", |
| 63 | "IPCThreadState.cpp", |
| 64 | "Parcel.cpp", |
| 65 | "ProcessState.cpp", |
| 66 | "Static.cpp", |
| 67 | "TextOutput.cpp", |
Steven Moreland | a80270c | 2020-11-19 21:08:28 +0000 | [diff] [blame] | 68 | "Utils.cpp", |
Dan Willemsen | f7cc91b | 2016-09-13 16:35:00 -0700 | [diff] [blame] | 69 | ], |
| 70 | |
| 71 | product_variables: { |
| 72 | binder32bit: { |
| 73 | cflags: ["-DBINDER_IPC_32BIT=1"], |
| 74 | }, |
| 75 | }, |
| 76 | |
Chih-Hung Hsieh | 29dbdcf | 2017-10-02 10:42:37 -0700 | [diff] [blame] | 77 | cflags: [ |
| 78 | "-Wall", |
| 79 | "-Werror", |
| 80 | ], |
| 81 | } |
Zhizhou Yang | 5166bc5 | 2018-03-26 17:19:04 -0700 | [diff] [blame] | 82 | |
Steven Moreland | 09a8725 | 2019-06-17 17:18:02 -0700 | [diff] [blame] | 83 | cc_defaults { |
| 84 | name: "libhwbinder-impl-shared-libs", |
Steven Moreland | 09a8725 | 2019-06-17 17:18:02 -0700 | [diff] [blame] | 85 | shared_libs: [ |
| 86 | "libbase", |
| 87 | "liblog", |
| 88 | "libcutils", |
| 89 | "libutils", |
| 90 | ], |
| 91 | export_shared_lib_headers: [ |
| 92 | "libbase", |
| 93 | "libutils", |
| 94 | ], |
| 95 | } |
| 96 | |
| 97 | // WARNING: this should no longer be used |
Steven Moreland | 202ca45 | 2020-07-07 23:34:10 +0000 | [diff] [blame] | 98 | // This is automatically removed by bpfix. Once there are no makefiles, fixes can be automatically applied, and this can be removed. |
Yi Kong | 1a8beb6 | 2018-04-03 12:15:58 -0700 | [diff] [blame] | 99 | cc_library { |
| 100 | name: "libhwbinder", |
Steven Moreland | 09a8725 | 2019-06-17 17:18:02 -0700 | [diff] [blame] | 101 | vendor_available: true, |
Steven Moreland | 09a8725 | 2019-06-17 17:18:02 -0700 | [diff] [blame] | 102 | |
| 103 | export_include_dirs: ["include"], |
Steven Moreland | e8adbb1 | 2019-10-09 16:27:36 -0700 | [diff] [blame] | 104 | |
Dan Willemsen | 97767bf | 2020-06-09 15:28:40 -0700 | [diff] [blame] | 105 | visibility: [ |
| 106 | ":__subpackages__", |
| 107 | "//vendor:__subpackages__", |
| 108 | ], |
Steven Moreland | 09a8725 | 2019-06-17 17:18:02 -0700 | [diff] [blame] | 109 | } |
| 110 | |
| 111 | // Combined into libhidlbase for efficiency. |
| 112 | // Used as shared library to provide headers for libhidltransport-impl-internal. |
| 113 | cc_library_static { |
| 114 | name: "libhwbinder-impl-internal", |
Steven Moreland | d9bdb65 | 2019-09-17 15:42:45 -0700 | [diff] [blame] | 115 | include_dirs: [ |
Steven Moreland | d9bdb65 | 2019-09-17 15:42:45 -0700 | [diff] [blame] | 116 | // TODO(b/31559095): get headers from bionic on host |
| 117 | "bionic/libc/kernel/android/uapi/", |
| 118 | "bionic/libc/kernel/uapi/", |
| 119 | ], |
| 120 | |
Yi Kong | 1a8beb6 | 2018-04-03 12:15:58 -0700 | [diff] [blame] | 121 | defaults: [ |
| 122 | "libhwbinder_defaults", |
Steven Moreland | e3785d0 | 2020-01-31 14:58:48 -0800 | [diff] [blame] | 123 | "libhwbinder-impl-shared-libs", |
Yi Kong | 1a8beb6 | 2018-04-03 12:15:58 -0700 | [diff] [blame] | 124 | "hwbinder_pgo", |
Jayant Chowdhary | 985fc89 | 2018-10-01 22:54:05 +0000 | [diff] [blame] | 125 | "hwbinder_lto", |
Yi Kong | 1a8beb6 | 2018-04-03 12:15:58 -0700 | [diff] [blame] | 126 | ], |
Steven Moreland | d9bdb65 | 2019-09-17 15:42:45 -0700 | [diff] [blame] | 127 | host_supported: true, |
Steven Moreland | 09a8725 | 2019-06-17 17:18:02 -0700 | [diff] [blame] | 128 | recovery_available: true, |
| 129 | vendor_available: true, |
Justin Yun | 2f57140 | 2020-11-11 19:24:19 +0900 | [diff] [blame] | 130 | product_available: true, |
Victor Khimenko | 722a615 | 2020-07-03 00:23:21 +0200 | [diff] [blame] | 131 | // TODO(b/153609531): remove when no longer needed. |
| 132 | native_bridge_supported: true, |
Jiyong Park | 889cf78 | 2020-03-07 17:27:13 +0900 | [diff] [blame] | 133 | apex_available: [ |
| 134 | "//apex_available:platform", |
| 135 | "com.android.neuralnetworks", |
| 136 | "com.android.bluetooth.updatable", |
| 137 | "com.android.media", |
| 138 | "com.android.media.swcodec", |
| 139 | "com.android.tethering", |
| 140 | ], |
Jooyung Han | 1e5505d | 2020-04-16 18:48:34 +0900 | [diff] [blame] | 141 | min_sdk_version: "29", |
Yi Kong | 1a8beb6 | 2018-04-03 12:15:58 -0700 | [diff] [blame] | 142 | } |
| 143 | |
Steven Moreland | 09a8725 | 2019-06-17 17:18:02 -0700 | [diff] [blame] | 144 | // Only libhwbinder_benchmark needs to have pgo enabled. When all places |
| 145 | // support having PGO selectively enabled, all places can use libhwbinder. |
| 146 | // |
| 147 | // http://b/77320844 |
| 148 | cc_library_static { |
| 149 | name: "libhwbinder_pgo-impl-internal", |
| 150 | defaults: [ |
| 151 | "libhwbinder_defaults", |
| 152 | "libhwbinder-impl-shared-libs", |
| 153 | "hwbinder_benchmark_pgo", |
| 154 | "hwbinder_lto", |
Yi Kong | 1a8beb6 | 2018-04-03 12:15:58 -0700 | [diff] [blame] | 155 | ], |
| 156 | } |
| 157 | |
Zhizhou Yang | 5166bc5 | 2018-03-26 17:19:04 -0700 | [diff] [blame] | 158 | // Provide pgo property to build hwbinder with PGO |
| 159 | cc_defaults { |
| 160 | name: "hwbinder_pgo", |
| 161 | pgo: { |
| 162 | instrumentation: true, |
| 163 | profile_file: "hwbinder/hwbinder.profdata", |
| 164 | benchmarks: ["hwbinder"], |
| 165 | enable_profile_use: true, |
| 166 | }, |
| 167 | } |
Jayant Chowdhary | 985fc89 | 2018-10-01 22:54:05 +0000 | [diff] [blame] | 168 | |
Steven Moreland | 09a8725 | 2019-06-17 17:18:02 -0700 | [diff] [blame] | 169 | cc_defaults { |
| 170 | name: "hwbinder_benchmark_pgo", |
| 171 | pgo: { |
| 172 | instrumentation: true, |
| 173 | profile_file: "hwbinder/hwbinder.profdata", |
| 174 | benchmarks: ["hwbinder_benchmark"], |
| 175 | enable_profile_use: true, |
| 176 | }, |
| 177 | } |
| 178 | |
Zhizhou Yang | 5166bc5 | 2018-03-26 17:19:04 -0700 | [diff] [blame] | 179 | // Provide lto property to build hwbinder with LTO |
| 180 | cc_defaults { |
| 181 | name: "hwbinder_lto", |
| 182 | target: { |
| 183 | android: { |
| 184 | lto: { |
| 185 | thin: true, |
| 186 | }, |
| 187 | }, |
| 188 | }, |
| 189 | } |