<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Dec 21, 2016 at 12:26 PM, William D. Jones <span dir="ltr"><<a href="mailto:thor0505@comcast.net" target="_blank">thor0505@comcast.net</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
We need to fix the build to pass -mbig-obj to the gnu assembler. You can probably use -DCMAKE_CXX_FLAGS=-Wa,-mbigobj to work around the problem.<br>
</blockquote></span>
So officially, Clang builds now require COFF big objects?</blockquote><div><br></div><div>Basically, yes. MSVC has the same limitation, and here are all the places we add /bigobj now:</div><div><br></div><div><div>$ git grep '\/bigobj'</div><div>lib/ASTMatchers/Dynamic/CMakeLists.txt:  set_source_files_properties(Registry.cpp PROPERTIES COMPILE_FLAGS /bigobj)</div><div>lib/Sema/CMakeLists.txt:  set_source_files_properties(SemaExpr.cpp PROPERTIES COMPILE_FLAGS /bigobj)</div><div>test/Driver/cl-options.c:// RUN:    /bigobj \</div><div>unittests/ASTMatchers/CMakeLists.txt:  set_source_files_properties(InternalASTMatchersTest.cpp PROPERTIES COMPILE_FLAGS /bigobj)</div><div>unittests/ASTMatchers/CMakeLists.txt:  set_source_files_properties(NodeMatchersTest.cpp PROPERTIES COMPILE_FLAGS /bigobj)</div><div>unittests/ASTMatchers/CMakeLists.txt:  set_source_files_properties(NarrowingMatchersTest.cpp PROPERTIES COMPILE_FLAGS /bigobj)</div><div>unittests/ASTMatchers/CMakeLists.txt:  set_source_files_properties(ASTTraversalMatchersTest.cpp PROPERTIES COMPILE_FLAGS /bigobj)</div><div>unittests/Tooling/CMakeLists.txt:  set_source_files_properties(RecursiveASTVisitorTest.cpp PROPERTIES COMPILE_FLAGS /bigobj)</div><div>unittests/Tooling/CMakeLists.txt:  set_source_files_properties(RecursiveASTVisitorTestExprVisitor.cpp PROPERTIES COMPILE_FLAGS /bigobj)</div></div><div><br></div><div>The problem is particularly bad on Win64 because every C++ function gets separate .pdata and .xdata sections, although I don't think GCC does separate .debug_* sections for every inline function like MSVC. So, if you get close to 2**16/3 or 21845 functions in one file, it's easy to pass this limit. RecursiveASTVisitor uses CRTP, which makes it pretty easy to hit this limit.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I'd add this flag to the llvm build myself, but my mingw64 build of clang is currently broken for other reasons.<br>
</blockquote></span>
Not that I'm qualified to fix it, but... what's wrong with the build?</blockquote><div><br></div><div>We should pass -mbig-obj so that users don't have to.</div></div></div></div>