diff options
| author | 2024-06-06 16:28:26 +0000 | |
|---|---|---|
| committer | 2024-06-06 16:28:26 +0000 | |
| commit | 382caaf3a3fbd6b533f83d1ec6526abc48f147fa (patch) | |
| tree | f7819bdcb243deb3690b7e804088a9eb6ccef510 | |
| parent | 50c739287ad35ce79463b774ec96cdc6c479094d (diff) | |
| parent | ec1272d02335928cd9b24000a4fa2cfd7919a056 (diff) | |
Merge "Introduce binder_sdk - CMake snapshot" into main am: ec1272d023
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/3068487
Change-Id: I313a95e43994b5ba679001b08842a413ea0f26db
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| -rw-r--r-- | libs/binder/Android.bp | 164 | ||||
| -rw-r--r-- | libs/binder/liblog_stub/Android.bp | 1 | ||||
| -rw-r--r-- | libs/binder/ndk/Android.bp | 52 | ||||
| -rw-r--r-- | libs/binder/tests/Android.bp | 9 |
4 files changed, 204 insertions, 22 deletions
diff --git a/libs/binder/Android.bp b/libs/binder/Android.bp index 090e35bc37..cb1d1143bc 100644 --- a/libs/binder/Android.bp +++ b/libs/binder/Android.bp @@ -28,6 +28,7 @@ cc_library_headers { recovery_available: true, host_supported: true, native_bridge_supported: true, + cmake_snapshot_supported: true, header_libs: [ "libbinder_headers_platform_shared", @@ -83,6 +84,124 @@ cc_library_headers { }, } +cc_cmake_snapshot { + name: "binder_sdk", + modules: [ + "libbinder_sdk", + "libbinder_sdk_single_threaded", + "libbinder_ndk_sdk", + "binderRpcTestNoKernel", + ], + prebuilts: [ + // to enable arm64 host support, build with musl - e.g. on aosp_cf_arm64_phone + "aidl", + "libc++", + ], + include_sources: true, + cflags: [ + "-DNDEBUG", + "-DBINDER_ENABLE_LIBLOG_ASSERT", + "-DBINDER_DISABLE_NATIVE_HANDLE", + "-DBINDER_DISABLE_BLOB", + "-DBINDER_NO_LIBBASE", + "-DBINDER_NO_KERNEL_IPC_TESTING", + + // from Soong's global.go commonGlobalCflags and noOverrideGlobalCflags + "-Wno-c99-designator", + "-Wno-missing-field-initializers", + + // warnings that only pop up on gcc + "-Wno-unknown-pragmas", // "pragma clang" + "-Wno-attributes", // attributes on compound-statements + "-Wno-psabi", // reminders about old ABI changes + ], + cflags_ignored: [ + // gcc requires all header constexprs to be used in all dependent compilatinon units + "-Wunused-const-variable", + ], + library_mapping: [ + { + android_name: "libssl", + mapped_name: "ssl", + package_pregenerated: "external/boringssl", + }, + { + android_name: "libcrypto", + mapped_name: "crypto", + package_pregenerated: "external/boringssl", + }, + { + android_name: "libgtest", + mapped_name: "GTest::gtest", + package_system: "GTest", + }, + { + android_name: "libgtest_main", + mapped_name: "GTest::gtest", + package_system: "GTest", + }, + + // use libbinder_sdk and friends instead of full Android's libbinder + { + android_name: "libbinder_rpc_no_kernel", + mapped_name: "android::libbinder_sdk", + }, + { + android_name: "libbinder_rpc_single_threaded_no_kernel", + mapped_name: "android::libbinder_sdk_single_threaded", + }, + { + android_name: "libbinder_headers", + mapped_name: "android::libbinder_headers_base", + }, + { + android_name: "libbinder", + mapped_name: "android::libbinder_sdk", + }, + { + android_name: "libbinder_ndk", + mapped_name: "android::libbinder_ndk_sdk", + }, + { + android_name: "liblog", + mapped_name: "android::liblog_stub", + }, + + // explicitly included by Binder tests, but not needed outside of Android + { + android_name: "libbase", + }, + { + android_name: "libcutils", + }, + { + android_name: "libutils", + }, + + // disable tests that don't work outside of Android yet + { + android_name: "binder_rpc_test_service", + }, + { + android_name: "binder_rpc_test_service_single_threaded", + }, + + // trusty mocks are artificially triggered and not needed outside of Android build + { + android_name: "libbinder_on_trusty_mock", + }, + { + android_name: "libbinder_ndk_on_trusty_mock", + }, + { + android_name: "binderRpcTestService_on_trusty_mock", + }, + { + android_name: "binderRpcTest_on_trusty_mock", + }, + ], +} + // These interfaces are android-specific implementation unrelated to binder // transport itself and should be moved to AIDL or in domain-specific libs. // @@ -126,6 +245,9 @@ cc_defaults { header_libs: [ "libbinder_headers_base", ], + export_header_lib_headers: [ + "libbinder_headers_base", + ], cflags: [ "-Wextra", @@ -369,6 +491,7 @@ cc_library { double_loadable: true, // TODO(b/153609531): remove when no longer needed. native_bridge_supported: true, + cmake_snapshot_supported: false, // libbinder does not offer a stable wire protocol. // if a second copy of it is installed, then it may break after security @@ -408,16 +531,8 @@ cc_library { afdo: true, } -cc_library_host_shared { - name: "libbinder_sdk", - - defaults: [ - "libbinder_common_defaults", - ], - - shared_libs: [ - "libutils_binder_sdk", - ], +cc_defaults { + name: "binder_sdk_defaults", cflags: [ "-DBINDER_ENABLE_LIBLOG_ASSERT", @@ -429,6 +544,21 @@ cc_library_host_shared { header_libs: [ "liblog_stub", ], +} + +cc_defaults { + name: "libbinder_sdk_defaults", + + cmake_snapshot_supported: true, + + defaults: [ + "libbinder_common_defaults", + "binder_sdk_defaults", + ], + + shared_libs: [ + "libutils_binder_sdk", + ], srcs: [ "OS_non_android_linux.cpp", @@ -446,6 +576,19 @@ cc_library_host_shared { }, } +cc_library_host_shared { + name: "libbinder_sdk", + defaults: ["libbinder_sdk_defaults"], +} + +cc_library_host_shared { + name: "libbinder_sdk_single_threaded", + defaults: ["libbinder_sdk_defaults"], + cflags: [ + "-DBINDER_RPC_SINGLE_THREADED", + ], +} + cc_library { name: "libbinder_rpc_no_kernel", vendor_available: true, @@ -535,6 +678,7 @@ cc_defaults { defaults: ["libbinder_tls_shared_deps"], vendor_available: true, host_supported: true, + cmake_snapshot_supported: true, header_libs: [ "libbinder_headers", diff --git a/libs/binder/liblog_stub/Android.bp b/libs/binder/liblog_stub/Android.bp index f2ca22fdb0..2de6658419 100644 --- a/libs/binder/liblog_stub/Android.bp +++ b/libs/binder/liblog_stub/Android.bp @@ -30,6 +30,7 @@ cc_library_headers { product_available: true, recovery_available: true, vendor_available: true, + cmake_snapshot_supported: true, target: { windows: { diff --git a/libs/binder/ndk/Android.bp b/libs/binder/ndk/Android.bp index 9a2d14af32..26c228d9a4 100644 --- a/libs/binder/ndk/Android.bp +++ b/libs/binder/ndk/Android.bp @@ -32,17 +32,11 @@ license { ], } -cc_library { - name: "libbinder_ndk", - +cc_defaults { + name: "libbinder_ndk_common_defaults", host_supported: true, recovery_available: true, - llndk: { - symbol_file: "libbinder_ndk.map.txt", - export_llndk_headers: ["libvendorsupport_llndk_headers"], - }, - export_include_dirs: [ "include_cpp", "include_ndk", @@ -50,7 +44,6 @@ cc_library { ], cflags: [ - "-DBINDER_WITH_KERNEL_IPC", "-Wall", "-Wextra", "-Wextra-semi", @@ -59,14 +52,48 @@ cc_library { srcs: [ "ibinder.cpp", - "ibinder_jni.cpp", "libbinder.cpp", "parcel.cpp", + "stability.cpp", + "status.cpp", + ], +} + +cc_library_host_shared { + name: "libbinder_ndk_sdk", + + defaults: [ + "libbinder_ndk_common_defaults", + "binder_sdk_defaults", + ], + cmake_snapshot_supported: true, + + shared_libs: [ + "libbinder_sdk", + "libutils_binder_sdk", + ], +} + +cc_library { + name: "libbinder_ndk", + + defaults: ["libbinder_ndk_common_defaults"], + cmake_snapshot_supported: false, + + llndk: { + symbol_file: "libbinder_ndk.map.txt", + export_llndk_headers: ["libvendorsupport_llndk_headers"], + }, + + cflags: [ + "-DBINDER_WITH_KERNEL_IPC", + ], + + srcs: [ + "ibinder_jni.cpp", "parcel_jni.cpp", "persistable_bundle.cpp", "process.cpp", - "stability.cpp", - "status.cpp", "service_manager.cpp", ], @@ -195,6 +222,7 @@ cc_library_headers { host_supported: true, // TODO(b/153609531): remove when no longer needed. native_bridge_supported: true, + cmake_snapshot_supported: true, target: { darwin: { enabled: false, diff --git a/libs/binder/tests/Android.bp b/libs/binder/tests/Android.bp index 8771af52f3..3fe55d65f1 100644 --- a/libs/binder/tests/Android.bp +++ b/libs/binder/tests/Android.bp @@ -25,6 +25,7 @@ package { cc_defaults { name: "binder_test_defaults", + cmake_snapshot_supported: true, cflags: [ "-Wall", "-Werror", @@ -142,6 +143,7 @@ aidl_interface { name: "binderRpcTestIface", vendor_available: true, host_supported: true, + cmake_snapshot_supported: true, unstable: true, srcs: [ "BinderRpcTestClientInfo.aidl", @@ -223,6 +225,7 @@ cc_library_static { cc_defaults { name: "binderRpcTest_common_defaults", host_supported: true, + cmake_snapshot_supported: true, target: { darwin: { enabled: false, @@ -382,6 +385,9 @@ cc_test { static_libs: [ "libbinder_rpc_single_threaded_no_kernel", ], + shared_libs: [ + "libbinder_ndk", + ], } cc_binary { @@ -502,6 +508,9 @@ cc_test { static_libs: [ "libbinder_rpc_single_threaded_no_kernel", ], + shared_libs: [ + "libbinder_ndk", + ], } cc_test { |