[rust-dev] Impending change in RPATH behavior when linking to Rust dynamic libraries

Bob Ippolito bob at redivi.com
Wed Jul 9 09:44:19 PDT 2014


On Wed, Jul 9, 2014 at 9:29 AM, Patrick Walton <pcwalton at mozilla.com> wrote:

> On 7/9/14 7:42 AM, Bob Ippolito wrote:
>
>> This seems like madness. No other programming language out there that
>> I've seen requires developers to mangle these environment variables.
>>
>
> Note that rpath never worked on Windows [1], so it could never be a
> long-term solution.
>

Well, you could emulate it with runtime dynamic linking I guess, but my
point is that this is a silly regression. Why hobble every platform just
because of Windows? It's fine if you don't want to use @rpath, but you
should at least use absolute paths to libraries on Mac, if not
@executable_path or @loader_path. Windows will by default search the
equivalent of @executable_path/.. if I'm reading [1] correctly. If you
wanted a Mac solution that works in 100% of all cases the only solution is
absolute paths because dyld will ignore environment variables,
@executable_path, and @loader_path if the executable is restricted (setuid,
etc.) [2].

[1]
http://msdn.microsoft.com/en-us/library/ms682586%28VS.85%29.aspx#standard_search_order_for_desktop_applications
[2] http://www.opensource.apple.com/source/dyld/dyld-239.4/src/dyld.cpp
(see processRestricted, etc.)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/rust-dev/attachments/20140709/7c5d5081/attachment.html>


More information about the Rust-dev mailing list