Skip to content

Commit

Permalink
Make LuaJIT function on OmniOS.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
postwait committed Mar 10, 2013
1 parent acfc75d commit c49b4e0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/LuaJIT/src/lj_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <sys/resource.h>
#define MMAP_REGION_START ((uintptr_t)0x10000000)
#else
Expand Down
2 changes: 1 addition & 1 deletion src/LuaJIT/src/vm_x86.dasc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c49b4e0

Please sign in to comment.