diff options
author | Mike Pall <mike> | 2014-10-07 16:17:29 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2014-10-07 16:17:29 +0200 |
commit | 4846a714a9b8e01bac8f9fc1de0eb2a5f00ea79b (patch) | |
tree | 8ec2daae67277bddbafc0c8e3b71a691cb48baba | |
parent | cb886b58176dc5cd969f512d1a633f06d7120941 (diff) | |
download | luajit-4846a714a9b8e01bac8f9fc1de0eb2a5f00ea79b.tar.gz luajit-4846a714a9b8e01bac8f9fc1de0eb2a5f00ea79b.tar.bz2 luajit-4846a714a9b8e01bac8f9fc1de0eb2a5f00ea79b.zip |
Fix DragonFly build (unsupported).
Thanks to Robin Hahling, Alex Hornung and Joris Giovannangeli.
-rw-r--r-- | src/jit/bcsave.lua | 2 | ||||
-rw-r--r-- | src/lj_alloc.c | 6 | ||||
-rw-r--r-- | src/lj_arch.h | 3 | ||||
-rw-r--r-- | src/lj_gdbjit.c | 2 |
4 files changed, 8 insertions, 5 deletions
diff --git a/src/jit/bcsave.lua b/src/jit/bcsave.lua index f55bda97..122bb24b 100644 --- a/src/jit/bcsave.lua +++ b/src/jit/bcsave.lua | |||
@@ -69,7 +69,7 @@ local map_arch = { | |||
69 | 69 | ||
70 | local map_os = { | 70 | local map_os = { |
71 | linux = true, windows = true, osx = true, freebsd = true, netbsd = true, | 71 | linux = true, windows = true, osx = true, freebsd = true, netbsd = true, |
72 | openbsd = true, solaris = true, | 72 | openbsd = true, dragonfly = true, solaris = true, |
73 | } | 73 | } |
74 | 74 | ||
75 | local function checkarg(str, map, err) | 75 | local function checkarg(str, map, err) |
diff --git a/src/lj_alloc.c b/src/lj_alloc.c index facccee5..7c7ec678 100644 --- a/src/lj_alloc.c +++ b/src/lj_alloc.c | |||
@@ -194,14 +194,14 @@ static LJ_AINLINE void *CALL_MMAP(size_t size) | |||
194 | return ptr; | 194 | return ptr; |
195 | } | 195 | } |
196 | 196 | ||
197 | #elif LJ_TARGET_OSX || LJ_TARGET_PS4 || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__sun__) | 197 | #elif LJ_TARGET_OSX || LJ_TARGET_PS4 || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__sun__) |
198 | 198 | ||
199 | /* OSX and FreeBSD mmap() use a naive first-fit linear search. | 199 | /* OSX and FreeBSD mmap() use a naive first-fit linear search. |
200 | ** That's perfect for us. Except that -pagezero_size must be set for OSX, | 200 | ** That's perfect for us. Except that -pagezero_size must be set for OSX, |
201 | ** otherwise the lower 4GB are blocked. And the 32GB RLIMIT_DATA needs | 201 | ** otherwise the lower 4GB are blocked. And the 32GB RLIMIT_DATA needs |
202 | ** to be reduced to 250MB on FreeBSD. | 202 | ** to be reduced to 250MB on FreeBSD. |
203 | */ | 203 | */ |
204 | #if LJ_TARGET_OSX | 204 | #if LJ_TARGET_OSX || defined(__DragonFly__) |
205 | #define MMAP_REGION_START ((uintptr_t)0x10000) | 205 | #define MMAP_REGION_START ((uintptr_t)0x10000) |
206 | #elif LJ_TARGET_PS4 | 206 | #elif LJ_TARGET_PS4 |
207 | #define MMAP_REGION_START ((uintptr_t)0x4000) | 207 | #define MMAP_REGION_START ((uintptr_t)0x4000) |
@@ -238,7 +238,7 @@ static LJ_AINLINE void *CALL_MMAP(size_t size) | |||
238 | return p; | 238 | return p; |
239 | } | 239 | } |
240 | if (p != CMFAIL) munmap(p, size); | 240 | if (p != CMFAIL) munmap(p, size); |
241 | #ifdef __sun__ | 241 | #if defined(__sun__) || defined(__DragonFly__) |
242 | alloc_hint += 0x1000000; /* Need near-exhaustive linear scan. */ | 242 | alloc_hint += 0x1000000; /* Need near-exhaustive linear scan. */ |
243 | if (alloc_hint + size < MMAP_REGION_END) continue; | 243 | if (alloc_hint + size < MMAP_REGION_END) continue; |
244 | #endif | 244 | #endif |
diff --git a/src/lj_arch.h b/src/lj_arch.h index f04da3bf..f1c6e5e0 100644 --- a/src/lj_arch.h +++ b/src/lj_arch.h | |||
@@ -67,7 +67,8 @@ | |||
67 | #elif defined(__MACH__) && defined(__APPLE__) | 67 | #elif defined(__MACH__) && defined(__APPLE__) |
68 | #define LUAJIT_OS LUAJIT_OS_OSX | 68 | #define LUAJIT_OS LUAJIT_OS_OSX |
69 | #elif (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \ | 69 | #elif (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \ |
70 | defined(__NetBSD__) || defined(__OpenBSD__)) && !defined(__ORBIS__) | 70 | defined(__NetBSD__) || defined(__OpenBSD__) || \ |
71 | defined(__DragonFly__)) && !defined(__ORBIS__) | ||
71 | #define LUAJIT_OS LUAJIT_OS_BSD | 72 | #define LUAJIT_OS LUAJIT_OS_BSD |
72 | #elif (defined(__sun__) && defined(__svr4__)) || defined(__CYGWIN__) | 73 | #elif (defined(__sun__) && defined(__svr4__)) || defined(__CYGWIN__) |
73 | #define LUAJIT_OS LUAJIT_OS_POSIX | 74 | #define LUAJIT_OS LUAJIT_OS_POSIX |
diff --git a/src/lj_gdbjit.c b/src/lj_gdbjit.c index 5e7fca1c..d999986e 100644 --- a/src/lj_gdbjit.c +++ b/src/lj_gdbjit.c | |||
@@ -356,6 +356,8 @@ static const ELFheader elfhdr_template = { | |||
356 | .eosabi = 2, | 356 | .eosabi = 2, |
357 | #elif defined(__OpenBSD__) | 357 | #elif defined(__OpenBSD__) |
358 | .eosabi = 12, | 358 | .eosabi = 12, |
359 | #elif defined(__DragonFly__) | ||
360 | .eosabi = 0, | ||
359 | #elif (defined(__sun__) && defined(__svr4__)) | 361 | #elif (defined(__sun__) && defined(__svr4__)) |
360 | .eosabi = 6, | 362 | .eosabi = 6, |
361 | #else | 363 | #else |