<div dir="rtl"><div dir="ltr">A while ago, I tried building and testing LLVM with MSYS2 instead of the old MSYS. I saw a similar large number of unexplained failures. At first it looked like the problem was with grep from MSYS2 since many of the failing tests were using grep. After replacing MSYS grep with Gnuwin32 grep, many other problems still remained. </div><div dir="ltr">I did not checked this further, so if you are using MSYS2 it may be the same problem. See</div><div dir="ltr"><br></div><div dir="ltr"> <a href="http://sourceforge.net/p/msys2/tickets/89/">http://sourceforge.net/p/msys2/tickets/89/</a><br></div><div dir="ltr"><br></div><div dir="ltr">Yaron</div><div dir="ltr"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div dir="ltr">2015-03-25 18:02 GMT+02:00 Reid Kleckner <span dir="ltr"><<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>></span>:</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">My theory is that you have checked out the tests with DOS line endings, and they don't pass that way.<div><br></div><div>This C++11 raw string failure, for example, shows an extra carriage return in the string literal:</div><div>"""</div><div><div>R:\Sources\llvm\tools\clang\test\CodeGen\string-literal.c:91:18: error: expected string not found in input</div><div> // CHECK-CXX11: private unnamed_addr constant [8 x i8] c"abc\0Adef\00", align 1</div><div> ^</div><div><stdin>:23:1: note: scanning from here</div><div>@.str16 = private unnamed_addr constant [9 x i8] c"abc\0D\0Adef\00", align 1</div><div>^</div><div><stdin>:23:11: note: possible intended match here</div><div>@.str16 = private unnamed_addr constant [9 x i8] c"abc\0D\0Adef\00", align 1</div><div> ^</div><div>"""</div><div><br></div><div>Many other tests fail with messages like this:</div><div>error: 'R:\Sources\llvm\tools\clang\test\ARCMT\whitelisted/header1.h.result' is different than 'C:\TEMP\header1.h-5c694d..h'<br></div><div><br></div><div>That suggests that the test compared golden expected test result files with carriage returns with output written by clang, which will probably not have carriage returns.</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 24, 2015 at 9:52 PM, David Bakin <span dir="ltr"><<a href="mailto:davidbak@gmail.com" target="_blank">davidbak@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Thanks for your help. I've got clang built now ... and I'm trying to confirm it works. </div><div><div> </div></div><div>I've built an x64 version using the Visual Studio 2013 toolchain (as I described previously). Following your suggestions I eliminated compiler-rt and left llvm-shlib turned off (for the latter, I didn't know what I was doing when I turned it on).</div><div><div> </div></div><div>The unit tests for clang (built into ...\tools\clang\unittests) all run successfully. I then tried to run tests using the command line "test harness" described <a href="http://clang.llvm.org/hacking.html#testingCommands" target="_blank">here</a> even though I'm not exactly sure what tests these are. The "test harness" required a little tweaking in the cfg files but I got it to run and the summary of results is:</div><div><div> </div></div><blockquote style="margin-right:0px" dir="ltr"><div><font face="monospace,monospace">********************</font></div><font face="monospace,monospace"><div>Unresolved Tests (1):</div></font><div><font face="monospace,monospace"> Clang :: Index/annotate-comments.cpp</font></div><div><font face="monospace,monospace"> Expected Passes : 6460<div> Expected Failures : 20</div><div> Unsupported Tests : 178</div><div> Unresolved Tests : 1</div></font><div><font face="monospace,monospace"> Unexpected Failures: 174</font></div></div></blockquote><div> </div><div>So I'm not sure what this means but it probably isn't good. "Unexpected Failures" seems awfully high - in fact, I assume that any number >0 is bad. </div><div><br></div><div>Any ideas on these failures? (I've attached the log file in case you're interested in looking at it.) Alternatively, are there other ways to test my built Clang? (I'm not sure what I can do without compiler-rt.) Thanks! -- David</div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 24, 2015 at 11:09 AM, Chris Bieneman <span dir="ltr"><<a href="mailto:cbieneman@apple.com" target="_blank">cbieneman@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><br><div><span><blockquote type="cite"><div>On Mar 24, 2015, at 9:30 AM, Reid Kleckner <<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>> wrote:</div><br><div><div style="font:12px/normal Helvetica;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal" dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Mar 23, 2015 at 5:22 PM, David Bakin<span> </span><span dir="ltr"><<a href="mailto:davidbak@gmail.com" target="_blank">davidbak@gmail.com</a>></span><span> </span>wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid"><div dir="ltr"><div>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><div> </div></div><div>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><br></div><div>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></div></span><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><span><br><blockquote type="cite"><div><div style="font:12px/normal Helvetica;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal" dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>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><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid"><div dir="ltr"><div>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><br></div><div>You don't need to build compiler-rt to build a semantic analyzer, so I would remove it from your checkout, honestly.</div><div><br></div><div>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> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid"><div dir="ltr"><div>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"><div></div><div><font face="monospace,monospace">18>LINK : warning LNK4044: unrecognized option '/Oy-'; ignored</font><div><font face="monospace,monospace">18>LINK : warning LNK4044: unrecognized option '/GS-'; ignored</font></div><div><font face="monospace,monospace">18>LINK : warning LNK4044: unrecognized option '/Zi'; ignored</font></div><div><font face="monospace,monospace">18>LINK : warning LNK4044: unrecognized option '/wd4146'; ignored</font></div><div><font face="monospace,monospace">18>LINK : warning LNK4044: unrecognized option '/wd4291'; ignored</font></div><div><font face="monospace,monospace">18>LINK : warning LNK4044: unrecognized option '/wd4391'; ignored</font></div><div><font face="monospace,monospace">18>LINK : warning LNK4044: unrecognized option '/wd4722'; ignored</font></div><div><font face="monospace,monospace">18>LINK : warning LNK4044: unrecognized option '/wd4800'; ignored</font></div><div><font face="monospace,monospace">18>LINK : warning LNK4044: unrecognized option '/GR-'; ignored</font></div></div></blockquote><div> </div><div>What's the fix for that?</div></div></blockquote><div><br></div><div>It's not fixed yet. :) As a workaround, don't build compiler-rt, I don't think you need it.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid"><div dir="ltr"><div>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><div> </div></div><div><blockquote style="margin-right:0px"><div><font><font face="monospace,monospace">CMake Error at tools/llvm-shlib/CMakeLists.txt:48 (message):</font></font></div><font face="monospace,monospace"><div>Auto-generation not implemented for Win32 without GNU utils. Please</div></font><div><font face="monospace,monospace">specify LLVM_EXPORTED_SYMBOL_FILE.</font></div></blockquote><span style="color:rgb(255,0,0)"><div> </div></span><div><span style="color:rgb(255,0,0)">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> </span><a href="http://llvm.org/docs/CMake.html" target="_blank">http://llvm.org/docs/CMake.html</a><span> </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></div></span><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><span><font color="#888888"><div><br></div><div>-Chris</div></font></span><span><br><blockquote type="cite"><div><div style="font:12px/normal Helvetica;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;white-space:normal" dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>Don't enable LLVM_BUILD_LLVM_DYLIB if you don't need it. Maybe we should document how this works better.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid"><div dir="ltr"><div><div><span style="color:rgb(255,0,0)"><div><font>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><font color="#888888"><span><font color="#888888"><div><font></font><br></div><div><font>-- David Bakin</font></div></font></span></font></span></span></div></div></div><br>_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a></blockquote></div></div></div></div></blockquote></span></div><br></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
<br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>