Incorrect dynamic library name in OSX
When building a simple program that is built using -dynamic, the resulting executable fails with the following error:
/Users/ian/zz64/ghc-7.4.1/libffi/build/inst/lib/libffi.5.dylib
Referenced from: /usr/local/lib/ghc-7.4.1/libHSrts-ghc7.4.1.dylib Reason: image not found
[1] 90849 trace trap
The workaround in this case is to execute the following two commands:
otool -id /usr/local/lib/ghc-7.4.1/libffi.dylib /usr/local/lib/ghc-7.4.1/libffi.dylib
install_name_tool /usr/local/lib/ghc-7.4.1/libHSrts-ghc7.4.1.dylib -change /Users/ian/zz64/ghc-7.4.1/libffi/build/inst/lib/libffi.5.dylib /usr/local/lib/ghc-7.4.1/libffi.dylib
which is to say that the library at /usr/local/lib/ghc-7.4.1/libffi.dylib is identified as being /Users/ian/zz64/ghc-7.4.1/libffi/build/inst/lib/libffi.5.dylib which causes the linker to fail.
Trac metadata
| Trac field | Value |
|---|---|
| Version | 7.4.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | libraries/base |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture |