<div dir="ltr">after following the instructions for 

<span style="font-family:"Courier New";font-size:12px">ninja check-all:</span><div><br></div><div>FAILED: bin/libclang.dll lib/liblibclang.dll.a<br>cmd.exe /C "cd . && C:\Strawberry\c\bin\c++.exe  -Wa,-mbig-obj -Werror=date-time<br> -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-fi<br>eld-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-unin<br>itialized -Wno-class-memaccess -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno<br>-comment -fno-common -Woverloaded-virtual -fno-strict-aliasing  -O2  C:/temp/llv<br>m-build/llvm-project/build1/tools/clang/tools/libclang/libclang.def -shared -o b<br>in\libclang.dll -Wl,--out-implib,lib\liblibclang.dll.a -Wl,--major-image-version<br>,11,--minor-image-version,0 @CMakeFiles\libclang.rsp  && cd ."<br>C:/Strawberry/c/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w64-m<br>ingw32/bin/ld.exe: cannot find lib/libLLVMCore.a: Too many open files<br>C:/Strawberry/c/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w64-m<br>ingw32/bin/ld.exe: cannot find lib/libLLVMRemarks.a: Too many open files<br>C:/Strawberry/c/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w64-m<br>ingw32/bin/ld.exe: cannot find lib/libLLVMBitstreamReader.a: Too many open files<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Apr 12, 2020 at 1:25 PM Alexandre Ganea <<a href="mailto:alexandre.ganea@ubisoft.com" target="_blank">alexandre.ganea@ubisoft.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





<div lang="EN-CA">
<div>
<p class="MsoNormal">build_llvm_package.bat is only a template for building releases.<u></u><u></u></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span>You can use it as reference, but for a two-stage build the simplest you can do is:<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<ol style="margin-top:0cm" start="1" type="1">
<li style="margin-left:0cm"><span>Ensure cmake, ninja build, python, GnuWin32 are installed and available in %PATH%.<u></u><u></u></span></li><li style="margin-left:0cm"><span>Start “x64 Native Tools Command Prompt for VS 2017” from the Start menu/Visual Studio 2017.<u></u><u></u></span></li><li style="margin-left:0cm"><span>‘cd’ to the root of your git checkout and run:<u></u><u></u></span></li></ol>
<p><span><u></u> <u></u></span></p>
<p class="MsoNormal" style="margin-left:18pt"><span style="font-size:9pt;font-family:"Courier New"">D:\llvm-project> mkdir build1 && cd build1<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:18pt"><span style="font-size:9pt;font-family:"Courier New""><u></u> <u></u></span></p>
<p class="MsoNormal" style="margin-left:18pt"><span style="font-size:9pt;font-family:"Courier New"">D:\llvm-project\build1> cmake -GNinja ../llvm -DCMAKE_BUILD_TYPE=Release -DLLVM_OPTIMIZED_TABLEGEN=ON -DLLVM_ENABLE_ASSERTIONS=ON
 -DLLVM_ENABLE_LIBXML2=OFF -DLLVM_ENABLE_PROJECTS="llvm;clang;lld"<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:18pt"><span style="font-size:9pt;font-family:"Courier New"">(…)<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:18pt"><span style="font-size:9pt;font-family:"Courier New""><u></u> <u></u></span></p>
<p class="MsoNormal" style="margin-left:18pt"><span style="font-size:9pt;font-family:"Courier New"">D:\llvm-project\build1> ninja check-all<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span>The first stage will therefore use MSVC. If the above commands succeed, you can move on to stage 2:<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:18pt"><span><u></u> <u></u></span></p>
<p class="MsoNormal" style="margin-left:18pt"><span style="font-size:9pt;font-family:"Courier New"">D:\llvm-project\build1> cd .. && mkdir build2 && cd build2</span><span><u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:18pt"><span style="font-size:9pt;font-family:"Courier New""><u></u> <u></u></span></p>
<p class="MsoNormal" style="margin-left:18pt"><span style="font-size:9pt;font-family:"Courier New"">D:\llvm-project\build2> cmake -GNinja ../llvm -DCMAKE_BUILD_TYPE=Release -DLLVM_OPTIMIZED_TABLEGEN=ON -DLLVM_ENABLE_LIBXML2=OFF
 -DCMAKE_C_COMPILER="../build1/bin/clang-cl.exe" -DCMAKE_CXX_COMPILER="../build1/bin/clang-cl.exe" -DCMAKE_LINKER="../build1/bin/lld-link.exe" -DLLVM_ENABLE_LLD=ON -DCMAKE_CXX_FLAGS="-Xclang -O3" -DCMAKE_C_FLAGS="-Xclang -O3" -DLLVM_ENABLE_PROJECTS="llvm;clang;lld"
 -DCLANG_TABLEGEN="../build1/bin/clang-tblgen.exe" -DLLVM_TABLEGEN="../build1/bin/llvm-tblgen.exe"<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:18pt"><span style="font-size:9pt;font-family:"Courier New""><u></u> <u></u></span></p>
<p class="MsoNormal" style="margin-left:18pt"><span style="font-size:9pt;font-family:"Courier New"">D:\llvm-project\build2> ninja check-all<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span>You should have now the binaries for the second stage in build2\bin.<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span>This is only an example. You can then take a look at
</span><a href="https://llvm.org/docs/CMake.html" target="_blank">https://llvm.org/docs/CMake.html</a> for extra cmake flags that can be used to tweak your build. You could for example use ThinLTO on the second stage, by adding -DLLVM_ENABLE_LTO=Thin. You can also use `cmake-gui`
 if you don’t want to go through command-lines (ensure it points to the right build stage).<span><u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span>Best,<u></u><u></u></span></p>
<p class="MsoNormal"><span>Alex.<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><b>De :</b> llvm-dev <<a href="mailto:llvm-dev-bounces@lists.llvm.org" target="_blank">llvm-dev-bounces@lists.llvm.org</a>> <b>De la part de</b> blackthirt33n . via llvm-dev<br>
<b>Envoyé :</b> April 11, 2020 7:46 PM<br>
<b>À :</b> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<b>Objet :</b> [llvm-dev] using the bat script build_llvm_package.bat on windows<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">where should the file build_llvm_package.bat be placed and how should the build_llvm_package.bat be called?<u></u><u></u></p>
<div>
<p class="MsoNormal">or <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">is there a another way to do a two stage build of the llvm project on windows starting with using visual studio 2017 community.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</div>
</div>

</blockquote></div>