The name and documentation both suggest it contains essential runtime functions for use by generated code. However, it's offered as an extra optional download, and when I omit it, the entire cycle of compiling a program with clang and running the resulting executable still seems to work fine. What am I missing? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150902/96b5d441/attachment.html>
On 2 Sep 2015, at 10:55, Russell Wallace via llvm-dev <llvm-dev at lists.llvm.org> wrote:> > The name and documentation both suggest it contains essential runtime functions for use by generated code. However, it's offered as an extra optional download, and when I omit it, the entire cycle of compiling a program with clang and running the resulting executable still seems to work fine. What am I missing?You most likely have something equivalent (e.g. libgcc) installed already. David
I'm probably not 100% right here, but here's how I'd explain it: It is there to allow the compiler to run on platforms that would otherwise not have the relevant functionality. If you already have a C++ compiler to build Clang with on the target system, you (most likely) have everything you need. But what if you are cross-compiling to a target with limited/no support for C++ on the target? -- Mats On 2 September 2015 at 10:55, Russell Wallace via llvm-dev < llvm-dev at lists.llvm.org> wrote:> The name and documentation both suggest it contains essential runtime > functions for use by generated code. However, it's offered as an extra > optional download, and when I omit it, the entire cycle of compiling a > program with clang and running the resulting executable still seems to work > fine. What am I missing? > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150902/da68de50/attachment.html>
On 2 Sep 2015, at 10:59, mats petersson via llvm-dev <llvm-dev at lists.llvm.org> wrote:> > It is there to allow the compiler to run on platforms that would otherwise not have the relevant functionality. If you already have a C++ compiler to build Clang with on the target system, you (most likely) have everything you need. But what if you are cross-compiling to a target with limited/no support for C++ on the target?It’s not just cross compiling. On most operating systems, the OS vendor is responsible for providing a set of libraries that perform functionality expected by the compiler. This includes functions that provide missing CPU functionality (and which would be too expensive to inline everywhere, or which all programs must do in precisely the same way, irrespective of the compiler used), for example some complex floating point operations or atomics, and the generic unwind frameworks. Most OS vendors *do* provide these (and so do some third-party toolchains, such as MinGW). GCC provides an implementation of these that most Linux distributions ship. On FreeBSD or OS X, these are provided by compiler-rt. If you are bringing up a new platform, then compiler-rt gives you some of these components. Note that nothing in compiler-rt is specific to C++. The closest thing is the unwind library, which provides the generic part of the unwinder, which is also used for other languages (Objective-C, Ada, Java with GCJ, and so on). David
Apparently Analagous Threads
- [LLVMdev] Sanitizers libs in Compiler-RT
- [LLVMdev] LibUnwind into Compiler-RT?
- [LLVMdev] Heads-up: changing the structure of compiler-rt source tree
- [LLVMdev] Heads-up: changing the structure of compiler-rt source tree
- [LLVMdev] Heads-up: changing the structure of compiler-rt source tree