在Linux上为clang构建libc ++是什么? [英] What is the sanctioned way to build libc++ for clang on Linux?

查看:272
本文介绍了在Linux上为clang构建libc ++是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编辑/更新/注意:只要让clang使用libstdc ++。到目前为止,我的工作效果非常好。



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



在过去,我已经能够通过使用 cmake 刚刚我在 http:// llvm的 lib 目录中发现了 buildit .org / svn / llvm-project / libcxx / trunk 项目树。



这个 buildit 脚本似乎没有使用 libsupc ++ 这是我以前使用的 cmake 方法。例如,此指南显示一个 cmake incantation为 libc ++ 生成一个makefile,这将能够负责编译和安装。



我的问题是,这些不同的方式产生LLVM之间的区别 - libc ++ 用过的?他们的行为会有不同吗?



buildit 脚本似乎不提供任何安装帮助。在任何地方有如何正确安装图书馆的方向吗?在我以前的libc ++构建与cmake,我不得不总是添加 -lc ++ 链接器标志(和路径与 -L .llvm.org /rel =nofollow> libc ++网站对构建libc ++的可能方法有很好的概述。



我建议使用CMake + libc ++ abi



另请参阅 Arch Linux用户存储库构建脚本,它使用 buildit 脚本。我安装了libc ++并成功使用它与Arch Linux Clang包使用

  clang ++ -std = c ++ 11  - stdlib = libc ++ -lc ++ abi 


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.

解决方案

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

这篇关于在Linux上为clang构建libc ++是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆