summaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine
diff options
context:
space:
mode:
authorBrian Gaeke <gaeke@uiuc.edu>2003-10-11 03:51:18 +0000
committerBrian Gaeke <gaeke@uiuc.edu>2003-10-11 03:51:18 +0000
commit364f86d4dff7ec203afcef6ae09f64c468e57804 (patch)
treeb3572c6e4b7d1873ff778b3de693a87f0e8eee96 /lib/ExecutionEngine
parentab9585f38b432126909d3d0e1f54989cbc352ecf (diff)
downloadllvm-364f86d4dff7ec203afcef6ae09f64c468e57804.tar.gz
llvm-364f86d4dff7ec203afcef6ae09f64c468e57804.tar.bz2
llvm-364f86d4dff7ec203afcef6ae09f64c468e57804.tar.xz
Make mmap's fd for anonymous memory acquisition default to -1, except on
Linux. This is consistent with what FreeBSD and Solaris both want. This makes the JIT work on FreeBSD 5.1-RELEASE. Whee. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9045 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine')
-rw-r--r--lib/ExecutionEngine/JIT/JITEmitter.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/ExecutionEngine/JIT/JITEmitter.cpp b/lib/ExecutionEngine/JIT/JITEmitter.cpp
index 982eadd12f..d25aaa3e4a 100644
--- a/lib/ExecutionEngine/JIT/JITEmitter.cpp
+++ b/lib/ExecutionEngine/JIT/JITEmitter.cpp
@@ -56,13 +56,18 @@ static void *getMemory(unsigned NumBytes) {
#if defined(MAP_ANON) && !defined(MAP_ANONYMOUS)
# define MAP_ANONYMOUS MAP_ANON
#endif /* defined(MAP_ANON) && !defined(MAP_ANONYMOUS) */
-#define fd 0
#elif defined(sparc) || defined(__sparc__) || defined(__sparcv9)
-#define fd -1
+/* nothing */
#else
std::cerr << "This architecture is not supported by the JIT!\n";
abort();
#endif
+
+#if defined(__linux__)
+#define fd 0
+#else
+#define fd -1
+#endif
unsigned mmapFlags = MAP_PRIVATE|MAP_ANONYMOUS;
#ifdef MAP_NORESERVE