Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the sanctioned way to build libc++ for clang on Linux?

Edit/Update/Note: Just let clang use libstdc++. Has been working really well for me so far.

===============================

In the past I have been able to succeed by doing something with cmake, but just now I discovered a buildit script inside the lib directory of the http://llvm.org/svn/llvm-project/libcxx/trunk project tree.

This buildit script appears to not make use of libsupc++ which is what the cmake approach that I took earlier used. For instance, this guide shows one cmake incantation to produce a makefile for libc++, which will be able to take care of compiling and installation.

My question is what is the difference between these different ways to produce the LLVM-libc++ and which one should be used? Will they behave differently?

The buildit script does not appear to provide any help for installation. Are there directions anywhere for how to properly install the library? With my previous libc++ built with cmake, I had to always add -lc++ to the linker flags (and the path with -L), which is not necessary in my OS X makefiles.

like image 579
Steven Lu Avatar asked Jul 29 '13 06:07

Steven Lu


1 Answers

The libc++ website has a nice overview of the possible ways to build libc++.

I suggest using CMake + libc++abi.

Also see the Arch Linux User Repository build script, which uses the buildit script. I installed libc++ from that and used it with the Arch Linux Clang package succesfully by using

clang++ -std=c++11 -stdlib=libc++ -lc++abi
like image 85
rubenvb Avatar answered Nov 15 '22 12:11

rubenvb