39

I'm trying to determine if building and using libcxxabi from the llvm project under linux makes sense.

My build of libcxxabi is linked to

ldd libc++abi.so.1.0 
    linux-vdso.so.1 =>  (0x00007fff2e0db000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fd658f0d000)
    librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fd658d05000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd65893c000)
    libc++.so.1 => /path/where/clang/is // edited
    /lib64/ld-linux-x86-64.so.2 (0x00007fd6593ab000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fd658465000)

and so it's using the gcc_s library, the GNU librt, and the only real difference is the fact that it's using libc++ over libstdc++, but how good this really is ?

Given the critical role of an abi library, I should go for libcxxabi under such platform ?

My problem it's not about how to build this, or if this will work, but if this is a good idea C++-wise, what kind of benefits I can possibly get, or what kind of benefits you are getting if you are already using this.

nicko
  • 460
  • 3
  • 11
user2485710
  • 9,451
  • 13
  • 58
  • 102
  • 1
    I find it very weird that your libcxxabi is linking against libc++. It should be the other way around. As for your question. There's really no reason to use libcxxabi on a Linux system that still relies on libsupc++ (statically linked into libstdc++). It's useful if you wanted to make a non-gnu linux system though. – Michael Spencer Jun 01 '14 at 12:46
  • 1
    Perhaps one should do some performance comparisons with other standard c++ libraries implementations ? Also, up to GCC 5.1, libstdc++ wasn't conformant with C++11. Now the two implementations coexist in the shared object, but under a different namespace. – Jean-Michaël Celerier Jun 23 '15 at 13:40
  • Don't use libcxxabi. It's for libcxx (libc++) and only known to work on macOS. Homebrew's formula for llvm doesn't even use it because it adds an rpath and homebrew maintainers are mostly glorified web developers, so they just removed what they didn't understand. –  Jan 01 '19 at 02:11

1 Answers1

3

You should not use libcxxabi directly. To my understanding it is a kind of platform abstraction library, providing low level functions needed to implement libcxx.

If you are asking about using libcxx or libstdc++, the differences are mostly the license, newer standard version completeness (the clang project seems slightly faster in implementing recent C++ revisions) and the fact that you have two alternative implementations.

There seems no pressing reason for one of those above the other. I would stick to the one that is better supported on your system. Both projects aim at being ABI compatible, so it should be possible to use either without any breakage.

Jan Henke
  • 875
  • 1
  • 15
  • 28