[Lldb-commits] [lldb] c1709e5 - Set appropriate host defines for building under emscripten

Derek Schuff via lldb-commits lldb-commits at lists.llvm.org
Thu Jun 18 17:02:18 PDT 2020


Author: Derek Schuff
Date: 2020-06-18T17:00:53-07:00
New Revision: c1709e5d90e613917d616a7866ee52cfac311de6

URL: https://github.com/llvm/llvm-project/commit/c1709e5d90e613917d616a7866ee52cfac311de6
DIFF: https://github.com/llvm/llvm-project/commit/c1709e5d90e613917d616a7866ee52cfac311de6.diff

LOG: Set appropriate host defines for building under emscripten

Emscripten has emulations for several headers found on Linux,
including spwan.h and endian.h

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

Added: 
    

Modified: 
    lldb/include/lldb/Host/HostInfo.h
    lldb/source/Host/common/Host.cpp
    llvm/include/llvm/Support/SwapByteOrder.h

Removed: 
    


################################################################################
diff  --git a/lldb/include/lldb/Host/HostInfo.h b/lldb/include/lldb/Host/HostInfo.h
index a9b10aed47c2..b7010d69d88e 100644
--- a/lldb/include/lldb/Host/HostInfo.h
+++ b/lldb/include/lldb/Host/HostInfo.h
@@ -35,7 +35,7 @@
 #if defined(_WIN32)
 #include "lldb/Host/windows/HostInfoWindows.h"
 #define HOST_INFO_TYPE HostInfoWindows
-#elif defined(__linux__)
+#elif defined(__linux__) || defined(__EMSCRIPTEN__)
 #if defined(__ANDROID__)
 #include "lldb/Host/android/HostInfoAndroid.h"
 #define HOST_INFO_TYPE HostInfoAndroid

diff  --git a/lldb/source/Host/common/Host.cpp b/lldb/source/Host/common/Host.cpp
index a5705c92afec..4128fa19c142 100644
--- a/lldb/source/Host/common/Host.cpp
+++ b/lldb/source/Host/common/Host.cpp
@@ -28,7 +28,7 @@
 
 #if defined(__linux__) || defined(__FreeBSD__) ||                              \
     defined(__FreeBSD_kernel__) || defined(__APPLE__) ||                       \
-    defined(__NetBSD__) || defined(__OpenBSD__)
+    defined(__NetBSD__) || defined(__OpenBSD__) || defined(__EMSCRIPTEN__)
 #if !defined(__ANDROID__)
 #include <spawn.h>
 #endif

diff  --git a/llvm/include/llvm/Support/SwapByteOrder.h b/llvm/include/llvm/Support/SwapByteOrder.h
index a9f43735328f..500df2355307 100644
--- a/llvm/include/llvm/Support/SwapByteOrder.h
+++ b/llvm/include/llvm/Support/SwapByteOrder.h
@@ -21,7 +21,8 @@
 #include <stdlib.h>
 #endif
 
-#if defined(__linux__) || defined(__GNU__) || defined(__HAIKU__)
+#if defined(__linux__) || defined(__GNU__) || defined(__HAIKU__) ||            \
+    defined(__EMSCRIPTEN__)
 #include <endian.h>
 #elif defined(_AIX)
 #include <sys/machine.h>


        


More information about the lldb-commits mailing list