<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Mar 24, 2015, at 9:30 AM, Reid Kleckner <<a href="mailto:rnk@google.com" class="">rnk@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_extra"><div class="gmail_quote">On Mon, Mar 23, 2015 at 5:22 PM, David Bakin<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:davidbak@gmail.com" target="_blank" class="">davidbak@gmail.com</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div dir="ltr" class=""><div class="">Hi! I'm new to Clang/LLVM and I'm trying to use Clang as a parser/semantic analyzer for a tool I'm trying to write (details on request if you'd like). I'm having trouble building, having following directions from the Clang site, the book "Getting Started with LLVM Core Libraries", and a couple of other sites mashed together.</div><div class=""><div class=""> </div></div><div class="">a) Using cmake-gui and selecting "Visual Studio 12 2013" I got a set of VS project files that only had a Win32 configuration, no x64. So to build x64 it must be necessary to select generator "Visual Studio 12 2013 Win64"? And therefore 32-bit vs 64-bit determined by the "generator" and not by LLVM_TARGETS_TO_BUILD (which apparently only has X86 and not also X64)?</div></div></blockquote><div class=""><br class=""></div><div class="">Right, we don't support generating a single VS solution that supports building LLVM in both 32 and 64-bit.</div></div></div></div></div></blockquote><div><br class=""></div><div>I could be wrong, but I actually think this is a painful limitation of CMake. I believe CMake implements Win32 and Win64 as different generators rather than a configure-time setting, which would make this very difficult to support. Conversely OS X’s multi-arch support is done via a configure time variable (CMAKE_OSX_ARCHITECTURES). Oddly enough I find that to be a terrible name because it really just sets the clang -arch flag, and it works for OS X and iOS, and it should work for Linux too if you use clang (although I’ve never tested it).</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""><br class=""></div><div class="">LLVM_TARGETS_TO_BUILD controls the set of backends to build, not the architecture you are currently targeting. Because x86 and x86_64 are so similar, all the code for both is part of the X86 target. Therefore, there is no separate X64 target, and you can just enable the X86 backend.</div><div class=""><br class=""></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div dir="ltr" class=""><div class="">b) That set of project files didn't build DEBUG - I got errors from projects RTAsan_dynamic.i386 and RTAsan.i386 that they don't build DEBUG (only RELEASE). (Message from asan_win.cc in both cases.) Can I just remove the DEBUG builds from those two projects, thereby building them for release even in the debug build? And, for curiosity, what is the actual limitation there?</div></div></blockquote><div class=""><br class=""></div><div class="">You don't need to build compiler-rt to build a semantic analyzer, so I would remove it from your checkout, honestly.</div><div class=""><br class=""></div><div class="">ASan doesn't support using the debug CRTs because they greatly complicate heap interception. For now, ASan should probably just force the usage of the release CRT regardless of what the user chose. Eventually we should support the debug CRT when we figure out proper interception.</div><div class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div dir="ltr" class=""><div class="">c) That set of project files also had an error building clang_rt.asan-dynamic.i386 with LINK.EXE complaining about a bunch of switches (that look to me like compiler switches).</div><blockquote style="margin-right: 0px;" class=""><div class=""></div><div class=""><font face="monospace,monospace" class="">18>LINK : warning LNK4044: unrecognized option '/Oy-'; ignored</font><div class=""><font face="monospace,monospace" class="">18>LINK : warning LNK4044: unrecognized option '/GS-'; ignored</font></div><div class=""><font face="monospace,monospace" class="">18>LINK : warning LNK4044: unrecognized option '/Zi'; ignored</font></div><div class=""><font face="monospace,monospace" class="">18>LINK : warning LNK4044: unrecognized option '/wd4146'; ignored</font></div><div class=""><font face="monospace,monospace" class="">18>LINK : warning LNK4044: unrecognized option '/wd4291'; ignored</font></div><div class=""><font face="monospace,monospace" class="">18>LINK : warning LNK4044: unrecognized option '/wd4391'; ignored</font></div><div class=""><font face="monospace,monospace" class="">18>LINK : warning LNK4044: unrecognized option '/wd4722'; ignored</font></div><div class=""><font face="monospace,monospace" class="">18>LINK : warning LNK4044: unrecognized option '/wd4800'; ignored</font></div><div class=""><font face="monospace,monospace" class="">18>LINK : warning LNK4044: unrecognized option '/GR-'; ignored</font></div></div></blockquote><div class=""> </div><div class="">What's the fix for that?</div></div></blockquote><div class=""><br class=""></div><div class="">It's not fixed yet. :) As a workaround, don't build compiler-rt, I don't think you need it.</div><div class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div dir="ltr" class=""><div class="">d) Finally, I also tried configuring an x64 build using generator "Visual Studio 12 2013 Win64" but cmake-gui complained at the selections I made as follows:</div><div class=""><div class=""> </div></div><div class=""><blockquote style="margin-right: 0px;" class=""><div class=""><font class=""><font face="monospace,monospace" class="">CMake Error at tools/llvm-shlib/CMakeLists.txt:48 (message):</font></font></div><font face="monospace,monospace" class=""><div class="">Auto-generation not implemented for Win32 without GNU utils. Please</div></font><div class=""><font face="monospace,monospace" class="">specify LLVM_EXPORTED_SYMBOL_FILE.</font></div></blockquote><span style="color: rgb(255, 0, 0);" class=""><div class=""> </div></span><div class=""><span style="color: rgb(255, 0, 0);" class="">What's the proper way to fix that? By which I mean ... is there some kind of more complete documentation of the use of CMake in LLVM than<span class="Apple-converted-space"> </span><a href="http://llvm.org/docs/CMake.html" target="_blank" class="">http://llvm.org/docs/CMake.html</a><span class="Apple-converted-space"> </span>(the option LLVM_EXPORTED_SYMBOL_FILE doesn't appear on that page and anyway doesn't sound like that's the real problem)?</span></div></div></div></blockquote></div></div></div></div></blockquote><div><br class=""></div><div>The LLVM_EXPORTED_SYBMOL_FILE is a variable you set to the path of a file containing the export list you want to pass to the linker. I’m not aware of anyone using llvm-shlib (LLVM_BUILD_DYLIB) on Windows, so I don’t know how functional that build tooling will be. If you need dlls rather than static libraries you might try using the BUILD_SHARED_LIBS option instead.</div><div><br class=""></div><div>-Chris</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""><br class=""></div><div class="">Don't enable LLVM_BUILD_LLVM_DYLIB if you don't need it. Maybe we should document how this works better.</div><div class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div dir="ltr" class=""><div class=""><div class=""><span style="color: rgb(255, 0, 0);" class=""><div class=""><font class="">I hope all of you more experienced LLVM developers will put up with a newbie with newbie questions for awhile. Thanks in advance! (And let me know if there's a better place to get questions answered, perhaps SO?)</font></div><span class=""><font color="#888888" class=""><span class=""><font color="#888888" class=""><div class=""><font class=""></font><br class=""></div><div class=""><font class="">-- David Bakin</font></div></font></span></font></span></span></div></div></div><br class="">_______________________________________________<br class="">cfe-dev mailing list<br class=""><a href="mailto:cfe-dev@cs.uiuc.edu" class="">cfe-dev@cs.uiuc.edu</a><br class=""><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank" class="">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a></blockquote></div></div></div></div></blockquote></div><br class=""></body></html>