From d66ab081bb943bc3f2eeb4940dd34c28e92927d3 Mon Sep 17 00:00:00 2001 From: Lars Kanis Date: Thu, 19 Jan 2023 15:39:58 +0100 Subject: Update libffi to latest master --- ext/ffi_c/libffi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/ffi_c/libffi b/ext/ffi_c/libffi index 5c63b46..ac598b7 160000 --- a/ext/ffi_c/libffi +++ b/ext/ffi_c/libffi @@ -1 +1 @@ -Subproject commit 5c63b463b87d3c06102a4a7f05f395929d9ea79b +Subproject commit ac598b7f5272d536b75f4b3833a4610cf4cd9404 -- cgit v1.2.1 From 55e2b5921b7ca73b8a6b7bfb7f8e0b3889d9a74b Mon Sep 17 00:00:00 2001 From: Lars Kanis Date: Fri, 27 Jan 2023 18:42:58 +0100 Subject: Disable custom trampoline when using libffi closure allocation This is because libffi changed the way how closures are allocated to static trampolines. `codeloc` is an opaque pointer now, to the internal `struct tramp` struct - and not to executable code. The executable code of trampolines is static and no longer written or writable at runtime. --- ext/ffi_c/MethodHandle.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/ffi_c/MethodHandle.c b/ext/ffi_c/MethodHandle.c index d047e10..83f7b77 100644 --- a/ext/ffi_c/MethodHandle.c +++ b/ext/ffi_c/MethodHandle.c @@ -77,7 +77,9 @@ static bool prep_trampoline(void* ctx, void* code, Closure* closure, char* errmsg, size_t errmsgsize); static long trampoline_size(void); -#if defined(__x86_64__) && (defined(__linux__) || defined(__APPLE__)) +#if defined(__x86_64__) && \ + (defined(__linux__) || defined(__APPLE__)) && \ + !USE_FFI_ALLOC # define CUSTOM_TRAMPOLINE 1 #endif -- cgit v1.2.1