ffi 1.10.0 → 1.13.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{appveyor.yml → .appveyor.yml} +9 -1
- data/.github/workflows/ci.yml +64 -0
- data/.gitignore +3 -0
- data/.gitmodules +1 -0
- data/.travis.yml +35 -20
- data/CHANGELOG.md +124 -0
- data/Gemfile +6 -4
- data/README.md +29 -17
- data/Rakefile +29 -120
- data/ext/ffi_c/AbstractMemory.c +5 -9
- data/ext/ffi_c/Buffer.c +2 -2
- data/ext/ffi_c/Call.c +14 -41
- data/ext/ffi_c/Call.h +4 -7
- data/ext/ffi_c/ClosurePool.c +11 -14
- data/ext/ffi_c/DynamicLibrary.c +1 -1
- data/ext/ffi_c/Function.c +18 -117
- data/ext/ffi_c/FunctionInfo.c +1 -2
- data/ext/ffi_c/LongDouble.c +12 -10
- 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 -47
- 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 +4 -223
- data/ext/ffi_c/Thread.h +0 -14
- data/ext/ffi_c/Type.c +0 -18
- data/ext/ffi_c/Type.h +0 -1
- data/ext/ffi_c/Types.c +1 -1
- data/ext/ffi_c/Variadic.c +9 -15
- data/ext/ffi_c/compat.h +4 -0
- data/ext/ffi_c/extconf.rb +36 -26
- data/ext/ffi_c/ffi.c +3 -8
- data/ext/ffi_c/libffi.darwin.mk +1 -1
- data/ext/ffi_c/libffi/.appveyor.yml +29 -13
- data/ext/ffi_c/libffi/.gitattributes +4 -0
- data/ext/ffi_c/libffi/.travis.yml +51 -2
- data/ext/ffi_c/libffi/.travis/bfin-sim.exp +58 -0
- data/ext/ffi_c/libffi/.travis/build-cross-in-container.sh +14 -0
- data/ext/ffi_c/libffi/.travis/build-in-container.sh +12 -0
- data/ext/ffi_c/libffi/.travis/build.sh +116 -8
- data/ext/ffi_c/libffi/.travis/install.sh +65 -16
- data/ext/ffi_c/libffi/.travis/m32r-sim.exp +58 -0
- data/ext/ffi_c/libffi/.travis/or1k-sim.exp +58 -0
- data/ext/ffi_c/libffi/.travis/powerpc-eabisim.exp +58 -0
- data/ext/ffi_c/libffi/.travis/site.exp +10 -1
- data/ext/ffi_c/libffi/.travis/wine-sim.exp +55 -0
- data/ext/ffi_c/libffi/{ChangeLog.libffi-3.1 → ChangeLog.old} +1407 -0
- data/ext/ffi_c/libffi/LICENSE +1 -1
- data/ext/ffi_c/libffi/LICENSE-BUILDTOOLS +5 -4
- data/ext/ffi_c/libffi/Makefile.am +35 -41
- data/ext/ffi_c/libffi/README.md +29 -8
- data/ext/ffi_c/libffi/configure.ac +31 -11
- data/ext/ffi_c/libffi/configure.host +26 -9
- data/ext/ffi_c/libffi/generate-darwin-source-and-headers.py +1 -3
- data/ext/ffi_c/libffi/include/ffi.h.in +19 -7
- data/ext/ffi_c/libffi/include/ffi_common.h +5 -1
- data/ext/ffi_c/libffi/libffi.map.in +8 -12
- data/ext/ffi_c/libffi/libffi.xcodeproj/project.pbxproj +2 -48
- data/ext/ffi_c/libffi/libtool-version +1 -1
- data/ext/ffi_c/libffi/m4/asmcfi.m4 +1 -1
- data/ext/ffi_c/libffi/m4/ax_append_flag.m4 +5 -26
- data/ext/ffi_c/libffi/m4/ax_check_compile_flag.m4 +5 -26
- data/ext/ffi_c/libffi/m4/ax_compiler_vendor.m4 +2 -1
- data/ext/ffi_c/libffi/m4/ax_configure_args.m4 +5 -26
- data/ext/ffi_c/libffi/m4/ax_gcc_archflag.m4 +7 -3
- data/ext/ffi_c/libffi/make_sunver.pl +333 -0
- data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.sln +33 -0
- data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj +130 -0
- data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj.filters +57 -0
- data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj.user +4 -0
- data/ext/ffi_c/libffi/msvc_build/aarch64/aarch64_include/ffi.h +511 -0
- data/ext/ffi_c/libffi/msvcc.sh +27 -2
- data/ext/ffi_c/libffi/src/aarch64/ffi.c +132 -58
- data/ext/ffi_c/libffi/src/aarch64/ffitarget.h +13 -2
- data/ext/ffi_c/libffi/src/aarch64/sysv.S +21 -8
- data/ext/ffi_c/libffi/src/aarch64/win64_armasm.S +506 -0
- data/ext/ffi_c/libffi/src/arm/ffi.c +40 -5
- data/ext/ffi_c/libffi/src/arm/ffitarget.h +8 -1
- data/ext/ffi_c/libffi/src/arm/sysv.S +2 -0
- data/ext/ffi_c/libffi/src/arm/sysv_msvc_arm32.S +311 -0
- data/ext/ffi_c/libffi/src/closures.c +51 -13
- data/ext/ffi_c/libffi/src/frv/ffi.c +1 -1
- data/ext/ffi_c/libffi/src/metag/ffi.c +1 -1
- data/ext/ffi_c/libffi/src/mips/o32.S +2 -0
- data/ext/ffi_c/libffi/src/moxie/ffi.c +1 -1
- 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 +27 -4
- data/ext/ffi_c/libffi/src/powerpc/ffi.c +6 -4
- data/ext/ffi_c/libffi/src/powerpc/ffi_linux64.c +211 -32
- data/ext/ffi_c/libffi/src/powerpc/ffi_powerpc.h +18 -7
- data/ext/ffi_c/libffi/src/powerpc/ffitarget.h +10 -4
- data/ext/ffi_c/libffi/src/powerpc/linux64.S +83 -28
- data/ext/ffi_c/libffi/src/powerpc/linux64_closure.S +68 -4
- data/ext/ffi_c/libffi/src/powerpc/sysv.S +5 -7
- data/ext/ffi_c/libffi/src/prep_cif.c +4 -2
- data/ext/ffi_c/libffi/src/riscv/ffi.c +42 -6
- data/ext/ffi_c/libffi/src/riscv/ffitarget.h +1 -0
- data/ext/ffi_c/libffi/src/riscv/sysv.S +86 -7
- data/ext/ffi_c/libffi/src/x86/ffi.c +21 -10
- data/ext/ffi_c/libffi/src/x86/ffi64.c +15 -11
- data/ext/ffi_c/libffi/src/x86/ffitarget.h +15 -2
- data/ext/ffi_c/libffi/src/x86/ffiw64.c +15 -10
- data/ext/ffi_c/libffi/src/x86/sysv.S +103 -8
- data/ext/ffi_c/libffi/src/x86/sysv_intel.S +995 -0
- data/ext/ffi_c/libffi/src/x86/unix64.S +99 -2
- data/ext/ffi_c/libffi/src/x86/win64.S +9 -1
- data/ext/ffi_c/libffi/testsuite/Makefile.am +114 -109
- data/ext/ffi_c/libffi/testsuite/lib/libffi.exp +26 -22
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/bhaible.exp +7 -2
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-call.c +1 -1
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-callback.c +1 -1
- data/ext/ffi_c/libffi/testsuite/libffi.call/call.exp +12 -1
- data/ext/ffi_c/libffi/testsuite/libffi.call/float2.c +9 -8
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c +1 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/closure.exp +67 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn0.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn1.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn2.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn3.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn4.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn5.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn6.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_loc_fn0.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_simple.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_12byte.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_16byte.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_18byte.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_19byte.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_1_1byte.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_20byte.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_20byte1.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_24byte.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_2byte.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3_1byte.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3byte1.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3byte2.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3float.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_4_1byte.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_4byte.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_5_1_byte.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_5byte.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_64byte.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_6_1_byte.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_6byte.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_7_1_byte.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_7byte.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_8byte.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_9byte1.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_9byte2.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_double.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_float.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble_split.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble_split2.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_pointer.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint16.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint32.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint64.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint16.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint32.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint64.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_dbls_struct.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_double.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_double_va.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_float.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_longdouble.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_longdouble_va.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_many_mixed_args.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_many_mixed_float_double.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_schar.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_sshort.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_sshortchar.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_uchar.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_ushort.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_ushortchar.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_pointer.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_pointer_stack.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_schar.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_sint.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_sshort.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_struct_va1.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uchar.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uchar_va.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uint.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uint_va.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ulong_va.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ulonglong.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ushort.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ushort_va.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/err_bad_abi.c +0 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/ffitest.h +138 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/huge_struct.c +1 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct1.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct10.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct11.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct2.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct3.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct4.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct5.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct6.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct7.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct8.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct9.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/problem1.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_large.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_large2.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_medium.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_medium2.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/testclosure.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/unwindtest.cc +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/unwindtest_ffi_call.cc +0 -0
- data/ext/ffi_c/rbffi.h +0 -2
- data/ffi.gemspec +12 -5
- data/lib/ffi.rb +10 -2
- data/lib/ffi/data_converter.rb +67 -0
- data/lib/ffi/ffi.rb +2 -0
- data/lib/ffi/library.rb +10 -6
- data/lib/ffi/platform.rb +12 -3
- data/lib/ffi/platform/aarch64-freebsd/types.conf +89 -89
- data/lib/ffi/platform/aarch64-freebsd12/types.conf +89 -89
- data/lib/ffi/platform/aarch64-linux/types.conf +81 -81
- data/lib/ffi/platform/arm-freebsd/types.conf +87 -87
- data/lib/ffi/platform/arm-freebsd12/types.conf +87 -87
- data/lib/ffi/platform/arm-linux/types.conf +110 -82
- data/lib/ffi/platform/i386-cygwin/types.conf +1 -1
- data/lib/ffi/platform/i386-darwin/types.conf +63 -63
- data/lib/ffi/platform/i386-freebsd/types.conf +87 -87
- data/lib/ffi/platform/i386-freebsd12/types.conf +87 -87
- data/lib/ffi/platform/i386-gnu/types.conf +84 -84
- data/lib/ffi/platform/i386-linux/types.conf +77 -77
- data/lib/ffi/platform/i386-netbsd/types.conf +87 -87
- data/lib/ffi/platform/i386-openbsd/types.conf +89 -89
- data/lib/ffi/platform/i386-solaris/types.conf +96 -96
- data/lib/ffi/platform/i386-windows/types.conf +43 -96
- data/lib/ffi/platform/ia64-linux/types.conf +79 -79
- data/lib/ffi/platform/mips-linux/types.conf +79 -79
- data/lib/ffi/platform/mips64-linux/types.conf +81 -81
- data/lib/ffi/platform/mips64el-linux/types.conf +81 -81
- data/lib/ffi/platform/mipsel-linux/types.conf +79 -79
- data/lib/ffi/platform/mipsisa32r6-linux/types.conf +79 -79
- data/lib/ffi/platform/mipsisa32r6el-linux/types.conf +79 -79
- data/lib/ffi/platform/mipsisa64r6-linux/types.conf +81 -81
- data/lib/ffi/platform/mipsisa64r6el-linux/types.conf +81 -81
- data/lib/ffi/platform/powerpc-aix/types.conf +155 -155
- data/lib/ffi/platform/powerpc-darwin/types.conf +63 -63
- data/lib/ffi/platform/powerpc-linux/types.conf +108 -78
- data/lib/ffi/platform/powerpc-openbsd/types.conf +156 -0
- data/lib/ffi/platform/powerpc64-linux/types.conf +81 -81
- data/lib/ffi/platform/s390-linux/types.conf +79 -79
- data/lib/ffi/platform/s390x-linux/types.conf +79 -79
- data/lib/ffi/platform/sparc-linux/types.conf +79 -79
- data/lib/ffi/platform/sparc-solaris/types.conf +103 -103
- data/lib/ffi/platform/sparc64-linux/types.conf +79 -79
- data/lib/ffi/platform/sparcv9-openbsd/types.conf +156 -0
- data/lib/ffi/platform/sparcv9-solaris/types.conf +103 -103
- data/lib/ffi/platform/x86_64-cygwin/types.conf +1 -1
- data/lib/ffi/platform/x86_64-darwin/types.conf +88 -84
- data/lib/ffi/platform/x86_64-dragonflybsd/types.conf +130 -0
- data/lib/ffi/platform/x86_64-freebsd/types.conf +89 -89
- data/lib/ffi/platform/x86_64-freebsd12/types.conf +139 -109
- data/lib/ffi/platform/x86_64-linux/types.conf +107 -77
- data/lib/ffi/platform/x86_64-netbsd/types.conf +89 -89
- data/lib/ffi/platform/x86_64-openbsd/types.conf +86 -86
- data/lib/ffi/platform/x86_64-solaris/types.conf +96 -96
- data/lib/ffi/platform/x86_64-windows/types.conf +42 -110
- data/lib/ffi/pointer.rb +20 -13
- data/lib/ffi/struct.rb +13 -68
- data/lib/ffi/struct_by_reference.rb +72 -0
- data/lib/ffi/struct_layout.rb +96 -0
- data/lib/ffi/tools/const_generator.rb +5 -4
- data/lib/ffi/tools/generator.rb +47 -2
- data/lib/ffi/tools/generator_task.rb +13 -17
- data/lib/ffi/tools/struct_generator.rb +4 -4
- data/lib/ffi/tools/types_generator.rb +7 -4
- data/lib/ffi/types.rb +1 -1
- 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 +141 -116
- data/ext/ffi_c/DataConverter.c +0 -91
- data/ext/ffi_c/StructByReference.c +0 -190
- data/ext/ffi_c/StructByReference.h +0 -50
- data/ext/ffi_c/libffi/ChangeLog.libffi +0 -584
- data/ext/ffi_c/libffi/ChangeLog.libgcj +0 -40
- data/ext/ffi_c/libffi/ChangeLog.v1 +0 -764
- data/samples/sample_helper.rb +0 -6
data/ext/ffi_c/libffi/msvcc.sh
CHANGED
@@ -60,7 +60,7 @@ do
|
|
60
60
|
case $1
|
61
61
|
in
|
62
62
|
--verbose)
|
63
|
-
|
63
|
+
verbose=1
|
64
64
|
shift 1
|
65
65
|
;;
|
66
66
|
--version)
|
@@ -80,6 +80,16 @@ do
|
|
80
80
|
safeseh=
|
81
81
|
shift 1
|
82
82
|
;;
|
83
|
+
-marm)
|
84
|
+
ml='armasm'
|
85
|
+
safeseh=
|
86
|
+
shift 1
|
87
|
+
;;
|
88
|
+
-marm64)
|
89
|
+
ml='armasm64'
|
90
|
+
safeseh=
|
91
|
+
shift 1
|
92
|
+
;;
|
83
93
|
-clang-cl)
|
84
94
|
cl="clang-cl"
|
85
95
|
shift 1
|
@@ -237,6 +247,7 @@ do
|
|
237
247
|
else
|
238
248
|
output="-Fe$2"
|
239
249
|
fi
|
250
|
+
armasm_output="-o $2"
|
240
251
|
if [ -n "$assembly" ]; then
|
241
252
|
args="$args $output"
|
242
253
|
else
|
@@ -289,13 +300,27 @@ if [ -n "$assembly" ]; then
|
|
289
300
|
fi
|
290
301
|
ppsrc="$outdir/$(basename $src|sed 's/.S$/.asm/g')"
|
291
302
|
|
303
|
+
if [ $ml = "armasm" ]; then
|
304
|
+
defines="$defines -D_M_ARM"
|
305
|
+
fi
|
306
|
+
|
307
|
+
if [ $ml = "armasm64" ]; then
|
308
|
+
defines="$defines -D_M_ARM64"
|
309
|
+
fi
|
310
|
+
|
292
311
|
if test -n "$verbose"; then
|
293
312
|
echo "$cl -nologo -EP $includes $defines $src > $ppsrc"
|
294
313
|
fi
|
295
314
|
|
296
315
|
"$cl" -nologo -EP $includes $defines $src > $ppsrc || exit $?
|
297
316
|
output="$(echo $output | sed 's%/F[dpa][^ ]*%%g')"
|
298
|
-
|
317
|
+
if [ $ml = "armasm" ]; then
|
318
|
+
args="-nologo -g -oldit $armasm_output $ppsrc -errorReport:prompt"
|
319
|
+
elif [ $ml = "armasm64" ]; then
|
320
|
+
args="-nologo -g $armasm_output $ppsrc -errorReport:prompt"
|
321
|
+
else
|
322
|
+
args="-nologo $safeseh $single $output $ppsrc"
|
323
|
+
fi
|
299
324
|
|
300
325
|
if test -n "$verbose"; then
|
301
326
|
echo "$ml $args"
|
@@ -19,6 +19,7 @@ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
19
19
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
20
20
|
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
21
21
|
|
22
|
+
#if defined(__aarch64__) || defined(__arm64__)|| defined (_M_ARM64)
|
22
23
|
#include <stdio.h>
|
23
24
|
#include <stdlib.h>
|
24
25
|
#include <stdint.h>
|
@@ -26,6 +27,9 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
|
26
27
|
#include <ffi.h>
|
27
28
|
#include <ffi_common.h>
|
28
29
|
#include "internal.h"
|
30
|
+
#ifdef _M_ARM64
|
31
|
+
#include <windows.h> /* FlushInstructionCache */
|
32
|
+
#endif
|
29
33
|
|
30
34
|
/* Force FFI_TYPE_LONGDOUBLE to be different than FFI_TYPE_DOUBLE;
|
31
35
|
all further uses in this file will refer to the 128-bit type. */
|
@@ -58,6 +62,9 @@ struct call_context
|
|
58
62
|
#if FFI_EXEC_TRAMPOLINE_TABLE
|
59
63
|
|
60
64
|
#ifdef __MACH__
|
65
|
+
#ifdef HAVE_PTRAUTH
|
66
|
+
#include <ptrauth.h>
|
67
|
+
#endif
|
61
68
|
#include <mach/vm_param.h>
|
62
69
|
#endif
|
63
70
|
|
@@ -74,6 +81,8 @@ ffi_clear_cache (void *start, void *end)
|
|
74
81
|
sys_icache_invalidate (start, (char *)end - (char *)start);
|
75
82
|
#elif defined (__GNUC__)
|
76
83
|
__builtin___clear_cache (start, end);
|
84
|
+
#elif defined (_M_ARM64)
|
85
|
+
FlushInstructionCache(GetCurrentProcess(), start, (char*)end - (char*)start);
|
77
86
|
#else
|
78
87
|
#error "Missing builtin to flush instruction cache"
|
79
88
|
#endif
|
@@ -315,6 +324,9 @@ extend_integer_type (void *source, int type)
|
|
315
324
|
}
|
316
325
|
}
|
317
326
|
|
327
|
+
#if defined(_MSC_VER)
|
328
|
+
void extend_hfa_type (void *dest, void *src, int h);
|
329
|
+
#else
|
318
330
|
static void
|
319
331
|
extend_hfa_type (void *dest, void *src, int h)
|
320
332
|
{
|
@@ -350,10 +362,10 @@ extend_hfa_type (void *dest, void *src, int h)
|
|
350
362
|
" b 1f\n"
|
351
363
|
" nop\n"
|
352
364
|
" ldp q16, q17, [%3]\n" /* Q4 */
|
353
|
-
" ldp q18, q19, [%3, #
|
365
|
+
" ldp q18, q19, [%3, #32]\n"
|
354
366
|
" b 4f\n"
|
355
367
|
" ldp q16, q17, [%3]\n" /* Q3 */
|
356
|
-
" ldr q18, [%3, #
|
368
|
+
" ldr q18, [%3, #32]\n"
|
357
369
|
" b 3f\n"
|
358
370
|
" ldp q16, q17, [%3]\n" /* Q2 */
|
359
371
|
" b 2f\n"
|
@@ -368,7 +380,11 @@ extend_hfa_type (void *dest, void *src, int h)
|
|
368
380
|
: "r"(f * 12), "r"(dest), "r"(src)
|
369
381
|
: "memory", "v16", "v17", "v18", "v19");
|
370
382
|
}
|
383
|
+
#endif
|
371
384
|
|
385
|
+
#if defined(_MSC_VER)
|
386
|
+
void* compress_hfa_type (void *dest, void *src, int h);
|
387
|
+
#else
|
372
388
|
static void *
|
373
389
|
compress_hfa_type (void *dest, void *reg, int h)
|
374
390
|
{
|
@@ -437,6 +453,7 @@ compress_hfa_type (void *dest, void *reg, int h)
|
|
437
453
|
}
|
438
454
|
return dest;
|
439
455
|
}
|
456
|
+
#endif
|
440
457
|
|
441
458
|
/* Either allocate an appropriate register for the argument type, or if
|
442
459
|
none are available, allocate a stack slot and return a pointer
|
@@ -454,7 +471,7 @@ allocate_int_to_reg_or_stack (struct call_context *context,
|
|
454
471
|
return allocate_to_stack (state, stack, size, size);
|
455
472
|
}
|
456
473
|
|
457
|
-
ffi_status
|
474
|
+
ffi_status FFI_HIDDEN
|
458
475
|
ffi_prep_cif_machdep (ffi_cif *cif)
|
459
476
|
{
|
460
477
|
ffi_type *rtype = cif->rtype;
|
@@ -539,9 +556,9 @@ ffi_prep_cif_machdep (ffi_cif *cif)
|
|
539
556
|
|
540
557
|
#if defined (__APPLE__)
|
541
558
|
/* Perform Apple-specific cif processing for variadic calls */
|
542
|
-
ffi_status
|
543
|
-
|
544
|
-
|
559
|
+
ffi_status FFI_HIDDEN
|
560
|
+
ffi_prep_cif_machdep_var(ffi_cif *cif, unsigned int nfixedargs,
|
561
|
+
unsigned int ntotalargs)
|
545
562
|
{
|
546
563
|
ffi_status status = ffi_prep_cif_machdep (cif);
|
547
564
|
cif->aarch64_nfixedargs = nfixedargs;
|
@@ -588,8 +605,8 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *orig_rvalue,
|
|
588
605
|
/* Allocate consectutive stack for everything we'll need. */
|
589
606
|
context = alloca (sizeof(struct call_context) + stack_bytes + 32 + rsize);
|
590
607
|
stack = context + 1;
|
591
|
-
frame = stack + stack_bytes;
|
592
|
-
rvalue = (rsize ? frame + 32 : orig_rvalue);
|
608
|
+
frame = (void*)((uintptr_t)stack + (uintptr_t)stack_bytes);
|
609
|
+
rvalue = (rsize ? (void*)((uintptr_t)frame + 32) : orig_rvalue);
|
593
610
|
|
594
611
|
arg_init (&state);
|
595
612
|
for (i = 0, nargs = cif->nargs; i < nargs; i++)
|
@@ -651,6 +668,22 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *orig_rvalue,
|
|
651
668
|
if (h)
|
652
669
|
{
|
653
670
|
int elems = 4 - (h & 3);
|
671
|
+
#ifdef _M_ARM64 /* for handling armasm calling convention */
|
672
|
+
if (cif->is_variadic)
|
673
|
+
{
|
674
|
+
if (state.ngrn + elems <= N_X_ARG_REG)
|
675
|
+
{
|
676
|
+
dest = &context->x[state.ngrn];
|
677
|
+
state.ngrn += elems;
|
678
|
+
extend_hfa_type(dest, a, h);
|
679
|
+
break;
|
680
|
+
}
|
681
|
+
state.nsrn = N_X_ARG_REG;
|
682
|
+
dest = allocate_to_stack(&state, stack, ty->alignment, s);
|
683
|
+
}
|
684
|
+
else
|
685
|
+
{
|
686
|
+
#endif /* for handling armasm calling convention */
|
654
687
|
if (state.nsrn + elems <= N_V_ARG_REG)
|
655
688
|
{
|
656
689
|
dest = &context->v[state.nsrn];
|
@@ -660,6 +693,9 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *orig_rvalue,
|
|
660
693
|
}
|
661
694
|
state.nsrn = N_V_ARG_REG;
|
662
695
|
dest = allocate_to_stack (&state, stack, ty->alignment, s);
|
696
|
+
#ifdef _M_ARM64 /* for handling armasm calling convention */
|
697
|
+
}
|
698
|
+
#endif /* for handling armasm calling convention */
|
663
699
|
}
|
664
700
|
else if (s > 16)
|
665
701
|
{
|
@@ -681,7 +717,7 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *orig_rvalue,
|
|
681
717
|
X registers, then the argument is copied into
|
682
718
|
consecutive X registers. */
|
683
719
|
dest = &context->x[state.ngrn];
|
684
|
-
|
720
|
+
state.ngrn += (unsigned int)n;
|
685
721
|
}
|
686
722
|
else
|
687
723
|
{
|
@@ -756,6 +792,9 @@ ffi_prep_closure_loc (ffi_closure *closure,
|
|
756
792
|
|
757
793
|
#if FFI_EXEC_TRAMPOLINE_TABLE
|
758
794
|
#ifdef __MACH__
|
795
|
+
#ifdef HAVE_PTRAUTH
|
796
|
+
codeloc = ptrauth_strip (codeloc, ptrauth_key_asia);
|
797
|
+
#endif
|
759
798
|
void **config = (void **)((uint8_t *)codeloc - PAGE_MAX_SIZE);
|
760
799
|
config[0] = closure;
|
761
800
|
config[1] = start;
|
@@ -773,6 +812,16 @@ ffi_prep_closure_loc (ffi_closure *closure,
|
|
773
812
|
*(UINT64 *)(tramp + 16) = (uintptr_t)start;
|
774
813
|
|
775
814
|
ffi_clear_cache(tramp, tramp + FFI_TRAMPOLINE_SIZE);
|
815
|
+
|
816
|
+
/* Also flush the cache for code mapping. */
|
817
|
+
#ifdef _M_ARM64
|
818
|
+
// Not using dlmalloc.c for Windows ARM64 builds
|
819
|
+
// so calling ffi_data_to_code_pointer() isn't necessary
|
820
|
+
unsigned char *tramp_code = tramp;
|
821
|
+
#else
|
822
|
+
unsigned char *tramp_code = ffi_data_to_code_pointer (tramp);
|
823
|
+
#endif
|
824
|
+
ffi_clear_cache (tramp_code, tramp_code + FFI_TRAMPOLINE_SIZE);
|
776
825
|
#endif
|
777
826
|
|
778
827
|
closure->cif = cif;
|
@@ -871,55 +920,78 @@ ffi_closure_SYSV_inner (ffi_cif *cif,
|
|
871
920
|
if (h)
|
872
921
|
{
|
873
922
|
n = 4 - (h & 3);
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
913
|
-
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
+
#ifdef _M_ARM64 /* for handling armasm calling convention */
|
924
|
+
if (cif->is_variadic)
|
925
|
+
{
|
926
|
+
if (state.ngrn + n <= N_X_ARG_REG)
|
927
|
+
{
|
928
|
+
void *reg = &context->x[state.ngrn];
|
929
|
+
state.ngrn += (unsigned int)n;
|
930
|
+
|
931
|
+
/* Eeek! We need a pointer to the structure, however the
|
932
|
+
homogeneous float elements are being passed in individual
|
933
|
+
registers, therefore for float and double the structure
|
934
|
+
is not represented as a contiguous sequence of bytes in
|
935
|
+
our saved register context. We don't need the original
|
936
|
+
contents of the register storage, so we reformat the
|
937
|
+
structure into the same memory. */
|
938
|
+
avalue[i] = compress_hfa_type(reg, reg, h);
|
939
|
+
}
|
940
|
+
else
|
941
|
+
{
|
942
|
+
state.ngrn = N_X_ARG_REG;
|
943
|
+
state.nsrn = N_V_ARG_REG;
|
944
|
+
avalue[i] = allocate_to_stack(&state, stack,
|
945
|
+
ty->alignment, s);
|
946
|
+
}
|
947
|
+
}
|
948
|
+
else
|
949
|
+
{
|
950
|
+
#endif /* for handling armasm calling convention */
|
951
|
+
if (state.nsrn + n <= N_V_ARG_REG)
|
952
|
+
{
|
953
|
+
void *reg = &context->v[state.nsrn];
|
954
|
+
state.nsrn += (unsigned int)n;
|
955
|
+
avalue[i] = compress_hfa_type(reg, reg, h);
|
956
|
+
}
|
957
|
+
else
|
958
|
+
{
|
959
|
+
state.nsrn = N_V_ARG_REG;
|
960
|
+
avalue[i] = allocate_to_stack(&state, stack,
|
961
|
+
ty->alignment, s);
|
962
|
+
}
|
963
|
+
#ifdef _M_ARM64 /* for handling armasm calling convention */
|
964
|
+
}
|
965
|
+
#endif /* for handling armasm calling convention */
|
966
|
+
}
|
967
|
+
else if (s > 16)
|
968
|
+
{
|
969
|
+
/* Replace Composite type of size greater than 16 with a
|
970
|
+
pointer. */
|
971
|
+
avalue[i] = *(void **)
|
972
|
+
allocate_int_to_reg_or_stack (context, &state, stack,
|
973
|
+
sizeof (void *));
|
974
|
+
}
|
975
|
+
else
|
976
|
+
{
|
977
|
+
n = (s + 7) / 8;
|
978
|
+
if (state.ngrn + n <= N_X_ARG_REG)
|
979
|
+
{
|
980
|
+
avalue[i] = &context->x[state.ngrn];
|
981
|
+
state.ngrn += (unsigned int)n;
|
982
|
+
}
|
983
|
+
else
|
984
|
+
{
|
985
|
+
state.ngrn = N_X_ARG_REG;
|
986
|
+
avalue[i] = allocate_to_stack(&state, stack,
|
987
|
+
ty->alignment, s);
|
988
|
+
}
|
989
|
+
}
|
990
|
+
break;
|
991
|
+
|
992
|
+
default:
|
993
|
+
abort();
|
994
|
+
}
|
923
995
|
|
924
996
|
#if defined (__APPLE__)
|
925
997
|
if (i + 1 == cif->aarch64_nfixedargs)
|
@@ -939,3 +1011,5 @@ ffi_closure_SYSV_inner (ffi_cif *cif,
|
|
939
1011
|
|
940
1012
|
return flags;
|
941
1013
|
}
|
1014
|
+
|
1015
|
+
#endif /* (__aarch64__) || defined(__arm64__)|| defined (_M_ARM64)*/
|
@@ -32,6 +32,10 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
|
32
32
|
#define FFI_SIZEOF_JAVA_RAW 4
|
33
33
|
typedef unsigned long long ffi_arg;
|
34
34
|
typedef signed long long ffi_sarg;
|
35
|
+
#elif defined(_M_ARM64)
|
36
|
+
#define FFI_SIZEOF_ARG 8
|
37
|
+
typedef unsigned long long ffi_arg;
|
38
|
+
typedef signed long long ffi_sarg;
|
35
39
|
#else
|
36
40
|
typedef unsigned long ffi_arg;
|
37
41
|
typedef signed long ffi_sarg;
|
@@ -65,17 +69,24 @@ typedef enum ffi_abi
|
|
65
69
|
#define FFI_TRAMPOLINE_CLOSURE_OFFSET FFI_TRAMPOLINE_SIZE
|
66
70
|
#endif
|
67
71
|
|
72
|
+
#ifdef _M_ARM64
|
73
|
+
#define FFI_EXTRA_CIF_FIELDS unsigned is_variadic
|
74
|
+
#endif
|
75
|
+
|
68
76
|
/* ---- Internal ---- */
|
69
77
|
|
70
78
|
#if defined (__APPLE__)
|
71
79
|
#define FFI_TARGET_SPECIFIC_VARIADIC
|
72
80
|
#define FFI_EXTRA_CIF_FIELDS unsigned aarch64_nfixedargs
|
73
|
-
#
|
74
|
-
/* iOS
|
81
|
+
#elif !defined(_M_ARM64)
|
82
|
+
/* iOS and Windows reserve x18 for the system. Disable Go closures until
|
75
83
|
a new static chain is chosen. */
|
76
84
|
#define FFI_GO_CLOSURES 1
|
77
85
|
#endif
|
78
86
|
|
87
|
+
#ifndef _M_ARM64
|
88
|
+
/* No complex type on Windows */
|
79
89
|
#define FFI_TARGET_HAS_COMPLEX_TYPE
|
90
|
+
#endif
|
80
91
|
|
81
92
|
#endif
|
@@ -19,6 +19,7 @@ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
19
19
|
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
20
20
|
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
21
21
|
|
22
|
+
#if defined(__aarch64__) || defined(__arm64__)
|
22
23
|
#define LIBFFI_ASM
|
23
24
|
#include <fficonfig.h>
|
24
25
|
#include <ffi.h>
|
@@ -55,6 +56,14 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
|
55
56
|
#define PTR_SIZE 4
|
56
57
|
#else
|
57
58
|
#define PTR_SIZE 8
|
59
|
+
#endif
|
60
|
+
|
61
|
+
#if FFI_EXEC_TRAMPOLINE_TABLE && defined(__MACH__) && defined(HAVE_PTRAUTH)
|
62
|
+
# define BR(r) braaz r
|
63
|
+
# define BLR(r) blraaz r
|
64
|
+
#else
|
65
|
+
# define BR(r) br r
|
66
|
+
# define BLR(r) blr r
|
58
67
|
#endif
|
59
68
|
|
60
69
|
.text
|
@@ -110,7 +119,7 @@ CNAME(ffi_call_SYSV):
|
|
110
119
|
/* Deallocate the context, leaving the stacked arguments. */
|
111
120
|
add sp, sp, #CALL_CONTEXT_SIZE
|
112
121
|
|
113
|
-
|
122
|
+
BLR(x9) /* call fn */
|
114
123
|
|
115
124
|
ldp x3, x4, [x29, #16] /* reload rvalue and flags */
|
116
125
|
|
@@ -198,9 +207,9 @@ CNAME(ffi_call_SYSV):
|
|
198
207
|
cfi_endproc
|
199
208
|
|
200
209
|
.globl CNAME(ffi_call_SYSV)
|
210
|
+
FFI_HIDDEN(CNAME(ffi_call_SYSV))
|
201
211
|
#ifdef __ELF__
|
202
212
|
.type CNAME(ffi_call_SYSV), #function
|
203
|
-
.hidden CNAME(ffi_call_SYSV)
|
204
213
|
.size CNAME(ffi_call_SYSV), .-CNAME(ffi_call_SYSV)
|
205
214
|
#endif
|
206
215
|
|
@@ -237,9 +246,9 @@ CNAME(ffi_closure_SYSV_V):
|
|
237
246
|
cfi_endproc
|
238
247
|
|
239
248
|
.globl CNAME(ffi_closure_SYSV_V)
|
249
|
+
FFI_HIDDEN(CNAME(ffi_closure_SYSV_V))
|
240
250
|
#ifdef __ELF__
|
241
251
|
.type CNAME(ffi_closure_SYSV_V), #function
|
242
|
-
.hidden CNAME(ffi_closure_SYSV_V)
|
243
252
|
.size CNAME(ffi_closure_SYSV_V), . - CNAME(ffi_closure_SYSV_V)
|
244
253
|
#endif
|
245
254
|
|
@@ -270,6 +279,9 @@ CNAME(ffi_closure_SYSV):
|
|
270
279
|
bl CNAME(ffi_closure_SYSV_inner)
|
271
280
|
|
272
281
|
/* Load the return value as directed. */
|
282
|
+
#if FFI_EXEC_TRAMPOLINE_TABLE && defined(__MACH__) && defined(HAVE_PTRAUTH)
|
283
|
+
autiza x1
|
284
|
+
#endif
|
273
285
|
adr x1, 0f
|
274
286
|
and w0, w0, #AARCH64_RET_MASK
|
275
287
|
add x1, x1, x0, lsl #3
|
@@ -349,9 +361,9 @@ CNAME(ffi_closure_SYSV):
|
|
349
361
|
cfi_endproc
|
350
362
|
|
351
363
|
.globl CNAME(ffi_closure_SYSV)
|
364
|
+
FFI_HIDDEN(CNAME(ffi_closure_SYSV))
|
352
365
|
#ifdef __ELF__
|
353
366
|
.type CNAME(ffi_closure_SYSV), #function
|
354
|
-
.hidden CNAME(ffi_closure_SYSV)
|
355
367
|
.size CNAME(ffi_closure_SYSV), . - CNAME(ffi_closure_SYSV)
|
356
368
|
#endif
|
357
369
|
|
@@ -364,14 +376,14 @@ CNAME(ffi_closure_trampoline_table_page):
|
|
364
376
|
.rept PAGE_MAX_SIZE / FFI_TRAMPOLINE_SIZE
|
365
377
|
adr x16, -PAGE_MAX_SIZE
|
366
378
|
ldp x17, x16, [x16]
|
367
|
-
|
379
|
+
BR(x16)
|
368
380
|
nop /* each entry in the trampoline config page is 2*sizeof(void*) so the trampoline itself cannot be smaller that 16 bytes */
|
369
381
|
.endr
|
370
382
|
|
371
383
|
.globl CNAME(ffi_closure_trampoline_table_page)
|
384
|
+
FFI_HIDDEN(CNAME(ffi_closure_trampoline_table_page))
|
372
385
|
#ifdef __ELF__
|
373
386
|
.type CNAME(ffi_closure_trampoline_table_page), #function
|
374
|
-
.hidden CNAME(ffi_closure_trampoline_table_page)
|
375
387
|
.size CNAME(ffi_closure_trampoline_table_page), . - CNAME(ffi_closure_trampoline_table_page)
|
376
388
|
#endif
|
377
389
|
#endif
|
@@ -396,9 +408,9 @@ CNAME(ffi_go_closure_SYSV_V):
|
|
396
408
|
cfi_endproc
|
397
409
|
|
398
410
|
.globl CNAME(ffi_go_closure_SYSV_V)
|
411
|
+
FFI_HIDDEN(CNAME(ffi_go_closure_SYSV_V))
|
399
412
|
#ifdef __ELF__
|
400
413
|
.type CNAME(ffi_go_closure_SYSV_V), #function
|
401
|
-
.hidden CNAME(ffi_go_closure_SYSV_V)
|
402
414
|
.size CNAME(ffi_go_closure_SYSV_V), . - CNAME(ffi_go_closure_SYSV_V)
|
403
415
|
#endif
|
404
416
|
|
@@ -425,12 +437,13 @@ CNAME(ffi_go_closure_SYSV):
|
|
425
437
|
cfi_endproc
|
426
438
|
|
427
439
|
.globl CNAME(ffi_go_closure_SYSV)
|
440
|
+
FFI_HIDDEN(CNAME(ffi_go_closure_SYSV))
|
428
441
|
#ifdef __ELF__
|
429
442
|
.type CNAME(ffi_go_closure_SYSV), #function
|
430
|
-
.hidden CNAME(ffi_go_closure_SYSV)
|
431
443
|
.size CNAME(ffi_go_closure_SYSV), . - CNAME(ffi_go_closure_SYSV)
|
432
444
|
#endif
|
433
445
|
#endif /* FFI_GO_CLOSURES */
|
446
|
+
#endif /* __arm64__ */
|
434
447
|
|
435
448
|
#if defined __ELF__ && defined __linux__
|
436
449
|
.section .note.GNU-stack,"",%progbits
|