ffi 1.15.5 → 1.17.0
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
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +118 -0
- data/Gemfile +10 -3
- data/README.md +4 -3
- data/Rakefile +25 -10
- data/ext/ffi_c/AbstractMemory.c +99 -74
- data/ext/ffi_c/AbstractMemory.h +3 -2
- data/ext/ffi_c/ArrayType.c +51 -15
- data/ext/ffi_c/ArrayType.h +1 -0
- data/ext/ffi_c/Buffer.c +90 -33
- data/ext/ffi_c/Call.c +29 -12
- data/ext/ffi_c/Call.h +3 -2
- data/ext/ffi_c/DynamicLibrary.c +90 -27
- data/ext/ffi_c/Function.c +244 -98
- data/ext/ffi_c/Function.h +1 -0
- data/ext/ffi_c/FunctionInfo.c +81 -25
- data/ext/ffi_c/LastError.c +29 -11
- data/ext/ffi_c/MappedType.c +66 -23
- data/ext/ffi_c/MappedType.h +0 -2
- data/ext/ffi_c/MemoryPointer.c +36 -9
- data/ext/ffi_c/MethodHandle.c +3 -1
- data/ext/ffi_c/Pointer.c +82 -40
- data/ext/ffi_c/Pointer.h +1 -0
- data/ext/ffi_c/Struct.c +166 -84
- data/ext/ffi_c/Struct.h +7 -4
- data/ext/ffi_c/StructByValue.c +48 -16
- data/ext/ffi_c/StructLayout.c +130 -61
- data/ext/ffi_c/Type.c +120 -51
- data/ext/ffi_c/Type.h +3 -1
- data/ext/ffi_c/Types.c +8 -2
- data/ext/ffi_c/Types.h +0 -1
- data/ext/ffi_c/Variadic.c +71 -26
- data/ext/ffi_c/compat.h +22 -22
- data/ext/ffi_c/extconf.rb +19 -2
- data/ext/ffi_c/ffi.c +4 -0
- data/ext/ffi_c/libffi/.allow-ai-service +0 -0
- data/ext/ffi_c/libffi/.appveyor/site.exp +16 -0
- data/ext/ffi_c/libffi/.appveyor/unix-noexec.exp +7 -0
- data/ext/ffi_c/libffi/.appveyor.yml +27 -9
- data/ext/ffi_c/libffi/.ci/build-cross-in-container.sh +18 -0
- data/ext/ffi_c/libffi/{.travis → .ci}/build-in-container.sh +4 -6
- data/ext/ffi_c/libffi/.ci/build.sh +124 -0
- data/ext/ffi_c/libffi/{.travis → .ci}/install.sh +14 -7
- data/ext/ffi_c/libffi/.ci/msvs-detect +1103 -0
- data/ext/ffi_c/libffi/{.travis → .ci}/site.exp +5 -3
- data/ext/ffi_c/libffi/.circleci/config.yml +156 -0
- data/ext/ffi_c/libffi/.github/workflows/build.yml +479 -0
- data/ext/ffi_c/libffi/.github/workflows/emscripten.yml +172 -0
- data/ext/ffi_c/libffi/.gitignore +10 -2
- data/ext/ffi_c/libffi/LICENSE +1 -1
- data/ext/ffi_c/libffi/Makefile.am +12 -5
- data/ext/ffi_c/libffi/Makefile.in +118 -51
- data/ext/ffi_c/libffi/README.md +150 -105
- data/ext/ffi_c/libffi/acinclude.m4 +10 -112
- data/ext/ffi_c/libffi/compile +348 -0
- data/ext/ffi_c/libffi/config.guess +623 -556
- data/ext/ffi_c/libffi/config.sub +75 -34
- data/ext/ffi_c/libffi/configure +4571 -3830
- data/ext/ffi_c/libffi/configure.ac +64 -28
- data/ext/ffi_c/libffi/configure.host +26 -7
- data/ext/ffi_c/libffi/doc/Makefile.in +9 -6
- data/ext/ffi_c/libffi/doc/libffi.texi +82 -33
- data/ext/ffi_c/libffi/doc/version.texi +4 -4
- data/ext/ffi_c/libffi/fficonfig.h.in +12 -47
- data/ext/ffi_c/libffi/generate-darwin-source-and-headers.py +163 -52
- data/ext/ffi_c/libffi/include/Makefile.am +1 -1
- data/ext/ffi_c/libffi/include/Makefile.in +10 -9
- data/ext/ffi_c/libffi/include/ffi.h.in +55 -60
- data/ext/ffi_c/libffi/include/ffi_cfi.h +21 -0
- data/ext/ffi_c/libffi/include/ffi_common.h +33 -2
- data/ext/ffi_c/libffi/include/tramp.h +45 -0
- data/ext/ffi_c/libffi/install-sh +92 -69
- data/ext/ffi_c/libffi/libffi.map.in +5 -0
- data/ext/ffi_c/libffi/libtool-version +2 -2
- data/ext/ffi_c/libffi/ltmain.sh +518 -333
- data/ext/ffi_c/libffi/m4/ax_cc_maxopt.m4 +18 -14
- data/ext/ffi_c/libffi/m4/ax_cflags_warn_all.m4 +108 -72
- data/ext/ffi_c/libffi/m4/ax_compiler_vendor.m4 +76 -45
- data/ext/ffi_c/libffi/m4/ax_prepend_flag.m4 +51 -0
- data/ext/ffi_c/libffi/man/Makefile.in +9 -6
- data/ext/ffi_c/libffi/missing +1 -1
- data/ext/ffi_c/libffi/msvc_build/aarch64/aarch64_include/ffi.h +2 -2
- data/ext/ffi_c/libffi/msvcc.sh +1 -1
- data/ext/ffi_c/libffi/src/aarch64/ffi.c +172 -55
- data/ext/ffi_c/libffi/src/aarch64/internal.h +32 -0
- data/ext/ffi_c/libffi/src/aarch64/sysv.S +331 -87
- data/ext/ffi_c/libffi/src/arc/arcompact.S +169 -94
- data/ext/ffi_c/libffi/src/arc/ffi.c +325 -148
- data/ext/ffi_c/libffi/src/arc/ffitarget.h +14 -0
- data/ext/ffi_c/libffi/src/arm/ffi.c +62 -17
- data/ext/ffi_c/libffi/src/arm/ffitarget.h +3 -3
- data/ext/ffi_c/libffi/src/arm/internal.h +10 -0
- data/ext/ffi_c/libffi/src/arm/sysv.S +113 -42
- data/ext/ffi_c/libffi/src/closures.c +136 -50
- data/ext/ffi_c/libffi/src/debug.c +2 -2
- data/ext/ffi_c/libffi/src/dlmalloc.c +6 -1
- data/ext/ffi_c/libffi/src/ia64/ffi.c +12 -0
- data/ext/ffi_c/libffi/src/ia64/unix.S +20 -2
- data/ext/ffi_c/libffi/src/loongarch64/ffi.c +624 -0
- data/ext/ffi_c/libffi/src/loongarch64/ffitarget.h +82 -0
- data/ext/ffi_c/libffi/src/loongarch64/sysv.S +327 -0
- data/ext/ffi_c/libffi/src/m32r/ffi.c +31 -14
- data/ext/ffi_c/libffi/src/mips/ffi.c +250 -67
- data/ext/ffi_c/libffi/src/mips/ffitarget.h +7 -0
- data/ext/ffi_c/libffi/src/mips/n32.S +193 -33
- data/ext/ffi_c/libffi/src/mips/o32.S +61 -4
- data/ext/ffi_c/libffi/src/moxie/ffi.c +47 -22
- data/ext/ffi_c/libffi/src/or1k/ffi.c +25 -12
- data/ext/ffi_c/libffi/src/pa/ffi.c +32 -33
- data/ext/ffi_c/libffi/src/pa/ffi64.c +614 -0
- data/ext/ffi_c/libffi/src/pa/ffitarget.h +22 -8
- data/ext/ffi_c/libffi/src/pa/hpux32.S +83 -36
- data/ext/ffi_c/libffi/src/pa/hpux64.S +681 -0
- data/ext/ffi_c/libffi/src/pa/linux.S +82 -35
- data/ext/ffi_c/libffi/src/powerpc/ffi_darwin.c +36 -24
- data/ext/ffi_c/libffi/src/powerpc/ffi_linux64.c +1 -1
- data/ext/ffi_c/libffi/src/powerpc/linux64.S +2 -0
- data/ext/ffi_c/libffi/src/powerpc/linux64_closure.S +2 -0
- data/ext/ffi_c/libffi/src/powerpc/t-aix +5 -0
- data/ext/ffi_c/libffi/src/prep_cif.c +22 -2
- data/ext/ffi_c/libffi/src/riscv/ffi.c +37 -4
- data/ext/ffi_c/libffi/src/sparc/ffi64.c +23 -1
- data/ext/ffi_c/libffi/src/tramp.c +716 -0
- data/ext/ffi_c/libffi/src/types.c +4 -6
- data/ext/ffi_c/libffi/src/wasm32/ffi.c +947 -0
- data/ext/ffi_c/libffi/src/wasm32/ffitarget.h +62 -0
- data/ext/ffi_c/libffi/src/x86/ffi.c +99 -37
- data/ext/ffi_c/libffi/src/x86/ffi64.c +67 -12
- data/ext/ffi_c/libffi/src/x86/ffitarget.h +9 -5
- data/ext/ffi_c/libffi/src/x86/ffiw64.c +44 -1
- data/ext/ffi_c/libffi/src/x86/internal.h +14 -0
- data/ext/ffi_c/libffi/src/x86/internal64.h +14 -0
- data/ext/ffi_c/libffi/src/x86/sysv.S +172 -38
- data/ext/ffi_c/libffi/src/x86/sysv_intel.S +91 -88
- data/ext/ffi_c/libffi/src/x86/unix64.S +96 -6
- data/ext/ffi_c/libffi/src/x86/win64.S +20 -7
- data/ext/ffi_c/libffi/src/xtensa/ffi.c +16 -8
- data/ext/ffi_c/libffi/src/xtensa/ffitarget.h +4 -0
- data/ext/ffi_c/libffi/src/xtensa/sysv.S +26 -16
- data/ext/ffi_c/libffi/testsuite/Makefile.am +79 -114
- data/ext/ffi_c/libffi/testsuite/Makefile.in +89 -121
- data/ext/ffi_c/libffi/testsuite/emscripten/build-tests.sh +54 -0
- data/ext/ffi_c/libffi/testsuite/emscripten/build.sh +63 -0
- data/ext/ffi_c/libffi/testsuite/emscripten/conftest.py +86 -0
- data/ext/ffi_c/libffi/testsuite/emscripten/node-tests.sh +48 -0
- data/ext/ffi_c/libffi/testsuite/emscripten/test.html +7 -0
- data/ext/ffi_c/libffi/testsuite/emscripten/test_libffi.py +51 -0
- data/ext/ffi_c/libffi/testsuite/lib/libffi.exp +43 -21
- data/ext/ffi_c/libffi/testsuite/lib/target-libpath.exp +2 -2
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-call.c +1 -0
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/testcases.c +5 -1
- data/ext/ffi_c/libffi/testsuite/libffi.call/bpo_38748.c +41 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/callback.c +99 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/callback2.c +108 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/callback3.c +114 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/callback4.c +119 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/ffitest.h +28 -3
- data/ext/ffi_c/libffi/testsuite/libffi.call/float_va.c +3 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_ll1.c +5 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_sl.c +4 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_ul.c +4 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/s55.c +60 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen.c +8 -9
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen2.c +2 -2
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen3.c +2 -2
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen4.c +2 -2
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct10.c +1 -1
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_2.c +63 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_3.c +65 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_3f.c +65 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_4.c +67 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_4f.c +67 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_big.c +93 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_small.c +61 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_return_2H.c +63 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_return_8H.c +90 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c +1 -119
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_2.c +220 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_3.c +154 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct1.c +13 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct2.c +11 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct3.c +15 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn0.c +3 -2
- data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn1.c +2 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn2.c +2 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn3.c +21 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn4.c +2 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn5.c +2 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn6.c +2 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_loc_fn0.c +7 -6
- data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_simple.c +6 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_12byte.c +18 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_16byte.c +22 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_18byte.c +24 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_19byte.c +29 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_1_1byte.c +4 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_20byte.c +19 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_20byte1.c +21 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_24byte.c +35 -3
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_2byte.c +13 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3_1byte.c +19 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3byte1.c +13 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3byte2.c +13 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3float.c +18 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_4_1byte.c +22 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_4byte.c +13 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_5_1_byte.c +29 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_5byte.c +19 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_64byte.c +24 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_6_1_byte.c +28 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_6byte.c +24 -2
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_7_1_byte.c +39 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_7byte.c +25 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_8byte.c +14 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_9byte1.c +14 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_9byte2.c +14 -2
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_double.c +19 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_float.c +19 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_longdouble.c +20 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_longdouble_split.c +40 -25
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_longdouble_split2.c +40 -3
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_pointer.c +19 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_sint16.c +18 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_sint32.c +18 -3
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_sint64.c +18 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_uint16.c +18 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_uint32.c +19 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_uint64.c +19 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_dbls_struct.c +3 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_double_va.c +9 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_float.c +4 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_longdouble.c +11 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_longdouble_va.c +22 -3
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_schar.c +5 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_sshort.c +6 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_sshortchar.c +9 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_uchar.c +9 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_ushort.c +6 -2
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_ushortchar.c +9 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_pointer.c +5 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_pointer_stack.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_schar.c +3 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_sint.c +2 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_sshort.c +3 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_struct_va1.c +11 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uchar.c +3 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uint.c +4 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uint_va.c +4 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ulong_va.c +4 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ulonglong.c +2 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ushort.c +3 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/ffitest.h +1 -138
- data/ext/ffi_c/libffi/testsuite/libffi.closures/huge_struct.c +21 -21
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct.c +32 -9
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct1.c +1 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct10.c +12 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct11.c +21 -5
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct12.c +86 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct13.c +115 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct2.c +10 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct3.c +10 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct4.c +9 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct5.c +9 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct6.c +11 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct7.c +9 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct8.c +11 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct9.c +11 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/single_entry_structs1.c +86 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/single_entry_structs2.c +102 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/single_entry_structs3.c +101 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/stret_medium.c +1 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/stret_medium2.c +1 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/testclosure.c +6 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/unwindtest.cc +2 -1
- data/ext/ffi_c/libffi/testsuite/libffi.closures/unwindtest_ffi_call.cc +1 -0
- data/ext/ffi_c/libffi.bsd.mk +2 -2
- data/ext/ffi_c/libffi.darwin.mk +2 -2
- data/ext/ffi_c/libffi.gnu.mk +2 -2
- data/ext/ffi_c/rbffi.h +1 -1
- data/ffi.gemspec +3 -3
- data/lib/ffi/autopointer.rb +8 -31
- data/lib/ffi/compat.rb +43 -0
- data/lib/ffi/data_converter.rb +2 -2
- data/lib/ffi/dynamic_library.rb +118 -0
- data/lib/ffi/enum.rb +18 -12
- data/lib/ffi/ffi.rb +3 -0
- data/lib/ffi/function.rb +71 -0
- data/lib/ffi/io.rb +2 -2
- data/lib/ffi/library.rb +72 -88
- data/lib/ffi/library_path.rb +109 -0
- data/lib/ffi/managedstruct.rb +1 -1
- data/lib/ffi/platform/aarch64-linux/types.conf +74 -3
- data/lib/ffi/platform/aarch64-windows/types.conf +52 -0
- data/lib/ffi/platform/hppa1.1-linux/types.conf +178 -0
- data/lib/ffi/platform/hppa2.0-linux/types.conf +178 -0
- data/lib/ffi/platform/loongarch64-linux/types.conf +141 -0
- data/lib/ffi/platform/sw_64-linux/types.conf +141 -0
- data/lib/ffi/platform.rb +15 -13
- data/lib/ffi/pointer.rb +6 -6
- data/lib/ffi/struct.rb +6 -5
- data/lib/ffi/struct_layout.rb +3 -3
- data/lib/ffi/struct_layout_builder.rb +9 -9
- data/lib/ffi/types.rb +65 -37
- data/lib/ffi/variadic.rb +19 -8
- data/lib/ffi/version.rb +1 -1
- data/samples/hello_ractor.rb +11 -0
- data/samples/qsort_ractor.rb +28 -0
- data/sig/ffi/abstract_memory.rbs +165 -0
- data/sig/ffi/auto_pointer.rbs +27 -0
- data/sig/ffi/buffer.rbs +18 -0
- data/sig/ffi/data_converter.rbs +10 -0
- data/sig/ffi/dynamic_library.rbs +9 -0
- data/sig/ffi/enum.rbs +38 -0
- data/sig/ffi/function.rbs +39 -0
- data/sig/ffi/library.rbs +42 -0
- data/sig/ffi/native_type.rbs +86 -0
- data/sig/ffi/pointer.rbs +42 -0
- data/sig/ffi/struct.rbs +76 -0
- data/sig/ffi/struct_by_reference.rbs +11 -0
- data/sig/ffi/struct_by_value.rbs +7 -0
- data/sig/ffi/struct_layout.rbs +9 -0
- data/sig/ffi/struct_layout_builder.rbs +5 -0
- data/sig/ffi/type.rbs +39 -0
- data/sig/ffi.rbs +26 -0
- data.tar.gz.sig +0 -0
- metadata +122 -28
- metadata.gz.sig +1 -0
- data/ext/ffi_c/libffi/.travis/build-cross-in-container.sh +0 -14
- data/ext/ffi_c/libffi/.travis/build.sh +0 -142
- data/ext/ffi_c/libffi/.travis.yml +0 -83
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uchar_va.c +0 -44
- data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ushort_va.c +0 -44
- /data/ext/ffi_c/libffi/{.travis → .ci}/ar-lib +0 -0
- /data/ext/ffi_c/libffi/{.travis → .ci}/bfin-sim.exp +0 -0
- /data/ext/ffi_c/libffi/{.travis → .ci}/compile +0 -0
- /data/ext/ffi_c/libffi/{.travis → .ci}/m32r-sim.exp +0 -0
- /data/ext/ffi_c/libffi/{.travis → .ci}/moxie-sim.exp +0 -0
- /data/ext/ffi_c/libffi/{.travis → .ci}/or1k-sim.exp +0 -0
- /data/ext/ffi_c/libffi/{.travis → .ci}/powerpc-eabisim.exp +0 -0
- /data/ext/ffi_c/libffi/{.travis → .ci}/wine-sim.exp +0 -0
- /data/ext/ffi_c/libffi/testsuite/libffi.call/{pyobjc-tc.c → pyobjc_tc.c} +0 -0
- /data/lib/ffi/platform/{sparc64-linux → sparcv9-linux}/types.conf +0 -0
data/ext/ffi_c/libffi/config.sub
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
#! /bin/sh
|
2
2
|
# Configuration validation subroutine script.
|
3
|
-
# Copyright 1992-
|
3
|
+
# Copyright 1992-2022 Free Software Foundation, Inc.
|
4
4
|
|
5
|
-
|
5
|
+
# shellcheck disable=SC2006,SC2268 # see below for rationale
|
6
|
+
|
7
|
+
timestamp='2022-01-03'
|
6
8
|
|
7
9
|
# This file is free software; you can redistribute it and/or modify it
|
8
10
|
# under the terms of the GNU General Public License as published by
|
9
|
-
# the Free Software Foundation
|
11
|
+
# the Free Software Foundation, either version 3 of the License, or
|
10
12
|
# (at your option) any later version.
|
11
13
|
#
|
12
14
|
# This program is distributed in the hope that it will be useful, but
|
@@ -33,7 +35,7 @@ timestamp='2020-08-05'
|
|
33
35
|
# Otherwise, we print the canonical config type on stdout and succeed.
|
34
36
|
|
35
37
|
# You can get the latest version of this script from:
|
36
|
-
# https://git.savannah.gnu.org/
|
38
|
+
# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
|
37
39
|
|
38
40
|
# This file is supposed to be the same for all GNU packages
|
39
41
|
# and recognize all the CPU types, system types and aliases
|
@@ -50,6 +52,13 @@ timestamp='2020-08-05'
|
|
50
52
|
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
|
51
53
|
# It is wrong to echo any other type of specification.
|
52
54
|
|
55
|
+
# The "shellcheck disable" line above the timestamp inhibits complaints
|
56
|
+
# about features and limitations of the classic Bourne shell that were
|
57
|
+
# superseded or lifted in POSIX. However, this script identifies a wide
|
58
|
+
# variety of pre-POSIX systems that do not have POSIX shells at all, and
|
59
|
+
# even some reasonably current systems (Solaris 10 as case-in-point) still
|
60
|
+
# have a pre-POSIX /bin/sh.
|
61
|
+
|
53
62
|
me=`echo "$0" | sed -e 's,.*/,,'`
|
54
63
|
|
55
64
|
usage="\
|
@@ -67,7 +76,7 @@ Report bugs and patches to <config-patches@gnu.org>."
|
|
67
76
|
version="\
|
68
77
|
GNU config.sub ($timestamp)
|
69
78
|
|
70
|
-
Copyright 1992-
|
79
|
+
Copyright 1992-2022 Free Software Foundation, Inc.
|
71
80
|
|
72
81
|
This is free software; see the source for copying conditions. There is NO
|
73
82
|
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
@@ -112,9 +121,11 @@ esac
|
|
112
121
|
|
113
122
|
# Split fields of configuration type
|
114
123
|
# shellcheck disable=SC2162
|
124
|
+
saved_IFS=$IFS
|
115
125
|
IFS="-" read field1 field2 field3 field4 <<EOF
|
116
126
|
$1
|
117
127
|
EOF
|
128
|
+
IFS=$saved_IFS
|
118
129
|
|
119
130
|
# Separate into logical components for further validation
|
120
131
|
case $1 in
|
@@ -163,6 +174,10 @@ case $1 in
|
|
163
174
|
basic_machine=$field1
|
164
175
|
basic_os=$field2
|
165
176
|
;;
|
177
|
+
zephyr*)
|
178
|
+
basic_machine=$field1-unknown
|
179
|
+
basic_os=$field2
|
180
|
+
;;
|
166
181
|
# Manufacturers
|
167
182
|
dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \
|
168
183
|
| att* | 7300* | 3300* | delta* | motorola* | sun[234]* \
|
@@ -922,9 +937,11 @@ case $basic_machine in
|
|
922
937
|
|
923
938
|
*-*)
|
924
939
|
# shellcheck disable=SC2162
|
940
|
+
saved_IFS=$IFS
|
925
941
|
IFS="-" read cpu vendor <<EOF
|
926
942
|
$basic_machine
|
927
943
|
EOF
|
944
|
+
IFS=$saved_IFS
|
928
945
|
;;
|
929
946
|
# We use `pc' rather than `unknown'
|
930
947
|
# because (1) that's what they normally are, and
|
@@ -1003,6 +1020,11 @@ case $cpu-$vendor in
|
|
1003
1020
|
;;
|
1004
1021
|
|
1005
1022
|
# Here we normalize CPU types with a missing or matching vendor
|
1023
|
+
armh-unknown | armh-alt)
|
1024
|
+
cpu=armv7l
|
1025
|
+
vendor=alt
|
1026
|
+
basic_os=${basic_os:-linux-gnueabihf}
|
1027
|
+
;;
|
1006
1028
|
dpx20-unknown | dpx20-bull)
|
1007
1029
|
cpu=rs6000
|
1008
1030
|
vendor=bull
|
@@ -1104,7 +1126,7 @@ case $cpu-$vendor in
|
|
1104
1126
|
xscale-* | xscalee[bl]-*)
|
1105
1127
|
cpu=`echo "$cpu" | sed 's/^xscale/arm/'`
|
1106
1128
|
;;
|
1107
|
-
arm64-*)
|
1129
|
+
arm64-* | arm64_32-* | aarch64le-*)
|
1108
1130
|
cpu=aarch64
|
1109
1131
|
;;
|
1110
1132
|
|
@@ -1165,7 +1187,7 @@ case $cpu-$vendor in
|
|
1165
1187
|
| alphapca5[67] | alpha64pca5[67] \
|
1166
1188
|
| am33_2.0 \
|
1167
1189
|
| amdgcn \
|
1168
|
-
| arc | arceb \
|
1190
|
+
| arc | arceb | arc32 | arc64 \
|
1169
1191
|
| arm | arm[lb]e | arme[lb] | armv* \
|
1170
1192
|
| avr | avr32 \
|
1171
1193
|
| asmjs \
|
@@ -1185,6 +1207,7 @@ case $cpu-$vendor in
|
|
1185
1207
|
| k1om \
|
1186
1208
|
| le32 | le64 \
|
1187
1209
|
| lm32 \
|
1210
|
+
| loongarch32 | loongarch64 | loongarchx32 \
|
1188
1211
|
| m32c | m32r | m32rle \
|
1189
1212
|
| m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
|
1190
1213
|
| m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
|
@@ -1203,9 +1226,13 @@ case $cpu-$vendor in
|
|
1203
1226
|
| mips64vr5900 | mips64vr5900el \
|
1204
1227
|
| mipsisa32 | mipsisa32el \
|
1205
1228
|
| mipsisa32r2 | mipsisa32r2el \
|
1229
|
+
| mipsisa32r3 | mipsisa32r3el \
|
1230
|
+
| mipsisa32r5 | mipsisa32r5el \
|
1206
1231
|
| mipsisa32r6 | mipsisa32r6el \
|
1207
1232
|
| mipsisa64 | mipsisa64el \
|
1208
1233
|
| mipsisa64r2 | mipsisa64r2el \
|
1234
|
+
| mipsisa64r3 | mipsisa64r3el \
|
1235
|
+
| mipsisa64r5 | mipsisa64r5el \
|
1209
1236
|
| mipsisa64r6 | mipsisa64r6el \
|
1210
1237
|
| mipsisa64sb1 | mipsisa64sb1el \
|
1211
1238
|
| mipsisa64sr71k | mipsisa64sr71kel \
|
@@ -1229,7 +1256,7 @@ case $cpu-$vendor in
|
|
1229
1256
|
| powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
|
1230
1257
|
| pru \
|
1231
1258
|
| pyramid \
|
1232
|
-
| riscv | riscv32 | riscv64 \
|
1259
|
+
| riscv | riscv32 | riscv32be | riscv64 | riscv64be \
|
1233
1260
|
| rl78 | romp | rs6000 | rx \
|
1234
1261
|
| s390 | s390x \
|
1235
1262
|
| score \
|
@@ -1241,6 +1268,7 @@ case $cpu-$vendor in
|
|
1241
1268
|
| sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
|
1242
1269
|
| spu \
|
1243
1270
|
| tahoe \
|
1271
|
+
| thumbv7* \
|
1244
1272
|
| tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
|
1245
1273
|
| tron \
|
1246
1274
|
| ubicom32 \
|
@@ -1278,34 +1306,40 @@ esac
|
|
1278
1306
|
|
1279
1307
|
# Decode manufacturer-specific aliases for certain operating systems.
|
1280
1308
|
|
1281
|
-
if
|
1309
|
+
if test x$basic_os != x
|
1282
1310
|
then
|
1283
1311
|
|
1284
|
-
# First recognize some ad-hoc
|
1312
|
+
# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just
|
1285
1313
|
# set os.
|
1286
1314
|
case $basic_os in
|
1287
1315
|
gnu/linux*)
|
1288
1316
|
kernel=linux
|
1289
|
-
os=`echo $basic_os | sed -e 's|gnu/linux|gnu|'`
|
1317
|
+
os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'`
|
1318
|
+
;;
|
1319
|
+
os2-emx)
|
1320
|
+
kernel=os2
|
1321
|
+
os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'`
|
1290
1322
|
;;
|
1291
1323
|
nto-qnx*)
|
1292
1324
|
kernel=nto
|
1293
|
-
os=`echo $basic_os | sed -e 's|nto-qnx|qnx|'`
|
1325
|
+
os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'`
|
1294
1326
|
;;
|
1295
1327
|
*-*)
|
1296
1328
|
# shellcheck disable=SC2162
|
1329
|
+
saved_IFS=$IFS
|
1297
1330
|
IFS="-" read kernel os <<EOF
|
1298
1331
|
$basic_os
|
1299
1332
|
EOF
|
1333
|
+
IFS=$saved_IFS
|
1300
1334
|
;;
|
1301
1335
|
# Default OS when just kernel was specified
|
1302
1336
|
nto*)
|
1303
1337
|
kernel=nto
|
1304
|
-
os=`echo $basic_os | sed -e 's|nto|qnx|'`
|
1338
|
+
os=`echo "$basic_os" | sed -e 's|nto|qnx|'`
|
1305
1339
|
;;
|
1306
1340
|
linux*)
|
1307
1341
|
kernel=linux
|
1308
|
-
os=`echo $basic_os | sed -e 's|linux|gnu|'`
|
1342
|
+
os=`echo "$basic_os" | sed -e 's|linux|gnu|'`
|
1309
1343
|
;;
|
1310
1344
|
*)
|
1311
1345
|
kernel=
|
@@ -1326,7 +1360,7 @@ case $os in
|
|
1326
1360
|
os=cnk
|
1327
1361
|
;;
|
1328
1362
|
solaris1 | solaris1.*)
|
1329
|
-
os=`echo $os | sed -e 's|solaris1|sunos4|'`
|
1363
|
+
os=`echo "$os" | sed -e 's|solaris1|sunos4|'`
|
1330
1364
|
;;
|
1331
1365
|
solaris)
|
1332
1366
|
os=solaris2
|
@@ -1355,7 +1389,7 @@ case $os in
|
|
1355
1389
|
os=sco3.2v4
|
1356
1390
|
;;
|
1357
1391
|
sco3.2.[4-9]*)
|
1358
|
-
os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
|
1392
|
+
os=`echo "$os" | sed -e 's/sco3.2./sco3.2v/'`
|
1359
1393
|
;;
|
1360
1394
|
sco*v* | scout)
|
1361
1395
|
# Don't match below
|
@@ -1367,13 +1401,7 @@ case $os in
|
|
1367
1401
|
os=psos
|
1368
1402
|
;;
|
1369
1403
|
qnx*)
|
1370
|
-
|
1371
|
-
x86 | i*86)
|
1372
|
-
;;
|
1373
|
-
*)
|
1374
|
-
os=nto-$os
|
1375
|
-
;;
|
1376
|
-
esac
|
1404
|
+
os=qnx
|
1377
1405
|
;;
|
1378
1406
|
hiux*)
|
1379
1407
|
os=hiuxwe2
|
@@ -1437,7 +1465,7 @@ case $os in
|
|
1437
1465
|
;;
|
1438
1466
|
# Preserve the version number of sinix5.
|
1439
1467
|
sinix5.*)
|
1440
|
-
os=`echo $os | sed -e 's|sinix|sysv|'`
|
1468
|
+
os=`echo "$os" | sed -e 's|sinix|sysv|'`
|
1441
1469
|
;;
|
1442
1470
|
sinix*)
|
1443
1471
|
os=sysv4
|
@@ -1683,11 +1711,14 @@ fi
|
|
1683
1711
|
|
1684
1712
|
# Now, validate our (potentially fixed-up) OS.
|
1685
1713
|
case $os in
|
1686
|
-
# Sometimes we do "kernel-
|
1687
|
-
musl* | newlib* | uclibc*)
|
1714
|
+
# Sometimes we do "kernel-libc", so those need to count as OSes.
|
1715
|
+
musl* | newlib* | relibc* | uclibc*)
|
1716
|
+
;;
|
1717
|
+
# Likewise for "kernel-abi"
|
1718
|
+
eabi* | gnueabi*)
|
1688
1719
|
;;
|
1689
|
-
#
|
1690
|
-
|
1720
|
+
# VxWorks passes extra cpu info in the 4th filed.
|
1721
|
+
simlinux | simwindows | spe)
|
1691
1722
|
;;
|
1692
1723
|
# Now accept the basic system types.
|
1693
1724
|
# The portable systems comes first.
|
@@ -1697,19 +1728,19 @@ case $os in
|
|
1697
1728
|
| hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
|
1698
1729
|
| sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \
|
1699
1730
|
| hiux* | abug | nacl* | netware* | windows* \
|
1700
|
-
| os9* | macos* | osx* | ios* \
|
1731
|
+
| os9* | macos* | osx* | ios* | watchos* | tvos* \
|
1701
1732
|
| mpw* | magic* | mmixware* | mon960* | lnews* \
|
1702
1733
|
| amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
|
1703
1734
|
| aos* | aros* | cloudabi* | sortix* | twizzler* \
|
1704
1735
|
| nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
|
1705
1736
|
| clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
|
1706
1737
|
| mirbsd* | netbsd* | dicos* | openedition* | ose* \
|
1707
|
-
| bitrig* | openbsd* | solidbsd* | libertybsd* | os108* \
|
1738
|
+
| bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \
|
1708
1739
|
| ekkobsd* | freebsd* | riscix* | lynxos* | os400* \
|
1709
1740
|
| bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
|
1710
1741
|
| ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
|
1711
1742
|
| udi* | lites* | ieee* | go32* | aux* | hcos* \
|
1712
|
-
| chorusrdb* | cegcc* | glidix* \
|
1743
|
+
| chorusrdb* | cegcc* | glidix* | serenity* \
|
1713
1744
|
| cygwin* | msys* | pe* | moss* | proelf* | rtems* \
|
1714
1745
|
| midipix* | mingw32* | mingw64* | mint* \
|
1715
1746
|
| uxpv* | beos* | mpeix* | udk* | moxiebox* \
|
@@ -1722,7 +1753,8 @@ case $os in
|
|
1722
1753
|
| skyos* | haiku* | rdos* | toppers* | drops* | es* \
|
1723
1754
|
| onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
|
1724
1755
|
| midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
|
1725
|
-
| nsk* | powerunix* | genode* | zvmoe*
|
1756
|
+
| nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \
|
1757
|
+
| fiwix* )
|
1726
1758
|
;;
|
1727
1759
|
# This one is extra strict with allowed versions
|
1728
1760
|
sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
|
@@ -1739,9 +1771,12 @@ esac
|
|
1739
1771
|
# As a final step for OS-related things, validate the OS-kernel combination
|
1740
1772
|
# (given a valid OS), if there is a kernel.
|
1741
1773
|
case $kernel-$os in
|
1742
|
-
linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib*
|
1774
|
+
linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \
|
1775
|
+
| linux-musl* | linux-relibc* | linux-uclibc* )
|
1743
1776
|
;;
|
1744
|
-
-
|
1777
|
+
uclinux-uclibc* )
|
1778
|
+
;;
|
1779
|
+
-dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* )
|
1745
1780
|
# These are just libc implementations, not actual OSes, and thus
|
1746
1781
|
# require a kernel.
|
1747
1782
|
echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2
|
@@ -1749,8 +1784,14 @@ case $kernel-$os in
|
|
1749
1784
|
;;
|
1750
1785
|
kfreebsd*-gnu* | kopensolaris*-gnu*)
|
1751
1786
|
;;
|
1787
|
+
vxworks-simlinux | vxworks-simwindows | vxworks-spe)
|
1788
|
+
;;
|
1752
1789
|
nto-qnx*)
|
1753
1790
|
;;
|
1791
|
+
os2-emx)
|
1792
|
+
;;
|
1793
|
+
ios*-simulator | tvos*-simulator | watchos*-simulator)
|
1794
|
+
;;
|
1754
1795
|
*-eabi* | *-gnueabi*)
|
1755
1796
|
;;
|
1756
1797
|
-*)
|