<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 29, 2016, at 2:06 PM, Asiri Rathnayake via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_extra"><br class="Apple-interchange-newline"><br class=""><div class="gmail_quote">On Tue, Dec 27, 2016 at 2:45 PM, Carsten Mattner<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:carstenmattner@gmail.com" target="_blank" class="">carstenmattner@gmail.com</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><span class="gmail-">On Tue, Dec 27, 2016 at 3:38 PM, Asiri Rathnayake<br class=""><<a href="mailto:asiri.rathnayake@gmail.com" class="">asiri.rathnayake@gmail.com</a>> wrote:<br class="">><br class="">><br class="">> On Tue, Dec 27, 2016 at 1:29 PM, Carsten Mattner via llvm-dev<br class="">> <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:<br class="">>><br class="">>> When I tried to build with -DLLVM_ENABLE_LIBCXX, I found out that<br class="">>> it doesn't try to use the in-tree libcxx but looks for one built<br class="">>> and installed in the system.<br class="">><br class="">><br class="">> IIRC, -DLLVM_ENABLE_LIBCXX reduces to passing --stdlib=libc++ (see<br class="">> [1]) to the compiler.<br class="">><br class="">> What you can do is a two-stage build. On the first stage, build just<br class="">> libc++ (ninja cxx cxxabi). On the second stage, re-configure with<br class="">> -DLLVM_ENABLE_LIBCXX and build the rest of the tools. We have a<br class="">> downstream builder that works this way to avoid a libstdc++ defect<br class="">> on the host platform. I can't remember the exact details, can dig<br class="">> them up if it helps.<br class=""><br class=""></span>Yes please, that would be helpful as an interim workaround.<br class=""></blockquote></div><br class=""></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 class=""></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></div></div></blockquote><br class=""></div><div>A bootstrap 2-stage build is the usual way to get there. I’m not sure I really get the motivation of what we’re trying to achieve here that is really useful in a 1-stage build?</div><div><br class=""></div><div>— </div><div>Mehdi</div><div><br class=""></div><br class=""></body></html>