libc++

What is the difference between libc++ and libc++abi library in LLVM?

丶灬走出姿态 提交于 2019-12-12 07:32:59
问题 I saw the two projects are quite related, but what are the differences between them? The official webpage doesn't tell much about it. I know that ABI (Application Binary Interface) is used to provide low-level binary interface among different platforms. So is libc++abi used to provide different implementations for different platforms, and general interface for libc++? Would be better go give some specific example, e.g. what are included in libc++abi and what in libc++. Thanks. 回答1: The

How to fix clang libc++ error on Mac: calling private constructor

青春壹個敷衍的年華 提交于 2019-12-12 04:53:21
问题 I'm trying to compile a (private) C++ software with Clang and libc++ on Mac OS X 10.10 and am getting this error: error: calling a private constructor of class 'std::__1::__wrap_iter<unsigned short *>' Full error message here. Can someone explain this error and how to fix it? A small self-contained code example that results in this error and an option how to re-write it so that it works would be great! 回答1: You're asking for a self-contained example showing the error but haven't provided your

How to use LLVM's libcxx & libcxxabi in cmake project?

别等时光非礼了梦想. 提交于 2019-12-11 17:54:29
问题 Currently I'm running Debian stretch with the system's default compiler GCC 6.3.0. But I have a project using cmake (ceph's master branch) that depends on C++17, which requires non default includes and libraries. So I decided to use Clang/LLVM to build it. I downloaded and installed Clang/LLVM, compiled it and installed it below /usr/local . Now my question is, how to instruct cmake to use the includes from /usr/local/include/c++/v1/ and the libraries from /usr/local/lib ? 来源: https:/

What is __builtin_operator_new and how it works?

断了今生、忘了曾经 提交于 2019-12-11 15:26:47
问题 While going through libc++ code, I see ndk allocators __allocate function is calling __builtin_operator_new , but I could not found its definition in libc++ code. By name it is evident that it is memory allocation function. But who implements it? Is it defined by compiler like clang, gcc? where can I find its definition? 回答1: It's an intrinsic, defined implicitly by the compiler itself (hence why it's called a builtin). It's documented on the language extension section for Clang: __builtin

How to enable cmake to exclude a subdirectory from install?

Deadly 提交于 2019-12-11 13:39:38
问题 I have been trying to build RPM packages for libc++ 3.3 on a RHEL 6.4 box. I need both static and shared libraries. So, I learned some basics of cmake and then modified the bundled CMakeList.txt . Got that part to work. But since in RHEL 6.x, all 64-bit libraries should go to /usr/lib64 instead of /usr/lib , I have been attempting to use the following to get the job done: (A) During building, I use SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib${LIB_SUFFIX}) to have all library files ( *

why __dependent_type from libcxx uses a template non-type parameter bool _Dummy?

旧时模样 提交于 2019-12-11 05:23:10
问题 Here is the definition of __dependent_type: template <class _Tp, bool> struct _LIBCPP_TEMPLATE_VIS __dependent_type : public _Tp {}; All use cases: /usr/.../c++/v1 >>> rg "_dependent_type" memory 2211: __dependent_type<is_default_constructible<_T1>, _Dummy>::value && 2212: __dependent_type<is_default_constructible<_T2>, _Dummy>::value 2402: typename __dependent_type<_DeleterSFINAE, _Dummy>::__lval_ref_type; 2406: typename __dependent_type<_DeleterSFINAE, _Dummy>::__good_rval_ref_type; 2410:

OS X libstdc++ prevents boost::thread from interruptions?

ε祈祈猫儿з 提交于 2019-12-11 04:05:31
问题 Consider the following sample code which creates a thread and interrupts it from the main thread using thread::interrupt call: #include <iostream> #include <boost/thread.hpp> #include <boost/chrono.hpp> #include <boost/ref.hpp> int main() { boost::thread t([]{ int counter = 0; while (1){ std::cout << "interruption enabled " << boost::this_thread::interruption_enabled() << std::endl; try { counter++; if (counter % 5 == 0) throw std::runtime_error("runtime error!"); std::cout << "thread

C++ error: 'inline' can only appear on functions

僤鯓⒐⒋嵵緔 提交于 2019-12-11 04:03:23
问题 I'm trying to compile VCMI under OS X 10.7 using clang++. I configured project with CXX=clang++ because Apple's gcc didn't seem to recognize required -std=c++0x flag. I've added -stdlib=libc++ to CXXFLAGS because without that clang wasn't even able to find #include <array> . Currently i've got: CXXFLAGS= -std=c++0x -stdlib=libc++ -Wall -Wextra -Wcast-align -Wpointer-arith -Wno-switch -Wno-sign-compare -Wno-unused-parameter -Wc++11-extensions The problem is that I get following errors: clang:

When is libc++ sources needed when building Clang from sources?

混江龙づ霸主 提交于 2019-12-11 02:59:22
问题 I've been building Clang for years on Linux and OS X. From the LLVM Download page, I've always used the following sources: LLVM (LLVM source) Compiler Front End (Clang source) Compiler RT (Runtime source) Compiler Tools (Tools Extra sources) The recipe I am using to download, build and install Clang 3.5 can be found at Clang 3.5 download, build and install script. Its works great on OS X 10.7 and 10.8, and I've never needed the libc++ gear on OS X 10.7.x or 10.8.x (that's about 2010 or so

Unknown package libcxx and libcxxabi when building Clang?

给你一囗甜甜゛ 提交于 2019-12-10 16:49:10
问题 I'm trying to build Clang with libc++ from sources. And I'm trying to drop libc++ in-tree while building it out-of-tree with the other components. The recipe I use is below. If I simply place libcxx and libcxxabi in-tree, then configure does not pick them up, and they are not built automatically. I placed them in llvm/projects per LLVM's libc++ Standard Library. Additionally, adding make cxx to the recipe does not work as advertised on the LLVM's libc++ Standard Library page. It results in: