<div dir="ltr">On Sat, Jan 5, 2013 at 11:08 PM, Edward Diener <span dir="ltr"><<a href="mailto:eldlistmailingz@tropicsoft.com" target="_blank">eldlistmailingz@tropicsoft.com</a>></span> wrote:<div class="gmail_extra">
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 1/5/2013 8:01 PM, Justin Holewinski wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
<br>
On Sat, Jan 5, 2013 at 5:59 PM, Edward Diener<br></div>
<<a href="mailto:eldlistmailingz@tropicsoft.com" target="_blank">eldlistmailingz@tropicsoft.<u></u>com</a> <mailto:<a href="mailto:eldlistmailingz@tropicsoft.com" target="_blank">eldlistmailingz@<u></u>tropicsoft.com</a>>><div class="im">
<br>
wrote:<br>
<br>
On 01/05/2013 01:11 PM, Dmitri Gribenko wrote:<br>
<br>
On Sat, Jan 5, 2013 at 7:48 PM, Edward Diener<br></div>
<eldlistmailingz@tropicsoft.__<u></u>com<br>
<mailto:<a href="mailto:eldlistmailingz@tropicsoft.com" target="_blank">eldlistmailingz@<u></u>tropicsoft.com</a>>> wrote:<div class="im"><br>
<br>
I actually found out that llvm/configure will choose clang<br>
if it is<br>
found in the path. This contradicts what is written at<br></div>
<a href="http://llvm.org/docs/__GettingStarted.html#__requirements" target="_blank">http://llvm.org/docs/__<u></u>GettingStarted.html#__<u></u>requirements</a><br>
<<a href="http://llvm.org/docs/GettingStarted.html#requirements" target="_blank">http://llvm.org/docs/<u></u>GettingStarted.html#<u></u>requirements</a>>,<div><div class="h5"><br>
where it says it<br>
will use the first GCC it finds. Perhaps that explanation<br>
needs to be<br>
updated.<br>
<br>
<br>
Updated docs in r171630.<br>
<br>
Finally I found that if llvm/configure uses clang instead of<br>
gcc, it<br>
invariably fails on my Linux distros because it is using the gcc<br>
distributed included directories and an earlier version of<br>
clang will<br>
often fail with these gcc header files. Once I force<br>
llvm/configure to<br>
use gcc, building llvm/clang succeeds again.<br>
<br>
<br>
Right. Maybe we need to skip old clang versions in this case.<br>
<br>
<br>
I think this should be done until clang can use its own header files<br>
and libraries, when it is installed as a binary, rather than the<br>
ones that gcc installs. In fact I am a bit amazed that clang does<br>
not already have its own header files and libraries for use when one<br>
tries llvm/configure and it sets up llvm's build system to use clang<br>
as its compiler. Is this the fault of clang or is it the fault of<br>
the llvm/configure system ?<br>
<br>
<br>
There is no complete solution for LLVM-only headers/libraries yet on<br>
Linux. For C++, you can use libc++, but you still need some GCC<br>
libraries (or alternatives). And you will at least need glibc or<br>
another compatible C runtime.<br>
</div></div></blockquote>
<br>
Should not what it is needed by clang to work correctly under Linux be posted somewhere on the clang Getting Started web page ? Even what you posted above requires guesswork on my part.<br></blockquote><div><br></div><div style>
Clang will attempt to use your installed system libraries, usually libstdc++ and glibc on a Linux distribution. We could probably maintain a libstdc++ compatibility table that says clang x.y is compatible with libstdc++ up to z.w. In the vast majority of cases, this just works if you install a somewhat-newer version of clang. The problems arise when you use an older clang with a newer libstdc++ (e.g. newer gcc and/or linux distribution).</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Am I supposed to install libc++ and glibc in a Linux distro for clang to work correctly ?<br></blockquote><div><br></div><div style>glibc will already be there. libc++ is purely optional. Clang will happily use libstdc++ (which comes with your linux distribution), but newer libstdc++ versions may use new GCC extensions that clang does not yet support. This is an unfortunate condition that arises from depending on GNU libraries that assume GCC. At this time, libc++ is not entirely self-contained on Linux and still requires some GCC libraries for some external functions.</div>
<div style><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Which versions do I need ?<br></blockquote><div><br></div><div style>I'm guessing you are running into issues with the C++ standard library headers. In that case, it depends on which clang version you are using. For compatibility reasons, it is best to always use the latest released clang (if not trunk). If you try again with 3.2, I bet your problems go away.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
How do I tell clang what to use or is this automatically figured out by clang ?<br></blockquote><div><br></div><div style>There are ways to override the location for the headers/libraries of libstdc++, but I would not recommend this. Upgrading to a newer clang should be easier in the long run.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Will llvm/configure use these libraries if I let it choose a clang binary in order to build the latest llvm/clang from source ?</blockquote><div><br></div><div style>Which libraries? An older libstdc++? You can use CXXFLAGS and LDFLAGS to adjust the library search paths, just as you use CXX to set the compiler to use.</div>
<div style><br></div><div style><br></div><div style>Generally, it is recommended to bootstrap clang:</div><div style><br></div><div style>1. Build llvm/clang with system gcc</div><div style>2. Build llvm/clang with new clang</div>
<div style>3. Install new clang somewhere (which will automatically use system libstdc++/glibc).</div><div style><br></div><div style>This should solve your problem.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<br>
______________________________<u></u>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/llvmdev</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><br><div>Thanks,</div><div><br></div><div>Justin Holewinski</div>
</div></div>