<div dir="ltr"><div>As a rule, if you're trying to use clang-on-Windows tools in place of Visual Studio's, you should keep this correspondence in mind:</div><br><div>clang-cl is equivalent to cl.exe (the C/C++ compiler)<br></div><div>lld-link is equivalent to link.exe (the linker)<br></div><div>llvm-lib is equivalent to lib.exe (the static library archiver)<br></div><div>llvm-rc is (sort of) equivalent to rc.exe (the Windows resource compiler) - though you may need to run clang-cl /P on any .rc files first, since llvm-rc doesn't include the preprocessor.<br></div><div><br></div><div>... on the other hand, I'm seeing a few guides online already to building Lua on Windows with gcc and mingw (e.g., [1], though I can't confirm its quality). You may well be able to use clang in place of gcc without much difficulty!<br></div><div><br></div><div>    [1]: <a href="http://lua-users.org/wiki/BuildingLuaInWindowsForNewbies">http://lua-users.org/wiki/BuildingLuaInWindowsForNewbies</a></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jan 10, 2020 at 1:42 AM Zachary Turner via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</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 dir="ltr">On Windows lib files are typically made with a tool called lib which ships with Visual Studio.  Unlike ar, which outputs .a files, lib outputs .lib files.<div><br></div><div>It sounds like perhaps you need to modify the Makefile to not try to use ar on Windows, but to use lib instead.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jan 9, 2020 at 10:27 PM Russell Haley via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</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 dir="ltr">Hi, <div><br></div><div>Er. Hello, I don't feel like I have any business being on a compiler mailing list but I've been driven here by desperation. Not that I don't want to be here, I just suck at C so it feels weird. </div><div><br></div><div>Anywho, I like Lua. It's  a fun little language. The neat part is it's so small and customizable. On FreeBSD it's *super* easy to build. In fact, it's so easy a nicompoop like me has become the port maintainer for Lua (albeit with great heaps of help from someone else). </div><div><br></div><div>Alas, on Windows, Lua is not so easy to build. I need to download a 20 GB Visual Studio or tear my hair out getting mingw set up. I have sometimes resorted to the Free VC++ Build Tools, but that's still 4GB to build Lua, which is.. er.. 402 KB. I also still need to do everything in DOS to get all the environment variables, or go through backflips trying to set up powershell to work with VC++.</div><div><br></div><div>So, many years ago I downloaded LLVM (clang 5.01) and tried to build Lua only to be stymied and then waylaid by life. I recently became interested in compilers on Windows again, spurred on by the discovery of the Embarcadero and Keil compilers, both built on clang. However, both licenses *explicitly* forbids my use case.</div><div><br></div><div>So, here I am. I just want to be able to build Lua easily on Windows, so I'm going to make my own compiler toolchain using clang and I'm going to include it in my binary Windows distribution of Lua. PERFECTLY logical. </div><div><br></div><div>Anyway, you know how I said I suck at C? Well the thing that stymied me so many years ago - and has stymied me this very night and driven me insane enough to swear to almighty God that I'mna learn how to make a compiler - is that the Lua Makefile uses `ar` and there is no `ar` on Windows. Do I need ar (an archiver to build lib files) when I'm compiling on Windows with clang? Could someone help me build Lua on Windows with clang so I can start my lunatic journey into LLVM?</div><div><br></div><div>Thanks, and nice meeting you all.</div><div><br></div><div>Russell Haley</div><div><br></div></div>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div>