mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
Fix DragonFly build (unsupported).
Thanks to Robin Hahling, Alex Hornung and Joris Giovannangeli.
This commit is contained in:
parent
cb886b5817
commit
4846a714a9
@ -69,7 +69,7 @@ local map_arch = {
|
|||||||
|
|
||||||
local map_os = {
|
local map_os = {
|
||||||
linux = true, windows = true, osx = true, freebsd = true, netbsd = true,
|
linux = true, windows = true, osx = true, freebsd = true, netbsd = true,
|
||||||
openbsd = true, solaris = true,
|
openbsd = true, dragonfly = true, solaris = true,
|
||||||
}
|
}
|
||||||
|
|
||||||
local function checkarg(str, map, err)
|
local function checkarg(str, map, err)
|
||||||
|
@ -194,14 +194,14 @@ static LJ_AINLINE void *CALL_MMAP(size_t size)
|
|||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif LJ_TARGET_OSX || LJ_TARGET_PS4 || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__sun__)
|
#elif LJ_TARGET_OSX || LJ_TARGET_PS4 || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__sun__)
|
||||||
|
|
||||||
/* OSX and FreeBSD mmap() use a naive first-fit linear search.
|
/* OSX and FreeBSD mmap() use a naive first-fit linear search.
|
||||||
** That's perfect for us. Except that -pagezero_size must be set for OSX,
|
** That's perfect for us. Except that -pagezero_size must be set for OSX,
|
||||||
** otherwise the lower 4GB are blocked. And the 32GB RLIMIT_DATA needs
|
** otherwise the lower 4GB are blocked. And the 32GB RLIMIT_DATA needs
|
||||||
** to be reduced to 250MB on FreeBSD.
|
** to be reduced to 250MB on FreeBSD.
|
||||||
*/
|
*/
|
||||||
#if LJ_TARGET_OSX
|
#if LJ_TARGET_OSX || defined(__DragonFly__)
|
||||||
#define MMAP_REGION_START ((uintptr_t)0x10000)
|
#define MMAP_REGION_START ((uintptr_t)0x10000)
|
||||||
#elif LJ_TARGET_PS4
|
#elif LJ_TARGET_PS4
|
||||||
#define MMAP_REGION_START ((uintptr_t)0x4000)
|
#define MMAP_REGION_START ((uintptr_t)0x4000)
|
||||||
@ -238,7 +238,7 @@ static LJ_AINLINE void *CALL_MMAP(size_t size)
|
|||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
if (p != CMFAIL) munmap(p, size);
|
if (p != CMFAIL) munmap(p, size);
|
||||||
#ifdef __sun__
|
#if defined(__sun__) || defined(__DragonFly__)
|
||||||
alloc_hint += 0x1000000; /* Need near-exhaustive linear scan. */
|
alloc_hint += 0x1000000; /* Need near-exhaustive linear scan. */
|
||||||
if (alloc_hint + size < MMAP_REGION_END) continue;
|
if (alloc_hint + size < MMAP_REGION_END) continue;
|
||||||
#endif
|
#endif
|
||||||
|
@ -67,7 +67,8 @@
|
|||||||
#elif defined(__MACH__) && defined(__APPLE__)
|
#elif defined(__MACH__) && defined(__APPLE__)
|
||||||
#define LUAJIT_OS LUAJIT_OS_OSX
|
#define LUAJIT_OS LUAJIT_OS_OSX
|
||||||
#elif (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \
|
#elif (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \
|
||||||
defined(__NetBSD__) || defined(__OpenBSD__)) && !defined(__ORBIS__)
|
defined(__NetBSD__) || defined(__OpenBSD__) || \
|
||||||
|
defined(__DragonFly__)) && !defined(__ORBIS__)
|
||||||
#define LUAJIT_OS LUAJIT_OS_BSD
|
#define LUAJIT_OS LUAJIT_OS_BSD
|
||||||
#elif (defined(__sun__) && defined(__svr4__)) || defined(__CYGWIN__)
|
#elif (defined(__sun__) && defined(__svr4__)) || defined(__CYGWIN__)
|
||||||
#define LUAJIT_OS LUAJIT_OS_POSIX
|
#define LUAJIT_OS LUAJIT_OS_POSIX
|
||||||
|
@ -356,6 +356,8 @@ static const ELFheader elfhdr_template = {
|
|||||||
.eosabi = 2,
|
.eosabi = 2,
|
||||||
#elif defined(__OpenBSD__)
|
#elif defined(__OpenBSD__)
|
||||||
.eosabi = 12,
|
.eosabi = 12,
|
||||||
|
#elif defined(__DragonFly__)
|
||||||
|
.eosabi = 0,
|
||||||
#elif (defined(__sun__) && defined(__svr4__))
|
#elif (defined(__sun__) && defined(__svr4__))
|
||||||
.eosabi = 6,
|
.eosabi = 6,
|
||||||
#else
|
#else
|
||||||
|
Loading…
Reference in New Issue
Block a user