[cfe-dev] libc++ linking problem

Jean-Daniel Dupas devlists at shadowlab.org
Tue Feb 22 05:39:34 PST 2011


Le 22 févr. 2011 à 14:13, Christopher Jefferson a écrit :

> Recently I have found programs built with libc++ have stopped working recently, producing the message:
> 
> ~/temp$ ./a.out 
> dyld: Library not loaded: /usr/lib/libc++.1.dylib
> Referenced from: /Users/caj/temp/./a.out
> Reason: image not found
> Trace/BPT trap
> 
> Looking at otool I see:
> 
> Load command 10
>         cmd LC_LOAD_DYLIB
>     cmdsize 48
>        name /usr/lib/libc++.1.dylib (offset 24)
>  time stamp 2 Thu Jan  1 01:00:02 1970
>     current version 1.0.0
> 
> Note the ".1" in the dylib name. This is not mentioned on the instructions on the libc++ homepage. If I use an older build of both clang and libc++, on another computer (sorry for the number of changed variables) I get:
> 
> Load command 10
>         cmd LC_LOAD_DYLIB
>     cmdsize 48
>        name /usr/lib/libc++.dylib (offset 24)
>  time stamp 2 Thu Jan  1 01:00:02 1970
>     current version 1.0.0
> compatibility version 1.0.0
> 
> With no ".1". Is this an intentional change, or might my computer be confused? If it is an intentional change, the instructions on the libc++ homepage should be changed.


To be able to deploy many versions of the same library, the library install name must contain the version. That what all libraries in /usr/lib do.
The fact that libc++ didn't include the version was IMHO an error, and so the fix make it consistent with all other libraries.

I attached a patch to fix the doc.
I choose to create a relative symlink for the libc++.dylib to be consistent with all other symlinks in /usr/lib, but if you prefer to make it points to the compiled library directly, it can be changed.


-- Jean-Daniel



-------------- next part --------------
A non-text attachment was scrubbed...
Name: install.patch
Type: application/octet-stream
Size: 592 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110222/00b60e91/attachment.obj>


More information about the cfe-dev mailing list