Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -164,12 +164,18 @@ ], [ AC_MSG_ERROR([libobjc not found!]) ]) ;; GNU) - AC_DEFINE(OF_GNU_RUNTIME, 1, - [Whether we use the GNU ObjC runtime]) + # The new API of the new GNU runtime is currently too broken to + # be of any use, thus we even use the old API when the new one + # is detected until the new one has been fixed and offers a way + # to detect if it is the fixed one. + dnl AC_DEFINE(OF_GNU_RUNTIME, 1, + dnl [Whether we use the GNU ObjC runtime]) + AC_DEFINE(OF_OLD_GNU_RUNTIME, 1, + [Whether we use the old GNU ObjC runtime]) AC_CHECK_LIB(objc, objc_msg_lookup, [ LIBS="-lobjc $LIBS" ], [ AC_MSG_ERROR([libobjc not found!]) Index: src/OFObject.m ================================================================== --- src/OFObject.m +++ src/OFObject.m @@ -107,10 +107,14 @@ objc_enumerationMutation(id object) { enumeration_mutation_handler(object); } #endif + +#if defined(HAVE_OBJC_ENUMERATIONMUTATION) && defined(OF_OLD_GNU_RUNTIME) +extern void objc_setEnumerationMutationHandler(void(*handler)(id)); +#endif const char* _NSPrintForDebugger(id object) { return [[object description] cString]; @@ -170,11 +174,11 @@ stderr); abort(); } #endif -#if defined(OF_APPLE_RUNTIME) || defined(OF_GNU_RUNTIME) +#ifdef HAVE_OBJC_ENUMERATIONMUTATION objc_setEnumerationMutationHandler(enumeration_mutation_handler); #endif cxx_construct = sel_registerName(".cxx_construct"); cxx_destruct = sel_registerName(".cxx_destruct");