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 15package { 16 default_applicable_licenses: ["system_libhwbinder_license"], 17} 18 19// Added automatically by a large-scale-change 20// http://go/android-license-faq 21license { 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 32cc_library_headers { 33 name: "libhwbinder_headers", 34 export_include_dirs: ["include"], 35 host_supported: true, 36 recovery_available: true, 37 vendor_available: true, 38 product_available: true, 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 48cc_defaults { 49 name: "libhwbinder_defaults", 50 51 header_libs: ["libhwbinder_headers"], 52 export_header_lib_headers: ["libhwbinder_headers"], 53 54 sanitize: { 55 misc_undefined: ["integer"], 56 }, 57 srcs: [ 58 "Binder.cpp", 59 "BpHwBinder.cpp", 60 "BufferedTextOutput.cpp", 61 "Debug.cpp", 62 "IInterface.cpp", 63 "IPCThreadState.cpp", 64 "Parcel.cpp", 65 "ProcessState.cpp", 66 "Static.cpp", 67 "TextOutput.cpp", 68 "Utils.cpp", 69 ], 70 71 product_variables: { 72 binder32bit: { 73 cflags: ["-DBINDER_IPC_32BIT=1"], 74 }, 75 }, 76 77 cflags: [ 78 "-Wall", 79 "-Werror", 80 ], 81} 82 83cc_defaults { 84 name: "libhwbinder-impl-shared-libs", 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 98// This is automatically removed by bpfix. Once there are no makefiles, fixes can be automatically applied, and this can be removed. 99cc_library { 100 name: "libhwbinder", 101 vendor_available: true, 102 103 export_include_dirs: ["include"], 104 105 visibility: [ 106 ":__subpackages__", 107 "//vendor:__subpackages__", 108 ], 109} 110 111// Combined into libhidlbase for efficiency. 112// Used as shared library to provide headers for libhidltransport-impl-internal. 113cc_library_static { 114 name: "libhwbinder-impl-internal", 115 include_dirs: [ 116 // TODO(b/31559095): get headers from bionic on host 117 "bionic/libc/kernel/android/uapi/", 118 "bionic/libc/kernel/uapi/", 119 ], 120 121 defaults: [ 122 "libhwbinder_defaults", 123 "libhwbinder-impl-shared-libs", 124 "hwbinder_lto", 125 ], 126 host_supported: true, 127 recovery_available: true, 128 vendor_available: true, 129 product_available: true, 130 // TODO(b/153609531): remove when no longer needed. 131 native_bridge_supported: true, 132 apex_available: [ 133 "//apex_available:platform", 134 "com.android.neuralnetworks", 135 "com.android.btservices", 136 "com.android.media", 137 "com.android.media.swcodec", 138 "com.android.tethering", 139 ], 140 min_sdk_version: "29", 141} 142 143// Provide lto property to build hwbinder with LTO 144cc_defaults { 145 name: "hwbinder_lto", 146 target: { 147 android: { 148 lto: { 149 thin: true, 150 }, 151 }, 152 }, 153 arch: { 154 // TODO(b/254713216): undefined symbol in BufferedTextOutput::getBuffer 155 riscv64: { 156 lto: { 157 thin: false, 158 }, 159 }, 160 }, 161} 162