ffi 1.9.25 → 1.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +212 -0
- data/Gemfile +3 -4
- data/README.md +38 -18
- data/Rakefile +55 -146
- data/ext/ffi_c/AbstractMemory.c +29 -34
- data/ext/ffi_c/Buffer.c +4 -9
- data/ext/ffi_c/Call.c +16 -49
- data/ext/ffi_c/Call.h +4 -7
- data/ext/ffi_c/ClosurePool.c +75 -25
- data/ext/ffi_c/ClosurePool.h +3 -1
- data/ext/ffi_c/DynamicLibrary.c +2 -7
- data/ext/ffi_c/Function.c +47 -131
- data/ext/ffi_c/Function.h +0 -4
- data/ext/ffi_c/FunctionInfo.c +3 -8
- data/ext/ffi_c/LastError.c +49 -8
- data/ext/ffi_c/LongDouble.c +12 -10
- data/ext/ffi_c/LongDouble.h +0 -4
- data/ext/ffi_c/MemoryPointer.c +3 -8
- data/ext/ffi_c/MemoryPointer.h +0 -4
- data/ext/ffi_c/MethodHandle.c +21 -31
- data/ext/ffi_c/MethodHandle.h +3 -2
- data/ext/ffi_c/Platform.c +3 -54
- data/ext/ffi_c/Pointer.c +25 -26
- data/ext/ffi_c/Pointer.h +0 -4
- data/ext/ffi_c/Struct.c +49 -56
- data/ext/ffi_c/Struct.h +12 -6
- data/ext/ffi_c/StructByValue.c +2 -7
- data/ext/ffi_c/StructLayout.c +22 -20
- data/ext/ffi_c/Thread.c +4 -228
- data/ext/ffi_c/Thread.h +1 -20
- data/ext/ffi_c/Type.c +1 -19
- data/ext/ffi_c/Type.h +0 -1
- data/ext/ffi_c/Types.c +7 -8
- data/ext/ffi_c/Types.h +3 -4
- data/ext/ffi_c/Variadic.c +23 -24
- data/ext/ffi_c/compat.h +4 -0
- data/ext/ffi_c/extconf.rb +53 -30
- 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/moxie-sim.exp +1 -1
- 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 +56 -72
- data/ext/ffi_c/libffi/README.md +33 -8
- data/ext/ffi_c/libffi/config.guess +552 -331
- data/ext/ffi_c/libffi/config.sub +1321 -1306
- data/ext/ffi_c/libffi/configure.ac +37 -12
- data/ext/ffi_c/libffi/configure.host +56 -27
- data/ext/ffi_c/libffi/doc/Makefile.am +3 -0
- data/ext/ffi_c/libffi/doc/libffi.texi +997 -0
- data/ext/ffi_c/libffi/doc/version.texi +4 -0
- data/ext/ffi_c/libffi/generate-darwin-source-and-headers.py +2 -4
- 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 +38 -13
- data/ext/ffi_c/libffi/src/aarch64/ffi.c +153 -69
- data/ext/ffi_c/libffi/src/aarch64/ffitarget.h +19 -3
- data/ext/ffi_c/libffi/src/aarch64/internal.h +1 -0
- data/ext/ffi_c/libffi/src/aarch64/sysv.S +22 -9
- data/ext/ffi_c/libffi/src/aarch64/win64_armasm.S +506 -0
- data/ext/ffi_c/libffi/src/arm/ffi.c +62 -5
- data/ext/ffi_c/libffi/src/arm/ffitarget.h +8 -1
- data/ext/ffi_c/libffi/src/arm/sysv.S +6 -4
- data/ext/ffi_c/libffi/src/arm/sysv_msvc_arm32.S +311 -0
- data/ext/ffi_c/libffi/src/closures.c +69 -14
- 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 +1 -1
- data/ext/ffi_c/libffi/src/frv/ffi.c +1 -1
- 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/metag/ffi.c +1 -1
- data/ext/ffi_c/libffi/src/mips/ffi.c +5 -1
- data/ext/ffi_c/libffi/src/mips/ffitarget.h +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_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 +91 -28
- data/ext/ffi_c/libffi/src/powerpc/linux64_closure.S +81 -5
- 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 +29 -12
- data/ext/ffi_c/libffi/src/x86/ffi64.c +22 -11
- data/ext/ffi_c/libffi/src/x86/ffitarget.h +15 -2
- data/ext/ffi_c/libffi/src/x86/ffiw64.c +20 -10
- data/ext/ffi_c/libffi/src/x86/sysv.S +105 -10
- data/ext/ffi_c/libffi/src/x86/sysv_intel.S +995 -0
- data/ext/ffi_c/libffi/src/x86/unix64.S +100 -4
- data/ext/ffi_c/libffi/src/x86/win64.S +12 -3
- data/ext/ffi_c/libffi/src/x86/win64_intel.S +3 -2
- data/ext/ffi_c/libffi/testsuite/Makefile.am +114 -109
- data/ext/ffi_c/libffi/testsuite/lib/libffi.exp +32 -8
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/bhaible.exp +7 -2
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-call.c +4 -4
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-callback.c +2 -2
- 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 +3 -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 +13 -6
- data/lib/ffi.rb +10 -2
- data/lib/ffi/abstract_memory.rb +44 -0
- data/lib/ffi/autopointer.rb +1 -1
- data/lib/ffi/data_converter.rb +67 -0
- data/lib/ffi/ffi.rb +3 -0
- data/lib/ffi/io.rb +3 -3
- data/lib/ffi/library.rb +12 -8
- data/lib/ffi/managedstruct.rb +2 -2
- data/lib/ffi/platform.rb +34 -10
- 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 +128 -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/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/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/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/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 +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/pointer.rb +26 -20
- 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/variadic.rb +1 -10
- data/lib/ffi/version.rb +1 -1
- 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/inotify.rb +1 -1
- data/samples/pty.rb +1 -2
- data/samples/qsort.rb +0 -1
- metadata +160 -122
- 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/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/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/compat.h
CHANGED
data/ext/ffi_c/extconf.rb
CHANGED
@@ -1,8 +1,31 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
if
|
3
|
+
if RUBY_ENGINE == 'ruby' || RUBY_ENGINE == 'rbx'
|
4
4
|
require 'mkmf'
|
5
5
|
require 'rbconfig'
|
6
|
+
|
7
|
+
def system_libffi_usable?
|
8
|
+
# We need pkg_config or ffi.h
|
9
|
+
libffi_ok = pkg_config("libffi") ||
|
10
|
+
have_header("ffi.h") ||
|
11
|
+
find_header("ffi.h", "/usr/local/include", "/usr/include/ffi",
|
12
|
+
"/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/ffi",
|
13
|
+
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ffi") ||
|
14
|
+
(find_header("ffi.h", `xcrun --sdk macosx --show-sdk-path`.strip + "/usr/include/ffi") rescue false)
|
15
|
+
|
16
|
+
# Ensure we can link to ffi_prep_closure_loc
|
17
|
+
libffi_ok &&= have_library("ffi", "ffi_prep_closure_loc", [ "ffi.h" ]) ||
|
18
|
+
have_library("libffi", "ffi_prep_closure_loc", [ "ffi.h" ]) ||
|
19
|
+
have_library("libffi-8", "ffi_prep_closure_loc", [ "ffi.h" ])
|
20
|
+
|
21
|
+
if RbConfig::CONFIG['host_os'] =~ /mswin/
|
22
|
+
have_library('libffi_convenience')
|
23
|
+
have_library('shlwapi')
|
24
|
+
end
|
25
|
+
|
26
|
+
libffi_ok
|
27
|
+
end
|
28
|
+
|
6
29
|
dir_config("ffi_c")
|
7
30
|
|
8
31
|
# recent versions of ruby add restrictive ansi and warning flags on a whim - kill them all
|
@@ -12,58 +35,58 @@ if !defined?(RUBY_ENGINE) || RUBY_ENGINE == 'ruby' || RUBY_ENGINE == 'rbx'
|
|
12
35
|
# solaris 10 needs -c99 for <stdbool.h>
|
13
36
|
$CFLAGS << " -std=c99" if RbConfig::CONFIG['host_os'] =~ /solaris(!?2\.11)/
|
14
37
|
|
15
|
-
|
16
|
-
|
17
|
-
find_header("ffi.h", "/usr/local/include", "/usr/include/ffi"))
|
38
|
+
# Check whether we use system libffi
|
39
|
+
system_libffi = enable_config('system-libffi', :try)
|
18
40
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
# Check if the raw api is available.
|
25
|
-
$defs << "-DHAVE_RAW_API" if have_func("ffi_raw_call") && have_func("ffi_prep_raw_closure")
|
41
|
+
if system_libffi == :try
|
42
|
+
system_libffi = ENV['RUBY_CC_VERSION'].nil? && system_libffi_usable?
|
43
|
+
elsif system_libffi
|
44
|
+
abort "system libffi is not usable" unless system_libffi_usable?
|
26
45
|
end
|
27
46
|
|
28
|
-
|
29
|
-
have_header('ruby/thread.h') # for compat with ruby < 2.0
|
30
|
-
have_func('rb_thread_blocking_region')
|
31
|
-
have_func('rb_thread_call_with_gvl')
|
32
|
-
have_func('rb_thread_call_without_gvl')
|
33
|
-
|
34
|
-
if libffi_ok
|
47
|
+
if system_libffi
|
35
48
|
have_func('ffi_prep_cif_var')
|
49
|
+
$defs << "-DHAVE_RAW_API" if have_func("ffi_raw_call") && have_func("ffi_prep_raw_closure")
|
36
50
|
else
|
37
51
|
$defs << "-DHAVE_FFI_PREP_CIF_VAR"
|
52
|
+
$defs << "-DUSE_INTERNAL_LIBFFI"
|
53
|
+
|
54
|
+
# Ensure libffi symbols aren't exported when using static libffi.
|
55
|
+
# This is to avoid interference with other gems like fiddle.
|
56
|
+
# See https://github.com/ffi/ffi/issues/835
|
57
|
+
append_ldflags "-Wl,--exclude-libs,ALL"
|
58
|
+
end
|
59
|
+
|
60
|
+
ffi_alloc_default = RbConfig::CONFIG['host_os'] =~ /darwin/i && RbConfig::CONFIG['host'] =~ /arm/i
|
61
|
+
if enable_config('libffi-alloc', ffi_alloc_default)
|
62
|
+
$defs << "-DUSE_FFI_ALLOC"
|
38
63
|
end
|
39
64
|
|
40
65
|
$defs << "-DHAVE_EXTCONF_H" if $defs.empty? # needed so create_header works
|
41
|
-
$defs << "-DUSE_INTERNAL_LIBFFI" unless libffi_ok
|
42
|
-
$defs << "-DRUBY_1_9" if RUBY_VERSION >= "1.9.0"
|
43
|
-
$defs << "-DFFI_BUILDING" if RbConfig::CONFIG['host_os'] =~ /mswin/ # for compatibility with newer libffi
|
44
66
|
|
45
67
|
create_header
|
46
|
-
|
47
|
-
$LOCAL_LIBS << " ./libffi/.libs/libffi_convenience.lib" if !libffi_ok && RbConfig::CONFIG['host_os'] =~ /mswin/
|
48
|
-
|
49
68
|
create_makefile("ffi_c")
|
50
|
-
|
69
|
+
|
70
|
+
unless system_libffi
|
51
71
|
File.open("Makefile", "a") do |mf|
|
52
72
|
mf.puts "LIBFFI_HOST=--host=#{RbConfig::CONFIG['host_alias']}" if RbConfig::CONFIG.has_key?("host_alias")
|
53
|
-
if RbConfig::CONFIG['host_os']
|
73
|
+
if RbConfig::CONFIG['host_os'] =~ /darwin/i
|
74
|
+
if RbConfig::CONFIG['host'] =~ /arm/i
|
75
|
+
mf.puts "LIBFFI_HOST=--host=aarch64-apple-#{RbConfig::CONFIG['host_os']}"
|
76
|
+
end
|
54
77
|
mf.puts "include ${srcdir}/libffi.darwin.mk"
|
55
|
-
elsif RbConfig::CONFIG['host_os']
|
78
|
+
elsif RbConfig::CONFIG['host_os'] =~ /bsd/i
|
56
79
|
mf.puts '.include "${srcdir}/libffi.bsd.mk"'
|
57
|
-
elsif RbConfig::CONFIG['host_os']
|
80
|
+
elsif RbConfig::CONFIG['host_os'] =~ /mswin64/i
|
58
81
|
mf.puts '!include $(srcdir)/libffi.vc64.mk'
|
59
|
-
elsif RbConfig::CONFIG['host_os']
|
82
|
+
elsif RbConfig::CONFIG['host_os'] =~ /mswin32/i
|
60
83
|
mf.puts '!include $(srcdir)/libffi.vc.mk'
|
61
84
|
else
|
62
85
|
mf.puts "include ${srcdir}/libffi.mk"
|
63
86
|
end
|
64
87
|
end
|
65
88
|
end
|
66
|
-
|
89
|
+
|
67
90
|
else
|
68
91
|
File.open("Makefile", "w") do |mf|
|
69
92
|
mf.puts "# Dummy makefile for non-mri rubies"
|
data/ext/ffi_c/ffi.c
CHANGED
@@ -40,7 +40,6 @@
|
|
40
40
|
#include "MemoryPointer.h"
|
41
41
|
#include "Struct.h"
|
42
42
|
#include "StructByValue.h"
|
43
|
-
#include "StructByReference.h"
|
44
43
|
#include "DynamicLibrary.h"
|
45
44
|
#include "Platform.h"
|
46
45
|
#include "Types.h"
|
@@ -59,9 +58,9 @@ VALUE rbffi_FFIModule = Qnil;
|
|
59
58
|
static VALUE moduleFFI = Qnil;
|
60
59
|
|
61
60
|
void
|
62
|
-
Init_ffi_c(void)
|
61
|
+
Init_ffi_c(void)
|
63
62
|
{
|
64
|
-
/*
|
63
|
+
/*
|
65
64
|
* Document-module: FFI
|
66
65
|
*
|
67
66
|
* This module embbed type constants from {FFI::NativeType}.
|
@@ -70,12 +69,10 @@ Init_ffi_c(void)
|
|
70
69
|
rb_global_variable(&rbffi_FFIModule);
|
71
70
|
|
72
71
|
rbffi_Thread_Init(rbffi_FFIModule);
|
73
|
-
|
72
|
+
|
74
73
|
/* FFI::Type needs to be initialized before most other classes */
|
75
74
|
rbffi_Type_Init(moduleFFI);
|
76
75
|
|
77
|
-
rbffi_DataConverter_Init(moduleFFI);
|
78
|
-
|
79
76
|
rbffi_ArrayType_Init(moduleFFI);
|
80
77
|
rbffi_LastError_Init(moduleFFI);
|
81
78
|
rbffi_Call_Init(moduleFFI);
|
@@ -88,11 +85,9 @@ Init_ffi_c(void)
|
|
88
85
|
rbffi_MemoryPointer_Init(moduleFFI);
|
89
86
|
rbffi_Buffer_Init(moduleFFI);
|
90
87
|
rbffi_StructByValue_Init(moduleFFI);
|
91
|
-
rbffi_StructByReference_Init(moduleFFI);
|
92
88
|
rbffi_Struct_Init(moduleFFI);
|
93
89
|
rbffi_DynamicLibrary_Init(moduleFFI);
|
94
90
|
rbffi_Variadic_Init(moduleFFI);
|
95
91
|
rbffi_Types_Init(moduleFFI);
|
96
92
|
rbffi_MappedType_Init(moduleFFI);
|
97
93
|
}
|
98
|
-
|
data/ext/ffi_c/libffi.darwin.mk
CHANGED
@@ -58,7 +58,7 @@ build_ffi = \
|
|
58
58
|
env CC="$(CCACHE) $(CC)" CFLAGS="-arch $(1) $(LIBFFI_CFLAGS)" LDFLAGS="-arch $(1)" \
|
59
59
|
$(LIBFFI_CONFIGURE) --host=$(1)-apple-darwin > /dev/null; \
|
60
60
|
fi); \
|
61
|
-
|
61
|
+
$(MAKE) -C "$(BUILD_DIR)"/libffi-$(1)
|
62
62
|
|
63
63
|
target_ffi = "$(BUILD_DIR)"/libffi-$(1)/.libs/libffi_convenience.a:; $(call build_ffi,$(1))
|
64
64
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
shallow_clone: true
|
2
2
|
|
3
|
-
# We're currently only testing
|
3
|
+
# We're currently only testing libffi built with Microsoft's
|
4
4
|
# tools.
|
5
5
|
# This matrix should be expanded to include at least:
|
6
6
|
# 32- and 64-bit gcc/cygwin
|
@@ -8,9 +8,12 @@ shallow_clone: true
|
|
8
8
|
# 32- and 64-bit clang/mingw
|
9
9
|
# and perhaps more.
|
10
10
|
|
11
|
-
image: Visual Studio
|
11
|
+
image: Visual Studio 2017
|
12
12
|
platform:
|
13
13
|
- x64
|
14
|
+
- x86
|
15
|
+
- arm
|
16
|
+
- arm64
|
14
17
|
|
15
18
|
environment:
|
16
19
|
global:
|
@@ -18,33 +21,46 @@ environment:
|
|
18
21
|
CYG_CACHE: C:/cygwin/var/cache/setup
|
19
22
|
CYG_MIRROR: http://mirrors.kernel.org/sourceware/cygwin/
|
20
23
|
matrix:
|
21
|
-
- VSVER:
|
24
|
+
- VSVER: 15
|
22
25
|
|
23
26
|
install:
|
24
27
|
- ps: >-
|
25
28
|
If ($env:Platform -Match "x86") {
|
26
29
|
$env:VCVARS_PLATFORM="x86"
|
27
|
-
$env:BUILD="
|
28
|
-
$env:HOST="
|
30
|
+
$env:BUILD="i686-pc-cygwin"
|
31
|
+
$env:HOST="i686-pc-cygwin"
|
32
|
+
$env:MSVCC="/cygdrive/c/projects/libffi/msvcc.sh"
|
33
|
+
$env:SRC_ARCHITECTURE="x86"
|
34
|
+
} ElseIf ($env:Platform -Match "arm64") {
|
35
|
+
$env:VCVARS_PLATFORM="x86_arm64"
|
36
|
+
$env:BUILD="i686-pc-cygwin"
|
37
|
+
$env:HOST="aarch64-w64-cygwin"
|
38
|
+
$env:MSVCC="/cygdrive/c/projects/libffi/msvcc.sh -marm64"
|
39
|
+
$env:SRC_ARCHITECTURE="aarch64"
|
40
|
+
} ElseIf ($env:Platform -Match "arm") {
|
41
|
+
$env:VCVARS_PLATFORM="x86_arm"
|
42
|
+
$env:BUILD="i686-pc-cygwin"
|
43
|
+
$env:HOST="arm-w32-cygwin"
|
44
|
+
$env:MSVCC="/cygdrive/c/projects/libffi/msvcc.sh -marm"
|
45
|
+
$env:SRC_ARCHITECTURE="arm"
|
29
46
|
} Else {
|
30
47
|
$env:VCVARS_PLATFORM="amd64"
|
31
48
|
$env:BUILD="x86_64-w64-cygwin"
|
32
49
|
$env:HOST="x86_64-w64-cygwin"
|
50
|
+
$env:MSVCC="/cygdrive/c/projects/libffi/msvcc.sh -m64"
|
51
|
+
$env:SRC_ARCHITECTURE="x86"
|
33
52
|
}
|
34
53
|
- 'appveyor DownloadFile https://cygwin.com/setup-x86.exe -FileName setup.exe'
|
35
54
|
- 'setup.exe -qnNdO -R "%CYG_ROOT%" -s "%CYG_MIRROR%" -l "%CYG_CACHE%" -P dejagnu >NUL'
|
36
55
|
- '%CYG_ROOT%/bin/bash -lc "cygcheck -dc cygwin"'
|
56
|
+
- echo call VsDevCmd to set VS150COMNTOOLS
|
57
|
+
- call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat"
|
37
58
|
- ps: $env:VSCOMNTOOLS=(Get-Content ("env:VS" + "$env:VSVER" + "0COMNTOOLS"))
|
38
59
|
- echo "Using Visual Studio %VSVER%.0 at %VSCOMNTOOLS%"
|
39
|
-
- call "%VSCOMNTOOLS
|
60
|
+
- call "%VSCOMNTOOLS%..\..\vc\Auxiliary\Build\vcvarsall.bat" %VCVARS_PLATFORM%
|
40
61
|
|
41
62
|
build_script:
|
42
63
|
- c:\cygwin\bin\sh -lc "(cd $OLDPWD; ./autogen.sh;)"
|
43
|
-
- c:\cygwin\bin\sh -lc "(cd $OLDPWD; ./configure CC='
|
44
|
-
- c:\cygwin\bin\sh -lc "(cd $OLDPWD; cp src
|
64
|
+
- c:\cygwin\bin\sh -lc "(cd $OLDPWD; ./configure CC='%MSVCC%' CXX='%MSVCC%' LD='link' CPP='cl -nologo -EP' CXXCPP='cl -nologo -EP' CPPFLAGS='-DFFI_BUILDING_DLL' AR='/cygdrive/c/projects/libffi/.travis/ar-lib lib' NM='dumpbin -symbols' STRIP=':' --build=$BUILD --host=$HOST;)"
|
65
|
+
- c:\cygwin\bin\sh -lc "(cd $OLDPWD; cp src/%SRC_ARCHITECTURE%/ffitarget.h include; make; find .;)"
|
45
66
|
- c:\cygwin\bin\sh -lc "(cd $OLDPWD; cp `find . -name 'libffi-?.dll'` $HOST/testsuite/; make check; cat `find ./ -name libffi.log`)"
|
46
|
-
|
47
|
-
# FIXME: "make check" currently fails. It just looks like msvcc needs
|
48
|
-
# to learn about -L and -l options. If you add "make check; cat `find
|
49
|
-
# ./ -name libffi.log" to the end of that build command you'll see
|
50
|
-
# what I mean.
|
@@ -3,10 +3,58 @@ sudo: required
|
|
3
3
|
|
4
4
|
language: cpp
|
5
5
|
|
6
|
+
# For qemu-powered targets, get the list of supported processors from
|
7
|
+
# travis by setting QEMU_CPU=help, then set -mcpu= for the compilers
|
8
|
+
# accordingly.
|
9
|
+
|
6
10
|
matrix:
|
7
11
|
include:
|
12
|
+
- os: linux
|
13
|
+
env: HOST=powerpc-eabisim RUNTESTFLAGS="--target_board powerpc-eabisim" DEJAGNU="/opt/.travis/site.exp"
|
14
|
+
- os: linux
|
15
|
+
env: HOST=or1k-elf RUNTESTFLAGS="--target_board or1k-sim" DEJAGNU="/opt/.travis/site.exp"
|
16
|
+
- os: linux
|
17
|
+
env: HOST=m32r-elf RUNTESTFLAGS="--target_board m32r-sim" DEJAGNU="/opt/.travis/site.exp"
|
18
|
+
- os: linux
|
19
|
+
env: HOST=bfin-elf RUNTESTFLAGS="--target_board bfin-sim" DEJAGNU="/opt/.travis/site.exp"
|
20
|
+
# This configuration is still using the native x86 toolchain?
|
21
|
+
# - os: osx
|
22
|
+
# env: HOST=aarch64-apple-darwin13
|
8
23
|
- os: osx
|
9
|
-
env: HOST=
|
24
|
+
env: HOST=x86_64-apple-darwin10
|
25
|
+
- os: linux
|
26
|
+
env: HOST=x86_64-w64-mingw32 MEVAL='export CC="x86_64-w64-mingw32-gcc" && CXX="x86_64-w64-mingw32-g++" RUNTESTFLAGS="--target_board wine-sim" DEJAGNU="$TRAVIS_BUILD_DIR/.travis/site.exp" CONFIGURE_OPTIONS=--disable-shared LIBFFI_TEST_OPTIMIZATION="-O2"
|
27
|
+
- os: linux
|
28
|
+
env: HOST=sh4-linux-gnu CONFIGURE_OPTIONS=--disable-shared QEMU_LD_PREFIX=/usr/sh4-linux-gnu
|
29
|
+
- os: linux
|
30
|
+
env: HOST=alpha-linux-gnu CONFIGURE_OPTIONS=--disable-shared QEMU_LD_PREFIX=/usr/alpha-linux-gnu
|
31
|
+
- os: linux
|
32
|
+
env: HOST=m68k-linux-gnu MEVAL='export CC="m68k-linux-gnu-gcc-8 -mcpu=547x" && CXX="m68k-linux-gnu-g++-8 -mcpu=547x"' CONFIGURE_OPTIONS=--disable-shared QEMU_LD_PREFIX=/usr/m68k-linux-gnu QEMU_CPU=cfv4e
|
33
|
+
- os: linux
|
34
|
+
arch: s390x
|
35
|
+
env: HOST=s390x-linux-gnu
|
36
|
+
- os: linux
|
37
|
+
arch: ppc64le
|
38
|
+
env: HOST=ppc64le-linux-gnu
|
39
|
+
- os: linux
|
40
|
+
arch: arm64
|
41
|
+
env: HOST=aarch64-linux-gnu
|
42
|
+
- os: linux
|
43
|
+
arch: arm64
|
44
|
+
env: HOST=aarch64-linux-gnu
|
45
|
+
compiler: clang
|
46
|
+
- os: linux
|
47
|
+
env: HOST=arm32v7-linux-gnu LIBFFI_TEST_OPTIMIZATION="-O0"
|
48
|
+
- os: linux
|
49
|
+
env: HOST=arm32v7-linux-gnu LIBFFI_TEST_OPTIMIZATION="-O2"
|
50
|
+
- os: linux
|
51
|
+
env: HOST=arm32v7-linux-gnu LIBFFI_TEST_OPTIMIZATION="-O2 -fomit-frame-pointer"
|
52
|
+
# The sparc64 linux system in the GCC compile farm is non-responsive.
|
53
|
+
# - os: linux
|
54
|
+
# env: HOST=sparc64-linux-gnu
|
55
|
+
# The mips64 linux system in the GCC compile farm is not allowing logins
|
56
|
+
# - os: linux
|
57
|
+
# env: HOST=mips64el-linux-gnu
|
10
58
|
- os: linux
|
11
59
|
compiler: gcc
|
12
60
|
env: HOST=i386-pc-linux-gnu MEVAL='export CC="$CC -m32" && CXX="$CXX -m32"'
|
@@ -27,8 +75,9 @@ before_install:
|
|
27
75
|
- if test x"$MEVAL" != x; then eval ${MEVAL}; fi
|
28
76
|
|
29
77
|
install:
|
30
|
-
- ./.travis/install.sh
|
78
|
+
- travis_wait 30 ./.travis/install.sh
|
31
79
|
|
32
80
|
script:
|
33
81
|
- if ! test x"$MEVAL" = x; then eval ${MEVAL}; fi
|
82
|
+
- travis_wait 115 sleep infinity &
|
34
83
|
- ./.travis/build.sh
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# Copyright (C) 2010, 2019 Free Software Foundation, Inc.
|
2
|
+
#
|
3
|
+
# This file is part of DejaGnu.
|
4
|
+
#
|
5
|
+
# DejaGnu is free software; you can redistribute it and/or modify it
|
6
|
+
# under the terms of the GNU General Public License as published by
|
7
|
+
# the Free Software Foundation; either version 2 of the License, or
|
8
|
+
# (at your option) any later version.
|
9
|
+
#
|
10
|
+
# DejaGnu is distributed in the hope that it will be useful, but
|
11
|
+
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
|
+
# General Public License for more details.
|
14
|
+
#
|
15
|
+
# You should have received a copy of the GNU General Public License
|
16
|
+
# along with DejaGnu; if not, write to the Free Software Foundation,
|
17
|
+
# Inc., 51 Franklin Street, Fifth Floor, MA 02110, USA.
|
18
|
+
|
19
|
+
# This is a list of toolchains that are supported on this board.
|
20
|
+
set_board_info target_install {bfin-elf}
|
21
|
+
|
22
|
+
# Load the generic configuration for this board. This will define a basic set
|
23
|
+
# of routines needed by the tool to communicate with the board.
|
24
|
+
load_generic_config "sim"
|
25
|
+
|
26
|
+
# basic-sim.exp is a basic description for the standard Cygnus simulator.
|
27
|
+
load_base_board_description "basic-sim"
|
28
|
+
|
29
|
+
# "bfin" is the name of the sim subdir in devo/sim.
|
30
|
+
setup_sim bfin
|
31
|
+
|
32
|
+
# No multilib options needed by default.
|
33
|
+
process_multilib_options ""
|
34
|
+
|
35
|
+
# We only support newlib on this target. We assume that all multilib
|
36
|
+
# options have been specified before we get here.
|
37
|
+
|
38
|
+
set_board_info compiler "[find_gcc]"
|
39
|
+
set_board_info cflags "[libgloss_include_flags] [newlib_include_flags]"
|
40
|
+
set_board_info ldflags "[libgloss_link_flags] [newlib_link_flags]"
|
41
|
+
|
42
|
+
# Configuration settings for testsuites
|
43
|
+
set_board_info noargs 1
|
44
|
+
set_board_info gdb,nosignals 1
|
45
|
+
set_board_info gdb,noresults 1
|
46
|
+
set_board_info gdb,cannot_call_functions 1
|
47
|
+
set_board_info gdb,skip_float_tests 1
|
48
|
+
set_board_info gdb,can_reverse 1
|
49
|
+
set_board_info gdb,use_precord 1
|
50
|
+
|
51
|
+
# More time is needed
|
52
|
+
set_board_info gcc,timeout 800
|
53
|
+
set_board_info gdb,timeout 60
|
54
|
+
|
55
|
+
# Used by a few gcc.c-torture testcases to delimit how large the stack can
|
56
|
+
# be.
|
57
|
+
set_board_info gcc,stack_size 5000
|
58
|
+
|
@@ -1,34 +1,142 @@
|
|
1
1
|
#!/bin/bash
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
set -x
|
4
|
+
|
5
|
+
# This is a policy bound API key. It can only be used with
|
6
|
+
# https://github.com/libffi/rlgl-policy.git.
|
7
|
+
RLGL_KEY=0LIBFFI-0LIBFFI-0LIBFFI-0LIBFFI
|
8
|
+
|
9
|
+
if [ -z ${QEMU_CPU+x} ]; then
|
10
|
+
export SET_QEMU_CPU=
|
11
|
+
else
|
12
|
+
export SET_QEMU_CPU="-e QEMU_CPU=${QEMU_CPU}"
|
13
|
+
fi
|
14
|
+
|
15
|
+
export DOCKER=docker
|
16
|
+
|
17
|
+
function build_cfarm()
|
18
|
+
{
|
19
|
+
curl -u ${CFARM_AUTH} https://cfarm-test-libffi-libffi.apps.home.labdroid.net/test?host=${HOST}\&commit=${TRAVIS_COMMIT} | tee build.log
|
20
|
+
echo :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
21
|
+
echo $(tail build.log | grep '^==LOGFILE==')
|
22
|
+
echo $(tail build.log | grep '^==LOGFILE==' | cut -b13-)
|
23
|
+
echo :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
24
|
+
curl -u ${CFARM_AUTH} "$(tail build.log | grep '^==LOGFILE==' | cut -b13-)" > libffi.log
|
25
|
+
|
26
|
+
./rlgl l --key=${RLGL_KEY} https://rl.gl
|
27
|
+
ID=$(./rlgl start)
|
28
|
+
./rlgl e --id=$ID --policy=https://github.com/libffi/rlgl-policy.git libffi.log
|
29
|
+
exit $?
|
30
|
+
}
|
5
31
|
|
6
32
|
function build_linux()
|
7
33
|
{
|
8
34
|
./autogen.sh
|
9
|
-
./configure ${HOST+--host=$HOST} ${CONFIGURE_OPTIONS}
|
35
|
+
./configure ${HOST+--host=$HOST} ${CONFIGURE_OPTIONS} || cat */config.log
|
10
36
|
make
|
11
37
|
make dist
|
12
38
|
make check RUNTESTFLAGS="-a $RUNTESTFLAGS"
|
13
|
-
|
39
|
+
|
40
|
+
./rlgl l --key=${RLGL_KEY} https://rl.gl
|
41
|
+
ID=$(./rlgl start)
|
42
|
+
./rlgl e --id=$ID --policy=https://github.com/libffi/rlgl-policy.git */testsuite/libffi.log
|
43
|
+
exit $?
|
44
|
+
}
|
45
|
+
|
46
|
+
function build_foreign_linux()
|
47
|
+
{
|
48
|
+
${DOCKER} run --rm -t -i -v $(pwd):/opt ${SET_QEMU_CPU} -e LIBFFI_TEST_OPTIMIZATION="${LIBFFI_TEST_OPTIMIZATION}" $2 bash -c /opt/.travis/build-in-container.sh
|
49
|
+
|
50
|
+
./rlgl l --key=${RLGL_KEY} https://rl.gl
|
51
|
+
ID=$(./rlgl start)
|
52
|
+
./rlgl e --id=$ID --policy=https://github.com/libffi/rlgl-policy.git */testsuite/libffi.log
|
53
|
+
exit $?
|
54
|
+
}
|
55
|
+
|
56
|
+
function build_cross_linux()
|
57
|
+
{
|
58
|
+
${DOCKER} run --rm -t -i -v $(pwd):/opt ${SET_QEMU_CPU} -e HOST="${HOST}" -e CC="${HOST}-gcc-8 ${GCC_OPTIONS}" -e CXX="${HOST}-g++-8 ${GCC_OPTIONS}" -e LIBFFI_TEST_OPTIMIZATION="${LIBFFI_TEST_OPTIMIZATION}" moxielogic/cross-ci-build-container:latest bash -c /opt/.travis/build-in-container.sh
|
59
|
+
|
60
|
+
./rlgl l --key=${RLGL_KEY} https://rl.gl
|
61
|
+
ID=$(./rlgl start)
|
62
|
+
./rlgl e --id=$ID --policy=https://github.com/libffi/rlgl-policy.git */testsuite/libffi.log
|
63
|
+
exit $?
|
64
|
+
}
|
65
|
+
|
66
|
+
function build_cross()
|
67
|
+
{
|
68
|
+
${DOCKER} pull quay.io/moxielogic/libffi-ci-${HOST}
|
69
|
+
${DOCKER} run --rm -t -i -v $(pwd):/opt -e HOST="${HOST}" -e CC="${HOST}-gcc ${GCC_OPTIONS}" -e CXX="${HOST}-g++ ${GCC_OPTIONS}" -e TRAVIS_BUILD_DIR=/opt -e DEJAGNU="${DEJAGNU}" -e RUNTESTFLAGS="${RUNTESTFLAGS}" -e LIBFFI_TEST_OPTIMIZATION="${LIBFFI_TEST_OPTIMIZATION}" quay.io/moxielogic/libffi-ci-${HOST} bash -c /opt/.travis/build-cross-in-container.sh
|
70
|
+
|
71
|
+
./rlgl l --key=${RLGL_KEY} https://rl.gl
|
72
|
+
ID=$(./rlgl start)
|
73
|
+
./rlgl e --id=$ID --policy=https://github.com/libffi/rlgl-policy.git */testsuite/libffi.log
|
74
|
+
exit $?
|
14
75
|
}
|
15
76
|
|
16
77
|
function build_ios()
|
17
78
|
{
|
18
79
|
which python
|
19
80
|
# export PYTHON_BIN=/usr/local/bin/python
|
20
|
-
./generate-darwin-source-and-headers.py
|
81
|
+
./generate-darwin-source-and-headers.py --only-ios
|
21
82
|
xcodebuild -showsdks
|
22
|
-
xcodebuild -project libffi.xcodeproj -target "libffi-iOS" -configuration Release -sdk
|
23
|
-
|
83
|
+
xcodebuild -project libffi.xcodeproj -target "libffi-iOS" -configuration Release -sdk iphoneos11.4
|
84
|
+
exit $?
|
85
|
+
}
|
86
|
+
|
87
|
+
function build_macosx()
|
88
|
+
{
|
89
|
+
which python
|
90
|
+
# export PYTHON_BIN=/usr/local/bin/python
|
91
|
+
./generate-darwin-source-and-headers.py --only-osx
|
92
|
+
xcodebuild -showsdks
|
93
|
+
xcodebuild -project libffi.xcodeproj -target "libffi-Mac" -configuration Release -sdk macosx10.13
|
94
|
+
echo "Finished build"
|
95
|
+
exit $?
|
24
96
|
}
|
25
97
|
|
26
|
-
./autogen.sh
|
27
98
|
case "$HOST" in
|
28
99
|
arm-apple-darwin*)
|
100
|
+
./autogen.sh
|
29
101
|
build_ios
|
30
102
|
;;
|
103
|
+
x86_64-apple-darwin*)
|
104
|
+
./autogen.sh
|
105
|
+
build_macosx
|
106
|
+
;;
|
107
|
+
arm32v7-linux-gnu)
|
108
|
+
./autogen.sh
|
109
|
+
build_foreign_linux arm moxielogic/arm32v7-ci-build-container:latest
|
110
|
+
;;
|
111
|
+
mips64el-linux-gnu | sparc64-linux-gnu)
|
112
|
+
build_cfarm
|
113
|
+
;;
|
114
|
+
bfin-elf )
|
115
|
+
./autogen.sh
|
116
|
+
GCC_OPTIONS=-msim build_cross
|
117
|
+
;;
|
118
|
+
m32r-elf )
|
119
|
+
./autogen.sh
|
120
|
+
build_cross
|
121
|
+
;;
|
122
|
+
or1k-elf )
|
123
|
+
./autogen.sh
|
124
|
+
build_cross
|
125
|
+
;;
|
126
|
+
powerpc-eabisim )
|
127
|
+
./autogen.sh
|
128
|
+
build_cross
|
129
|
+
;;
|
130
|
+
m68k-linux-gnu )
|
131
|
+
./autogen.sh
|
132
|
+
GCC_OPTIONS=-mcpu=547x build_cross_linux
|
133
|
+
;;
|
134
|
+
alpha-linux-gnu | sh4-linux-gnu )
|
135
|
+
./autogen.sh
|
136
|
+
build_cross_linux
|
137
|
+
;;
|
31
138
|
*)
|
139
|
+
./autogen.sh
|
32
140
|
build_linux
|
33
141
|
;;
|
34
142
|
esac
|