<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>John,</p>
<p>I think Pascal means that you will need to use (cffi:load-library
"path/to/library") in your code, and if you happen to bundle your
dylibs with your .app then you can at least find them there. One
problem that I haven't found a good answer to is if your libs have
explicit path references to other libraries, with otool -L. I
would assume you would need to use a tool to rewrite the library
names so that they are all consistent for your desired deployment
target fs paths and libs. If I am wrong someone please correct
me.</p>
<p>Josh Kordani<br>
</p>
<br>
<div class="moz-cite-prefix">On 9/25/17 7:15 PM, John Mercouris
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:71F58F39-7E23-4892-925C-8821867572AF@gmail.com">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
Hi Pascal,
<div class=""><br class="">
</div>
<div class="">If I don’t use the install_name_tool, and I just
leave the compiled binary without changing the paths to QT or
anything, it all runs fine.</div>
<div class="">The issue is, I need to copy the libraries into my
application bundle to make it easy to distribute for OS X,</div>
<div class=""><br class="">
</div>
<div class="">Can you explain what you mean how I may load the
libraries at run-time? I looked up CFFI and all I came up with
was C Foreign Function Interface, </div>
<div class=""><br class="">
</div>
<div class="">Thanks for your help,</div>
<div class=""><br class="">
</div>
<div class="">-John<br class="">
<div>
<blockquote type="cite" class="">
<div class="">On Sep 25, 2017, at 18:07, Pascal Bourguignon
<<a href="mailto:pjb@informatimago.com" class=""
moz-do-not-send="true">pjb@informatimago.com</a>>
wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode:
space; -webkit-line-break: after-white-space;" class=""><br
class="">
<div class="">
<blockquote type="cite" class="">
<div class="">On 26 Sep 2017, at 00:41, John
Mercouris <<a
href="mailto:jmercouris@gmail.com" class=""
moz-do-not-send="true">jmercouris@gmail.com</a>>
wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div style="word-wrap: break-word;
-webkit-nbsp-mode: space; -webkit-line-break:
after-white-space;" class="">Hi Pascal, I’ve
done exactly as you said and have the following
output:
<div class=""><br class="">
</div>
</div>
<span
id="cid:89D958B2-02FC-434E-9AE0-A7E6E190C2EB"
class=""><output.pdf></span></div>
</blockquote>
<div class=""><br class="">
</div>
<div class="">(format nil "~x"(+ 1025 #xe70)) —>
"1271"</div>
<div class="page" title="Page 3">
<div class="section" style="background-color:
rgb(100.000000%, 100.000000%, 100.000000%)">
<div class="layoutArea">
<div class="column">
<p class="">Since it looks like the functions
around this address are unrelated to file
accesses, then we may suppose that we have
an error due to the modifications made
by install_name_tool to the binary.</p>
<div class=""><br class="">
</div>
<div class="">Try without using this tool.</div>
<div class=""><br class="">
</div>
<div class="">If my hypothesis is correct, you
will have to load the libraries explicitely
at run-time as we’ve always done with cffi…</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
</div>
</div>
</div>
</div>
<blockquote type="cite" class="">
<div class="">
<div style="word-wrap: break-word;
-webkit-nbsp-mode: space; -webkit-line-break:
after-white-space;" class="">
<div class="">Honestly, I’m not sure what to
make of it, it looks very similar to your
output as well,</div>
<div class=""><br class="">
</div>
<div class="">-John<br class="">
<div class="">
<blockquote type="cite" class="">
<div class="">On Sep 25, 2017, at 16:58,
Pascal Bourguignon <<a
href="mailto:pjb@informatimago.com"
class="" moz-do-not-send="true">pjb@informatimago.com</a>>
wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="" style="font-family:
Helvetica; font-size: 12px;
font-style: normal; font-variant-caps:
normal; font-weight: normal;
letter-spacing: normal; text-align:
start; text-indent: 0px;
text-transform: none; white-space:
normal; word-spacing: 0px;
-webkit-text-stroke-width: 0px;">
<div class="" style="letter-spacing:
normal; text-align: start;
text-indent: 0px; text-transform:
none; white-space: normal;
word-spacing: 0px;
-webkit-text-stroke-width: 0px;
word-wrap: break-word;
-webkit-nbsp-mode: space;
-webkit-line-break:
after-white-space;">
<div class="" style="letter-spacing:
normal; text-align: start;
text-indent: 0px; text-transform:
none; white-space: normal;
word-spacing: 0px;
-webkit-text-stroke-width: 0px;
word-wrap: break-word;
-webkit-nbsp-mode: space;
-webkit-line-break:
after-white-space;"><br
class="Apple-interchange-newline">
<br class="">
</div>
</div>
</div>
<br class="" style="font-family:
Helvetica; font-size: 12px;
font-style: normal; font-variant-caps:
normal; font-weight: normal;
letter-spacing: normal; text-align:
start; text-indent: 0px;
text-transform: none; white-space:
normal; word-spacing: 0px;
-webkit-text-stroke-width: 0px;">
<div style="font-family: Helvetica;
font-size: 12px; font-style: normal;
font-variant-caps: normal;
font-weight: normal; letter-spacing:
normal; text-align: start;
text-indent: 0px; text-transform:
none; white-space: normal;
word-spacing: 0px;
-webkit-text-stroke-width: 0px;"
class="">
<blockquote type="cite" class="">
<div class="">On 25 Sep 2017, at
22:47, John Mercouris <<a
href="mailto:jmercouris@gmail.com"
class="" moz-do-not-send="true">jmercouris@gmail.com</a>>
wrote:</div>
<br
class="Apple-interchange-newline">
<div class="">
<div class="" style="word-wrap:
break-word; -webkit-nbsp-mode:
space; -webkit-line-break:
after-white-space;">Hi Pascal,
<div class=""><br class="">
</div>
<div class="">Thank you for your
email,</div>
<div class=""><br class="">
</div>
<div class="">1. You’re correct,
I had to manually copy the
libraries in to the app
bundle, I just did something
like:</div>
<div class=""><br class="">
</div>
<div class=""> > cp
/usr/local/lib/libeql5.1.dylib
./next.app/Contents/Frameworks/</div>
<div class=""><br class="">
</div>
<div class="">2. I saw the
message is within ECL, I found
the exact file with the error
message, it is located in
ecl/src/c/unixint.d</div>
<div class=""><br class="">
</div>
<div class="">I figured my
problem was unrelated to the
libraries, but I wasn’t 100%
sure, just wanted to include
all information,</div>
<div class=""><br class="">
</div>
<div class="">3. I have no idea
how to read assembly, I mean I
can pick through it, but I
won’t be able to really
understand what’s going on,
nor would I know how to even
attach a debugger to the
process, are there any other
ways that I can examine what’s
going on? A source file I can
look at? Should I be looking
for issues within ECL or EQL?</div>
</div>
</div>
</blockquote>
<br class="">
</div>
<div style="font-family: Helvetica;
font-size: 12px; font-style: normal;
font-variant-caps: normal;
font-weight: normal; letter-spacing:
normal; text-align: start;
text-indent: 0px; text-transform:
none; white-space: normal;
word-spacing: 0px;
-webkit-text-stroke-width: 0px;"
class="">You don’t need to understand
the assembly code; you can just watch
the name of the functions around the
indicated location.</div>
<div style="font-family: Helvetica;
font-size: 12px; font-style: normal;
font-variant-caps: normal;
font-weight: normal; letter-spacing:
normal; text-align: start;
text-indent: 0px; text-transform:
none; white-space: normal;
word-spacing: 0px;
-webkit-text-stroke-width: 0px;"
class=""><br class="">
</div>
<div style="font-family: Helvetica;
font-size: 12px; font-style: normal;
font-variant-caps: normal;
font-weight: normal; letter-spacing:
normal; text-align: start;
text-indent: 0px; text-transform:
none; white-space: normal;
word-spacing: 0px;
-webkit-text-stroke-width: 0px;"
class=""><font class="" face="Menlo">In
the case of my version of libecl, I
would find:</font></div>
<div style="font-family: Helvetica;
font-size: 12px; font-style: normal;
font-variant-caps: normal;
font-weight: normal; letter-spacing:
normal; text-align: start;
text-indent: 0px; text-transform:
none; white-space: normal;
word-spacing: 0px;
-webkit-text-stroke-width: 0px;"
class=""><font class="" face="Menlo"><br
class="">
</font></div>
<div style="font-family: Helvetica;
font-size: 12px; font-style: normal;
font-variant-caps: normal;
font-weight: normal; letter-spacing:
normal; text-align: start;
text-indent: 0px; text-transform:
none; white-space: normal;
word-spacing: 0px;
-webkit-text-stroke-width: 0px;"
class="">
<div class=""><font class=""
face="Menlo">[pjb@despina :0.0
documentation]$ otool -t -v -V
/opt/local/lib/libecl.dylib|grep
-A300 -e '^_cl_boot:'</font></div>
<div class=""><font class=""
face="Menlo">_cl_boot:</font></div>
<div class=""><font class=""
face="Menlo">0000000000001d34<span class="Apple-tab-span" style="white-space: pre;"> </span>movl<span class="Apple-tab-span" style="white-space: pre;"> </span>0x22ddce(%rip),
%eax</font></div>
<div class=""><font class=""
face="Menlo">0000000000001d3a<span class="Apple-tab-span" style="white-space: pre;"> </span>testl<span class="Apple-tab-span" style="white-space: pre;"> </span>%eax,
%eax</font></div>
<div class=""><font class=""
face="Menlo"><br class="">
</font></div>
<div class=""><font class=""
face="Menlo">#x</font><span
class="" style="font-family:
Menlo;">1d34 + 1025 = #x2135</span></div>
<div class=""><font class=""
face="Menlo"><br class="">
</font></div>
<div class="">
<div class=""><font class=""
face="Menlo">00000000000020e2<span class="Apple-tab-span" style="white-space: pre;"> </span>callq<span class="Apple-tab-span" style="white-space: pre;"> </span>0x151748
## symbol stub for: _si_getcwd</font></div>
<div class=""><font class=""
face="Menlo">00000000000020e7<span class="Apple-tab-span" style="white-space: pre;"> </span>movq<span class="Apple-tab-span" style="white-space: pre;"> </span>%rax,
0x708(%r13)</font></div>
<div class=""><font class=""
face="Menlo">00000000000020ee<span class="Apple-tab-span" style="white-space: pre;"> </span>movl<span class="Apple-tab-span" style="white-space: pre;"> </span>$0x1003,
%esi</font></div>
<div class=""><font class=""
face="Menlo">00000000000020f3<span class="Apple-tab-span" style="white-space: pre;"> </span>movl<span class="Apple-tab-span" style="white-space: pre;"> </span>$0x1,
%edx</font></div>
<div class=""><font class=""
face="Menlo">00000000000020f8<span class="Apple-tab-span" style="white-space: pre;"> </span>movl<span class="Apple-tab-span" style="white-space: pre;"> </span>$0x1,
%ecx</font></div>
<div class=""><font class=""
face="Menlo">00000000000020fd<span class="Apple-tab-span" style="white-space: pre;"> </span>movl<span class="Apple-tab-span" style="white-space: pre;"> </span>$0x1,
%r8d</font></div>
<div class=""><font class=""
face="Menlo">0000000000002103<span class="Apple-tab-span" style="white-space: pre;"> </span>movl<span class="Apple-tab-span" style="white-space: pre;"> </span>$0x1,
%r9d</font></div>
<div class=""><font class=""
face="Menlo">0000000000002109<span class="Apple-tab-span" style="white-space: pre;"> </span>movq<span class="Apple-tab-span" style="white-space: pre;"> </span>%r14,
%rdi</font></div>
<div class=""><font class=""
face="Menlo">000000000000210c<span class="Apple-tab-span" style="white-space: pre;"> </span>callq<span class="Apple-tab-span" style="white-space: pre;"> </span>0x151814
## symbol stub for:
_si_make_vector</font></div>
<div class=""><font class=""
face="Menlo">0000000000002111<span class="Apple-tab-span" style="white-space: pre;"> </span>movq<span class="Apple-tab-span" style="white-space: pre;"> </span>%rax,
0x250(%r15)</font></div>
<div class=""><font class=""
face="Menlo">0000000000002118<span class="Apple-tab-span" style="white-space: pre;"> </span>movl<span class="Apple-tab-span" style="white-space: pre;"> </span>$0x4,
%esi</font></div>
<div class=""><font class=""
face="Menlo">000000000000211d<span class="Apple-tab-span" style="white-space: pre;"> </span>movl<span class="Apple-tab-span" style="white-space: pre;"> </span>$0x3,
%edx</font></div>
<div class=""><font class=""
face="Menlo">0000000000002122<span class="Apple-tab-span" style="white-space: pre;"> </span>movl<span class="Apple-tab-span" style="white-space: pre;"> </span>$0x1,
%ecx</font></div>
<div class=""><font class=""
face="Menlo">0000000000002127<span class="Apple-tab-span" style="white-space: pre;"> </span>movq<span class="Apple-tab-span" style="white-space: pre;"> </span>%rax,
%rdi</font></div>
<div class=""><font class=""
face="Menlo">000000000000212a<span class="Apple-tab-span" style="white-space: pre;"> </span>callq<span class="Apple-tab-span" style="white-space: pre;"> </span>0x15163a
## symbol stub for:
_si_fill_array_with_elt</font></div>
<div class=""><font class=""
face="Menlo">000000000000212f<span class="Apple-tab-span" style="white-space: pre;"> </span>movq<span class="Apple-tab-span" style="white-space: pre;"> </span>0x250(%r15),
%rax</font></div>
<div class=""><font class=""
face="Menlo">0000000000002136<span class="Apple-tab-span" style="white-space: pre;"> </span>movq<span class="Apple-tab-span" style="white-space: pre;"> </span>0x10(%rax),
%rcx</font></div>
<div class=""><font class=""
face="Menlo">000000000000213a<span class="Apple-tab-span" style="white-space: pre;"> </span>movq<span class="Apple-tab-span" style="white-space: pre;"> </span>%rcx,
0x240(%r15)</font></div>
<div class=""><font class=""
face="Menlo">0000000000002141<span class="Apple-tab-span" style="white-space: pre;"> </span>movq<span class="Apple-tab-span" style="white-space: pre;"> </span>0x20(%rax),
%rax</font></div>
<div class=""><font class=""
face="Menlo">0000000000002145<span class="Apple-tab-span" style="white-space: pre;"> </span>movq<span class="Apple-tab-span" style="white-space: pre;"> </span>%rax,
0x248(%r15)</font></div>
<div class=""><font class=""
face="Menlo">000000000000214c<span class="Apple-tab-span" style="white-space: pre;"> </span>movq<span class="Apple-tab-span" style="white-space: pre;"> </span>0x320(%r15),
%rax</font></div>
<div class=""><font class=""
face="Menlo">0000000000002153<span class="Apple-tab-span" style="white-space: pre;"> </span>movq<span class="Apple-tab-span" style="white-space: pre;"> </span>%rax,
0x134b0(%r13)</font></div>
<div class=""><font class=""
face="Menlo">000000000000215a<span class="Apple-tab-span" style="white-space: pre;"> </span>movq<span class="Apple-tab-span" style="white-space: pre;"> </span>0x22dbef(%rip),
%rdx</font></div>
<div class=""><font class=""
face="Menlo">0000000000002161<span class="Apple-tab-span" style="white-space: pre;"> </span>movq<span class="Apple-tab-span" style="white-space: pre;"> </span>0x22dbf0(%rip),
%rcx</font></div>
<div class=""><font class=""
face="Menlo">0000000000002168<span class="Apple-tab-span" style="white-space: pre;"> </span>leaq<span class="Apple-tab-span" style="white-space: pre;"> </span>0x4980(%r13),
%rdi</font></div>
<div class=""><font class=""
face="Menlo">000000000000216f<span class="Apple-tab-span" style="white-space: pre;"> </span>movl<span class="Apple-tab-span" style="white-space: pre;"> </span>$0x203,
%esi</font></div>
<div class=""><font class=""
face="Menlo">0000000000002174<span class="Apple-tab-span" style="white-space: pre;"> </span>callq<span class="Apple-tab-span" style="white-space: pre;"> </span>0x150026
## symbol stub for:
_cl__make_hash_table</font></div>
<div class=""><font class=""
face="Menlo">0000000000002179<span class="Apple-tab-span" style="white-space: pre;"> </span>movq<span class="Apple-tab-span" style="white-space: pre;"> </span>%rax,
%r15</font></div>
<div class=""><font class=""
face="Menlo">000000000000217c<span class="Apple-tab-span" style="white-space: pre;"> </span>movq<span class="Apple-tab-span" style="white-space: pre;"> </span>%r15,
0x22daad(%rip)</font></div>
<div class=""><font class=""
face="Menlo">0000000000002183<span class="Apple-tab-span" style="white-space: pre;"> </span>leaq<span class="Apple-tab-span" style="white-space: pre;"> </span>_char_names(%rip),
%rbx</font></div>
</div>
<div class=""><br class="">
</div>
</div>
<span style="font-family: Helvetica;
font-size: 12px; font-style: normal;
font-variant-caps: normal;
font-weight: normal; letter-spacing:
normal; text-align: start;
text-indent: 0px; text-transform:
none; white-space: normal;
word-spacing: 0px;
-webkit-text-stroke-width: 0px; float:
none; display: inline !important;"
class="">we can see that calls to
SI:GETCWD, SI:MAKE-VECTOR and
SI-FILL-ARRAY-WITH-ELT are made just
before that address, and a call to
CL:MAKE-HASH-TABLE will be called just
after.</span>
<div class="" style="font-family:
Helvetica; font-size: 12px;
font-style: normal; font-variant-caps:
normal; font-weight: normal;
letter-spacing: normal; text-align:
start; text-indent: 0px;
text-transform: none; white-space:
normal; word-spacing: 0px;
-webkit-text-stroke-width: 0px;"><br
class="">
</div>
<div class="" style="font-family:
Helvetica; font-size: 12px;
font-style: normal; font-variant-caps:
normal; font-weight: normal;
letter-spacing: normal; text-align:
start; text-indent: 0px;
text-transform: none; white-space:
normal; word-spacing: 0px;
-webkit-text-stroke-width: 0px;">So if
I had the error at the same
cl_boot+1025 offset, I would infer
there’s some problem with the
allocation of a vector.</div>
<div class="" style="font-family:
Helvetica; font-size: 12px;
font-style: normal; font-variant-caps:
normal; font-weight: normal;
letter-spacing: normal; text-align:
start; text-indent: 0px;
text-transform: none; white-space:
normal; word-spacing: 0px;
-webkit-text-stroke-width: 0px;">(But
this is not consistent with your file
not found error, so check your own
copy of the library, you may find
other functions around the
cl_boot+1025 address).</div>
<div class="" style="font-family:
Helvetica; font-size: 12px;
font-style: normal; font-variant-caps:
normal; font-weight: normal;
letter-spacing: normal; text-align:
start; text-indent: 0px;
text-transform: none; white-space:
normal; word-spacing: 0px;
-webkit-text-stroke-width: 0px;"><br
class="">
</div>
<div class="" style="font-family:
Helvetica; font-size: 12px;
font-style: normal; font-variant-caps:
normal; font-weight: normal;
letter-spacing: normal; text-align:
start; text-indent: 0px;
text-transform: none; white-space:
normal; word-spacing: 0px;
-webkit-text-stroke-width: 0px;"><br
class="">
</div>
<div class="" style="font-family:
Helvetica; font-size: 12px;
font-style: normal; font-variant-caps:
normal; font-weight: normal;
letter-spacing: normal; text-align:
start; text-indent: 0px;
text-transform: none; white-space:
normal; word-spacing: 0px;
-webkit-text-stroke-width: 0px;">-- <br
class="">
__Pascal J. Bourguignon__</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</blockquote>
<br>
</body>
</html>