mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-17 21:29:02 +00:00
This code is a real mess, but at least get the JIT *building* on platforms
(such as plan 9) without mmap. Of course it won't RUN... but that's another step. :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13839 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -60,6 +60,7 @@ static void *getMemory(unsigned NumBytes) {
|
|||||||
static const long pageSize = sysconf(_SC_PAGESIZE);
|
static const long pageSize = sysconf(_SC_PAGESIZE);
|
||||||
unsigned NumPages = (NumBytes+pageSize-1)/pageSize;
|
unsigned NumPages = (NumBytes+pageSize-1)/pageSize;
|
||||||
|
|
||||||
|
/* FIXME: This should use the proper autoconf flags */
|
||||||
#if defined(i386) || defined(__i386__) || defined(__x86__)
|
#if defined(i386) || defined(__i386__) || defined(__x86__)
|
||||||
/* Linux and *BSD tend to have these flags named differently. */
|
/* Linux and *BSD tend to have these flags named differently. */
|
||||||
#if defined(MAP_ANON) && !defined(MAP_ANONYMOUS)
|
#if defined(MAP_ANON) && !defined(MAP_ANONYMOUS)
|
||||||
@@ -70,8 +71,10 @@ static void *getMemory(unsigned NumBytes) {
|
|||||||
#else
|
#else
|
||||||
std::cerr << "This architecture is not supported by the JIT!\n";
|
std::cerr << "This architecture is not supported by the JIT!\n";
|
||||||
abort();
|
abort();
|
||||||
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_MMAP
|
||||||
int fd = -1;
|
int fd = -1;
|
||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
fd = 0;
|
fd = 0;
|
||||||
@@ -89,6 +92,11 @@ static void *getMemory(unsigned NumBytes) {
|
|||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
return pa;
|
return pa;
|
||||||
|
#else
|
||||||
|
std::cerr << "Do not know how to allocate mem for the JIT without mmap!\n";
|
||||||
|
abort();
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
JITMemoryManager::JITMemoryManager() {
|
JITMemoryManager::JITMemoryManager() {
|
||||||
|
Reference in New Issue
Block a user