libbinder: Add __assert in Trusty
Delegate code calls the __assert macro which was
not defined on Trusty, causing the default implementation
based on syslog to be used. This provides a Trusty-specific
__assert implementation that uses Trusty logging APIs.
Bug: 230135749
Test: build.py on Trusty
Change-Id: Ic256a1a26a046cb697479e2328312972edbad4a6
diff --git a/libs/binder/trusty/include/log/log.h b/libs/binder/trusty/include/log/log.h
index bf877a3..d88d18a 100644
--- a/libs/binder/trusty/include/log/log.h
+++ b/libs/binder/trusty/include/log/log.h
@@ -120,3 +120,7 @@
do { \
TLOGE("android_errorWriteLog: tag:%x subTag:%s\n", tag, subTag); \
} while (0)
+
+extern "C" inline void __assert(const char* file, int line, const char* str) {
+ LOG_ALWAYS_FATAL("%s:%d: assertion \"%s\" failed", file, line, str);
+}