[PATCH] D82121: Set appropriate host defines for building under emscripten
Derek Schuff via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 18 13:08:48 PDT 2020
dschuff created this revision.
Herald added subscribers: llvm-commits, lldb-commits, aheejin, krytarowski.
Herald added projects: LLDB, LLVM.
Emscripten has emulations for several headers found on Linux,
including spwan.h and endian.h
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D82121
Files:
lldb/include/lldb/Host/HostInfo.h
lldb/source/Host/common/Host.cpp
llvm/include/llvm/Support/SwapByteOrder.h
Index: llvm/include/llvm/Support/SwapByteOrder.h
===================================================================
--- llvm/include/llvm/Support/SwapByteOrder.h
+++ 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>
Index: lldb/source/Host/common/Host.cpp
===================================================================
--- lldb/source/Host/common/Host.cpp
+++ 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
Index: lldb/include/lldb/Host/HostInfo.h
===================================================================
--- lldb/include/lldb/Host/HostInfo.h
+++ 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82121.271822.patch
Type: text/x-patch
Size: 1554 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200618/4c186cdd/attachment.bin>
More information about the llvm-commits
mailing list