<div dir="ltr"><div>Forwarding a conversation where I forgot to CC the mailing list...</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Jan 11, 2020 at 10:59 AM Zachary Turner <<a href="mailto:zturner@roblox.com">zturner@roblox.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>Sure, go ahead.</div><div dir="auto"><br></div><div dir="auto">You might need to build llvm from source to get strip and ranlib, I’m not sure what’s in the install package </div></blockquote><div>To the Bat Cave! </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Jan 11, 2020 at 10:21 AM Russell Haley <<a href="mailto:russ.haley@gmail.com" target="_blank">russ.haley@gmail.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 dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Jan 11, 2020 at 7:48 AM Zachary Turner <<a href="mailto:zturner@roblox.com" target="_blank">zturner@roblox.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><div dir="auto">llvm has versions of both of those.  llvm-strip and llvm-ranlib</div></div></blockquote><div>Hmmm... I have a new installation of LLVM (done last night) and it doesn't seem to include llvm-strip?</div><div><br></div><div>I just realized both our conversations went private (e.g. not on the mailing list anymore). That's my fault, the lua mailing list does an automatic reply all and I forget when using other mailing lists. If your comfortable with that, I'll take the opportunity to ask you about your awesome job (I checked you on linkedin), otherwise I'll reply all. </div><div> </div><div>Cheers,</div></div></div><div dir="ltr"><div class="gmail_quote"><div>Russ</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jan 10, 2020 at 11:28 PM Russell Haley <<a href="mailto:russ.haley@gmail.com" target="_blank">russ.haley@gmail.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 dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jan 10, 2020 at 10:45 PM Zachary Turner <<a href="mailto:zturner@roblox.com" target="_blank">zturner@roblox.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><div dir="auto">If you’re trying to build a 32-bit lua, pass -m32 for all clang invocations.  If you’re trying to build a 64-bit lua, pass -m64 instead.  That should hopefully fix it.</div></div><div dir="auto"><br></div><div dir="auto">Also, cross posting between Lia and clang mailing lists... This is a new one :)</div></blockquote><div><br></div><div>Yes, it's a bit cheeky isn't it? I checked the installation date for clang I've been wringing my hands about this issue for three years apparently. Capre diem and all that.</div><div><br></div><div>So close! 

Is there a microsoft/llvm equivalent to "strip" or ranlib?</div><div><br></div><div>clang -std=c99 -m32 -shared -o lua53.dll lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o lauxlib.o lbaselib.o lbitlib.o lcorolib.o ldblib.o liolib.o lmathlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o loadlib.o linit.o<br>   Creating library lua53.lib and object lua53.exp<br>strip --strip-unneeded lua53.dll<br>process_begin: CreateProcess(NULL, strip --strip-unneeded lua53.dll, ...) failed.<br>make (e=2): The system cannot find the file specified.<br>make[1]: *** [lua53.dll] Error 2<br>make[1]: Leaving directory `C:/Users/russh/lua/lua-5.3.5/src'<br>make: *** [clang] Error 2<br></div><div><br></div><div></div><div>(Also, thank you!)</div><div>Russ</div></div></div><div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jan 10, 2020 at 10:22 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"><div dir="ltr"><div><br></div></div><br><div class="gmail_quote"></div></div><div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jan 10, 2020 at 10:01 PM Russell Haley <<a href="mailto:russ.haley@gmail.com" target="_blank">russ.haley@gmail.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 dir="ltr">Hi,<br><div><br></div><div>I'm taking a shot at building Lua with Clang on Windows and I'm stalled out on modifying the standard Lua makefile. I've tried both the GNU Win32 Make (3.8.1) and Digital Mars Make (It came with DLang). All the below work is with GNU Make.</div><div><br></div><div>To modify the Makefile for Windows, I changed CC = clang. Then I've replaced *.o with *.obj in the file and created a new target called clang which looks like this (full modified makefile here: <a href="https://pastebin.com/BXGvrPiD" target="_blank">https://pastebin.com/BXGvrPiD</a>)</div><div><br></div>clang:<br> $(MAKE) "LUA_A=lua53.dll" "LUA_T=lua.exe" \<br>       "AR=lib" \<br>  "SYSCFLAGS=-DLUA_BUILD_AS_DLL" "SYSLIBS=" "SYSLDFLAGS=-s" lua.exe<br><div>$(MAKE) "LUAC_T=luac.exe" luac.exe </div><div><br></div><div>mingw:<br>      $(MAKE) "LUA_A=lua53.dll" "LUA_T=lua.exe" \<br>       "AR=$(CC) -shared -o" "RANLIB=strip --strip-unneeded" \<br>   "SYSCFLAGS=-DLUA_BUILD_AS_DLL" "SYSLIBS=" "SYSLDFLAGS=-s" lua.exe<br>       $(MAKE) "LUAC_T=luac.exe" luac.exe<br></div><div><br></div><div>The above is my attempt to modify the mingw target which I have also included for reference. I've tried the clang target with -shared and -o left in and removed, both with no success. This is the result of my latest attempt with -shared and -o left in: </div><div><br></div><div>C:\Users\russh\lua\lua-5.3.5\src> make clang<br>make "LUA_A=lua53.dll" "LUA_T=lua.exe" \<br>        "AR=clang -std=gnu99 -shared -o" \<br>        "AR=lib -shared -o" \<br>        "SYSCFLAGS=-DLUA_BUILD_AS_DLL" "SYSLIBS=" "SYSLDFLAGS=-s" lua.exe<br>make[1]: Entering directory `C:/Users/russh/lua/lua-5.3.5/src'<br>lib -shared -o lua53.dll lapi.obj lcode.obj lctype.obj ldebug.obj ldo.obj ldump.obj lfunc.obj lgc.obj llex.obj lmem.obj lobject.obj lopcodes.obj lparser.obj lstate.obj lstring.obj ltable.obj ltm.obj lundump.obj lvm.obj lzio.obj lauxlib.obj lbaselib.obj lbitlib.obj lcorolib.obj ldblib.obj liolib.obj lmathlib.obj loslib.obj lstrlib.obj ltablib.obj lutf8lib.obj loadlib.obj linit.obj<br>Microsoft (R) Library Manager Version 14.16.27024.1<br>Copyright (C) Microsoft Corporation.  All rights reserved.<br><br>LINK : warning LNK4044: unrecognized option '/shared'; ignored<br>LINK : warning LNK4044: unrecognized option '/o'; ignored<br>LINK : fatal error LNK1181: cannot open input file 'lua53.dll'<br>make[1]: *** [lua53.dll] Error 1181<br>make[1]: Leaving directory `C:/Users/russh/lua/lua-5.3.5/src'<br>make: *** [clang] Error 2<br></div><div><br></div><div>It seems to me to be missing the compile step and going straight to the link step?</div><div><br></div><div>Any input would be appreciated. </div><div><br></div><div>Regards,</div><div>Russell</div></div></blockquote><div><br></div></div></div><div dir="ltr"><div class="gmail_quote">Ugh. I spent hours tonight trying things then finally spend the time to write up that last email and fire it off. Three seconds later I thought of a new path and it turned out to solve the issue. I reverted back to the original makefile and started again. I change CC=clang and set MAKE= make (to fix the spaces in the installed path).<div><br></div><div>Anyway, Now I'm stuck with an architecture mis-match:</div><div><br></div><div> make clang<br>make "LUA_A=lua53.dll" "LUA_T=lua.exe" \<br>        "AR=clang -std=gnu99 -shared -o" "RANLIB=strip --strip-unneeded" \<br>        "SYSCFLAGS=-DLUA_BUILD_AS_DLL" "SYSLIBS=" "SYSLDFLAGS=-s" lua.exe<br>make[1]: Entering directory `C:/Users/russh/lua/lua-5.3.5/src'<br>clang -std=gnu99 -shared -o lua53.dll lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o lauxlib.o lbaselib.o lbitlib.o lcorolib.o ldblib.o liolib.o lmathlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o loadlib.o linit.o<br>libcmt.lib(chkstk.obj) : fatal error LNK1112: module machine type 'x86' conflicts with target machine type 'x64'<br>clang: error: linker command failed with exit code 1112 (use -v to see invocation)<br>make[1]: *** [lua53.dll] Error 1112<br>make[1]: Leaving directory `C:/Users/russh/lua/lua-5.3.5/src'<br>make: *** [clang] Error 2<br></div><div></div><div> </div><div>Regards,</div><div>Russell</div></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></div>
</blockquote></div></div>
</blockquote></div></div>
</blockquote></div></div>
</blockquote></div></div>
</blockquote></div></div>