<div dir="ltr"><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">I think you are more correct though</blockquote><div>Meant to say more likely correct. :)<br><br></div><div>I don't have an ego problem this was a typo<br><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">Michael<br>In short Michael <br></blockquote>Also said his name twice,<br>I need to start reading things twice before I click the send button<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 28, 2015 at 1:40 PM, Martell Malone <span dir="ltr"><<a href="mailto:martellmalone@gmail.com" target="_blank">martellmalone@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi Renato<br><br> </div><span class=""><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">I had the impression that Michael actually wanted the latter, like GCC<br>
has autoconf options to change the default behaviour of the compiler<br>
at build time.<br>
<br>
I may be wrong, though.</blockquote><div><br></div></span><div>yes I thought that was what he wanted because he said<span class=""><br><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">Are they used to indicate that if the C/C++ compiler for building LLVM is clang<br></blockquote><div><br></div></span><div>That combined with the standard cmake flags cmake_cxx_compiler and cmake_c_compiler should result in the host being clang and using libc++ and libc++abi<br></div><div>I was a little thrown off by the wording of the question<br></div><div>I think you are more correct though I misread the second part of the question where he said what he actually wanted the resulting compiler to use libc++<br></div><div>Sorry for the noise<br><br>Michael<br><br>In short Michael it should not matter if clang was build with libc++ or libstdc++ the resulting compiler can use both after the fact<br>As Renato described above in more detail LDFLAGS="--stdlib=libc++ -lc++abi -lunwind" would be used to tell that resulting compiler to link its programs with libc++, libc++abi and libunwind<br></div><div>Rather than using libstdc++ and libgcc_eh<br></div><div><br></div><div>If you want to know how to change the default to do this without touching the LDFLAGS for your target this you must look in the clang repo under lib/driver<br></div><div>If you have any trouble doing this I'd be glad to help you change the default behavior if let me know what your target is.<br><br></div><div>Kind Regards<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888"><div>Martell<br></div></font></span></div></div><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Tue, Jul 28, 2015 at 1:06 PM, Renato Golin <span dir="ltr"><<a href="mailto:renato.golin@linaro.org" target="_blank">renato.golin@linaro.org</a>></span> wrote:<br></span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 28 July 2015 at 12:10, Schlottke-Lakemper, Michael<br>
</span><div><div class="h5"><span><<a href="mailto:m.schlottke-lakemper@aia.rwth-aachen.de" target="_blank">m.schlottke-lakemper@aia.rwth-aachen.de</a>> wrote:<br>
> I am wondering about the meaning of the cmake flags LLVM_ENABLE_LIBCXX and LLVM_ENABLE_LIBCXXABI. Are they used to indicate that if the C/C++ compiler for building LLVM is clang, and if this clang has support for libc++ with libc++Abi, that both lib++ and libc++abi should be used (instead of linking to the default, which at least on Linux is libstdc++)? If not, what is the canonical way of building LLVM with libc++? I am asking since I seem to have problems linking libLLVMSupport.a to a program while using clang with libc++, whereas the used clang/LLVM compiler was originally built with clang and libstdc++.<br>
<br>
</span>Hi Michael,<br>
<br>
Just cloning the libc++ / libc++abi / libunwind repositories in<br>
llvm/projects (or symlinking them there) is enough for CMake to pick<br>
it up, build and test on check-all. The libraries will be available on<br>
build/lib.<br>
<span><br>
<br>
> Related to the first question: do the above flags also make clang use libc++ by default, or is this configurable via a different set of flags?<br>
<br>
</span>No. I believe this is an old flag when that wasn't enable by default<br>
(and now it's used to disable it if you have the dirs). But maybe<br>
heavier users of libc++ can help you there.<br>
<br>
You still have to use LDFLAGS="--stdlib=libc++ -lc++abi -lunwind" and,<br>
if you're not installing it anywhere (but using the build directory),<br>
add LD_LIBRARY_PATH=build/lib to your environment.<br>
<br>
If you run into inconsistencies because libgcc_s / libgcc_eh are<br>
included, or if libstdc++ is included as well, you may have to use<br>
-nostdlibc++ to clean up the internal options, and then use --stdlib<br>
and friends to create a new set.<br>
<br>
It is confusing, but we don't want to make those libraries the default<br>
on any environment that might still need/use libstdc++/libgcc by<br>
default. This is more of a system-wide decision. For testing purposes,<br>
though, it works well.<br>
<br>
cheers,<br>
--renato<br>
</div></div><div><div><div><div class="h5"><br>
_______________________________________________<br>
LLVM Developers mailing list<br>
</div></div><span class=""><a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" rel="noreferrer" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</span></div></div></blockquote></div><br></div>
</blockquote></div><br></div>