site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com User-agent: Mozilla Thunderbird 1.0 (Macintosh/20041206) Peter O'Gorman wrote: | So if you build libhello with -bundle instead of -dynamiclib it works | somehow. But this is a no go for me. | I'm not aware of any workaround for panther. There is no workaround for getting libraries inserted with DYLD_INSERT_LIBRARIES to have their static constructors called on panther that I know of. Nor is there any standard that I am aware of which requires this functionality. Well, I can wait, or I _have_ to wait :) Andreas _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... Why? Well, the sample I showed was with dlopen, yes. But I need it in general with dylibs. I tried to build libgcj with -bundle but this conflicts with the whole gcc tree. So I really need -dynamiclib. Since you are dlopening the library, and panther uses dlcompat, and dlcompat looks for a symbol named "_init", you can use a hack. Inserting a "void _init() { ; }" into the .c file which has your static constructors should cause them to be called. They must appear in the same translation unit as the static constructor, or you must link your library using the - -single_module flag if you want dyld to call them. If I were you I'd check for different dlopen and dyld behavior on tiger... My need is more or less covered in tiger. I expect some issues but I can't test that often. This email sent to site_archiver@lists.apple.com