ffi 1.12.1 → 1.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.appveyor.yml +3 -0
- data/.github/workflows/ci.yml +64 -0
- data/.travis.yml +19 -5
- data/CHANGELOG.md +47 -0
- data/Gemfile +4 -2
- data/Rakefile +24 -43
- data/ext/ffi_c/Buffer.c +2 -2
- data/ext/ffi_c/Call.c +1 -7
- data/ext/ffi_c/ClosurePool.c +11 -14
- data/ext/ffi_c/Function.c +8 -23
- data/ext/ffi_c/FunctionInfo.c +1 -2
- data/ext/ffi_c/LongDouble.c +5 -3
- data/ext/ffi_c/LongDouble.h +0 -4
- data/ext/ffi_c/MemoryPointer.c +1 -1
- data/ext/ffi_c/MethodHandle.c +18 -24
- data/ext/ffi_c/MethodHandle.h +3 -2
- data/ext/ffi_c/Platform.c +1 -0
- data/ext/ffi_c/Pointer.c +1 -1
- data/ext/ffi_c/Struct.c +47 -51
- data/ext/ffi_c/Struct.h +12 -6
- data/ext/ffi_c/StructLayout.c +20 -14
- data/ext/ffi_c/Thread.c +0 -3
- data/ext/ffi_c/Thread.h +0 -3
- data/ext/ffi_c/compat.h +4 -0
- data/ext/ffi_c/extconf.rb +16 -20
- data/ext/ffi_c/libffi/.travis.yml +4 -0
- data/ext/ffi_c/libffi/.travis/build.sh +4 -0
- data/ext/ffi_c/libffi/Makefile.am +2 -1
- data/ext/ffi_c/libffi/README.md +7 -1
- data/ext/ffi_c/libffi/configure.ac +25 -9
- data/ext/ffi_c/libffi/include/ffi.h.in +8 -0
- data/ext/ffi_c/libffi/libffi.map.in +8 -12
- data/ext/ffi_c/libffi/libtool-version +1 -1
- data/ext/ffi_c/libffi/src/aarch64/ffi.c +6 -0
- data/ext/ffi_c/libffi/src/aarch64/sysv.S +13 -2
- data/ext/ffi_c/libffi/src/closures.c +10 -4
- data/ext/ffi_c/libffi/src/pa/ffi.c +46 -91
- data/ext/ffi_c/libffi/src/pa/ffitarget.h +1 -6
- data/ext/ffi_c/libffi/src/pa/hpux32.S +4 -2
- data/ext/ffi_c/libffi/src/pa/linux.S +4 -2
- data/ext/ffi_c/libffi/src/powerpc/sysv.S +5 -7
- data/ext/ffi_c/libffi/src/x86/ffi.c +7 -4
- data/ext/ffi_c/libffi/src/x86/ffi64.c +10 -8
- data/ext/ffi_c/libffi/src/x86/ffitarget.h +15 -2
- data/ext/ffi_c/libffi/src/x86/ffiw64.c +10 -8
- data/ext/ffi_c/libffi/src/x86/sysv.S +13 -4
- data/ext/ffi_c/libffi/src/x86/unix64.S +58 -2
- data/ext/ffi_c/libffi/src/x86/win64.S +4 -1
- data/ffi.gemspec +1 -1
- data/lib/ffi.rb +10 -2
- data/lib/ffi/library.rb +5 -1
- data/lib/ffi/platform.rb +6 -2
- data/lib/ffi/platform/arm-linux/types.conf +32 -4
- data/lib/ffi/platform/i386-windows/types.conf +26 -79
- data/lib/ffi/platform/powerpc-linux/types.conf +32 -2
- data/lib/ffi/platform/powerpc-openbsd/types.conf +156 -0
- data/lib/ffi/platform/sparcv9-openbsd/types.conf +156 -0
- data/lib/ffi/platform/x86_64-darwin/types.conf +4 -0
- data/lib/ffi/platform/x86_64-dragonflybsd/types.conf +4 -22
- data/lib/ffi/platform/x86_64-linux/types.conf +21 -0
- data/lib/ffi/platform/x86_64-windows/types.conf +10 -78
- data/lib/ffi/pointer.rb +19 -12
- data/lib/ffi/struct.rb +9 -4
- data/lib/ffi/tools/types_generator.rb +2 -0
- data/lib/ffi/version.rb +1 -1
- data/samples/getlogin.rb +1 -1
- data/samples/getpid.rb +1 -1
- data/samples/gettimeofday.rb +8 -8
- data/samples/hello.rb +2 -1
- data/samples/inotify.rb +1 -1
- data/samples/pty.rb +1 -2
- data/samples/qsort.rb +0 -1
- metadata +6 -4
- data/samples/sample_helper.rb +0 -6
data/ext/ffi_c/Struct.h
CHANGED
@@ -34,11 +34,7 @@
|
|
34
34
|
#include "extconf.h"
|
35
35
|
#include "AbstractMemory.h"
|
36
36
|
#include "Type.h"
|
37
|
-
#ifdef RUBY_1_9
|
38
37
|
#include <ruby/st.h>
|
39
|
-
#else
|
40
|
-
#include <st.h>
|
41
|
-
#endif
|
42
38
|
|
43
39
|
#ifdef __cplusplus
|
44
40
|
extern "C" {
|
@@ -73,11 +69,21 @@ extern "C" {
|
|
73
69
|
int size;
|
74
70
|
int align;
|
75
71
|
ffi_type** ffiTypes;
|
76
|
-
|
72
|
+
|
73
|
+
/*
|
74
|
+
* We use the fieldName's minor 8 Bits as index to a 256 entry cache.
|
75
|
+
* This avoids full ruby hash lookups for repeated lookups.
|
76
|
+
*/
|
77
|
+
#define FIELD_CACHE_LOOKUP(this, sym) ( &(this)->cache_row[((sym) >> 8) & 0xff] )
|
78
|
+
|
79
|
+
struct field_cache_entry {
|
80
|
+
VALUE fieldName;
|
81
|
+
StructField *field;
|
82
|
+
} cache_row[0x100];
|
77
83
|
|
78
84
|
/** The number of reference tracking fields in this struct */
|
79
85
|
int referenceFieldCount;
|
80
|
-
|
86
|
+
|
81
87
|
VALUE rbFieldNames;
|
82
88
|
VALUE rbFieldMap;
|
83
89
|
VALUE rbFields;
|
data/ext/ffi_c/StructLayout.c
CHANGED
@@ -138,7 +138,7 @@ struct_field_initialize(int argc, VALUE* argv, VALUE self)
|
|
138
138
|
&& RTEST(rb_funcall2(rbType, rb_intern("reference_required?"), 0, NULL)));
|
139
139
|
break;
|
140
140
|
}
|
141
|
-
|
141
|
+
|
142
142
|
return self;
|
143
143
|
}
|
144
144
|
|
@@ -239,7 +239,7 @@ static VALUE
|
|
239
239
|
struct_field_put(VALUE self, VALUE pointer, VALUE value)
|
240
240
|
{
|
241
241
|
StructField* f;
|
242
|
-
|
242
|
+
|
243
243
|
Data_Get_Struct(self, StructField, f);
|
244
244
|
if (f->memoryOp == NULL) {
|
245
245
|
rb_raise(rb_eArgError, "put not supported for %s", rb_obj_classname(f->rbType));
|
@@ -261,7 +261,7 @@ static VALUE
|
|
261
261
|
function_field_get(VALUE self, VALUE pointer)
|
262
262
|
{
|
263
263
|
StructField* f;
|
264
|
-
|
264
|
+
|
265
265
|
Data_Get_Struct(self, StructField, f);
|
266
266
|
|
267
267
|
return rbffi_Function_NewInstance(f->rbType, (*rbffi_AbstractMemoryOps.pointer->get)(MEMORY(pointer), f->offset));
|
@@ -272,7 +272,7 @@ function_field_get(VALUE self, VALUE pointer)
|
|
272
272
|
* @param [AbstractMemory] pointer pointer to a {Struct}
|
273
273
|
* @param [Function, Proc] proc
|
274
274
|
* @return [Function]
|
275
|
-
* Set a {Function} to memory pointed by +pointer+ as a function.
|
275
|
+
* Set a {Function} to memory pointed by +pointer+ as a function.
|
276
276
|
*
|
277
277
|
* If a Proc is submitted as +proc+, it is automatically transformed to a {Function}.
|
278
278
|
*/
|
@@ -339,19 +339,24 @@ array_field_put(VALUE self, VALUE pointer, VALUE value)
|
|
339
339
|
{
|
340
340
|
StructField* f;
|
341
341
|
ArrayType* array;
|
342
|
-
|
342
|
+
|
343
343
|
|
344
344
|
Data_Get_Struct(self, StructField, f);
|
345
345
|
Data_Get_Struct(f->rbType, ArrayType, array);
|
346
|
-
|
346
|
+
|
347
347
|
if (isCharArray(array) && rb_obj_is_instance_of(value, rb_cString)) {
|
348
348
|
VALUE argv[2];
|
349
349
|
|
350
350
|
argv[0] = INT2FIX(f->offset);
|
351
351
|
argv[1] = value;
|
352
352
|
|
353
|
-
|
354
|
-
|
353
|
+
if (RSTRING_LEN(value) < array->length) {
|
354
|
+
rb_funcall2(pointer, rb_intern("put_string"), 2, argv);
|
355
|
+
} else if (RSTRING_LEN(value) == array->length) {
|
356
|
+
rb_funcall2(pointer, rb_intern("put_bytes"), 2, argv);
|
357
|
+
} else {
|
358
|
+
rb_raise(rb_eIndexError, "String is longer (%ld bytes) than the char array (%d bytes)", RSTRING_LEN(value), array->length);
|
359
|
+
}
|
355
360
|
} else {
|
356
361
|
#ifdef notyet
|
357
362
|
MemoryOp* op;
|
@@ -419,7 +424,6 @@ struct_layout_allocate(VALUE klass)
|
|
419
424
|
layout->rbFieldMap = Qnil;
|
420
425
|
layout->rbFieldNames = Qnil;
|
421
426
|
layout->rbFields = Qnil;
|
422
|
-
layout->fieldSymbolTable = st_init_numtable();
|
423
427
|
layout->base.ffiType = xcalloc(1, sizeof(*layout->base.ffiType));
|
424
428
|
layout->base.ffiType->size = 0;
|
425
429
|
layout->base.ffiType->alignment = 0;
|
@@ -488,7 +492,6 @@ struct_layout_initialize(VALUE self, VALUE fields, VALUE size, VALUE align)
|
|
488
492
|
|
489
493
|
|
490
494
|
layout->ffiTypes[i] = ftype->size > 0 ? ftype : NULL;
|
491
|
-
st_insert(layout->fieldSymbolTable, rbName, rbField);
|
492
495
|
rb_hash_aset(layout->rbFieldMap, rbName, rbField);
|
493
496
|
rb_ary_push(layout->rbFields, rbField);
|
494
497
|
rb_ary_push(layout->rbFieldNames, rbName);
|
@@ -501,14 +504,14 @@ struct_layout_initialize(VALUE self, VALUE fields, VALUE size, VALUE align)
|
|
501
504
|
return self;
|
502
505
|
}
|
503
506
|
|
504
|
-
/*
|
507
|
+
/*
|
505
508
|
* call-seq: [](field)
|
506
509
|
* @param [Symbol] field
|
507
510
|
* @return [StructLayout::Field]
|
508
511
|
* Get a field from the layout.
|
509
512
|
*/
|
510
513
|
static VALUE
|
511
|
-
struct_layout_union_bang(VALUE self)
|
514
|
+
struct_layout_union_bang(VALUE self)
|
512
515
|
{
|
513
516
|
const ffi_type *alignment_types[] = { &ffi_type_sint8, &ffi_type_sint16, &ffi_type_sint32, &ffi_type_sint64,
|
514
517
|
&ffi_type_float, &ffi_type_double, &ffi_type_longdouble, NULL };
|
@@ -602,6 +605,10 @@ struct_layout_mark(StructLayout *layout)
|
|
602
605
|
rb_gc_mark(layout->rbFieldMap);
|
603
606
|
rb_gc_mark(layout->rbFieldNames);
|
604
607
|
rb_gc_mark(layout->rbFields);
|
608
|
+
/* Clear the cache, to be safe from changes of fieldName VALUE by GC.compact.
|
609
|
+
* TODO: Move cache clearing to compactation callback provided by Ruby-2.7+.
|
610
|
+
*/
|
611
|
+
memset(&layout->cache_row, 0, sizeof(layout->cache_row));
|
605
612
|
}
|
606
613
|
|
607
614
|
static void
|
@@ -610,7 +617,6 @@ struct_layout_free(StructLayout *layout)
|
|
610
617
|
xfree(layout->ffiTypes);
|
611
618
|
xfree(layout->base.ffiType);
|
612
619
|
xfree(layout->fields);
|
613
|
-
st_free_table(layout->fieldSymbolTable);
|
614
620
|
xfree(layout);
|
615
621
|
}
|
616
622
|
|
@@ -627,7 +633,7 @@ rbffi_StructLayout_Init(VALUE moduleFFI)
|
|
627
633
|
*/
|
628
634
|
rbffi_StructLayoutClass = rb_define_class_under(moduleFFI, "StructLayout", ffi_Type);
|
629
635
|
rb_global_variable(&rbffi_StructLayoutClass);
|
630
|
-
|
636
|
+
|
631
637
|
/*
|
632
638
|
* Document-class: FFI::StructLayout::Field
|
633
639
|
* A field in a {StructLayout}.
|
data/ext/ffi_c/Thread.c
CHANGED
data/ext/ffi_c/Thread.h
CHANGED
data/ext/ffi_c/compat.h
CHANGED
data/ext/ffi_c/extconf.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
if
|
3
|
+
if RUBY_ENGINE == 'ruby' || RUBY_ENGINE == 'rbx'
|
4
4
|
require 'mkmf'
|
5
5
|
require 'rbconfig'
|
6
6
|
|
@@ -8,14 +8,22 @@ if !defined?(RUBY_ENGINE) || RUBY_ENGINE == 'ruby' || RUBY_ENGINE == 'rbx'
|
|
8
8
|
# We need pkg_config or ffi.h
|
9
9
|
libffi_ok = pkg_config("libffi") ||
|
10
10
|
have_header("ffi.h") ||
|
11
|
-
find_header("ffi.h", "/usr/local/include", "/usr/include/ffi"
|
11
|
+
find_header("ffi.h", "/usr/local/include", "/usr/include/ffi",
|
12
|
+
"/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/ffi",
|
13
|
+
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ffi") ||
|
14
|
+
(find_header("ffi.h", `xcrun --sdk macosx --show-sdk-path`.strip + "/usr/include/ffi") rescue false)
|
12
15
|
|
13
|
-
# Ensure we can link to
|
14
|
-
libffi_ok &&= have_library("ffi", "
|
15
|
-
have_library("libffi", "
|
16
|
+
# Ensure we can link to ffi_prep_closure_loc
|
17
|
+
libffi_ok &&= have_library("ffi", "ffi_prep_closure_loc", [ "ffi.h" ]) ||
|
18
|
+
have_library("libffi", "ffi_prep_closure_loc", [ "ffi.h" ]) ||
|
19
|
+
have_library("libffi-8", "ffi_prep_closure_loc", [ "ffi.h" ])
|
16
20
|
|
17
|
-
|
18
|
-
|
21
|
+
if RbConfig::CONFIG['host_os'] =~ /mswin/
|
22
|
+
have_library('libffi_convenience')
|
23
|
+
have_library('shlwapi')
|
24
|
+
end
|
25
|
+
|
26
|
+
libffi_ok
|
19
27
|
end
|
20
28
|
|
21
29
|
dir_config("ffi_c")
|
@@ -36,14 +44,6 @@ if !defined?(RUBY_ENGINE) || RUBY_ENGINE == 'ruby' || RUBY_ENGINE == 'rbx'
|
|
36
44
|
abort "system libffi is not usable" unless system_libffi_usable?
|
37
45
|
end
|
38
46
|
|
39
|
-
have_header('shlwapi.h')
|
40
|
-
have_func('rb_thread_call_without_gvl') || abort("Ruby C-API function `rb_thread_call_without_gvl` is missing")
|
41
|
-
have_func('ruby_native_thread_p')
|
42
|
-
if RUBY_VERSION >= "2.3.0"
|
43
|
-
# On OSX and Linux ruby_thread_has_gvl_p() is detected but fails at runtime for ruby < 2.3.0
|
44
|
-
have_func('ruby_thread_has_gvl_p')
|
45
|
-
end
|
46
|
-
|
47
47
|
if system_libffi
|
48
48
|
have_func('ffi_prep_cif_var')
|
49
49
|
$defs << "-DHAVE_RAW_API" if have_func("ffi_raw_call") && have_func("ffi_prep_raw_closure")
|
@@ -53,14 +53,10 @@ if !defined?(RUBY_ENGINE) || RUBY_ENGINE == 'ruby' || RUBY_ENGINE == 'rbx'
|
|
53
53
|
end
|
54
54
|
|
55
55
|
$defs << "-DHAVE_EXTCONF_H" if $defs.empty? # needed so create_header works
|
56
|
-
$defs << "-DRUBY_1_9" if RUBY_VERSION >= "1.9.0"
|
57
|
-
$defs << "-DFFI_BUILDING" if RbConfig::CONFIG['host_os'] =~ /mswin/ # for compatibility with newer libffi
|
58
56
|
|
59
57
|
create_header
|
60
|
-
|
61
|
-
$LOCAL_LIBS << " ./libffi/.libs/libffi_convenience.lib" if !system_libffi && RbConfig::CONFIG['host_os'] =~ /mswin/
|
62
|
-
|
63
58
|
create_makefile("ffi_c")
|
59
|
+
|
64
60
|
unless system_libffi
|
65
61
|
File.open("Makefile", "a") do |mf|
|
66
62
|
mf.puts "LIBFFI_HOST=--host=#{RbConfig::CONFIG['host_alias']}" if RbConfig::CONFIG.has_key?("host_alias")
|
@@ -144,7 +144,8 @@ endif
|
|
144
144
|
libffi_version_info = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
|
145
145
|
|
146
146
|
libffi.map: $(top_srcdir)/libffi.map.in
|
147
|
-
$(COMPILE) -D$(TARGET) -
|
147
|
+
$(COMPILE) -D$(TARGET) -DGENERATE_LIBFFI_MAP \
|
148
|
+
-E -x assembler-with-cpp -o $@ $<
|
148
149
|
|
149
150
|
libffi_la_LDFLAGS = -no-undefined $(libffi_version_info) $(libffi_version_script) $(LTLDFLAGS) $(AM_LTLDFLAGS)
|
150
151
|
libffi_la_DEPENDENCIES = $(libffi_la_LIBADD) $(libffi_version_dep)
|
data/ext/ffi_c/libffi/README.md
CHANGED
@@ -4,7 +4,7 @@ Status
|
|
4
4
|
[](https://travis-ci.org/libffi/libffi)
|
5
5
|
[](https://ci.appveyor.com/project/atgreen/libffi)
|
6
6
|
|
7
|
-
libffi-3.
|
7
|
+
libffi-3.4 was released on TBD. Check the libffi web
|
8
8
|
page for updates: <URL:http://sourceware.org/libffi/>.
|
9
9
|
|
10
10
|
|
@@ -196,6 +196,12 @@ History
|
|
196
196
|
|
197
197
|
See the git log for details at http://github.com/libffi/libffi.
|
198
198
|
|
199
|
+
3.4 TBD
|
200
|
+
Add support for Intel Control-flow Enforcement Technology (CET).
|
201
|
+
Add support for ARM Pointer Authentication (PA).
|
202
|
+
Fix 32-bit PPC regression.
|
203
|
+
Fix MIPS soft-float problem.
|
204
|
+
|
199
205
|
3.3 Nov-23-19
|
200
206
|
Add RISC-V support.
|
201
207
|
New API in support of GO closures.
|
@@ -176,6 +176,28 @@ case "$TARGET" in
|
|
176
176
|
;;
|
177
177
|
esac
|
178
178
|
|
179
|
+
AC_CACHE_CHECK([whether compiler supports pointer authentication],
|
180
|
+
libffi_cv_as_ptrauth, [
|
181
|
+
libffi_cv_as_ptrauth=unknown
|
182
|
+
AC_TRY_COMPILE(,[
|
183
|
+
#ifdef __clang__
|
184
|
+
# if __has_feature(ptrauth_calls)
|
185
|
+
# define HAVE_PTRAUTH 1
|
186
|
+
# endif
|
187
|
+
#endif
|
188
|
+
|
189
|
+
#ifndef HAVE_PTRAUTH
|
190
|
+
# error Pointer authentication not supported
|
191
|
+
#endif
|
192
|
+
],
|
193
|
+
[libffi_cv_as_ptrauth=yes],
|
194
|
+
[libffi_cv_as_ptrauth=no])
|
195
|
+
])
|
196
|
+
if test "x$libffi_cv_as_ptrauth" = xyes; then
|
197
|
+
AC_DEFINE(HAVE_PTRAUTH, 1,
|
198
|
+
[Define if your compiler supports pointer authentication.])
|
199
|
+
fi
|
200
|
+
|
179
201
|
# On PaX enable kernels that have MPROTECT enable we can't use PROT_EXEC.
|
180
202
|
AC_ARG_ENABLE(pax_emutramp,
|
181
203
|
[ --enable-pax_emutramp enable pax emulated trampolines, for we can't use PROT_EXEC],
|
@@ -240,17 +262,11 @@ fi
|
|
240
262
|
if test "x$GCC" = "xyes"; then
|
241
263
|
AC_CACHE_CHECK([whether .eh_frame section should be read-only],
|
242
264
|
libffi_cv_ro_eh_frame, [
|
243
|
-
libffi_cv_ro_eh_frame=
|
265
|
+
libffi_cv_ro_eh_frame=yes
|
244
266
|
echo 'extern void foo (void); void bar (void) { foo (); foo (); }' > conftest.c
|
245
267
|
if $CC $CFLAGS -c -fpic -fexceptions -o conftest.o conftest.c > /dev/null 2>&1; then
|
246
|
-
|
247
|
-
|
248
|
-
if test "x$libffi_eh_frame_line" != "x"; then
|
249
|
-
libffi_test_line=`expr $libffi_eh_frame_line + 1`p
|
250
|
-
sed -n $libffi_test_line conftest.dump > conftest.line
|
251
|
-
if grep READONLY conftest.line > /dev/null; then
|
252
|
-
libffi_cv_ro_eh_frame=yes
|
253
|
-
fi
|
268
|
+
if readelf -WS conftest.o | grep -q -n 'eh_frame .* WA'; then
|
269
|
+
libffi_cv_ro_eh_frame=no
|
254
270
|
fi
|
255
271
|
fi
|
256
272
|
rm -f conftest.*
|
@@ -330,6 +330,14 @@ typedef struct {
|
|
330
330
|
FFI_API void *ffi_closure_alloc (size_t size, void **code);
|
331
331
|
FFI_API void ffi_closure_free (void *);
|
332
332
|
|
333
|
+
#if defined(PA_LINUX) || defined(PA_HPUX)
|
334
|
+
#define FFI_CLOSURE_PTR(X) ((void *)((unsigned int)(X) | 2))
|
335
|
+
#define FFI_RESTORE_PTR(X) ((void *)((unsigned int)(X) & ~3))
|
336
|
+
#else
|
337
|
+
#define FFI_CLOSURE_PTR(X) (X)
|
338
|
+
#define FFI_RESTORE_PTR(X) (X)
|
339
|
+
#endif
|
340
|
+
|
333
341
|
FFI_API ffi_status
|
334
342
|
ffi_prep_closure (ffi_closure*,
|
335
343
|
ffi_cif *,
|
@@ -6,7 +6,7 @@
|
|
6
6
|
/* These version numbers correspond to the libtool-version abi numbers,
|
7
7
|
not to the libffi release numbers. */
|
8
8
|
|
9
|
-
|
9
|
+
LIBFFI_BASE_8.0 {
|
10
10
|
global:
|
11
11
|
/* Exported data variables. */
|
12
12
|
ffi_type_void;
|
@@ -38,27 +38,23 @@ LIBFFI_BASE_7.0 {
|
|
38
38
|
ffi_java_raw_to_ptrarray;
|
39
39
|
ffi_java_raw_size;
|
40
40
|
|
41
|
+
ffi_get_struct_offsets;
|
41
42
|
local:
|
42
43
|
*;
|
43
44
|
};
|
44
45
|
|
45
|
-
LIBFFI_BASE_7.1 {
|
46
|
-
global:
|
47
|
-
ffi_get_struct_offsets;
|
48
|
-
} LIBFFI_BASE_7.0;
|
49
|
-
|
50
46
|
#ifdef FFI_TARGET_HAS_COMPLEX_TYPE
|
51
|
-
|
47
|
+
LIBFFI_COMPLEX_8.0 {
|
52
48
|
global:
|
53
49
|
/* Exported data variables. */
|
54
50
|
ffi_type_complex_float;
|
55
51
|
ffi_type_complex_double;
|
56
52
|
ffi_type_complex_longdouble;
|
57
|
-
}
|
53
|
+
} LIBFFI_BASE_8.0;
|
58
54
|
#endif
|
59
55
|
|
60
56
|
#if FFI_CLOSURES
|
61
|
-
|
57
|
+
LIBFFI_CLOSURE_8.0 {
|
62
58
|
global:
|
63
59
|
ffi_closure_alloc;
|
64
60
|
ffi_closure_free;
|
@@ -68,13 +64,13 @@ LIBFFI_CLOSURE_7.0 {
|
|
68
64
|
ffi_prep_raw_closure_loc;
|
69
65
|
ffi_prep_java_raw_closure;
|
70
66
|
ffi_prep_java_raw_closure_loc;
|
71
|
-
}
|
67
|
+
} LIBFFI_BASE_8.0;
|
72
68
|
#endif
|
73
69
|
|
74
70
|
#if FFI_GO_CLOSURES
|
75
|
-
|
71
|
+
LIBFFI_GO_CLOSURE_8.0 {
|
76
72
|
global:
|
77
73
|
ffi_call_go;
|
78
74
|
ffi_prep_go_closure;
|
79
|
-
}
|
75
|
+
} LIBFFI_CLOSURE_8.0;
|
80
76
|
#endif
|
@@ -62,6 +62,9 @@ struct call_context
|
|
62
62
|
#if FFI_EXEC_TRAMPOLINE_TABLE
|
63
63
|
|
64
64
|
#ifdef __MACH__
|
65
|
+
#ifdef HAVE_PTRAUTH
|
66
|
+
#include <ptrauth.h>
|
67
|
+
#endif
|
65
68
|
#include <mach/vm_param.h>
|
66
69
|
#endif
|
67
70
|
|
@@ -789,6 +792,9 @@ ffi_prep_closure_loc (ffi_closure *closure,
|
|
789
792
|
|
790
793
|
#if FFI_EXEC_TRAMPOLINE_TABLE
|
791
794
|
#ifdef __MACH__
|
795
|
+
#ifdef HAVE_PTRAUTH
|
796
|
+
codeloc = ptrauth_strip (codeloc, ptrauth_key_asia);
|
797
|
+
#endif
|
792
798
|
void **config = (void **)((uint8_t *)codeloc - PAGE_MAX_SIZE);
|
793
799
|
config[0] = closure;
|
794
800
|
config[1] = start;
|