<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 27, 2016 at 2:45 PM, Carsten Mattner <span dir="ltr"><<a href="mailto:carstenmattner@gmail.com" target="_blank">carstenmattner@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">On Tue, Dec 27, 2016 at 3:38 PM, Asiri Rathnayake<br>
<<a href="mailto:asiri.rathnayake@gmail.com">asiri.rathnayake@gmail.com</a>> wrote:<br>
><br>
><br>
> On Tue, Dec 27, 2016 at 1:29 PM, Carsten Mattner via llvm-dev<br>
> <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br>
>><br>
>> When I tried to build with -DLLVM_ENABLE_LIBCXX, I found out that<br>
>> it doesn't try to use the in-tree libcxx but looks for one built<br>
>> and installed in the system.<br>
><br>
><br>
> IIRC, -DLLVM_ENABLE_LIBCXX reduces to passing --stdlib=libc++ (see<br>
> [1]) to the compiler.<br>
><br>
> What you can do is a two-stage build. On the first stage, build just<br>
> libc++ (ninja cxx cxxabi). On the second stage, re-configure with<br>
> -DLLVM_ENABLE_LIBCXX and build the rest of the tools. We have a<br>
> downstream builder that works this way to avoid a libstdc++ defect<br>
> on the host platform. I can't remember the exact details, can dig<br>
> them up if it helps.<br>
<br>
</span>Yes please, that would be helpful as an interim workaround.<br>
</blockquote></div><br></div><div class="gmail_extra"><div class="gmail_extra" style="font-size:12.8px">Hmm, I have mis-remembered. We do have a two-stage build, but probably not what you want; stage-1 builds clang + libcxx using the host compiler (no -DLLVM_USE_LIBCXX is passed). Then the stage-2 build uses the compiler built on stage-1, along with the extra -DLLVM_USE_LIBCXX option.</div><div class="gmail_extra" style="font-size:12.8px"><br></div><div class="gmail_extra" style="font-size:12.8px">I'll dig around a bit further, I thought this worked out of the box tbh.</div><div class="gmail_extra" style="font-size:12.8px"><br></div><div class="gmail_extra" style="font-size:12.8px">/ Asiri</div></div></div>