From add8ba353e3308b36cf9a90eb11170b2a151c8e5 Mon Sep 17 00:00:00 2001 From: dzaima Date: Tue, 26 Dec 2023 02:48:47 +0200 Subject: [PATCH] require MAP_FIXED_NOREPLACE on linux for JIT --- src/vm.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/vm.h b/src/vm.h index 4f29c801..9893b63f 100644 --- a/src/vm.h +++ b/src/vm.h @@ -3,7 +3,12 @@ #include #endif -#if defined(JIT_ENABLED)? JIT_ENABLED : ((defined(__x86_64) || defined(__amd64__)) && (__APPLE__ || __MACH__ || __linux__ || __FreeBSD__ || __unix || __unix__) && defined(MAP_32BIT) && MM!=0) +#if defined(JIT_ENABLED)? JIT_ENABLED : ( \ + (defined(__x86_64) || defined(__amd64__)) \ + && (__APPLE__ || __MACH__ || __linux__ || __FreeBSD__ || __unix || __unix__) \ + && (defined(__linux__)? defined(MAP_FIXED_NOREPLACE) : 1) \ + && defined(MAP_32BIT) && MM!=0 \ +) #ifndef JIT_START #define JIT_START 2 // number of calls for when to start JITting. -1: never JIT; 0: JIT everything, n: JIT after n non-JIT invocations; max ¯1+2⋆16 #endif