[Lldb-commits] [lldb] r368069 - Various build fixes for lldb on MinGW

Haibo Huang via lldb-commits lldb-commits at lists.llvm.org
Tue Aug 6 11:20:43 PDT 2019


Author: hhb
Date: Tue Aug  6 11:20:43 2019
New Revision: 368069

URL: http://llvm.org/viewvc/llvm-project?rev=368069&view=rev
Log:
Various build fixes for lldb on MinGW

Subscribers: mstorsjo, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D65691

Modified:
    lldb/trunk/include/lldb/Host/windows/PosixApi.h
    lldb/trunk/source/Host/windows/FileSystem.cpp
    lldb/trunk/source/Initialization/SystemInitializerCommon.cpp
    lldb/trunk/tools/driver/Platform.h
    lldb/trunk/tools/lldb-vscode/VSCode.cpp
    lldb/trunk/tools/lldb-vscode/lldb-vscode.cpp

Modified: lldb/trunk/include/lldb/Host/windows/PosixApi.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/windows/PosixApi.h?rev=368069&r1=368068&r2=368069&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Host/windows/PosixApi.h (original)
+++ lldb/trunk/include/lldb/Host/windows/PosixApi.h Tue Aug  6 11:20:43 2019
@@ -45,6 +45,15 @@
 #define S_IRWXG 0
 #define S_IRWXO 0
 
+#ifdef __MINGW32__
+// pyconfig.h typedefs this.  We require python headers to be included before
+// any LLDB headers, but there's no way to prevent python's pid_t definition
+// from leaking, so this is the best option.
+#ifndef NO_PID_T
+#include <sys/types.h>
+#endif
+#endif // __MINGW32__
+
 #ifdef _MSC_VER
 
 // PRIxxx format macros for printf()
@@ -80,12 +89,16 @@ int vasprintf(char **ret, const char *fm
 char *strcasestr(const char *s, const char *find);
 char *realpath(const char *name, char *resolved);
 
+#ifdef _MSC_VER
+
 char *basename(char *path);
 char *dirname(char *path);
 
 int strcasecmp(const char *s1, const char *s2);
 int strncasecmp(const char *s1, const char *s2, size_t n);
 
+#endif // _MSC_VER
+
 // empty functions
 inline int posix_openpt(int flag) { LLVM_BUILTIN_UNREACHABLE; }
 

Modified: lldb/trunk/source/Host/windows/FileSystem.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/windows/FileSystem.cpp?rev=368069&r1=368068&r2=368069&view=diff
==============================================================================
--- lldb/trunk/source/Host/windows/FileSystem.cpp (original)
+++ lldb/trunk/source/Host/windows/FileSystem.cpp Tue Aug  6 11:20:43 2019
@@ -8,6 +8,7 @@
 
 #include "lldb/Host/windows/windows.h"
 
+#include <share.h>
 #include <shellapi.h>
 #include <sys/stat.h>
 #include <sys/types.h>

Modified: lldb/trunk/source/Initialization/SystemInitializerCommon.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Initialization/SystemInitializerCommon.cpp?rev=368069&r1=368068&r2=368069&view=diff
==============================================================================
--- lldb/trunk/source/Initialization/SystemInitializerCommon.cpp (original)
+++ lldb/trunk/source/Initialization/SystemInitializerCommon.cpp Tue Aug  6 11:20:43 2019
@@ -25,6 +25,7 @@
 #if defined(_WIN32)
 #include "Plugins/Process/Windows/Common/ProcessWindowsLog.h"
 #include "lldb/Host/windows/windows.h"
+#include <crtdbg.h>
 #endif
 
 #include "llvm/Support/TargetSelect.h"

Modified: lldb/trunk/tools/driver/Platform.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/driver/Platform.h?rev=368069&r1=368068&r2=368069&view=diff
==============================================================================
--- lldb/trunk/tools/driver/Platform.h (original)
+++ lldb/trunk/tools/driver/Platform.h Tue Aug  6 11:20:43 2019
@@ -15,6 +15,9 @@
 #if defined(_MSC_VER)
 #include <signal.h>
 #endif
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
 #include "lldb/Host/windows/windows.h"
 #include <inttypes.h>
 

Modified: lldb/trunk/tools/lldb-vscode/VSCode.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-vscode/VSCode.cpp?rev=368069&r1=368068&r2=368069&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-vscode/VSCode.cpp (original)
+++ lldb/trunk/tools/lldb-vscode/VSCode.cpp Tue Aug  6 11:20:43 2019
@@ -15,8 +15,10 @@
 #include "llvm/Support/FormatVariadic.h"
 
 #if defined(_WIN32)
+#ifndef __MINGW32__
 #define NOMINMAX
 #include <Windows.h>
+#endif // __MINGW32__
 #include <fcntl.h>
 #include <io.h>
 #endif

Modified: lldb/trunk/tools/lldb-vscode/lldb-vscode.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-vscode/lldb-vscode.cpp?rev=368069&r1=368068&r2=368069&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-vscode/lldb-vscode.cpp (original)
+++ lldb/trunk/tools/lldb-vscode/lldb-vscode.cpp Tue Aug  6 11:20:43 2019
@@ -50,7 +50,9 @@
 #include "VSCode.h"
 
 #if defined(_WIN32)
+#ifndef PATH_MAX
 #define PATH_MAX MAX_PATH
+#endif
 typedef int socklen_t;
 constexpr const char *dev_null_path = "nul";
 




More information about the lldb-commits mailing list