Issues with building libcxxabi (and libcxx) on Linux

I’m trying to create a non-gcc toolchain (i.e., no libstdc++ or gcc involved). I began here: http://clang.llvm.org/get_started.html

I successfully built Clang with these steps. Next up is libcxx, so I went here: http://libcxx.llvm.org

It seems that if I want to build a non-gcc toolchain, I should follow the directions listed here:

“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.”

OK, so I went to the libcxxabi page here: http://libcxxabi.llvm.org

I see no instructions how to build libcxxabi… There does seem to be a “buildit” inside of libcxxabi/lib, but what envvars / parameters should I feed it? For example, do I need to set the triple?

Again, I have already built Clang 3.5 successfully using GCC, so I’m wondering also if I need to build libcxxabi and/or libcxx using Clang or GCC?

My platform:
uname -a
Linux ubuntu 3.5.0-17-generic #28-Ubuntu SMP Tue Oct 9 19:31:23 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

Thanks!

I’m trying to create a non-gcc toolchain (i.e., no libstdc++ or gcc involved). I began here: http://clang.llvm.org/get_started.html

I successfully built Clang with these steps. Next up is libcxx, so I went here: http://libcxx.llvm.org

It seems that if I want to build a non-gcc toolchain, I should follow the directions listed here:

“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.”

OK, so I went to the libcxxabi page here: http://libcxxabi.llvm.org

I see no instructions how to build libcxxabi… There does seem to be a “buildit” inside of libcxxabi/lib, but what envvars / parameters should I feed it? For example, do I need to set the triple?

Use libcxxrt. While libc++abi is theoretically possible, it’s really aimed at MacOS which has a separate libunwind, which means you would need to find and build a libunwind for Linux too.

libcxxrt is easier. Also, I recently submitted a patch that should make usage of the resulting libc++ easier. You might want to grab it (mail thread is called “Fixing common linking issues in Linux” or something like that) and apply it to your libc++ tree.

Again, I have already built Clang 3.5 successfully using GCC, so I’m wondering also if I need to build libcxxabi and/or libcxx using Clang or GCC?

You should build these things with Clang. In theory it shouldn’t matter, but I recommend Clang, because you will link them with your Clang-built actual code.

Sebastian