[Lldb-commits] [PATCH] D18519: Allow building LLDB on Windows with MinGW 64/4.9.2 and later

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Tue Mar 29 07:16:17 PDT 2016

labath added inline comments.

Comment at: CMakeLists.txt:3
@@ -2,1 +2,3 @@
+    # force debugging info into lldb sources
eran.ifrah wrote:
> labath wrote:
> > Why do we need this? Why is `-DCMAKE_BUILD_TYPE=Debug` not sufficient?
> No. As I mentioned in my previous comment the object file generated are too big for as.exe to handle
> and it aborts. This results from Clang files (not LLDB). As a workaround and I added this command line directive to be able to produce debug builds of LLDB so I can actually debug them and provide some more insights if needed
Sorry, I came late to the discussion and I did not catch that.

This sounds like the same problem clang is having with MSVC on windows. For MSVC, it is possible to fix this by specifying the `/bigobj` flag to the compiler (see clang/lib/ASTMatchers/Dynamic/CMakeLists.txt). A quick search <https://sourceforge.net/p/mingw-w64/bugs/341/> seems to indicate that the same solution could be applied to mingw as well. Could see if you could make that work instead?

Comment at: cmake/modules/LLDBConfig.cmake:224
@@ -223,2 +223,3 @@
 # Disable Clang warnings
eran.ifrah wrote:
> labath wrote:
> > Why is this necessary? The whole purpose `check_cxx_compiler_flag` is to check whether a compiler supports some flag. Hardcoding the check ourselves makes that kinda pointless. What error were you getting here?
> Tons of warnings about unrecognized command line directive (or something similar) - can't remember the exact warning message - but its something like this. If really need to know the warning message, I can re-compile without this change
Ok, so it seems the problem is that this check will not work because most compilers will not treat an unknown -W flag as a fatal error. The trick seems to be to pass `-Werror` as well to force a non-zero exit (see llvm/cmake/modules/HandleLLVMOptions.cmake). Perhaps you could do the same here?


More information about the lldb-commits mailing list