<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Oct 15, 2017 at 10:16 AM, Don Hinton <span dir="ltr"><<a href="mailto:hintonda@gmail.com" target="_blank">hintonda@gmail.com</a>></span> wrote:<br><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 class="gmail_extra"><div class="gmail_quote"><div><div class="gmail-h5">On Sun, Oct 15, 2017 at 10:03 AM, Aaron Ballman <span dir="ltr"><<a href="mailto:aaron@aaronballman.com" target="_blank">aaron@aaronballman.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail-m_1240544034515854370HOEnZb"><div class="gmail-m_1240544034515854370h5">On Sun, Oct 15, 2017 at 12:40 PM, Don Hinton <<a href="mailto:hintonda@gmail.com" target="_blank">hintonda@gmail.com</a>> wrote:<br>
> On Sun, Oct 15, 2017 at 8:34 AM, Aaron Ballman <<a href="mailto:aaron@aaronballman.com" target="_blank">aaron@aaronballman.com</a>><br>
> wrote:<br>
>><br>
>> FWIW, most of the ones I was fixing up were guarded by NDEBUG instead<br>
>> of LLVM_ENABLE_DUMP. Switching to LLVM_ENABLE_DUMP fixed the link<br>
>> errors for me -- the only one I struggled with was<br>
>> AsmMatcherEmitter::run(). But it sounds like you're saying switching<br>
>> the configuration type in MSVC from Debug to Release would have<br>
>> possibly caused issues as well?<br>
><br>
><br>
> This is what I believe is going on -- hope this isn't too convoluted...<br>
><br>
> I don't know how you invoked cmake, but the generators for VS and Xcode<br>
> support multiple configurations, allowing you to delay choosing the build<br>
> type and implicitly setting CMAKE_BUILD_TYPE=None.<br>
><br>
> If CMAKE_BUILD_TYPE isn't passed or doesn't include "debug", CMakeLists.txt<br>
> assumes it's a release build, turns off both asserts and dump methods, and<br>
> generates llvm-config.h without defining LLVM_ENABLE_DUMP. Since my change<br>
> removed the NDEBUG test for most dump definitions, they were #ifdef'd away.<br>
> While it's possible to override this behavior by passing<br>
> -DLLVM_ENABLE_ASSERTIONS or -DLLMV_FORCE_ENABLE_DUMP, you don't seem to have<br>
> done that.<br>
><br>
> So, when a Debug build was later selected, llvm-config.h had already been<br>
> written without defining LLVM_ENABLE_DUMP, and since table-gen didn't have<br>
> the fix, it assumed the dump methods were available when it didn't see<br>
> -DNEBUG on the command line -- hence the linking errors.<br>
><br>
> So, setting LLVM_ENABLE_DUMP at configuration time won't work in this case,<br>
> and I'm leaning toward removing it completely.<br>
<br>
</div></div>Ah, okay, I see what the issue is. Thank you for the explanation!<br>
<span><br>
> Jack's issue involved removing -DNDEBUG in a script for Release builds.<br>
> While it caused the same linking issues you saw, it really didn't have<br>
> anything to do with the configuration issue you uncovered. Had I seen any<br>
> other errors, I would have rolled it back yesterday, but as you've said, the<br>
>bots were clean wrt this change.<br>
<br>
</span>I was surprised that this didn't make any MSVC bots go red. The<br>
default behavior I see is that I run cmake and I get a Debug build<br>
without fiddling with anything in MSVC, unless I specify cmake options<br>
to do a release build.<br></blockquote><div><br></div></div></div><div>Since it creates multiple ones, it must be selecting the Debug configuration by default -- it has to pick something. But that has nothing to do with the cmake variables we set in CMakeList.txt.</div></div></div></div></blockquote><div><br></div><div>Looks like they specify everything explicitly:</div><div><br></div><div><pre style="font-family:"Courier New",courier,monotype,monospace;color:rgb(0,0,0);font-size:medium"><span class="gmail-header" style="color:blue">cmake -G Ninja ../llvm -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLLVM_ENABLE_ASSERTIONS=True -DLLVM_LIT_ARGS='-v' -DCMAKE_INSTALL_PREFIX=../stage1.install -DLLVM_ENABLE_ASSERTIONS=ON
</span></pre></div><div><br></div></div></div></div>