clang: update IBinder to be lto_visiblity_public
The clang optimization "-fwhole-program-vtables" can cause problems
with IBinder. In SurfaceFlinger, the optimization causes BpBinder
objects to act like IBinders. This results in problems when trying
to linkToDeath. IBinder's linkToDeath function is called instead
of BpBinder's linkToDeath. When IBinder is annotated for clang with
"[[clang::lto_visibility_public]]", the proper linkToDeath function
is called.
Bug: 119259043
Test: Transaction_test
Change-Id: If168eacb0f9a6716d07bafc9b35834cc7db869e1
diff --git a/libs/binder/include/binder/IBinder.h b/libs/binder/include/binder/IBinder.h
index 14edcbe..1674516 100644
--- a/libs/binder/include/binder/IBinder.h
+++ b/libs/binder/include/binder/IBinder.h
@@ -47,7 +47,7 @@
* (method calls, property get and set) is down through a low-level
* protocol implemented on top of the transact() API.
*/
-class IBinder : public virtual RefBase
+class [[clang::lto_visibility_public]] IBinder : public virtual RefBase
{
public:
enum {