I’m in the process of qualifying my app on 10.3.
My app uses dlopen() to load some libraries, which contain a number of static
objects that register themselves to the app in their constructors.
While this works fine in 10.4, on 10.3 these registrations
never occur. There are no errors loading the libraries, but it seems that
no C++ static object constructors are being called.
Looking on the web I’ve found these links:
http://darwinsource.opendarwin.org/10.3/iodbc-19/dlcompat-20010831/README
http://developer.apple.com/documentation/DeveloperTools/Conceptual/DynamicLibraries/Articles/DynamicLibraryUsageGuidelines.html
which strongly indicate problems with static initializer
calling and dlopen(). But I didn’t find anything saying that these
things were fixed in 10.4, and they obviously are.
So what to do? Perhaps I can, in 10.3 only code, create a module
initializer and finalizer with the __attribute__((constructor)) and
__attribute__((destructor)) that call to the proper C++ static initailizer and
destructor, but it isn’t entirely clear how to do this or if it would
work. I note there are a number of
__static_initialization_and_destruction_0(int,int)
lines in the output of nm on my library (with the ‘s’
tag), but that isn’t enough for me to go on.
Does anyone have any experience with this issue?
Thanks,
David Litwin
BigFix