Why no Debian package for libc++?

Dear List

I have downloaded the latest Debian packages for Clang/LLVM, for which I am very
grateful. It has certainly provided the necessary C++11 tools I need for my
learning of C++11.

However, I notice that libc++ is missing from those Debian packages. Is it possible
to create a Debian package for the LLVM version of libc++?

I should like to bring to your attention a small matter concerned with libc++.
I downloaded the source a few days ago and executed the ‘buildit’ script in the
libcxx/lib directory. This successfully produced libc++.so.1.0 which I put into
/usr/local/lib (plus links).

Yesterday, I did the same thing again because I wanted the latest version. The
buildit script produced a library which I again moved to /usr/local/lib. When I
used clang++ to use that library, I received a whole lot of error messages which
I have uploaded to my web-site . Could somebody look at those errors to see what has happened to libc++? My system is Debian wheezy 7.1 amd64 with kernel 3.2.0-4-amd64 SMP. My locale is eo.UTF-8. Sincerely

This is something that the Debian LLVM/Clang team would handle directly. I completely agree with your request and seeing as Debian is proving Debian FreeBSD it makes sense for them to have this available for both Debian Linux and Debian based FreeBSD.

I've cc'd the Debian Packaging Team on it.

- Marc

The errors are probably caused by the fact that you need ( and you are not
providing it to the linker ) libcxxabi [http://libcxxabi.llvm.org/](http://libcxxabi.llvm.org/) .

In general terms I personally consider both libcxx and libcxxabi under
Linux pretty useless right now.

The main issues are:
 - libcxx and libcxxabi are simply not ready yet for Linux, they are just
incomplete and without a real support from the llvm project
 - in the end libcxx and libcxxabi will use libsupc++ and stdlibc++ anyway,
so there is no point in using them, you are just introducing a new
dependence for nothing

I personally have little to no faith in libcxx taking over libstdc++ under
Linux in the immediate future.

2013/7/26 Sian Mountbatten <poenikatu@fastmail.co.uk>

Hello,

libc++ has been in Debian for the past year [1]
It is not part of the wheezy stable release but should be part of Jessie.

Sylvestre
http://packages.qa.debian.org/libc/libc++.html

I've built libc++ against libc++abi on Ubuntu 13.04, and yes, you do
need to specify -lc++ -lc++abi

ben@localhost:/usr/lib$ ldd libc++.so
  linux-vdso.so.1
  libc++abi.so.1
  libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
  libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6
  libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6
  librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1
  libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1
  /lib64/ld-linux-x86-64.so.2
ben@localhost:/usr/lib$ ldd libc++abi.so
  linux-vdso.so.1
  libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
  librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1
  libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6
  libc++.so.1 => /usr/lib/libc++.so.1
  /lib64/ld-linux-x86-64.so.2
  libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6
  libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1

libsupc++ is not required if libc++abi is used, and of course, libstdc++
is also not required.

In this configuration, with Clang 3.3, the llvm nightly test suite
passes. (Ok, there is one failure, but it's the same as with libstdc++)

Ben

Those are dynamically linked libraries, for what you know you could have libsupc++ statically linked to your libc++/abi or to at least of those libraries.

I’m not aware of any linux distribution or libc++ build under linux that is just using libc++ without libstdc++ or libsupc++, for what I know, at this point in time, libc++, at least under linux, is using libstdc++ and libsupc++ to provide a complete C++ support and filling the blanks that are still not supported by the library.

I think that libc++ will reach the indendpence from the GNU libs if and only if it will provide a complete C++ environment.

2013/7/29 Ben Pope <benpope81@gmail.com>

Those are dynamically linked libraries, for what you know you could have
libsupc++ statically linked to your libc++/abi or to at least of those
libraries.

Its a fair point, but...

I'm not aware of any linux distribution or libc++ build under linux that
is just using libc++ without libstdc++ or libsupc++, for what I know, at
this point in time, libc++, at least under linux, is using libstdc++ and
libsupc++ to provide a complete C++ support and filling the blanks that
are still not supported by the library.

FreeBSD 10 has switched to libc++ and libcxxrt and is working towards a
C++ toolchain that is free of GPLv2, according to the docs, it doesn't
rely upon libsupc++:

https://wiki.freebsd.org/NewC%2B%2BStack

I think that libc++ will reach the indendpence from the GNU libs if and
only if it will provide a complete C++ environment.

As far as I know it pretty much does, aside from using libgcc_s which
may be replaceable by libunwind. In order to link against other
libraries on the system, some of these bits are required anyway, it's a
convenience thing.

I don't think there is very much stopping a linux distribution switching
entirely to libc++ with libcxxrt and libunwind, dropping GCC entirely.
Of course, it would be a massive pain for the users when they have to
build everything from source as practically no binary in existence today
will work on their system.

Ben

Well FreeBSD is not Linux, also llvm is a project mainly focused on Mac OS, and MAC OS is part of the BSD world, no surprise that if something is supported under MAC OS, it’s probably portable under any other BSD OS.

The main reason why I’m not sharing your view is simple: if this is true I can’t explain why the llvm project keeps considering libc++ and libc++abi as “experimental” under linux. I mean if you can even build the kernel and libc++ really is libstdc+±free and libsupc+±free what else do you need to mark it as a reliable library ?

2013/7/29 Ben Pope <benpope81@gmail.com>

Well FreeBSD is not Linux

My point was that they have a toolchain that is free of libstdc++ and
libsupc++.

also llvm is a project mainly focused on Mac
OS, and MAC OS is part of the BSD world, no surprise that if something
is supported under MAC OS, it's probably portable under any other BSD OS.

The main reason why I'm not sharing your view is simple: if this is true
I can't explain why the llvm project keeps considering libc++ and
libc++abi as "experimental" under linux. I mean if you can even build
the kernel and libc++ really is libstdc++-free and libsupc++-free what
else do you need to mark it as a reliable library ?

I think somebody to actually do it and test it would probably be a bare
minimum. Not all code that compiles is bug free.

Linux thrives on GPL, the desire to push Clang and LLVM is therefore
much lower than FreeBSD where they have been sat on an ageing toolchain
due to licensing issues.

What I'm saying is that I can currently build software on Linux with
Clang and libc++ and libc++abi, and it appears to work. I'm not
pretending that it is entirely GPLv2 free, or that some of my
dependencies don't also rely on GPLv2 code from GCC, but the bits that I
have written and the C++ code that I depend on and compile myself are
using libc++ and libc++abi.

Ben

Someone on this list told me that on Debian jessie (testing), there is an implementation of libc++ and libc++abi. I have, accordingly, upgraded my system from wheezy to jessie and install those two libraries. That means that apart from the GNU libc6 library, I am not using GNU software for software development. I have to say that I have linked against libc++ without the need for specifying libc++abi. Using the command ‘ldd target’ shows that it does not use libc++abi. Sincerely