ffi 1.9.24 → 1.16.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +348 -0
- data/Gemfile +4 -5
- data/README.md +44 -17
- data/Rakefile +74 -148
- data/ext/ffi_c/AbstractMemory.c +89 -70
- data/ext/ffi_c/AbstractMemory.h +3 -2
- data/ext/ffi_c/ArrayType.c +49 -13
- data/ext/ffi_c/ArrayType.h +1 -0
- data/ext/ffi_c/Buffer.c +90 -38
- data/ext/ffi_c/Call.c +55 -56
- data/ext/ffi_c/Call.h +12 -6
- data/ext/ffi_c/ClosurePool.c +333 -0
- data/ext/ffi_c/{Closure.h → ClosurePool.h} +25 -13
- data/ext/ffi_c/DynamicLibrary.c +91 -33
- data/ext/ffi_c/Function.c +306 -235
- data/ext/ffi_c/Function.h +3 -5
- data/ext/ffi_c/FunctionInfo.c +87 -32
- data/ext/ffi_c/LastError.c +74 -15
- data/ext/ffi_c/LongDouble.c +12 -10
- data/ext/ffi_c/LongDouble.h +0 -4
- data/ext/ffi_c/MappedType.c +66 -23
- data/ext/ffi_c/MappedType.h +0 -2
- data/ext/ffi_c/MemoryPointer.c +37 -15
- data/ext/ffi_c/MemoryPointer.h +0 -4
- data/ext/ffi_c/MethodHandle.c +265 -38
- data/ext/ffi_c/MethodHandle.h +3 -2
- data/ext/ffi_c/Platform.c +5 -56
- data/ext/ffi_c/Pointer.c +93 -55
- data/ext/ffi_c/Pointer.h +1 -4
- data/ext/ffi_c/Struct.c +202 -134
- data/ext/ffi_c/Struct.h +18 -9
- data/ext/ffi_c/StructByValue.c +50 -23
- data/ext/ffi_c/StructLayout.c +135 -64
- data/ext/ffi_c/Thread.c +4 -228
- data/ext/ffi_c/Thread.h +1 -20
- data/ext/ffi_c/Type.c +105 -55
- data/ext/ffi_c/Type.h +3 -2
- data/ext/ffi_c/Types.c +8 -9
- data/ext/ffi_c/Types.h +3 -4
- data/ext/ffi_c/Variadic.c +88 -47
- data/ext/ffi_c/compat.h +26 -22
- data/ext/ffi_c/extconf.rb +75 -32
- data/ext/ffi_c/ffi.c +9 -10
- 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 +53 -19
- data/ext/ffi_c/libffi/.ci/bfin-sim.exp +58 -0
- data/ext/ffi_c/libffi/.ci/build-cross-in-container.sh +18 -0
- data/ext/ffi_c/libffi/.ci/build-in-container.sh +10 -0
- data/ext/ffi_c/libffi/.ci/build.sh +124 -0
- data/ext/ffi_c/libffi/.ci/install.sh +78 -0
- data/ext/ffi_c/libffi/.ci/m32r-sim.exp +58 -0
- data/ext/ffi_c/libffi/{.travis → .ci}/moxie-sim.exp +1 -1
- data/ext/ffi_c/libffi/.ci/msvs-detect +1103 -0
- data/ext/ffi_c/libffi/.ci/or1k-sim.exp +58 -0
- data/ext/ffi_c/libffi/.ci/powerpc-eabisim.exp +58 -0
- data/ext/ffi_c/libffi/.ci/site.exp +29 -0
- data/ext/ffi_c/libffi/.ci/wine-sim.exp +55 -0
- data/ext/ffi_c/libffi/.circleci/config.yml +156 -0
- data/ext/ffi_c/libffi/.gitattributes +4 -0
- data/ext/ffi_c/libffi/.github/workflows/build.yml +460 -0
- data/ext/ffi_c/libffi/.github/workflows/emscripten.yml +171 -0
- data/ext/ffi_c/libffi/.gitignore +10 -2
- 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 +64 -73
- data/ext/ffi_c/libffi/Makefile.in +553 -235
- data/ext/ffi_c/libffi/README.md +165 -100
- data/ext/ffi_c/libffi/acinclude.m4 +10 -112
- data/ext/ffi_c/libffi/compile +348 -0
- data/ext/ffi_c/libffi/config.guess +950 -662
- data/ext/ffi_c/libffi/config.sub +1362 -1306
- data/ext/ffi_c/libffi/configure +4909 -4096
- data/ext/ffi_c/libffi/configure.ac +93 -32
- data/ext/ffi_c/libffi/configure.host +76 -28
- data/ext/ffi_c/libffi/doc/Makefile.in +15 -8
- data/ext/ffi_c/libffi/doc/libffi.texi +107 -46
- data/ext/ffi_c/libffi/doc/version.texi +4 -4
- data/ext/ffi_c/libffi/fficonfig.h.in +22 -44
- data/ext/ffi_c/libffi/generate-darwin-source-and-headers.py +165 -56
- data/ext/ffi_c/libffi/include/Makefile.am +1 -1
- data/ext/ffi_c/libffi/include/Makefile.in +17 -12
- data/ext/ffi_c/libffi/include/ffi.h.in +64 -48
- data/ext/ffi_c/libffi/include/ffi_cfi.h +21 -0
- data/ext/ffi_c/libffi/include/ffi_common.h +34 -1
- data/ext/ffi_c/libffi/include/tramp.h +45 -0
- data/ext/ffi_c/libffi/install-sh +107 -74
- 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 +2 -2
- data/ext/ffi_c/libffi/ltmain.sh +576 -284
- 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_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_check_compile_flag.m4 +5 -26
- data/ext/ffi_c/libffi/m4/ax_compiler_vendor.m4 +76 -44
- 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/m4/ax_prepend_flag.m4 +51 -0
- data/ext/ffi_c/libffi/make_sunver.pl +333 -0
- data/ext/ffi_c/libffi/man/Makefile.in +15 -8
- data/ext/ffi_c/libffi/missing +8 -8
- 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/msvc_build/aarch64/aarch64_include/fficonfig.h +219 -0
- data/ext/ffi_c/libffi/msvcc.sh +39 -14
- data/ext/ffi_c/libffi/src/aarch64/ffi.c +286 -98
- data/ext/ffi_c/libffi/src/aarch64/ffitarget.h +19 -3
- data/ext/ffi_c/libffi/src/aarch64/internal.h +33 -0
- data/ext/ffi_c/libffi/src/aarch64/sysv.S +142 -37
- data/ext/ffi_c/libffi/src/aarch64/win64_armasm.S +506 -0
- 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 +112 -10
- data/ext/ffi_c/libffi/src/arm/ffitarget.h +8 -1
- data/ext/ffi_c/libffi/src/arm/internal.h +10 -0
- data/ext/ffi_c/libffi/src/arm/sysv.S +117 -44
- data/ext/ffi_c/libffi/src/arm/sysv_msvc_arm32.S +311 -0
- data/ext/ffi_c/libffi/src/closures.c +189 -48
- data/ext/ffi_c/libffi/src/csky/ffi.c +395 -0
- data/ext/ffi_c/libffi/src/csky/ffitarget.h +63 -0
- data/ext/ffi_c/libffi/src/csky/sysv.S +371 -0
- data/ext/ffi_c/libffi/src/dlmalloc.c +6 -1
- data/ext/ffi_c/libffi/src/frv/ffi.c +1 -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/kvx/asm.h +5 -0
- data/ext/ffi_c/libffi/src/kvx/ffi.c +273 -0
- data/ext/ffi_c/libffi/src/kvx/ffitarget.h +75 -0
- data/ext/ffi_c/libffi/src/kvx/sysv.S +127 -0
- data/ext/ffi_c/libffi/src/loongarch64/ffi.c +621 -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/metag/ffi.c +1 -1
- data/ext/ffi_c/libffi/src/mips/ffi.c +245 -66
- data/ext/ffi_c/libffi/src/mips/ffitarget.h +8 -1
- data/ext/ffi_c/libffi/src/mips/n32.S +137 -28
- data/ext/ffi_c/libffi/src/mips/o32.S +63 -4
- data/ext/ffi_c/libffi/src/moxie/ffi.c +48 -23
- data/ext/ffi_c/libffi/src/or1k/ffi.c +25 -12
- data/ext/ffi_c/libffi/src/pa/ffi.c +62 -108
- data/ext/ffi_c/libffi/src/pa/ffi64.c +614 -0
- data/ext/ffi_c/libffi/src/pa/ffitarget.h +20 -11
- data/ext/ffi_c/libffi/src/pa/hpux32.S +87 -38
- data/ext/ffi_c/libffi/src/pa/hpux64.S +681 -0
- data/ext/ffi_c/libffi/src/pa/linux.S +109 -39
- data/ext/ffi_c/libffi/src/powerpc/ffi.c +6 -4
- data/ext/ffi_c/libffi/src/powerpc/ffi_darwin.c +13 -1
- 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 +93 -28
- data/ext/ffi_c/libffi/src/powerpc/linux64_closure.S +83 -5
- data/ext/ffi_c/libffi/src/powerpc/sysv.S +5 -7
- data/ext/ffi_c/libffi/src/powerpc/t-aix +5 -0
- data/ext/ffi_c/libffi/src/prep_cif.c +26 -4
- data/ext/ffi_c/libffi/src/riscv/ffi.c +79 -10
- 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/sparc/ffi64.c +16 -0
- data/ext/ffi_c/libffi/src/tramp.c +716 -0
- data/ext/ffi_c/libffi/src/wasm32/ffi.c +934 -0
- data/ext/ffi_c/libffi/src/wasm32/ffitarget.h +62 -0
- data/ext/ffi_c/libffi/src/x86/ffi.c +128 -49
- data/ext/ffi_c/libffi/src/x86/ffi64.c +89 -23
- data/ext/ffi_c/libffi/src/x86/ffitarget.h +21 -4
- data/ext/ffi_c/libffi/src/x86/ffiw64.c +63 -10
- 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 +274 -45
- data/ext/ffi_c/libffi/src/x86/sysv_intel.S +998 -0
- data/ext/ffi_c/libffi/src/x86/unix64.S +190 -4
- data/ext/ffi_c/libffi/src/x86/win64.S +32 -10
- data/ext/ffi_c/libffi/src/x86/win64_intel.S +3 -2
- 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 +127 -109
- data/ext/ffi_c/libffi/testsuite/Makefile.in +144 -88
- 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 +80 -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 +71 -25
- data/ext/ffi_c/libffi/testsuite/lib/target-libpath.exp +2 -2
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/bhaible.exp +7 -2
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-call.c +5 -4
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-callback.c +2 -2
- 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/call.exp +12 -1
- data/ext/ffi_c/libffi/testsuite/libffi.call/ffitest.h +28 -3
- data/ext/ffi_c/libffi/testsuite/libffi.call/float2.c +9 -8
- 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.exp +67 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn0.c +3 -2
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn1.c +2 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn2.c +2 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn3.c +21 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn4.c +2 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn5.c +2 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn6.c +2 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_loc_fn0.c +7 -6
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_simple.c +6 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_12byte.c +18 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_16byte.c +22 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_18byte.c +24 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_19byte.c +29 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_1_1byte.c +4 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_20byte.c +19 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_20byte1.c +21 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_24byte.c +35 -3
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_2byte.c +13 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3_1byte.c +19 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3byte1.c +13 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3byte2.c +13 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3float.c +18 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_4_1byte.c +22 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_4byte.c +13 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_5_1_byte.c +29 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_5byte.c +19 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_64byte.c +24 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_6_1_byte.c +28 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_6byte.c +24 -2
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_7_1_byte.c +39 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_7byte.c +25 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_8byte.c +14 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_9byte1.c +14 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_9byte2.c +14 -2
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_double.c +19 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_float.c +19 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble.c +20 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble_split.c +40 -25
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble_split2.c +40 -3
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_pointer.c +19 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint16.c +18 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint32.c +18 -3
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint64.c +18 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint16.c +18 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint32.c +19 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint64.c +19 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_dbls_struct.c +3 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_double_va.c +9 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_float.c +4 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_longdouble.c +11 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_longdouble_va.c +22 -3
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_schar.c +5 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_sshort.c +6 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_sshortchar.c +9 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_uchar.c +9 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_ushort.c +6 -2
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_ushortchar.c +9 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_pointer.c +5 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_pointer_stack.c +10 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_schar.c +3 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_sint.c +2 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_sshort.c +3 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_struct_va1.c +11 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uchar.c +3 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uint.c +4 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uint_va.c +4 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ulong_va.c +4 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ulonglong.c +2 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ushort.c +3 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/ffitest.h +1 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/huge_struct.c +24 -22
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct.c +32 -9
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct1.c +1 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct10.c +12 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → 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.call → libffi.closures}/nested_struct2.c +10 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct3.c +10 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct4.c +9 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct5.c +9 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct6.c +11 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct7.c +9 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct8.c +11 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → 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.call → libffi.closures}/stret_medium.c +1 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_medium2.c +1 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/testclosure.c +6 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/unwindtest.cc +2 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/unwindtest_ffi_call.cc +1 -0
- data/ext/ffi_c/libffi.bsd.mk +2 -2
- data/ext/ffi_c/libffi.darwin.mk +1 -1
- data/ext/ffi_c/libffi.gnu.mk +2 -2
- data/ext/ffi_c/rbffi.h +1 -3
- data/ffi.gemspec +15 -9
- data/lib/ffi/abstract_memory.rb +44 -0
- data/lib/ffi/autopointer.rb +8 -23
- data/lib/ffi/compat.rb +43 -0
- data/lib/ffi/data_converter.rb +67 -0
- data/lib/ffi/dynamic_library.rb +89 -0
- data/lib/ffi/enum.rb +18 -11
- data/lib/ffi/ffi.rb +6 -0
- data/lib/ffi/function.rb +71 -0
- data/lib/ffi/io.rb +3 -3
- data/lib/ffi/library.rb +65 -77
- data/lib/ffi/library_path.rb +109 -0
- data/lib/ffi/managedstruct.rb +3 -3
- data/lib/ffi/platform/aarch64-darwin/types.conf +130 -0
- data/lib/ffi/platform/aarch64-freebsd/types.conf +128 -0
- data/lib/ffi/platform/aarch64-freebsd12/types.conf +181 -0
- data/lib/ffi/platform/aarch64-linux/types.conf +81 -81
- data/lib/ffi/platform/aarch64-openbsd/types.conf +134 -0
- data/lib/ffi/platform/aarch64-windows/types.conf +52 -0
- data/lib/ffi/platform/arm-freebsd/types.conf +152 -0
- data/lib/ffi/platform/arm-freebsd12/types.conf +152 -0
- data/lib/ffi/platform/arm-linux/types.conf +110 -82
- 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/i386-cygwin/types.conf +1 -1
- data/lib/ffi/platform/i386-darwin/types.conf +63 -63
- data/lib/ffi/platform/i386-freebsd/types.conf +89 -89
- data/lib/ffi/platform/i386-freebsd12/types.conf +152 -0
- 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/loongarch64-linux/types.conf +141 -0
- 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/powerpc64le-linux/types.conf +100 -0
- data/lib/ffi/platform/riscv64-linux/types.conf +104 -0
- 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/sparcv9-openbsd/types.conf +156 -0
- data/lib/ffi/platform/sparcv9-solaris/types.conf +103 -103
- data/lib/ffi/platform/sw_64-linux/types.conf +141 -0
- 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 +90 -90
- data/lib/ffi/platform/x86_64-freebsd12/types.conf +158 -0
- data/lib/ffi/platform/x86_64-haiku/types.conf +117 -0
- data/lib/ffi/platform/x86_64-linux/types.conf +107 -77
- data/lib/ffi/platform/x86_64-msys/types.conf +119 -0
- 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/platform.rb +43 -20
- data/lib/ffi/pointer.rb +26 -20
- data/lib/ffi/struct.rb +14 -68
- data/lib/ffi/struct_by_reference.rb +72 -0
- data/lib/ffi/struct_layout.rb +96 -0
- data/lib/ffi/struct_layout_builder.rb +1 -1
- data/lib/ffi/tools/const_generator.rb +11 -8
- data/lib/ffi/tools/generator.rb +47 -2
- data/lib/ffi/tools/generator_task.rb +13 -17
- data/lib/ffi/tools/struct_generator.rb +6 -5
- data/lib/ffi/tools/types_generator.rb +7 -4
- data/lib/ffi/types.rb +33 -7
- data/lib/ffi/variadic.rb +20 -18
- data/lib/ffi/version.rb +1 -1
- data/lib/ffi.rb +10 -3
- data/rakelib/ffi_gem_helper.rb +65 -0
- 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/hello_ractor.rb +11 -0
- data/samples/inotify.rb +1 -1
- data/samples/pty.rb +1 -2
- data/samples/qsort.rb +0 -1
- data/samples/qsort_ractor.rb +28 -0
- data.tar.gz.sig +0 -0
- metadata +252 -153
- metadata.gz.sig +0 -0
- data/.gitignore +0 -22
- data/.gitmodules +0 -3
- data/.travis.yml +0 -52
- data/.yardopts +0 -5
- data/appveyor.yml +0 -22
- data/ext/ffi_c/Closure.c +0 -54
- 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/.travis/build.sh +0 -34
- data/ext/ffi_c/libffi/.travis/install.sh +0 -22
- data/ext/ffi_c/libffi/.travis/site.exp +0 -18
- data/ext/ffi_c/libffi/.travis.yml +0 -34
- 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/ext/ffi_c/libffi/testsuite/libffi.call/cls_uchar_va.c +0 -44
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_ushort_va.c +0 -44
- data/ext/ffi_c/win32/stdbool.h +0 -8
- data/ext/ffi_c/win32/stdint.h +0 -201
- data/samples/sample_helper.rb +0 -6
- data/ext/ffi_c/libffi/{.travis → .ci}/ar-lib +0 -0
- data/ext/ffi_c/libffi/{.travis → .ci}/compile +0 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/{pyobjc-tc.c → pyobjc_tc.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_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}/err_bad_abi.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/lib/ffi/platform/{sparc64-linux → sparcv9-linux}/types.conf +79 -79
@@ -1,11 +1,11 @@
|
|
1
1
|
dnl Process this with autoconf to create configure
|
2
2
|
|
3
|
-
AC_PREREQ(2.
|
3
|
+
AC_PREREQ([2.71])
|
4
4
|
|
5
|
-
AC_INIT([libffi],
|
5
|
+
AC_INIT([libffi],[3.4.4],[http://github.com/libffi/libffi/issues])
|
6
6
|
AC_CONFIG_HEADERS([fficonfig.h])
|
7
7
|
|
8
|
-
|
8
|
+
AC_CANONICAL_TARGET
|
9
9
|
target_alias=${target_alias-$host_alias}
|
10
10
|
|
11
11
|
case "${host}" in
|
@@ -38,9 +38,12 @@ AC_SUBST(CFLAGS)
|
|
38
38
|
|
39
39
|
AM_PROG_AS
|
40
40
|
AM_PROG_CC_C_O
|
41
|
-
|
41
|
+
AC_PROG_EGREP
|
42
|
+
LT_INIT
|
42
43
|
AC_CONFIG_MACRO_DIR([m4])
|
43
44
|
|
45
|
+
AC_CHECK_TOOL(READELF, readelf)
|
46
|
+
|
44
47
|
# Test for 64-bit build.
|
45
48
|
AC_CHECK_SIZEOF([size_t])
|
46
49
|
|
@@ -59,13 +62,13 @@ fi
|
|
59
62
|
cat > local.exp <<EOF
|
60
63
|
set CC_FOR_TARGET "$CC"
|
61
64
|
set CXX_FOR_TARGET "$CXX"
|
65
|
+
set compiler_vendor "$ax_cv_c_compiler_vendor"
|
62
66
|
EOF
|
63
67
|
|
64
68
|
AM_MAINTAINER_MODE
|
65
69
|
|
66
|
-
AC_CHECK_HEADERS(sys/
|
67
|
-
AC_CHECK_FUNCS([
|
68
|
-
AC_FUNC_MMAP_BLACKLIST
|
70
|
+
AC_CHECK_HEADERS(sys/memfd.h)
|
71
|
+
AC_CHECK_FUNCS([memfd_create])
|
69
72
|
|
70
73
|
dnl The -no-testsuite modules omit the test subdir.
|
71
74
|
AM_CONDITIONAL(TESTSUBDIR, test -d $srcdir/testsuite)
|
@@ -82,9 +85,17 @@ fi
|
|
82
85
|
AC_SUBST(AM_RUNTESTFLAGS)
|
83
86
|
AC_SUBST(AM_LTLDFLAGS)
|
84
87
|
|
85
|
-
|
88
|
+
m4_warn([obsolete],
|
89
|
+
[The preprocessor macro `STDC_HEADERS' is obsolete.
|
90
|
+
Except in unusual embedded environments, you can safely include all
|
91
|
+
ISO C90 headers unconditionally.])dnl
|
92
|
+
# Autoupdate added the next two lines to ensure that your configure
|
93
|
+
# script's behavior did not change. They are probably safe to remove.
|
94
|
+
AC_CHECK_INCLUDES_DEFAULT
|
95
|
+
AC_PROG_EGREP
|
96
|
+
|
86
97
|
AC_CHECK_FUNCS(memcpy)
|
87
|
-
|
98
|
+
AC_CHECK_HEADERS(alloca.h)
|
88
99
|
|
89
100
|
AC_CHECK_SIZEOF(double)
|
90
101
|
AC_CHECK_SIZEOF(long double)
|
@@ -119,9 +130,7 @@ case "$TARGET" in
|
|
119
130
|
save_LDFLAGS="$LDFLAGS"
|
120
131
|
CFLAGS="$CFLAGS -fpic"
|
121
132
|
LDFLAGS="$LDFLAGS -shared"
|
122
|
-
|
123
|
-
[libffi_cv_as_sparc_ua_pcrel=yes],
|
124
|
-
[libffi_cv_as_sparc_ua_pcrel=no])
|
133
|
+
AC_LINK_IFELSE([AC_LANG_PROGRAM([[asm (".text; foo: nop; .data; .align 4; .byte 0; .uaword %r_disp32(foo); .text");]], [[]])],[libffi_cv_as_sparc_ua_pcrel=yes],[libffi_cv_as_sparc_ua_pcrel=no])
|
125
134
|
CFLAGS="$save_CFLAGS"
|
126
135
|
LDFLAGS="$save_LDFLAGS"])
|
127
136
|
if test "x$libffi_cv_as_sparc_ua_pcrel" = xyes; then
|
@@ -133,9 +142,7 @@ case "$TARGET" in
|
|
133
142
|
libffi_cv_as_register_pseudo_op, [
|
134
143
|
libffi_cv_as_register_pseudo_op=unknown
|
135
144
|
# Check if we have .register
|
136
|
-
|
137
|
-
[libffi_cv_as_register_pseudo_op=yes],
|
138
|
-
[libffi_cv_as_register_pseudo_op=no])
|
145
|
+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[asm (".register %g2, #scratch");]])],[libffi_cv_as_register_pseudo_op=yes],[libffi_cv_as_register_pseudo_op=no])
|
139
146
|
])
|
140
147
|
if test "x$libffi_cv_as_register_pseudo_op" = xyes; then
|
141
148
|
AC_DEFINE(HAVE_AS_REGISTER_PSEUDO_OP, 1,
|
@@ -176,12 +183,37 @@ case "$TARGET" in
|
|
176
183
|
;;
|
177
184
|
esac
|
178
185
|
|
179
|
-
|
186
|
+
AC_CACHE_CHECK([whether compiler supports pointer authentication],
|
187
|
+
libffi_cv_as_ptrauth, [
|
188
|
+
libffi_cv_as_ptrauth=unknown
|
189
|
+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
|
190
|
+
#ifdef __clang__
|
191
|
+
# if __has_feature(ptrauth_calls)
|
192
|
+
# define HAVE_PTRAUTH 1
|
193
|
+
# endif
|
194
|
+
#endif
|
195
|
+
|
196
|
+
#ifndef HAVE_PTRAUTH
|
197
|
+
# error Pointer authentication not supported
|
198
|
+
#endif
|
199
|
+
]])],[libffi_cv_as_ptrauth=yes],[libffi_cv_as_ptrauth=no])
|
200
|
+
])
|
201
|
+
if test "x$libffi_cv_as_ptrauth" = xyes; then
|
202
|
+
AC_DEFINE(HAVE_PTRAUTH, 1,
|
203
|
+
[Define if your compiler supports pointer authentication.])
|
204
|
+
fi
|
205
|
+
|
206
|
+
# On PaX enable kernels that have MPROTECT enable we can't use PROT_EXEC;
|
207
|
+
# if EMUTRAMP is active too ffi could try mapping without PROT_EXEC,
|
208
|
+
# but the kernel needs to recognize the trampoline generated by ffi.
|
209
|
+
# Otherwise fallback to double mmap trick.
|
180
210
|
AC_ARG_ENABLE(pax_emutramp,
|
181
|
-
[ --enable-pax_emutramp enable pax emulated trampolines
|
211
|
+
[ --enable-pax_emutramp enable pax emulated trampolines (experimental)],
|
182
212
|
if test "$enable_pax_emutramp" = "yes"; then
|
213
|
+
AC_MSG_WARN([EMUTRAMP is experimental only. Use --enable-pax_emutramp=experimental to enforce.])
|
214
|
+
elif test "$enable_pax_emutramp" = "experimental"; then
|
183
215
|
AC_DEFINE(FFI_MMAP_EXEC_EMUTRAMP_PAX, 1,
|
184
|
-
[Define this if you want to enable pax emulated trampolines])
|
216
|
+
[Define this if you want to enable pax emulated trampolines (experimental)])
|
185
217
|
fi)
|
186
218
|
|
187
219
|
LT_SYS_SYMBOL_USCORE
|
@@ -238,19 +270,15 @@ EOF
|
|
238
270
|
fi
|
239
271
|
|
240
272
|
if test "x$GCC" = "xyes"; then
|
273
|
+
AX_CHECK_COMPILE_FLAG(-fno-lto, libffi_cv_no_lto=-fno-lto)
|
274
|
+
|
241
275
|
AC_CACHE_CHECK([whether .eh_frame section should be read-only],
|
242
276
|
libffi_cv_ro_eh_frame, [
|
243
|
-
libffi_cv_ro_eh_frame=
|
277
|
+
libffi_cv_ro_eh_frame=yes
|
244
278
|
echo 'extern void foo (void); void bar (void) { foo (); foo (); }' > conftest.c
|
245
|
-
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
|
279
|
+
if $CC $CFLAGS -c -fpic -fexceptions $libffi_cv_no_lto -o conftest.o conftest.c > /dev/null 2>&1; then
|
280
|
+
if $READELF -WS conftest.o 2>/dev/null | grep -q -n 'eh_frame .* WA'; then
|
281
|
+
libffi_cv_ro_eh_frame=no
|
254
282
|
fi
|
255
283
|
fi
|
256
284
|
rm -f conftest.*
|
@@ -270,7 +298,7 @@ if test "x$GCC" = "xyes"; then
|
|
270
298
|
echo 'int __attribute__ ((visibility ("hidden"))) foo (void) { return 1 ; }' > conftest.c
|
271
299
|
libffi_cv_hidden_visibility_attribute=no
|
272
300
|
if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
|
273
|
-
if
|
301
|
+
if $EGREP '(\.hidden|\.private_extern).*foo' conftest.s >/dev/null; then
|
274
302
|
libffi_cv_hidden_visibility_attribute=yes
|
275
303
|
fi
|
276
304
|
fi
|
@@ -283,8 +311,7 @@ if test "x$GCC" = "xyes"; then
|
|
283
311
|
fi
|
284
312
|
|
285
313
|
AC_ARG_ENABLE(docs,
|
286
|
-
|
287
|
-
[Disable building of docs (default: no)]),
|
314
|
+
AS_HELP_STRING([--disable-docs],[Disable building of docs (default: no)]),
|
288
315
|
[enable_docs=no],
|
289
316
|
[enable_docs=yes])
|
290
317
|
AM_CONDITIONAL(BUILD_DOCS, [test x$enable_docs = xyes])
|
@@ -292,7 +319,11 @@ AM_CONDITIONAL(BUILD_DOCS, [test x$enable_docs = xyes])
|
|
292
319
|
AH_BOTTOM([
|
293
320
|
#ifdef HAVE_HIDDEN_VISIBILITY_ATTRIBUTE
|
294
321
|
#ifdef LIBFFI_ASM
|
322
|
+
#ifdef __APPLE__
|
323
|
+
#define FFI_HIDDEN(name) .private_extern name
|
324
|
+
#else
|
295
325
|
#define FFI_HIDDEN(name) .hidden name
|
326
|
+
#endif
|
296
327
|
#else
|
297
328
|
#define FFI_HIDDEN __attribute__ ((visibility ("hidden")))
|
298
329
|
#endif
|
@@ -338,6 +369,26 @@ AC_ARG_ENABLE(raw-api,
|
|
338
369
|
AC_DEFINE(FFI_NO_RAW_API, 1, [Define this if you do not want support for the raw API.])
|
339
370
|
fi)
|
340
371
|
|
372
|
+
AC_ARG_ENABLE(exec-static-tramp,
|
373
|
+
[ --disable-exec-static-tramp disable use of static exec trampolines (enabled by default)])
|
374
|
+
|
375
|
+
if test "$enable_exec_static_tramp" != no; then
|
376
|
+
case "$target" in
|
377
|
+
*-cygwin* | *-msys*)
|
378
|
+
# Only define static trampolines if we are using the cygwin runtime.
|
379
|
+
# Will this need to be changed for mingw?
|
380
|
+
if test "x$GCC" = "xyes"; then
|
381
|
+
AC_DEFINE(FFI_EXEC_STATIC_TRAMP, 1,
|
382
|
+
[Define this if you want statically defined trampolines])
|
383
|
+
fi
|
384
|
+
;;
|
385
|
+
*arm*-*-linux-* | aarch64*-*-linux-* | i*86-*-linux-* | x86_64-*-linux-* | loongarch*-*-linux-*)
|
386
|
+
AC_DEFINE(FFI_EXEC_STATIC_TRAMP, 1,
|
387
|
+
[Define this if you want statically defined trampolines])
|
388
|
+
;;
|
389
|
+
esac
|
390
|
+
fi
|
391
|
+
|
341
392
|
AC_ARG_ENABLE(purify-safety,
|
342
393
|
[ --enable-purify-safety purify-safe mode],
|
343
394
|
if test "$enable_purify_safety" = "yes"; then
|
@@ -347,7 +398,7 @@ AC_ARG_ENABLE(purify-safety,
|
|
347
398
|
AC_ARG_ENABLE(multi-os-directory,
|
348
399
|
[ --disable-multi-os-directory
|
349
400
|
disable use of gcc --print-multi-os-directory to change the library installation directory])
|
350
|
-
|
401
|
+
|
351
402
|
# These variables are only ever used when we cross-build to X86_WIN32.
|
352
403
|
# And we only support this with GCC, so...
|
353
404
|
if test "x$GCC" = "xyes"; then
|
@@ -372,6 +423,16 @@ else
|
|
372
423
|
fi
|
373
424
|
AC_SUBST(toolexeclibdir)
|
374
425
|
|
426
|
+
# Conditionalize the makefile for this target machine.
|
427
|
+
tmake_file_=
|
428
|
+
for f in ${tmake_file}; do
|
429
|
+
if test -f ${srcdir}/src/$TARGETDIR/$f; then
|
430
|
+
tmake_file_="${tmake_file_} \$(srcdir)/src/$TARGETDIR/$f"
|
431
|
+
fi
|
432
|
+
done
|
433
|
+
tmake_file="${tmake_file_}"
|
434
|
+
AC_SUBST(tmake_file)
|
435
|
+
|
375
436
|
# Check linker support.
|
376
437
|
LIBFFI_ENABLE_SYMVERS
|
377
438
|
|
@@ -6,6 +6,13 @@
|
|
6
6
|
# THIS TABLE IS SORTED. KEEP IT THAT WAY.
|
7
7
|
# Most of the time we can define all the variables all at once...
|
8
8
|
case "${host}" in
|
9
|
+
aarch64*-*-cygwin* | aarch64*-*-msys* | aarch64*-*-mingw* | aarch64*-*-win* )
|
10
|
+
TARGET=ARM_WIN64; TARGETDIR=aarch64
|
11
|
+
if test "${ax_cv_c_compiler_vendor}" = "microsoft"; then
|
12
|
+
MSVC=1
|
13
|
+
fi
|
14
|
+
;;
|
15
|
+
|
9
16
|
aarch64*-*-*)
|
10
17
|
TARGET=AARCH64; TARGETDIR=aarch64
|
11
18
|
SOURCES="ffi.c sysv.S"
|
@@ -23,6 +30,13 @@ case "${host}" in
|
|
23
30
|
SOURCES="ffi.c arcompact.S"
|
24
31
|
;;
|
25
32
|
|
33
|
+
arm*-*-cygwin* | arm*-*-msys* | arm*-*-mingw* | arm*-*-win* )
|
34
|
+
TARGET=ARM_WIN32; TARGETDIR=arm
|
35
|
+
if test "${ax_cv_c_compiler_vendor}" = "microsoft"; then
|
36
|
+
MSVC=1
|
37
|
+
fi
|
38
|
+
;;
|
39
|
+
|
26
40
|
arm*-*-*)
|
27
41
|
TARGET=ARM; TARGETDIR=arm
|
28
42
|
SOURCES="ffi.c sysv.S"
|
@@ -43,6 +57,11 @@ case "${host}" in
|
|
43
57
|
SOURCES="ffi.c sysv.S"
|
44
58
|
;;
|
45
59
|
|
60
|
+
csky-*-*)
|
61
|
+
TARGET=CSKY; TARGETDIR=csky
|
62
|
+
SOURCES="ffi.c sysv.S"
|
63
|
+
;;
|
64
|
+
|
46
65
|
frv-*-*)
|
47
66
|
TARGET=FRV; TARGETDIR=frv
|
48
67
|
SOURCES="ffi.c eabi.S"
|
@@ -54,6 +73,7 @@ case "${host}" in
|
|
54
73
|
;;
|
55
74
|
hppa*64-*-hpux*)
|
56
75
|
TARGET=PA64_HPUX; TARGETDIR=pa
|
76
|
+
SOURCES="ffi64.c hpux64.S"
|
57
77
|
;;
|
58
78
|
hppa*-*-hpux*)
|
59
79
|
TARGET=PA_HPUX; TARGETDIR=pa
|
@@ -64,8 +84,8 @@ case "${host}" in
|
|
64
84
|
TARGET=X86_FREEBSD; TARGETDIR=x86
|
65
85
|
;;
|
66
86
|
|
67
|
-
i?86-*-cygwin* | i?86-*-mingw* | i?86-*-os2* | i?86-*-interix* \
|
68
|
-
| x86_64-*-cygwin* | x86_64-*-mingw* | x86_64-*-win* )
|
87
|
+
i?86-*-cygwin* | i?86-*-msys* | i?86-*-mingw* | i?86-*-win* | i?86-*-os2* | i?86-*-interix* \
|
88
|
+
| x86_64-*-cygwin* | x86_64-*-msys* | x86_64-*-mingw* | x86_64-*-win* )
|
69
89
|
TARGETDIR=x86
|
70
90
|
if test $ac_cv_sizeof_size_t = 4; then
|
71
91
|
TARGET=X86_WIN32
|
@@ -74,12 +94,6 @@ case "${host}" in
|
|
74
94
|
fi
|
75
95
|
if test "${ax_cv_c_compiler_vendor}" = "microsoft"; then
|
76
96
|
MSVC=1
|
77
|
-
if test $ac_cv_sizeof_size_t = 4; then
|
78
|
-
# libffi does not support microsoft tools for 32-bit windows
|
79
|
-
# hosts. Try porting src/x86/sysv.S to intel assembly
|
80
|
-
# format.
|
81
|
-
UNSUPPORTED=1
|
82
|
-
fi
|
83
97
|
fi
|
84
98
|
# All mingw/cygwin/win32 builds require -no-undefined for sharedlib.
|
85
99
|
# We must also check with_cross_host to decide if this is a native
|
@@ -104,22 +118,14 @@ case "${host}" in
|
|
104
118
|
i?86-*-* | x86_64-*-* | amd64-*)
|
105
119
|
TARGETDIR=x86
|
106
120
|
if test $ac_cv_sizeof_size_t = 4; then
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
TARGET_X32=yes
|
116
|
-
TARGET=X86_64
|
117
|
-
else
|
118
|
-
TARGET=X86;
|
119
|
-
fi
|
120
|
-
rm -f conftest.*
|
121
|
-
;;
|
122
|
-
esac
|
121
|
+
echo 'int foo (void) { return __x86_64__; }' > conftest.c
|
122
|
+
if $CC $CFLAGS -Werror -S conftest.c -o conftest.s > /dev/null 2>&1; then
|
123
|
+
TARGET_X32=yes
|
124
|
+
TARGET=X86_64
|
125
|
+
else
|
126
|
+
TARGET=X86;
|
127
|
+
fi
|
128
|
+
rm -f conftest.*
|
123
129
|
else
|
124
130
|
TARGET=X86_64;
|
125
131
|
fi
|
@@ -130,6 +136,16 @@ case "${host}" in
|
|
130
136
|
SOURCES="ffi.c unix.S"
|
131
137
|
;;
|
132
138
|
|
139
|
+
kvx-*-*)
|
140
|
+
TARGET=KVX; TARGETDIR=kvx
|
141
|
+
SOURCES="ffi.c sysv.S"
|
142
|
+
;;
|
143
|
+
|
144
|
+
loongarch64-*-*)
|
145
|
+
TARGET=LOONGARCH64; TARGETDIR=loongarch64
|
146
|
+
SOURCES="ffi.c sysv.S"
|
147
|
+
;;
|
148
|
+
|
133
149
|
m32r*-*-*)
|
134
150
|
TARGET=M32R; TARGETDIR=m32r
|
135
151
|
SOURCES="ffi.c sysv.S"
|
@@ -163,7 +179,7 @@ case "${host}" in
|
|
163
179
|
mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*)
|
164
180
|
TARGET=MIPS; TARGETDIR=mips
|
165
181
|
;;
|
166
|
-
mips*-*linux* | mips*-*-openbsd*)
|
182
|
+
mips*-*linux* | mips*-*-openbsd* | mips*-*-freebsd*)
|
167
183
|
# Support 128-bit long double for NewABI.
|
168
184
|
HAVE_LONG_DOUBLE='defined(__mips64)'
|
169
185
|
TARGET=MIPS; TARGETDIR=mips
|
@@ -174,7 +190,7 @@ case "${host}" in
|
|
174
190
|
SOURCES="ffi.c sysv.S"
|
175
191
|
;;
|
176
192
|
|
177
|
-
or1k
|
193
|
+
or1k*-*-*)
|
178
194
|
TARGET=OR1K; TARGETDIR=or1k
|
179
195
|
SOURCES="ffi.c sysv.S"
|
180
196
|
;;
|
@@ -186,6 +202,9 @@ case "${host}" in
|
|
186
202
|
powerpc-*-amigaos*)
|
187
203
|
TARGET=POWERPC; TARGETDIR=powerpc
|
188
204
|
;;
|
205
|
+
powerpc-*-eabi*)
|
206
|
+
TARGET=POWERPC; TARGETDIR=powerpc
|
207
|
+
;;
|
189
208
|
powerpc-*-beos*)
|
190
209
|
TARGET=POWERPC; TARGETDIR=powerpc
|
191
210
|
;;
|
@@ -194,12 +213,18 @@ case "${host}" in
|
|
194
213
|
;;
|
195
214
|
powerpc-*-aix* | rs6000-*-aix*)
|
196
215
|
TARGET=POWERPC_AIX; TARGETDIR=powerpc
|
216
|
+
# Create AIX-style "FAT" libraries.
|
217
|
+
tmake_file="t-aix"
|
197
218
|
;;
|
198
219
|
powerpc-*-freebsd* | powerpc-*-openbsd* | powerpc-*-netbsd*)
|
199
220
|
TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc
|
200
221
|
HAVE_LONG_DOUBLE_VARIANT=1
|
201
222
|
;;
|
202
|
-
|
223
|
+
powerpcspe-*-freebsd*)
|
224
|
+
TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc
|
225
|
+
CFLAGS="$CFLAGS -D__NO_FPRS__"
|
226
|
+
;;
|
227
|
+
powerpc64-*-freebsd* | powerpc64le-*-freebsd*)
|
203
228
|
TARGET=POWERPC; TARGETDIR=powerpc
|
204
229
|
;;
|
205
230
|
powerpc*-*-rtems*)
|
@@ -240,6 +265,11 @@ case "${host}" in
|
|
240
265
|
SOURCES="ffi.c elfbsd.S"
|
241
266
|
;;
|
242
267
|
|
268
|
+
wasm32-*-*)
|
269
|
+
TARGET=wasm32; TARGETDIR=wasm32
|
270
|
+
SOURCES="ffi.c"
|
271
|
+
;;
|
272
|
+
|
243
273
|
xtensa*-*)
|
244
274
|
TARGET=XTENSA; TARGETDIR=xtensa
|
245
275
|
SOURCES="ffi.c sysv.S"
|
@@ -248,6 +278,20 @@ esac
|
|
248
278
|
|
249
279
|
# ... but some of the cases above share configury.
|
250
280
|
case "${TARGET}" in
|
281
|
+
ARM_WIN32)
|
282
|
+
if test "$MSVC" = 1; then
|
283
|
+
SOURCES="ffi.c sysv_msvc_arm32.S"
|
284
|
+
else
|
285
|
+
SOURCES="ffi.c sysv.S"
|
286
|
+
fi
|
287
|
+
;;
|
288
|
+
ARM_WIN64)
|
289
|
+
if test "$MSVC" = 1; then
|
290
|
+
SOURCES="ffi.c win64_armasm.S"
|
291
|
+
else
|
292
|
+
SOURCES="ffi.c sysv.S"
|
293
|
+
fi
|
294
|
+
;;
|
251
295
|
MIPS)
|
252
296
|
SOURCES="ffi.c o32.S n32.S"
|
253
297
|
;;
|
@@ -265,7 +309,11 @@ case "${TARGET}" in
|
|
265
309
|
SOURCES="ffi.c ffi_sysv.c sysv.S ppc_closure.S"
|
266
310
|
;;
|
267
311
|
X86 | X86_DARWIN | X86_FREEBSD | X86_WIN32)
|
268
|
-
|
312
|
+
if test "$MSVC" = 1; then
|
313
|
+
SOURCES="ffi.c sysv_intel.S"
|
314
|
+
else
|
315
|
+
SOURCES="ffi.c sysv.S"
|
316
|
+
fi
|
269
317
|
;;
|
270
318
|
X86_64)
|
271
319
|
if test x"$TARGET_X32" = xyes; then
|
@@ -1,7 +1,7 @@
|
|
1
|
-
# Makefile.in generated by automake 1.
|
1
|
+
# Makefile.in generated by automake 1.16.5 from Makefile.am.
|
2
2
|
# @configure_input@
|
3
3
|
|
4
|
-
# Copyright (C) 1994-
|
4
|
+
# Copyright (C) 1994-2021 Free Software Foundation, Inc.
|
5
5
|
|
6
6
|
# This Makefile.in is free software; the Free Software Foundation
|
7
7
|
# gives unlimited permission to copy and/or distribute it,
|
@@ -91,7 +91,6 @@ target_triplet = @target@
|
|
91
91
|
subdir = doc
|
92
92
|
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
93
93
|
am__aclocal_m4_deps = $(top_srcdir)/m4/asmcfi.m4 \
|
94
|
-
$(top_srcdir)/m4/ax_append_flag.m4 \
|
95
94
|
$(top_srcdir)/m4/ax_cc_maxopt.m4 \
|
96
95
|
$(top_srcdir)/m4/ax_cflags_warn_all.m4 \
|
97
96
|
$(top_srcdir)/m4/ax_check_compile_flag.m4 \
|
@@ -100,6 +99,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/asmcfi.m4 \
|
|
100
99
|
$(top_srcdir)/m4/ax_enable_builddir.m4 \
|
101
100
|
$(top_srcdir)/m4/ax_gcc_archflag.m4 \
|
102
101
|
$(top_srcdir)/m4/ax_gcc_x86_cpuid.m4 \
|
102
|
+
$(top_srcdir)/m4/ax_prepend_flag.m4 \
|
103
|
+
$(top_srcdir)/m4/ax_require_defined.m4 \
|
103
104
|
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
|
104
105
|
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
|
105
106
|
$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \
|
@@ -203,7 +204,6 @@ am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
|
203
204
|
am__DIST_COMMON = $(srcdir)/Makefile.in mdate-sh texinfo.tex
|
204
205
|
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
205
206
|
ACLOCAL = @ACLOCAL@
|
206
|
-
ALLOCA = @ALLOCA@
|
207
207
|
AMTAR = @AMTAR@
|
208
208
|
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
209
209
|
AM_LTLDFLAGS = @AM_LTLDFLAGS@
|
@@ -219,8 +219,9 @@ CCASDEPMODE = @CCASDEPMODE@
|
|
219
219
|
CCASFLAGS = @CCASFLAGS@
|
220
220
|
CCDEPMODE = @CCDEPMODE@
|
221
221
|
CFLAGS = @CFLAGS@
|
222
|
-
CPP = @CPP@
|
223
222
|
CPPFLAGS = @CPPFLAGS@
|
223
|
+
CSCOPE = @CSCOPE@
|
224
|
+
CTAGS = @CTAGS@
|
224
225
|
CXX = @CXX@
|
225
226
|
CXXCPP = @CXXCPP@
|
226
227
|
CXXDEPMODE = @CXXDEPMODE@
|
@@ -235,9 +236,11 @@ ECHO_C = @ECHO_C@
|
|
235
236
|
ECHO_N = @ECHO_N@
|
236
237
|
ECHO_T = @ECHO_T@
|
237
238
|
EGREP = @EGREP@
|
239
|
+
ETAGS = @ETAGS@
|
238
240
|
EXEEXT = @EXEEXT@
|
239
241
|
FFI_EXEC_TRAMPOLINE_TABLE = @FFI_EXEC_TRAMPOLINE_TABLE@
|
240
242
|
FGREP = @FGREP@
|
243
|
+
FILECMD = @FILECMD@
|
241
244
|
GREP = @GREP@
|
242
245
|
HAVE_LONG_DOUBLE = @HAVE_LONG_DOUBLE@
|
243
246
|
HAVE_LONG_DOUBLE_VARIANT = @HAVE_LONG_DOUBLE_VARIANT@
|
@@ -276,6 +279,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
|
|
276
279
|
PATH_SEPARATOR = @PATH_SEPARATOR@
|
277
280
|
PRTDIAG = @PRTDIAG@
|
278
281
|
RANLIB = @RANLIB@
|
282
|
+
READELF = @READELF@
|
279
283
|
SECTION_LDFLAGS = @SECTION_LDFLAGS@
|
280
284
|
SED = @SED@
|
281
285
|
SET_MAKE = @SET_MAKE@
|
@@ -342,6 +346,7 @@ target_alias = @target_alias@
|
|
342
346
|
target_cpu = @target_cpu@
|
343
347
|
target_os = @target_os@
|
344
348
|
target_vendor = @target_vendor@
|
349
|
+
tmake_file = @tmake_file@
|
345
350
|
toolexecdir = @toolexecdir@
|
346
351
|
toolexeclibdir = @toolexeclibdir@
|
347
352
|
top_build_prefix = @top_build_prefix@
|
@@ -369,8 +374,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
|
369
374
|
*config.status*) \
|
370
375
|
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
371
376
|
*) \
|
372
|
-
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(
|
373
|
-
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(
|
377
|
+
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
|
378
|
+
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
|
374
379
|
esac;
|
375
380
|
|
376
381
|
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
@@ -554,8 +559,10 @@ ctags CTAGS:
|
|
554
559
|
|
555
560
|
cscope cscopelist:
|
556
561
|
|
562
|
+
distdir: $(BUILT_SOURCES)
|
563
|
+
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
557
564
|
|
558
|
-
distdir: $(DISTFILES)
|
565
|
+
distdir-am: $(DISTFILES)
|
559
566
|
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
560
567
|
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
561
568
|
list='$(DISTFILES)'; \
|