From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33284) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMIzx-0002Ul-Ix for qemu-devel@nongnu.org; Wed, 18 Sep 2013 10:45:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VMIzp-0005mV-5d for qemu-devel@nongnu.org; Wed, 18 Sep 2013 10:44:57 -0400 Received: from mail-ob0-x22e.google.com ([2607:f8b0:4003:c01::22e]:48968) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMIzp-0005mM-04 for qemu-devel@nongnu.org; Wed, 18 Sep 2013 10:44:49 -0400 Received: by mail-ob0-f174.google.com with SMTP id uz6so7654184obc.33 for ; Wed, 18 Sep 2013 07:44:48 -0700 (PDT) Sender: Richard Henderson Message-ID: <5239BC59.5000201@twiddle.net> Date: Wed, 18 Sep 2013 07:44:41 -0700 From: Richard Henderson MIME-Version: 1.0 References: <20130916095121.GD22783@T430s.nay.redhat.com> <5236D8EB.9060700@redhat.com> <20130916101415.GH6005@redhat.com> <5236DB0E.5040302@redhat.com> <20130916102131.GI6005@redhat.com> <5236DDC7.1010908@redhat.com> <20130916112917.GA21374@T430s.nay.redhat.com> <5236EC72.20900@redhat.com> <20130916114641.GA22477@T430s.nay.redhat.com> <523786DD.5020406@twiddle.net> <20130917012910.GB3362@T430s.nay.redhat.com> <5237EB64.9030206@twiddle.net> <52399246.4090600@redhat.com> In-Reply-To: <52399246.4090600@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v10 5/8] module: implement module loading List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: peter.maydell@linaro.org, famz@redhat.com, mjt@tls.msk.ru, qemu-devel@nongnu.org, alex@alex.org.uk, vilanova@ac.upc.edu 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~