From c49b4e0f7b9ad7e42098ed7407bd0bf7a59be848 Mon Sep 17 00:00:00 2001 From: Theo Schlossnagle Date: Sun, 10 Mar 2013 15:23:22 +0000 Subject: [PATCH] Make LuaJIT function on OmniOS. OmniOS should take the same approach as the BSDs for allocating within the 4GB boundary. This won't fix evil stack issues, but emperically they seem easy to avoid. Additionally, our toolchain appears to want eh_frame in the amd64 unwind section with only alloc flags. --- .gitignore | 1 + src/LuaJIT/src/lj_alloc.c | 4 ++-- src/LuaJIT/src/vm_x86.dasc | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 7a7c1f134..db8ed6403 100644 --- a/.gitignore +++ b/.gitignore @@ -42,6 +42,7 @@ src/scripts/noit-config src/udns/udns_codes.c src/utils/dtrace_probes.h src/LuaJIT/lib/vmdef.lua +src/LuaJIT/src/jit/vmdef.lua src/LuaJIT/src/buildvm src/LuaJIT/src/lj_bcdef.h src/LuaJIT/src/lj_ffdef.h diff --git a/src/LuaJIT/src/lj_alloc.c b/src/LuaJIT/src/lj_alloc.c index 82b4e5b16..9e8b338e1 100644 --- a/src/LuaJIT/src/lj_alloc.c +++ b/src/LuaJIT/src/lj_alloc.c @@ -188,14 +188,14 @@ static LJ_AINLINE void *CALL_MMAP(size_t size) return ptr; } -#elif LJ_TARGET_OSX || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) +#elif LJ_TARGET_OSX || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) || defined(__sun__) /* 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, ** otherwise the lower 4GB are blocked. And the 32GB RLIMIT_DATA needs ** to be reduced to 250MB on FreeBSD. */ -#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) || defined(__sun__) #include #define MMAP_REGION_START ((uintptr_t)0x10000000) #else diff --git a/src/LuaJIT/src/vm_x86.dasc b/src/LuaJIT/src/vm_x86.dasc index b4674e2ba..28bdf5074 100644 --- a/src/LuaJIT/src/vm_x86.dasc +++ b/src/LuaJIT/src/vm_x86.dasc @@ -6152,7 +6152,7 @@ static void emit_asm_debug(BuildCtx *ctx) ".LEFDE1:\n\n", (int)ctx->codesz - fcofs); #endif #if (defined(__sun__) && defined(__svr4__)) - fprintf(ctx->fp, "\t.section .eh_frame,\"aw\",@progbits\n"); + fprintf(ctx->fp, "\t.section .eh_frame,\"a\",@unwind\n"); #else fprintf(ctx->fp, "\t.section .eh_frame,\"a\",@progbits\n"); #endif