[Haskell-cafe] Calling Haskell from C

dominic at steinitz.org dominic at steinitz.org
Sat Jan 14 08:45:36 UTC 2017


Apologies. I put the output of “-l” (not “-L”) here: https://gist.github.com/idontgetoutmuch/654007ac57e863a293b76a0cf98250c1 <https://gist.github.com/idontgetoutmuch/654007ac57e863a293b76a0cf98250c1>

I couldn’t immediately see anything that tells me how @rpath is resolved.

> On 13 Jan 2017, at 17:46, Brandon Allbery <allbery.b at gmail.com> wrote:
> 
> On Fri, Jan 13, 2017 at 12:35 PM, <dominic at steinitz.org <mailto:dominic at steinitz.org>> wrote:
>> 
>> $ otool -L a.out
> 
> I said "-l". "-L" shows how it resolves shared objects; "-l" dumps the load commands table, which includes RPATH entries that tell it how to resolve @rpath.
>> DYLD_FALLBACK_LIBRARY_PATH=/Users/dom/Library/Haskell/ghc-8.0.1/lib/test-via-c-0.1.0.0/bin:/Library/Frameworks/GHC.framework/Versions/8.0.1-x86_64/usr/lib/ghc-8.0.1/rts
>> ~/Dropbox/Private/TestU01-1.2.3/examples/src $ ./a.out
> 
> This is odd, unless Apple changed things yet again (I should not be surprised, the loader stuff is about as stable as water /o\ )
> 
> It’s not clear to me why it’s looking for `gcc/5` which is not installed when it looks as though it should be looking for `gcc/6`.
> 
> That might be indicated by the RPATH entries, since DYLD_FALLBACK_LIBRARY_PATH changes how lookups work (so does DYLD_LIBRARY_PATH, in a different way, which is why it's dangerous).
> 
> -- 
> brandon s allbery kf8nh                               sine nomine associates
> allbery.b at gmail.com <mailto:allbery.b at gmail.com>                                  ballbery at sinenomine.net <mailto:ballbery at sinenomine.net>
> unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net <http://sinenomine.net/>
Dominic Steinitz
dominic at steinitz.org
http://idontgetoutmuch.wordpress.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20170114/55a1b310/attachment.html>


More information about the Haskell-Cafe mailing list