• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
dlopen() on 10.3 and static initializers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

dlopen() on 10.3 and static initializers


  • Subject: dlopen() on 10.3 and static initializers
  • From: "David Litwin" <email@hidden>
  • Date: Wed, 5 Apr 2006 19:12:10 -0700
  • Thread-topic: dlopen() on 10.3 and static initializers

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

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: dlopen() on 10.3 and static initializers
      • From: "Peter O'Gorman" <email@hidden>
  • Prev by Date: Re: Seeking advice on debugging "real time" programs.
  • Next by Date: Re: dlopen() on 10.3 and static initializers
  • Previous by thread: Re: Current Project Version: Change does not cause rebuild?
  • Next by thread: Re: dlopen() on 10.3 and static initializers
  • Index(es):
    • Date
    • Thread