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

喜欢而已 提交于 2019-12-09 10:32:26

问题


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.


回答1:


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


来源:https://stackoverflow.com/questions/17917731/what-is-the-sanctioned-way-to-build-libc-for-clang-on-linux

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!