[cfe-dev] libcxx install location?

Jean-Daniel Dupas devlists at shadowlab.org
Sat Feb 5 05:52:06 PST 2011


Le 5 févr. 2011 à 14:26, Larry Evans a écrit :

> On 02/05/11 05:56, Larry Evans wrote:
>> On 02/05/11 05:39, Jean-Daniel Dupas wrote:
>>> 
>>> Le 5 févr. 2011 à 11:51, Larry Evans a écrit :
>> [snip]
>>>> Also, that libcxx page makes no mention of:
>>>> http://llvm.org/svn/llvm-project/cfe/trunk/runtime/libcxx/Makefile
>>>> However, seeing:
>>>> LIBCXX_SRC_ROOT := $(LLVM_SRC_ROOT)/projects/libcxx
>>>> CPP.Flags := -nostdinc++ -I$(LIBCXX_SRC_ROOT)/include
>> [snip]
>>> 
>>> Did you had a look at this thread:
>>> 
>>> http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-January/013017.html
>>> 
>>> 
>> Yes, but I'd rather not mess with /usr/lib or /usr/include if it
>> can be avoided, and the mentioned trunk/runtime/libcxx/Makefile
>> suggested maybe there's another way which avoids messing with /usr.
>> 
>> -Larry
> I went ahead and did as:
> 
>  http://libcxx.llvm.org/http://libcxx.llvm.org/http://libcxx.llvm.org/
> 
> and added symlinks from /usr/lib and /usr/include/c++.  It compiled OK;
> however, the link failed with:
> 
> make compile
> ls -ld /usr/lib/libc++*
> lrwxrwxrwx 1 root root 69 Feb  5 07:09 /usr/lib/libc++.so ->
> /home/evansl/download/llvm/svn/llvm/projects/libcxx/lib/libc++.so.1.0
> ls -ld /usr/include/c++/v1
> lrwxrwxrwx 1 root root 59 Feb  5 07:14 /usr/include/c++/v1 ->
> /home/evansl/download/llvm/svn/llvm/projects/libcxx/include
> /home/evansl/download/llvm/svn/build/Debug+Asserts/bin/clang++
> -stdlib=libc++ move.cpp -o move.exe
> /usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib64/libc++.so:
> undefined reference to `__cxa_free_exception'
> /usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib64/libc++.so:
> undefined reference to `__cxa_begin_catch'
> /usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib64/libc++.so:
> undefined reference to `__cxa_guard_release'
> ...
> 
> I didn't link to path-to-libcxx/lib/libc++.1.dylib
> because there was no such file.  Instead, I figured
> that was a MacOS convention for shared libs; so,
> I substituted the only likely file in the target
> directory:
> 
>  libc++.so.1.0
> 
> Now I did *not* do the download and install of:
> 
>  http://home.roadrunner.com/~hinnant/libcppabi.zip
> 
> because the webpage:
> 
>  http://libcxx.llvm.org/
> 
> said:
> 
>  To build on Mac OS X 10.6, you need a helper library and header found
>  here. cp cxxabi.h to /usr/include, and cp libc++abi.dylib to
>  /usr/lib.
> 
> and I'm on ubuntu, not Mac OS X.
> 
> Am I missing something?

I don't have access to my linux machine right now, so I cannot test, but I think you can link on libstdc++ to get the missing symbols (just adding -lstdc++ to the linker flags should be enough).

It should not conflict with libc++ symbols as libc++ uses inline namespace, and so mangle the standard symbols differently than the libstdc++.

This is what we use to do on OS X before we got a separate libc++abi library.

-- Jean-Daniel








More information about the cfe-dev mailing list