Compiling with Clang using Libc++ undefined references
I believe libc++ doesn’t support all exception functions yet. See the status page: http://libcxxabi.llvm.org/spec.html You could probably link against gnu’s libstdc++
I believe libc++ doesn’t support all exception functions yet. See the status page: http://libcxxabi.llvm.org/spec.html You could probably link against gnu’s libstdc++
Because when I wrote that code, the compiler (clang) had not yet implemented C++11 atomics. And I never got back to it to clean it up. Nothing subtle here. 🙂
It is a bug in libc++ that cannot be immediately fixed because it would break ABI. Apparently, it is a conforming implementation, although obviously it is often suboptimal. It’s not clear exactly why the Clang devs made such an implementation choice in the first place (although maybe if you’re really lucky, someone from Clang will … Read more
You should check if your distribution is using the vanilla GLIBC or the EGLIBC fork (Debian and Ubuntu have switched to EGLIBC EDIT: they switched back around 2014). Anyway, the repository browser for GLIBC is at http://sourceware.org/git/?p=glibc.git http://code.woboq.org/userspace/glibc/, posted by @guruz below, is a good alternative. The source is a bit complicated by the presence … Read more
[I’m the current maintainer of the Native SxS technology at Microsoft] New versions of MSVCRT are released with new versions of Visual Studio, and reflect changes to the C++ toolset. So that programs compiled with versions of VS released after a particular version of Windows continue can work downlevel (such as VS 2008 projects on … Read more
You can use the wrap feature provided by ld. From man ld: –wrap symbol Use a wrapper function for symbol. Any undefined reference to symbol will be resolved to __wrap_symbol. Any undefined reference to __real_symbol will be resolved to symbol. So you just have to use the prefix __wrap_ for your wrapper function and __real_ … Read more
[extern.names] 3 Each name from the C standard library declared with external linkage is reserved to the implementation for use as a name with extern “C” linkage, both in namespace std and in the global namespace. Note that this paragraph reserves the name itself. So aliasing time in the global namespace violates this contract.
How to build libc++ on Ubuntu 16.04 I had a similar issue as you do. While testing clang with libstdc++ worked fine with C++11 and C++14 there still might be licensing issues with libstdc++. So I ended up installing Clang toolchain from their repos and compiling libc++ on Ubuntu 16.04. Disclaimer: This post is summary … Read more
You should not use libcxxabi directly. To my understanding it is a kind of platform abstraction library, providing low level functions needed to implement libcxx. If you are asking about using libcxx or libstdc++, the differences are mostly the license, newer standard version completeness (the clang project seems slightly faster in implementing recent C++ revisions) … Read more
No you shouldn’t. Standard 7.20.4.5 says : The getenv function returns a pointer to a string associated with the matched list member. The string pointed to shall not be modified by the program, but may be overwritten by a subsequent call to the getenv function. I believe deletion is covered by the text in bold.