[Development] Plugin loading issue on Mac OS X

jiang.jiang at nokia.com jiang.jiang at nokia.com
Tue Jul 10 10:46:05 CEST 2012


Hi,

Due to an autotest regression, I recently discovered that if plugins built
with both release and debug version (-debug-and-release) are loaded, it will
cause warning messages like:

   objc[26809]: Class QNSListener is implemented in both /Users/jjgod/qtbase/plugins/bearer/libqcorewlanbearer.dylib and /Users/jjgod/qtbase/plugins/bearer/libqcorewlanbearer_debug.dylib. One of the two will be used. Which one is undefined.

or even crashes.

However, simply blacklist _debug.dylib doesn't seem to be a good idea, because
certain plugins are only built with debug version, libqtquick2plugin_debug.dylib
for instance. Meanwhile, some others are only built with release version, like
libcocoa.dylib.

But we can't tell if a dylib should be loaded without loading it at present,
because qt_unix_query() only works for ELF binaries. Thus, we have to temporarily
load a dylib to tell if it is a plugin.

I guess the proper fix is to implement metadata query for Mach-O binaries, if
that's viable.

Any better idea?

- Jiang


More information about the Development mailing list