[cfe-dev] [LLVMdev] [libcxx] Linking against just-built libcxxabi

Eric Fiselier eric at efcs.ca
Tue Feb 3 19:46:01 PST 2015


Hi,

I'm seeing the exact same thing you are. The problem has to do with
how CMake links libc++. After *trying* to build against a just-built
libc++abi I ran otool -L over libc++.dylib and the output was as
followed:

> ../build-libcxx/lib/libc++.dylib:
> @rpath/libc++.1.dylib (compatibility version 1.0.0, current version 1.0.0)
> /usr/lib/libc++abi.dylib (compatibility version 1.0.0, current version 49.1.0)
> @rpath/libc++abi.1.dylib (compatibility version 1.0.0, current version 1.0.0)
> /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)

So two different versions of libc++abi were linked into libc++.

I'll commit a fix for this in the coming days but until then you can
use the patch attached. That seemed to fix it for me.
Be very careful with what you do with your custom build libc++ and
libc++abi. Installing these in the wrong place can prevent your system
from booting.

/Eric

On Tue, Feb 3, 2015 at 7:01 PM, Dan Albert <danalbert at google.com> wrote:
> -llvmdev, +cfe-dev
>
> On Tue, Feb 3, 2015 at 2:55 PM, Greg Fitzgerald <garious at gmail.com> wrote:
>>
>> On OS X 10.9.5, I can only get all libcxx tests to pass if I link
>> against the system libcxxabi.  If instead, I link against the
>> just-built libcxxabi (using Apple LLVM version 6.0 based on LLVM 3.5),
>> I see the following test failures:
>>
>> Failing Tests (9):
>>     libc++ ::
>> std/language.support/support.dynamic/new.delete/new.delete.array/new_array.pass.cpp
>>     libc++ ::
>> std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow.pass.cpp
>>     libc++ ::
>> std/language.support/support.dynamic/new.delete/new.delete.single/new.pass.cpp
>>     libc++ ::
>> std/language.support/support.dynamic/new.delete/new.delete.single/new_nothrow.pass.cpp
>>     libc++ ::
>> std/language.support/support.exception/except.nested/rethrow_nested.pass.cpp
>>     libc++ ::
>> std/localization/locales/locale.global.templates/use_facet.pass.cpp
>>     libc++ ::
>> std/localization/locales/locale/locale.cons/char_pointer.pass.cpp
>>     libc++ :: std/strings/basic.string/string.capacity/max_size.pass.cpp
>>     libc++ ::
>> std/thread/thread.threads/thread.thread.class/thread.thread.destr/dtor.pass.cpp
>>
>> Error messages include:
>>
>> libc++abi.dylib: terminating
>> libc++abi.dylib: terminating with uncaught exception of type
>> std::bad_cast: std::bad_cast
>> libc++abi.dylib: terminating with uncaught exception of type
>> std::runtime_error: locale constructed with null
>> libc++abi.dylib: terminating with uncaught exception of type
>> std::bad_alloc
>> Assertion failed: (false), function main, file
>>
>> std/language.support/support.dynamic/new.delete/new.delete.array/new_array.pass.cpp,
>> line 50.
>> Assertion failed: (new_handler_called == 1), function main, file
>>
>> std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow.pass.cpp,
>> line 42.
>>
>>
>>
>> To link against the just-built library, I'm adding the following CMake
>> define:
>>
>>     -DLIBCXX_CXX_ABI_LIBRARY_PATH=../libcxxabi_install/lib
>>
>> Am I building libcxxabi correctly?  All tests in its own test suite
>> pass.  Or perhaps is libcxxabi only supported for certain OS X
>> versions?
>>
>> Thanks,
>> Greg
>> _______________________________________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: link.patch
Type: application/octet-stream
Size: 1661 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150203/59a7be3f/attachment.obj>


More information about the cfe-dev mailing list