<div dir="ltr"><div>Thanks for the clarification, David!<br><br></div><div>I didn't even think about atomics - or floating point, for that matter.<br></div><div><br>--<br></div>Mats<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 2 September 2015 at 11:22, David Chisnall <span dir="ltr"><<a href="mailto:David.Chisnall@cl.cam.ac.uk" target="_blank">David.Chisnall@cl.cam.ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 2 Sep 2015, at 10:59, mats petersson via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br>
><br>
> 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?<br>
<br>
</span>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.<br>
<br>
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.<br>
<br>
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).<br>
<span class="HOEnZb"><font color="#888888"><br>
David<br>
<br>
</font></span></blockquote></div><br></div>