<div dir="ltr">I think you just need to preface the variable with "BOOTSTRAP_" in order to pass it through. Take a look at the multi-stage cache files in clang/cmake/cache fore examples. In this case you can try setting BOOTSTRAP_LLVM_ENABLE_LLD=ON.<div><br></div><div>Please note that I didn't try this, at least not yet, so I can't guarantee it'll work out of the box, but it should get you started...<br><div><br></div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 26, 2017 at 2:23 PM, S. Jacobi via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Tue, 26 Dec 2017 16:14:02 +0100<br>
Dimitry Andric <<a href="mailto:dimitry@andric.com">dimitry@andric.com</a>> wrote:<br>
<br>
> On 26 Dec 2017, at 12:00, S. Jacobi via llvm-dev<br>
> <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br>
> ><br>
> > Hello,<br>
> > I have a working GCC toolchain and wanted to use LLVM tooling<br>
> > instead. Following the instructions on the website I set up my<br>
> > build directory and have lld as an internal project under tools/.<br>
> > I'd like to make use of lld in stage 2 of the build and thought<br>
> > -DLLVM_ENABLE_LLD was the correct option to pass. However, adding<br>
> > this options makes the configure step fail, complaining that the<br>
> > compiler (GCC) does not support -fuse-ld=lld.<br>
> > Is it possible, and if yes - how, to set up a 2-stages build to<br>
> > compile LLVM, Clang and LLD so that in stage 2, only LLVM tools are<br>
> > part of the build process?<br>
><br>
> For your second stage, use -D<br>
> CMAKE_C_COMPILER=/path/to/<wbr>your/first/stage/clang -D<br>
> CMAKE_CXX_COMPILER=/path/to/<wbr>your/first/stage/clang++, and add -D<br>
> LINK_FLAGS=-fuse-ld=lld.<br>
><br>
> -Dimitry<br>
><br>
<br>
</div></div>So to achieve what I want I have to use 2 cmake invocations? Because,<br>
and I should have been clear about that in the first mail, what I was<br>
hoping for is a simple setup where I pass the -DCLANG_ENABLE_BOOTSTRAP<br>
option next to all other cmake options I want to set and after that<br>
invoke the generator once, hoping that cmake set up targets for stage 1<br>
and 2, with the proper dependencies.<br>
<div class="HOEnZb"><div class="h5"><br>
______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
</div></div></blockquote></div><br></div>