<div dir="ltr">Hi Alex:<div><br></div><div class="gmail_extra"><div class="gmail_quote">On Tue, Dec 12, 2017 at 2:04 AM, Alex Bradbury via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@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">On 11 December 2017 at 19:53, Justin Bogner via llvm-commits<br>
<span class=""><<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br>
> Author: bogner<br>
> Date: Mon Dec 11 11:53:23 2017<br>
> New Revision: 320413<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=320413&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=320413&view=rev</a><br>
> Log:<br>
> [cmake] Pass TARGETS_TO_BUILD through to host tools build<br>
><br>
> In r319620, the host build was changed to use Native for<br>
> TARGETS_TO_BUILD because passing semicolons through add_custom_command<br>
> is surprisingly difficult. However, Native really doesn't make any<br>
> sense here, and it only works because we don't technically do any<br>
> codegen in the host tools so pretty well anything will "work".<br>
><br>
> The problem here is that passing something other than the correct<br>
> value is very fragile - as evidence note how the llvm-config in the<br>
> host tools acts differently than the target one now, and misreports<br>
> the targets to build. Similarly, if there is any logic conditional on<br>
> the targets in tablegen (now or in the future), it will do the wrong<br>
> thing.<br>
><br>
> To fix this, we need to escape the semicolons in the targets string<br>
> and pass it through to the child cmake invocation.<br>
<br>
</span>Hi Justin. This breaks builds which set targets through<br>
LLVM_EXPERIMENTAL_TARGETS_TO_<wbr>BUILD (in my case, the RISCV backend when<br>
building with -DLLVM_OPTIMIZED_TABLEGEN=<wbr>True). I'm not familiar enough<br>
with the CMake internals and the problem this patch fixes to suggest a<br>
minimal fix. Part of the problem is that at this point<br>
LLVM_EXPERIMENTAL_TARGETS_TO_<wbr>BUILD has already been merged in to<br>
LLVM_TARGETS_TO_BUILD. Is it desirable to set<br>
LLVM_EXPERIMENTAL_TARGETS_TO_<wbr>BUILD for the host build?<br></blockquote><div><br></div><div>Yes, for this to work, we'd need to pass LLVM_EXPERIMENTAL_TARGETS_TO_BUILD as well.</div><div><br></div><div>However, since Native is the only target actually used, I'd lean toward reverting this change and perhaps adding a comment.</div><div><br></div><div>hth...</div><div>don</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
Excerpt from failed configure:<br>
<br>
[1/1] Configuring NATIVE LLVM...<br>
FAILED: NATIVE/CMakeCache.txt<br>
cd /local/scratch/asb58/llvm-<wbr>repos/llvm/build_for_upstream/<wbr>NATIVE &&<br>
/local/scratch/asb58/cmake-3.<wbr>5.2-Linux-x86_64/bin/cmake -G Ninja<br>
-DCMAKE_C_COMPILER=/usr/bin/<wbr>clang-3.8<br>
-DCMAKE_CXX_COMPILER=/usr/bin/<wbr>clang++-3.8<br>
/local/scratch/asb58/llvm-<wbr>repos/llvm<br>
-DLLVM_TARGET_IS_CROSSCOMPILE_<wbr>HOST=TRUE<br>
-DLLVM_TARGETS_TO_BUILD="<wbr>AArch64;AMDGPU;ARM;BPF;<wbr>Hexagon;Lanai;Mips;MSP430;<wbr>NVPTX;PowerPC;Sparc;SystemZ;<wbr>X86;XCore;RISCV"<br>
-DCMAKE_BUILD_TYPE=Release<br>
-- Native target architecture is X86<br>
-- Threads enabled.<br>
-- Doxygen disabled.<br>
-- Go bindings enabled.<br>
-- Could NOT find OCaml (missing:  OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)<br>
-- Could NOT find OCaml (missing:  OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)<br>
-- OCaml bindings disabled.<br>
-- Could NOT find Python module pygments<br>
-- Could NOT find Python module yaml<br>
-- LLVM host triple: x86_64-unknown-linux-gnu<br>
-- LLVM default target triple: x86_64-unknown-linux-gnu<br>
-- Building with -fPIC<br>
-- Constructing LLVMBuild project information<br>
CMake Error at CMakeLists.txt:682 (message):<br>
  The target `RISCV' does not exist.<br>
<br>
      It should be one of<br>
<br>
<br>
  AArch64;AMDGPU;ARM;BPF;<wbr>Hexagon;Lanai;Mips;MSP430;<wbr>NVPTX;PowerPC;Sparc;SystemZ;<wbr>X86;XCore<br>
<br>
<br>
-- Configuring incomplete, errors occurred!<br>
See also "/local/scratch/asb58/llvm-<wbr>repos/llvm/build_for_upstream/<wbr>NATIVE/CMakeFiles/CMakeOutput.<wbr>log".<br>
See also "/local/scratch/asb58/llvm-<wbr>repos/llvm/build_for_upstream/<wbr>NATIVE/CMakeFiles/CMakeError.<wbr>log".<br>
ninja: build stopped: subcommand failed.<br>
<div class="HOEnZb"><div class="h5">______________________________<wbr>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br></div></div>