From 1a12df76d12bfc9fdfffadb290f7742763568765 Mon Sep 17 00:00:00 2001 From: Ariel Abreu Date: Sat, 7 Oct 2023 11:06:34 -0400 Subject: [PATCH] Fix objc message logging for 64-bit code The Objective-C runtime version 2 (used for non-32-bit architectures) added a runtime lock. This lock is always taken before the message log lock, but the lockdebug subsystem wasn't made aware of this; because of this, it would throw an error saying the lock order wasn't defined. Let's define it so it can calm down. --- runtime/objc-os.mm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/runtime/objc-os.mm b/runtime/objc-os.mm index be1c365..a3e60ff 100644 --- a/runtime/objc-os.mm +++ b/runtime/objc-os.mm @@ -776,6 +776,10 @@ static void defineLockOrder() lockdebug_lock_precedes_lock(&classInitLock, &runtimeLock); #endif +#if __OBJC2__ && defined(DARLING) + lockdebug_lock_precedes_lock(&runtimeLock, &objcMsgLogLock); +#endif + #if __OBJC2__ // Runtime operations may occur inside SideTable locks // (such as storeWeak calling getMethodImplementation)