On 09/18/2013 04:45 AM, Paolo Bonzini wrote: > But on Mac OS X a bundle (module loaded with dlopen) cannot have a > dependency on another bundle, afaik.
The documentation for NSAddImage suggests that they can: > NSADDIMAGE_OPTION_WITH_SEARCHING > With this option, the image_name passed for the library and all its > dependents is affected by the various dyld environment variables as if this > library were linked into the program. Note "and all its dependents". As for controlling the search path... from C it looks like we might be limited to the default $LD_LIBRARY_PATH, $DYLD_LIBRARY_PATH, current working directory, $DYLD_FALLBACK_LIBRARY_PATH" path. It would be interesting to know when dyld reads those environment variables: at startup only, or could we control them from main? Failing that, it appears that explicit control over search paths can be had from Objective C, via the NSBundle class. Something for someone who actually cares about macosx to work on. But you're absolutely right that we can't just whack those elf parameters into the makefile like that. r~