[MacPorts] #24238: yajl-1.0.6: Dynamically linking programs with -lyajl and running causes Trace/BPT trap
MacPorts
noreply at macports.org
Fri Mar 26 20:26:22 PDT 2010
#24238: yajl-1.0.6: Dynamically linking programs with -lyajl and running causes
Trace/BPT trap
-----------------------------------+----------------------------------------
Reporter: endgame.dos@… | Owner: macports-tickets@…
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 1.8.2
Keywords: | Port: yajl
-----------------------------------+----------------------------------------
OS: OSX 10.6 on Intel.
After installing yajl, I find that I cannot dynamically link programs
against libyajl.dylib. Minimal example:
{{{
#include <stdlib.h>
int main(int argc, char *argv[]) {
exit(EXIT_SUCCESS);
}
}}}
Running "gcc -o test test.c -L/opt/local/lib -lyajl" and "./test" fails
with:
{{{
$ ./test
dyld: Library not loaded: libyajl.1.dylib
Referenced from: /Users/endgame/code/mudflat/./test
Reason: image not found
Trace/BPT trap
}}}
otool -L test:
{{{
$ otool -L ./test
./test:
libyajl.1.dylib (compatibility version 1.0.0, current version
1.0.6)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
version 123.0.0)
}}}
The lack of an absolute path on libyajl1.dylib looks problematic.
I was able to fix this by adding a call to install_name_tool in the
portfile. I don't if that's the best way to fix it or if you want to push
on upstream, but I'll attach a patch to the portfile anyhow.
--
Ticket URL: <http://trac.macports.org/ticket/24238>
MacPorts <http://www.macports.org/>
Ports system for Mac OS
More information about the macports-tickets
mailing list