summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Andrei Homescu <ahomescu@google.com> 2022-11-30 06:26:17 +0000
committer Andrei Homescu <ahomescu@google.com> 2022-12-01 00:30:34 +0000
commit16759fc36124f2b76d9fd394eecb34ae0969bbe8 (patch)
tree8cf2df6977ce02e381382f7c3a90d749c9a35b53
parent8a0490039042c5aaa345f855f820d10d0b2fddc4 (diff)
libbinder: Fix __assert macro in Trusty
Override the definition of __assert from the binder_status.h header when building without bionic. The definition in that header uses syslog() to print the assertion message, and this function is not available in Trusty. Bug: 230135749 Test: m Test: build on Trusty Change-Id: I3fe849a021110f78127f70017bff0f1bad868500
-rw-r--r--libs/binder/trusty/include/log/log.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/libs/binder/trusty/include/log/log.h b/libs/binder/trusty/include/log/log.h
index d88d18a7be..de84617343 100644
--- a/libs/binder/trusty/include/log/log.h
+++ b/libs/binder/trusty/include/log/log.h
@@ -121,6 +121,8 @@ static inline void __ignore_va_args__(...) {}
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);
-}
+// Override the definition of __assert from binder_status.h
+#ifndef __BIONIC__
+#undef __assert
+#define __assert(file, line, str) LOG_ALWAYS_FATAL("%s:%d: %s", file, line, str)
+#endif // __BIONIC__