[cfe-dev] Trying to build libcxx/libcxxabi on Linux 64 bit

Csaba Raduly rcsaba at gmail.com
Thu Jun 27 05:35:25 PDT 2013


Hi all,
I'm trying to compile libc++ and I'm running into some of the problems as below:

On Sun, Jun 23, 2013 at 2:07 PM, Shriramana Sharma  wrote:
> I have checked-out the libcxx and libcxxabi SVN. From
> http://libcxx.llvm.org/ I read the following instructions:
>
> """Build on Linux using CMake and libc++abi.
> You will need to keep the source tree of libc++abi available on your
> build machine and your copy of the libc++abi shared library must be
> placed where your linker will find it."""

So I have to build libc++abi for libc++

> So I go to the libcxxabi directory. There is no README.txt or
> INSTALL.txt file to tell me how to build the "copy of the libc++abi
> shared library", but I see a script buildit under <tree-root>/lib.
> However upon executing it I get the following errors:
>
> $ ./buildit
> + clang++ -c -g -O3 -fPIC -std=c++11 -stdlib=libc++ -fstrict-aliasing
> -Wstrict-aliasing=2 -Wsign-conversion -Wshadow -Wconversion
> -Wunused-variable -Wmissing-field-initializers -Wchar-subscripts
> -Wmismatched-tags -Wmissing-braces -Wshorten-64-to-32 -Wsign-compare
> -Wstrict-aliasing=2 -Wstrict-overflow=4 -Wunused-parameter
> -Wnewline-eof -I../include ../src/abort_message.cpp
> + clang++ -c -g -O3 -fPIC -std=c++11 -stdlib=libc++ -fstrict-aliasing
> -Wstrict-aliasing=2 -Wsign-conversion -Wshadow -Wconversion
> -Wunused-variable -Wmissing-field-initializers -Wchar-subscripts
> -Wmismatched-tags -Wmissing-braces -Wshorten-64-to-32 -Wsign-compare
> -Wstrict-aliasing=2 -Wstrict-overflow=4 -Wunused-parameter
> -Wnewline-eof -I../include ../src/cxa_aux_runtime.cpp
> ../src/cxa_aux_runtime.cpp:14:10: fatal error: 'typeinfo' file not found
> #include <typeinfo>
>          ^
> 1 error generated.

This can be fixed by editing the "buildit" script and adding
-I../../libcxx/include

However, the build fails at linking:

clang++ abort_message.o cxa_aux_runtime.o cxa_default_handlers.o
cxa_demangle.o cxa_exception.o cxa_exception_storage.o cxa_guard.o
cxa_handlers.o cxa_new_delete.o cxa_personality.o cxa_unexpected.o
cxa_vector.o cxa_virtual.o exception.o private_typeinfo.o stdexcept.o
typeinfo.o -fPIC -o libc++abi.so.1.0 -shared -nodefaultlibs
-Wl,-soname,libc++abi.so.1 -lpthread -lrt -lc -lstdc++ -std=c++11
-stdlib=libc++ -fstrict-aliasing -Wstrict-aliasing=2 -Wsign-conversion
-Wshadow -Wconversion -Wunused-variable -Wmissing-field-initializers
-Wchar-subscripts -Wmismatched-tags -Wmissing-braces
-Wshorten-64-to-32 -Wsign-compare -Wstrict-aliasing=2
-Wstrict-overflow=4 -Wunused-parameter -Wnewline-eof
/usr/bin/ld: error: cannot find -lc++

There seems to be a circular dependency: libc++abi depends on libc++,
but I'm trying to build libc++abi for use by libc++ :(

Or do I have to build libsupc++ so I can build libc++ so I can build
libc++abi so I can build libc++ ?

Csaba
-- 
GCS a+ e++ d- C++ ULS$ L+$ !E- W++ P+++$ w++$ tv+ b++ DI D++ 5++
The Tao of math: The numbers you can count are not the real numbers.
Life is complex, with real and imaginary parts.
"Ok, it boots. Which means it must be bug-free and perfect. " -- Linus Torvalds
"People disagree with me. I just ignore them." -- Linus Torvalds



More information about the cfe-dev mailing list