[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cfe-dev
Subject:    Re: [cfe-dev] Cannot CMake self-hosted clang on Windows for lack of	libxml2
From:       Alexandre Ganea via cfe-dev <cfe-dev () lists ! llvm ! org>
Date:       2021-08-25 18:57:05
Message-ID: DM8PR17MB4984AFD70C6D589C09468A05EBC69 () DM8PR17MB4984 ! namprd17 ! prod ! outlook ! com
[Download RAW message or body]

[Attachment #2 (text/plain)]

In the meanwhile, as a workaround, adding -DCMAKE_MT="C:/Program Files (x86)/Windows \
Kits/10/bin/10.0.19041.0/x64/mt.exe" worked for me.

De : cfe-dev <cfe-dev-bounces@lists.llvm.org> De la part de Adrian McCarthy via \
cfe-dev Envoyé : August 20, 2021 7:35 PM
À : cfe-dev <cfe-dev@lists.llvm.org>
Objet : [cfe-dev] Cannot CMake self-hosted clang on Windows for lack of libxml2

I recently tried to build a self-hosted clang on Windows, but it fails when I use \
CMake to generate a Ninja file.

CMake finds my MSVC-built clang and tries to test it.  This invokes llvm-mt (the LLVM \
implementation of the manifest tool).  This tool depends on libxml2, which isn't \
typically installed on Windows.

I'm told the Windows build shouldn't need to invoke llvm-mt, so this is probably due \
to a CMake change.  Unfortunately, I don't know how far back I have to go to find a \
working build so that I can bisect the breaking change.  It's been a long time since \
I've tried a self-hosted build.

Maybe somebody changed this intentionally, and we just need to update the \
documentation to include libxml2 on the (already very long) list of things Windows \
developers have to install in order to build llvm.

If you have knowledge of this, let me know.  In the meantime, I'll attempt to bisect.

See below for the gory details.

Adrian.

cmake -GNinja -DPYTHON_HOME="C:\Program Files\Python38" \
-DLLDB_PYTHON_HOME="C:\Program Files\Python38" -DPYTHON_EXECUTABLE="C:\Program \
Files\Python38\bin\python.exe" -DPython3_ROOT_DIR="C:\Program Files\Python38" \
-DPython3_FIND_REGISTRY=LAST ..\..\llvm-project\llvm -DLLVM_ENABLE_ZLIB=OFF \
-DLLVM_ENABLE_PROJECTS="clang;lld;lldb" -DLLVM_TARGETS_TO_BUILD=X86 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=D:/src/llvm/build/ninja/bin/clang-cl.exe \
-DCMAKE_CXX_COMPILER=D:/src/llvm/build/ninja/bin/clang-cl.exe

-- The C compiler identification is Clang 14.0.0 with MSVC-like command-line
-- The CXX compiler identification is Clang 14.0.0 with MSVC-like command-line
-- The ASM compiler identification is Clang
-- Found assembler: D:/src/llvm/build/ninja/bin/clang-cl.exe
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: D:/src/llvm/build/ninja/bin/clang-cl.exe
-- Check for working C compiler: D:/src/llvm/build/ninja/bin/clang-cl.exe - broken
CMake Error at C:/Program Files (x86)/Microsoft Visual \
Studio/2019/Professional/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.20/Modules/CMakeTestCCompiler.cmake:66 \
(message):  The C compiler

    "D:/src/llvm/build/ninja/bin/clang-cl.exe"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: D:/src/llvm/build/selfhost/CMakeFiles/CMakeTmp

    Run Build Command(s):C:/PROGRA~2/MICROS~1/2019/PROFES~1/Common7/IDE/COMMON~1/MICROS~1/CMake/Ninja/ninja.exe \
cmTC_62af5 && [1/2] Building C object CMakeFiles\cmTC_62af5.dir\testCCompiler.c.obj  \
[2/2] Linking C executable cmTC_62af5.exe  FAILED: cmTC_62af5.exe
    cmd.exe /C "cd . && "C:\Program Files (x86)\Microsoft Visual \
Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" \
-E vs_link_exe --intdir=CMakeFiles\cmTC_62af5.dir \
--rc=C:\PROGRA~2\WI3CF2~1\10\bin\100183~1.0\x64\rc.exe \
--mt=D:\src\llvm\build\ninja\bin\llvm-mt.exe --manifests  -- \
D:\src\llvm\build\ninja\bin\lld-link.exe /nologo \
CMakeFiles\cmTC_62af5.dir\testCCompiler.c.obj  /out:cmTC_62af5.exe \
/implib:cmTC_62af5.lib /pdb:cmTC_62af5.pdb /version:0.0 /machine:x64  /debug \
/INCREMENTAL /subsystem:console  kernel32.lib user32.lib gdi32.lib winspool.lib \
shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."  MT: \
command "D:\src\llvm\build\ninja\bin\llvm-mt.exe /nologo /manifest \
CMakeFiles\cmTC_62af5.dir/intermediate.manifest \
/out:CMakeFiles\cmTC_62af5.dir/embed.manifest /notify_update" failed (exit code 0x1) \
with the following output:  llvm-mt: error: no libxml2
    llvm-mt: ignoring unsupported 'notify_update' option
    ninja: build stopped: subcommand failed.


[Attachment #3 (text/html)]

<html xmlns:v="urn:schemas-microsoft-com:vml" \
xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" \
xmlns="http://www.w3.org/TR/REC-html40"> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;}
span.EmailStyle18
	{mso-style-type:personal-reply;
	font-family:"Calibri",sans-serif;
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-family:"Calibri",sans-serif;
	mso-fareast-language:EN-US;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-CA" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">In the meanwhile, as a \
workaround, adding -DCMAKE_MT=&quot;C:/Program Files (x86)/Windows \
Kits/10/bin/10.0.19041.0/x64/mt.exe&quot; worked for me.<o:p></o:p></span></p> <p \
class="MsoNormal"><span \
style="mso-fareast-language:EN-US"><o:p>&nbsp;</o:p></span></p> <div \
style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm"> <p \
class="MsoNormal"><b><span lang="FR">De&nbsp;:</span></b><span lang="FR"> cfe-dev \
&lt;cfe-dev-bounces@lists.llvm.org&gt; <b>De la part de</b> Adrian McCarthy via \
cfe-dev<br> <b>Envoyé&nbsp;:</b> August 20, 2021 7:35 PM<br>
<b>À&nbsp;:</b> cfe-dev &lt;cfe-dev@lists.llvm.org&gt;<br>
<b>Objet&nbsp;:</b> [cfe-dev] Cannot CMake self-hosted clang on Windows for lack of \
libxml2<o:p></o:p></span></p> </div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<div>
<p class="MsoNormal">I recently tried to build a self-hosted clang on Windows, but it \
fails when I use CMake to generate a Ninja file.<o:p></o:p></p> <div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">CMake finds my MSVC-built clang and tries to test it.&nbsp; This \
invokes llvm-mt (the LLVM implementation of the manifest tool).&nbsp; This tool \
depends on libxml2, which isn't typically installed on Windows.<o:p></o:p></p> </div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
</div>
<div>
<p class="MsoNormal">I'm told the Windows build shouldn't need to invoke llvm-mt, so \
this is probably due to a CMake change.&nbsp; Unfortunately, I don't know how far \
back I have to go to find a working&nbsp;build so that I can bisect the breaking \
change.&nbsp; It's been  a long time since I've tried a self-hosted \
build.<o:p></o:p></p> </div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">Maybe somebody changed this intentionally, and we just need to \
update the documentation to include libxml2 on the (already very long) list of things \
Windows developers have to install in order to build llvm.<o:p></o:p></p> </div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">If you have knowledge of this, let me know.&nbsp; In the \
meantime, I'll attempt to bisect.<o:p></o:p></p> </div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">See below for the gory details.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">Adrian.<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:7.5pt;font-family:&quot;Courier \
New&quot;,serif">cmake -GNinja -DPYTHON_HOME=&quot;C:\Program Files\Python38&quot; \
-DLLDB_PYTHON_HOME=&quot;C:\Program Files\Python38&quot; \
-DPYTHON_EXECUTABLE=&quot;C:\Program Files\Python38\bin\python.exe&quot; \
-DPython3_ROOT_DIR=&quot;C:\Program  Files\Python38&quot; \
-DPython3_FIND_REGISTRY=LAST ..\..\llvm-project\llvm -DLLVM_ENABLE_ZLIB=OFF \
-DLLVM_ENABLE_PROJECTS=&quot;clang;lld;lldb&quot; -DLLVM_TARGETS_TO_BUILD=X86 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=D:/src/llvm/build/ninja/bin/clang-cl.exe \
-DCMAKE_CXX_COMPILER=D:/src/llvm/build/ninja/bin/clang-cl.exe</span><o:p></o:p></p> \
</div> <div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
</div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier \
New&quot;,serif">-- The C compiler identification is Clang 14.0.0 with MSVC-like \
command-line</span><br> <span style="font-size:10.0pt;font-family:&quot;Courier \
New&quot;,serif">-- The CXX compiler identification is Clang 14.0.0 with MSVC-like \
command-line</span><br> <span style="font-size:10.0pt;font-family:&quot;Courier \
New&quot;,serif">-- The ASM compiler identification is Clang</span><br> <span \
style="font-size:10.0pt;font-family:&quot;Courier New&quot;,serif">-- Found \
assembler: D:/src/llvm/build/ninja/bin/clang-cl.exe</span><br> <span \
style="font-size:10.0pt;font-family:&quot;Courier New&quot;,serif">-- Detecting C \
compiler ABI info</span><br> <span style="font-size:10.0pt;font-family:&quot;Courier \
New&quot;,serif">-- Detecting C compiler ABI info - failed</span><br> <span \
style="font-size:10.0pt;font-family:&quot;Courier New&quot;,serif">-- Check for \
working C compiler: D:/src/llvm/build/ninja/bin/clang-cl.exe</span><br> <span \
style="font-size:10.0pt;font-family:&quot;Courier New&quot;,serif">-- Check for \
working C compiler: D:/src/llvm/build/ninja/bin/clang-cl.exe - broken</span><br> \
<span style="font-size:10.0pt;font-family:&quot;Courier New&quot;,serif">CMake Error \
at C:/Program Files (x86)/Microsoft Visual \
Studio/2019/Professional/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.20/Modules/CMakeTestCCompiler.cmake:66 \
(message):</span><o:p></o:p></p> <div>
<p class="MsoNormal"><span style="font-size:7.5pt;font-family:&quot;Courier \
New&quot;,serif">&nbsp; The C compiler</span><o:p></o:p></p> </div>
<div>
<p class="MsoNormal"><span style="font-size:7.5pt;font-family:&quot;Courier \
New&quot;,serif"><br> &nbsp; &nbsp; \
&quot;D:/src/llvm/build/ninja/bin/clang-cl.exe&quot;<br> <br>
&nbsp; is not able to compile a simple test program.<br>
<br>
&nbsp; It fails with the following output:<br>
<br>
&nbsp; &nbsp; Change Dir: D:/src/llvm/build/selfhost/CMakeFiles/CMakeTmp<br>
<br>
&nbsp; &nbsp; Run Build \
Command(s):C:/PROGRA~2/MICROS~1/2019/PROFES~1/Common7/IDE/COMMON~1/MICROS~1/CMake/Ninja/ninja.exe \
cmTC_62af5 &amp;&amp; [1/2] Building C object \
CMakeFiles\cmTC_62af5.dir\testCCompiler.c.obj<br> &nbsp; &nbsp; [2/2] Linking C \
executable cmTC_62af5.exe<br> &nbsp; &nbsp; FAILED: cmTC_62af5.exe<br>
&nbsp; &nbsp; cmd.exe /C &quot;cd . &amp;&amp; &quot;C:\Program Files (x86)\Microsoft \
Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe&quot; \
-E vs_link_exe --intdir=CMakeFiles\cmTC_62af5.dir \
                --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100183~1.0\x64\rc.exe
 --mt=D:\src\llvm\build\ninja\bin\llvm-mt.exe --manifests &nbsp;-- \
D:\src\llvm\build\ninja\bin\lld-link.exe /nologo \
CMakeFiles\cmTC_62af5.dir\testCCompiler.c.obj &nbsp;/out:cmTC_62af5.exe \
/implib:cmTC_62af5.lib /pdb:cmTC_62af5.pdb /version:0.0 /machine:x64 &nbsp;/debug \
/INCREMENTAL  /subsystem:console &nbsp;kernel32.lib user32.lib gdi32.lib winspool.lib \
shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib &amp;&amp; cd \
.&quot;<br> &nbsp; &nbsp; MT: command &quot;D:\src\llvm\build\ninja\bin\llvm-mt.exe \
/nologo /manifest CMakeFiles\cmTC_62af5.dir/intermediate.manifest \
/out:CMakeFiles\cmTC_62af5.dir/embed.manifest /notify_update&quot; failed (exit code \
0x1) with the following output:<br> &nbsp; &nbsp; llvm-mt: error: no libxml2<br>
&nbsp; &nbsp; llvm-mt: ignoring unsupported 'notify_update' \
option</span><o:p></o:p></p> <div>
<p class="MsoNormal"><span style="font-size:7.5pt;font-family:&quot;Courier \
New&quot;,serif">&nbsp; &nbsp; ninja: build stopped: subcommand \
failed.</span><o:p></o:p></p> </div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
</div>
</div>
</div>
</body>
</html>


[Attachment #4 (unknown)]

_______________________________________________
cfe-dev mailing list
cfe-dev@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic