ffi 1.11.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.appveyor.yml +27 -0
- data/.gitignore +25 -0
- data/.gitmodules +4 -0
- data/.travis.yml +42 -0
- data/.yardopts +5 -0
- data/CHANGELOG.md +147 -0
- data/COPYING +49 -0
- data/Gemfile +15 -0
- data/LICENSE +24 -0
- data/LICENSE.SPECS +22 -0
- data/README.md +115 -0
- data/Rakefile +196 -0
- data/ext/ffi_c/AbstractMemory.c +1109 -0
- data/ext/ffi_c/AbstractMemory.h +175 -0
- data/ext/ffi_c/ArrayType.c +162 -0
- data/ext/ffi_c/ArrayType.h +59 -0
- data/ext/ffi_c/Buffer.c +365 -0
- data/ext/ffi_c/Call.c +503 -0
- data/ext/ffi_c/Call.h +107 -0
- data/ext/ffi_c/ClosurePool.c +283 -0
- data/ext/ffi_c/ClosurePool.h +57 -0
- data/ext/ffi_c/DynamicLibrary.c +339 -0
- data/ext/ffi_c/DynamicLibrary.h +98 -0
- data/ext/ffi_c/Function.c +917 -0
- data/ext/ffi_c/Function.h +87 -0
- data/ext/ffi_c/FunctionInfo.c +271 -0
- data/ext/ffi_c/LastError.c +229 -0
- data/ext/ffi_c/LastError.h +47 -0
- data/ext/ffi_c/LongDouble.c +63 -0
- data/ext/ffi_c/LongDouble.h +51 -0
- data/ext/ffi_c/MappedType.c +168 -0
- data/ext/ffi_c/MappedType.h +59 -0
- data/ext/ffi_c/MemoryPointer.c +197 -0
- data/ext/ffi_c/MemoryPointer.h +53 -0
- data/ext/ffi_c/MethodHandle.c +358 -0
- data/ext/ffi_c/MethodHandle.h +55 -0
- data/ext/ffi_c/Platform.c +82 -0
- data/ext/ffi_c/Platform.h +45 -0
- data/ext/ffi_c/Pointer.c +508 -0
- data/ext/ffi_c/Pointer.h +63 -0
- data/ext/ffi_c/Struct.c +829 -0
- data/ext/ffi_c/Struct.h +106 -0
- data/ext/ffi_c/StructByValue.c +150 -0
- data/ext/ffi_c/StructByValue.h +55 -0
- data/ext/ffi_c/StructLayout.c +698 -0
- data/ext/ffi_c/Thread.c +137 -0
- data/ext/ffi_c/Thread.h +84 -0
- data/ext/ffi_c/Type.c +379 -0
- data/ext/ffi_c/Type.h +61 -0
- data/ext/ffi_c/Types.c +139 -0
- data/ext/ffi_c/Types.h +89 -0
- data/ext/ffi_c/Variadic.c +298 -0
- data/ext/ffi_c/compat.h +78 -0
- data/ext/ffi_c/extconf.rb +86 -0
- data/ext/ffi_c/ffi.c +93 -0
- data/ext/ffi_c/libffi.bsd.mk +40 -0
- data/ext/ffi_c/libffi.darwin.mk +105 -0
- data/ext/ffi_c/libffi.gnu.mk +32 -0
- data/ext/ffi_c/libffi.mk +18 -0
- data/ext/ffi_c/libffi.vc.mk +26 -0
- data/ext/ffi_c/libffi.vc64.mk +26 -0
- data/ext/ffi_c/libffi/.appveyor.yml +66 -0
- data/ext/ffi_c/libffi/.gitattributes +4 -0
- data/ext/ffi_c/libffi/.github/issue_template.md +10 -0
- data/ext/ffi_c/libffi/.gitignore +38 -0
- data/ext/ffi_c/libffi/.travis.yml +63 -0
- data/ext/ffi_c/libffi/.travis/ar-lib +270 -0
- data/ext/ffi_c/libffi/.travis/build-in-container.sh +22 -0
- data/ext/ffi_c/libffi/.travis/build.sh +110 -0
- data/ext/ffi_c/libffi/.travis/compile +351 -0
- data/ext/ffi_c/libffi/.travis/install.sh +43 -0
- data/ext/ffi_c/libffi/.travis/moxie-sim.exp +60 -0
- data/ext/ffi_c/libffi/.travis/site.exp +18 -0
- data/ext/ffi_c/libffi/ChangeLog.libffi +584 -0
- data/ext/ffi_c/libffi/ChangeLog.libffi-3.1 +6000 -0
- data/ext/ffi_c/libffi/ChangeLog.libgcj +40 -0
- data/ext/ffi_c/libffi/ChangeLog.v1 +764 -0
- data/ext/ffi_c/libffi/LICENSE +21 -0
- data/ext/ffi_c/libffi/LICENSE-BUILDTOOLS +353 -0
- data/ext/ffi_c/libffi/Makefile.am +158 -0
- data/ext/ffi_c/libffi/README.md +470 -0
- data/ext/ffi_c/libffi/acinclude.m4 +479 -0
- data/ext/ffi_c/libffi/autogen.sh +2 -0
- data/ext/ffi_c/libffi/config.guess +1466 -0
- data/ext/ffi_c/libffi/config.sub +1836 -0
- data/ext/ffi_c/libffi/configure.ac +394 -0
- data/ext/ffi_c/libffi/configure.host +303 -0
- data/ext/ffi_c/libffi/generate-darwin-source-and-headers.py +203 -0
- data/ext/ffi_c/libffi/include/Makefile.am +9 -0
- data/ext/ffi_c/libffi/include/ffi.h.in +515 -0
- data/ext/ffi_c/libffi/include/ffi_cfi.h +55 -0
- data/ext/ffi_c/libffi/include/ffi_common.h +153 -0
- data/ext/ffi_c/libffi/libffi.map.in +80 -0
- data/ext/ffi_c/libffi/libffi.pc.in +11 -0
- data/ext/ffi_c/libffi/libffi.xcodeproj/project.pbxproj +1043 -0
- data/ext/ffi_c/libffi/libtool-version +29 -0
- data/ext/ffi_c/libffi/m4/asmcfi.m4 +13 -0
- data/ext/ffi_c/libffi/m4/ax_append_flag.m4 +71 -0
- data/ext/ffi_c/libffi/m4/ax_cc_maxopt.m4 +194 -0
- data/ext/ffi_c/libffi/m4/ax_cflags_warn_all.m4 +122 -0
- data/ext/ffi_c/libffi/m4/ax_check_compile_flag.m4 +74 -0
- data/ext/ffi_c/libffi/m4/ax_compiler_vendor.m4 +87 -0
- data/ext/ffi_c/libffi/m4/ax_configure_args.m4 +70 -0
- data/ext/ffi_c/libffi/m4/ax_enable_builddir.m4 +302 -0
- data/ext/ffi_c/libffi/m4/ax_gcc_archflag.m4 +263 -0
- data/ext/ffi_c/libffi/m4/ax_gcc_x86_cpuid.m4 +89 -0
- data/ext/ffi_c/libffi/m4/ax_require_defined.m4 +37 -0
- data/ext/ffi_c/libffi/make_sunver.pl +333 -0
- data/ext/ffi_c/libffi/man/Makefile.am +8 -0
- data/ext/ffi_c/libffi/man/ffi.3 +41 -0
- data/ext/ffi_c/libffi/man/ffi_call.3 +103 -0
- data/ext/ffi_c/libffi/man/ffi_prep_cif.3 +68 -0
- data/ext/ffi_c/libffi/man/ffi_prep_cif_var.3 +73 -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 +353 -0
- data/ext/ffi_c/libffi/src/aarch64/ffi.c +1009 -0
- data/ext/ffi_c/libffi/src/aarch64/ffitarget.h +92 -0
- data/ext/ffi_c/libffi/src/aarch64/internal.h +67 -0
- data/ext/ffi_c/libffi/src/aarch64/sysv.S +440 -0
- data/ext/ffi_c/libffi/src/aarch64/win64_armasm.S +506 -0
- data/ext/ffi_c/libffi/src/alpha/ffi.c +521 -0
- data/ext/ffi_c/libffi/src/alpha/ffitarget.h +57 -0
- data/ext/ffi_c/libffi/src/alpha/internal.h +23 -0
- data/ext/ffi_c/libffi/src/alpha/osf.S +282 -0
- data/ext/ffi_c/libffi/src/arc/arcompact.S +135 -0
- data/ext/ffi_c/libffi/src/arc/ffi.c +266 -0
- data/ext/ffi_c/libffi/src/arc/ffitarget.h +53 -0
- data/ext/ffi_c/libffi/src/arm/ffi.c +854 -0
- data/ext/ffi_c/libffi/src/arm/ffitarget.h +89 -0
- data/ext/ffi_c/libffi/src/arm/internal.h +7 -0
- data/ext/ffi_c/libffi/src/arm/sysv.S +385 -0
- data/ext/ffi_c/libffi/src/arm/sysv_msvc_arm32.S +311 -0
- data/ext/ffi_c/libffi/src/avr32/ffi.c +423 -0
- data/ext/ffi_c/libffi/src/avr32/ffitarget.h +55 -0
- data/ext/ffi_c/libffi/src/avr32/sysv.S +208 -0
- data/ext/ffi_c/libffi/src/bfin/ffi.c +196 -0
- data/ext/ffi_c/libffi/src/bfin/ffitarget.h +43 -0
- data/ext/ffi_c/libffi/src/bfin/sysv.S +179 -0
- data/ext/ffi_c/libffi/src/closures.c +990 -0
- data/ext/ffi_c/libffi/src/cris/ffi.c +386 -0
- data/ext/ffi_c/libffi/src/cris/ffitarget.h +56 -0
- data/ext/ffi_c/libffi/src/cris/sysv.S +215 -0
- data/ext/ffi_c/libffi/src/debug.c +64 -0
- data/ext/ffi_c/libffi/src/dlmalloc.c +5166 -0
- data/ext/ffi_c/libffi/src/frv/eabi.S +128 -0
- data/ext/ffi_c/libffi/src/frv/ffi.c +292 -0
- data/ext/ffi_c/libffi/src/frv/ffitarget.h +62 -0
- data/ext/ffi_c/libffi/src/ia64/ffi.c +604 -0
- data/ext/ffi_c/libffi/src/ia64/ffitarget.h +56 -0
- data/ext/ffi_c/libffi/src/ia64/ia64_flags.h +40 -0
- data/ext/ffi_c/libffi/src/ia64/unix.S +567 -0
- data/ext/ffi_c/libffi/src/java_raw_api.c +374 -0
- data/ext/ffi_c/libffi/src/m32r/ffi.c +232 -0
- data/ext/ffi_c/libffi/src/m32r/ffitarget.h +53 -0
- data/ext/ffi_c/libffi/src/m32r/sysv.S +121 -0
- data/ext/ffi_c/libffi/src/m68k/ffi.c +362 -0
- data/ext/ffi_c/libffi/src/m68k/ffitarget.h +54 -0
- data/ext/ffi_c/libffi/src/m68k/sysv.S +357 -0
- data/ext/ffi_c/libffi/src/m88k/ffi.c +400 -0
- data/ext/ffi_c/libffi/src/m88k/ffitarget.h +49 -0
- data/ext/ffi_c/libffi/src/m88k/obsd.S +209 -0
- data/ext/ffi_c/libffi/src/metag/ffi.c +330 -0
- data/ext/ffi_c/libffi/src/metag/ffitarget.h +53 -0
- data/ext/ffi_c/libffi/src/metag/sysv.S +311 -0
- data/ext/ffi_c/libffi/src/microblaze/ffi.c +321 -0
- data/ext/ffi_c/libffi/src/microblaze/ffitarget.h +53 -0
- data/ext/ffi_c/libffi/src/microblaze/sysv.S +302 -0
- data/ext/ffi_c/libffi/src/mips/ffi.c +1130 -0
- data/ext/ffi_c/libffi/src/mips/ffitarget.h +244 -0
- data/ext/ffi_c/libffi/src/mips/n32.S +663 -0
- data/ext/ffi_c/libffi/src/mips/o32.S +502 -0
- data/ext/ffi_c/libffi/src/moxie/eabi.S +101 -0
- data/ext/ffi_c/libffi/src/moxie/ffi.c +285 -0
- data/ext/ffi_c/libffi/src/moxie/ffitarget.h +52 -0
- data/ext/ffi_c/libffi/src/nios2/ffi.c +304 -0
- data/ext/ffi_c/libffi/src/nios2/ffitarget.h +52 -0
- data/ext/ffi_c/libffi/src/nios2/sysv.S +136 -0
- data/ext/ffi_c/libffi/src/or1k/ffi.c +328 -0
- data/ext/ffi_c/libffi/src/or1k/ffitarget.h +58 -0
- data/ext/ffi_c/libffi/src/or1k/sysv.S +107 -0
- data/ext/ffi_c/libffi/src/pa/ffi.c +719 -0
- data/ext/ffi_c/libffi/src/pa/ffitarget.h +85 -0
- data/ext/ffi_c/libffi/src/pa/hpux32.S +368 -0
- data/ext/ffi_c/libffi/src/pa/linux.S +378 -0
- data/ext/ffi_c/libffi/src/powerpc/aix.S +566 -0
- data/ext/ffi_c/libffi/src/powerpc/aix_closure.S +694 -0
- data/ext/ffi_c/libffi/src/powerpc/asm.h +125 -0
- data/ext/ffi_c/libffi/src/powerpc/darwin.S +378 -0
- data/ext/ffi_c/libffi/src/powerpc/darwin_closure.S +571 -0
- data/ext/ffi_c/libffi/src/powerpc/ffi.c +174 -0
- data/ext/ffi_c/libffi/src/powerpc/ffi_darwin.c +1440 -0
- data/ext/ffi_c/libffi/src/powerpc/ffi_linux64.c +1007 -0
- data/ext/ffi_c/libffi/src/powerpc/ffi_powerpc.h +94 -0
- data/ext/ffi_c/libffi/src/powerpc/ffi_sysv.c +923 -0
- data/ext/ffi_c/libffi/src/powerpc/ffitarget.h +198 -0
- data/ext/ffi_c/libffi/src/powerpc/linux64.S +228 -0
- data/ext/ffi_c/libffi/src/powerpc/linux64_closure.S +488 -0
- data/ext/ffi_c/libffi/src/powerpc/ppc_closure.S +397 -0
- data/ext/ffi_c/libffi/src/powerpc/sysv.S +175 -0
- data/ext/ffi_c/libffi/src/prep_cif.c +263 -0
- data/ext/ffi_c/libffi/src/raw_api.c +267 -0
- data/ext/ffi_c/libffi/src/riscv/ffi.c +481 -0
- data/ext/ffi_c/libffi/src/riscv/ffitarget.h +69 -0
- data/ext/ffi_c/libffi/src/riscv/sysv.S +293 -0
- data/ext/ffi_c/libffi/src/s390/ffi.c +756 -0
- data/ext/ffi_c/libffi/src/s390/ffitarget.h +70 -0
- data/ext/ffi_c/libffi/src/s390/internal.h +11 -0
- data/ext/ffi_c/libffi/src/s390/sysv.S +325 -0
- data/ext/ffi_c/libffi/src/sh/ffi.c +717 -0
- data/ext/ffi_c/libffi/src/sh/ffitarget.h +54 -0
- data/ext/ffi_c/libffi/src/sh/sysv.S +850 -0
- data/ext/ffi_c/libffi/src/sh64/ffi.c +469 -0
- data/ext/ffi_c/libffi/src/sh64/ffitarget.h +58 -0
- data/ext/ffi_c/libffi/src/sh64/sysv.S +539 -0
- data/ext/ffi_c/libffi/src/sparc/ffi.c +468 -0
- data/ext/ffi_c/libffi/src/sparc/ffi64.c +608 -0
- data/ext/ffi_c/libffi/src/sparc/ffitarget.h +81 -0
- data/ext/ffi_c/libffi/src/sparc/internal.h +26 -0
- data/ext/ffi_c/libffi/src/sparc/v8.S +443 -0
- data/ext/ffi_c/libffi/src/sparc/v9.S +440 -0
- data/ext/ffi_c/libffi/src/tile/ffi.c +355 -0
- data/ext/ffi_c/libffi/src/tile/ffitarget.h +65 -0
- data/ext/ffi_c/libffi/src/tile/tile.S +360 -0
- data/ext/ffi_c/libffi/src/types.c +108 -0
- data/ext/ffi_c/libffi/src/vax/elfbsd.S +195 -0
- data/ext/ffi_c/libffi/src/vax/ffi.c +276 -0
- data/ext/ffi_c/libffi/src/vax/ffitarget.h +49 -0
- data/ext/ffi_c/libffi/src/x86/asmnames.h +30 -0
- data/ext/ffi_c/libffi/src/x86/ffi.c +761 -0
- data/ext/ffi_c/libffi/src/x86/ffi64.c +886 -0
- data/ext/ffi_c/libffi/src/x86/ffitarget.h +147 -0
- data/ext/ffi_c/libffi/src/x86/ffiw64.c +311 -0
- data/ext/ffi_c/libffi/src/x86/internal.h +29 -0
- data/ext/ffi_c/libffi/src/x86/internal64.h +22 -0
- data/ext/ffi_c/libffi/src/x86/sysv.S +1129 -0
- data/ext/ffi_c/libffi/src/x86/sysv_intel.S +995 -0
- data/ext/ffi_c/libffi/src/x86/unix64.S +566 -0
- data/ext/ffi_c/libffi/src/x86/win64.S +237 -0
- data/ext/ffi_c/libffi/src/x86/win64_intel.S +237 -0
- data/ext/ffi_c/libffi/src/xtensa/ffi.c +298 -0
- data/ext/ffi_c/libffi/src/xtensa/ffitarget.h +53 -0
- data/ext/ffi_c/libffi/src/xtensa/sysv.S +258 -0
- data/ext/ffi_c/libffi/stamp-h.in +1 -0
- data/ext/ffi_c/libffi/testsuite/Makefile.am +119 -0
- data/ext/ffi_c/libffi/testsuite/config/default.exp +1 -0
- data/ext/ffi_c/libffi/testsuite/lib/libffi.exp +657 -0
- data/ext/ffi_c/libffi/testsuite/lib/target-libpath.exp +283 -0
- data/ext/ffi_c/libffi/testsuite/lib/wrapper.exp +45 -0
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/Makefile +28 -0
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/README +78 -0
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/alignof.h +50 -0
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/bhaible.exp +58 -0
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-call.c +1745 -0
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-callback.c +2885 -0
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/testcases.c +743 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/align_mixed.c +46 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/align_stdcall.c +46 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/call.exp +43 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn0.c +89 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn1.c +81 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn2.c +81 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn3.c +82 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn4.c +89 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn5.c +92 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn6.c +90 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/closure_loc_fn0.c +95 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/closure_simple.c +55 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_12byte.c +94 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_16byte.c +95 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_18byte.c +96 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_19byte.c +102 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_1_1byte.c +89 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_20byte.c +91 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_20byte1.c +93 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_24byte.c +113 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_2byte.c +90 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_3_1byte.c +95 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_3byte1.c +90 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_3byte2.c +90 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_3float.c +95 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_4_1byte.c +98 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_4byte.c +90 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_5_1_byte.c +109 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_5byte.c +98 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_64byte.c +124 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_6_1_byte.c +113 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_6byte.c +99 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_7_1_byte.c +117 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_7byte.c +97 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_8byte.c +88 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_9byte1.c +90 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_9byte2.c +91 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_double.c +93 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_float.c +91 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_longdouble.c +92 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_longdouble_split.c +132 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_longdouble_split2.c +115 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_pointer.c +95 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_sint16.c +91 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_sint32.c +91 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_sint64.c +92 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_uint16.c +91 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_uint32.c +91 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_uint64.c +93 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_dbls_struct.c +66 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_double.c +43 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_double_va.c +61 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_float.c +42 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_longdouble.c +105 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_longdouble_va.c +61 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_many_mixed_args.c +70 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_many_mixed_float_double.c +55 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_schar.c +74 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_sshort.c +74 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_sshortchar.c +86 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_uchar.c +91 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_ushort.c +74 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_ushortchar.c +86 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_pointer.c +74 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_pointer_stack.c +142 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_schar.c +44 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_sint.c +42 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_sshort.c +42 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_struct_va1.c +114 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_uchar.c +42 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_uchar_va.c +44 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_uint.c +43 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_uint_va.c +45 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_ulong_va.c +45 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_ulonglong.c +47 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_ushort.c +43 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_ushort_va.c +44 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/err_bad_abi.c +36 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/err_bad_typedef.c +26 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/ffitest.h +138 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/float.c +59 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/float1.c +60 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/float2.c +61 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/float3.c +74 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/float4.c +62 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/float_va.c +107 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/huge_struct.c +341 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/many.c +59 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/many2.c +57 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/many_double.c +70 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/many_mixed.c +78 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/negint.c +52 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct.c +152 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct1.c +161 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct10.c +134 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct11.c +121 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct2.c +110 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct3.c +111 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct4.c +111 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct5.c +112 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct6.c +131 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct7.c +111 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct8.c +131 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct9.c +131 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/offsets.c +46 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/pr1172638.c +127 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/problem1.c +90 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/promotion.c +59 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/pyobjc-tc.c +114 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl.c +36 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl1.c +43 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl2.c +42 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_fl.c +35 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_fl1.c +36 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_fl2.c +49 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_fl3.c +42 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_ldl.c +34 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_ll.c +41 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_ll1.c +43 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_sc.c +36 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_sl.c +38 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_uc.c +38 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_ul.c +38 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/stret_large.c +145 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/stret_large2.c +148 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/stret_medium.c +124 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/stret_medium2.c +125 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen.c +44 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen2.c +49 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen3.c +49 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen4.c +55 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct1.c +67 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct10.c +57 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct2.c +67 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct3.c +60 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct4.c +64 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct5.c +66 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct6.c +64 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct7.c +74 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct8.c +81 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct9.c +68 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/testclosure.c +70 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/uninitialized.c +61 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/unwindtest.cc +117 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/unwindtest_ffi_call.cc +54 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c +196 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct1.c +121 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct2.c +123 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct3.c +125 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex.inc +91 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_align_complex_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex.inc +42 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct.inc +71 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_struct_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va.inc +80 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_float.c +16 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/cls_complex_va_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex.exp +36 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex.inc +51 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_double.inc +7 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_float.inc +7 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_defs_longdouble.inc +7 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_int.c +86 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/complex_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/ffitest.h +1 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex.inc +78 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/many_complex_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex.inc +37 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1.inc +41 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex1_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2.inc +44 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex2_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_double.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_float.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.complex/return_complex_longdouble.c +10 -0
- data/ext/ffi_c/libffi/testsuite/libffi.go/aa-direct.c +34 -0
- data/ext/ffi_c/libffi/testsuite/libffi.go/closure1.c +28 -0
- data/ext/ffi_c/libffi/testsuite/libffi.go/ffitest.h +1 -0
- data/ext/ffi_c/libffi/testsuite/libffi.go/go.exp +36 -0
- data/ext/ffi_c/libffi/testsuite/libffi.go/static-chain.h +19 -0
- data/ext/ffi_c/rbffi.h +55 -0
- data/ext/ffi_c/rbffi_endian.h +59 -0
- data/ext/ffi_c/win32/stdbool.h +8 -0
- data/ext/ffi_c/win32/stdint.h +201 -0
- data/ffi.gemspec +43 -0
- data/lib/ffi.rb +20 -0
- data/lib/ffi/autopointer.rb +203 -0
- data/lib/ffi/buffer.rb +4 -0
- data/lib/ffi/callback.rb +4 -0
- data/lib/ffi/data_converter.rb +67 -0
- data/lib/ffi/enum.rb +296 -0
- data/lib/ffi/errno.rb +43 -0
- data/lib/ffi/ffi.rb +45 -0
- data/lib/ffi/io.rb +62 -0
- data/lib/ffi/library.rb +588 -0
- data/lib/ffi/managedstruct.rb +84 -0
- data/lib/ffi/memorypointer.rb +1 -0
- data/lib/ffi/platform.rb +175 -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 +104 -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 +104 -0
- data/lib/ffi/platform/i386-cygwin/types.conf +3 -0
- data/lib/ffi/platform/i386-darwin/types.conf +100 -0
- data/lib/ffi/platform/i386-freebsd/types.conf +152 -0
- data/lib/ffi/platform/i386-freebsd12/types.conf +152 -0
- data/lib/ffi/platform/i386-gnu/types.conf +107 -0
- data/lib/ffi/platform/i386-linux/types.conf +103 -0
- data/lib/ffi/platform/i386-netbsd/types.conf +126 -0
- data/lib/ffi/platform/i386-openbsd/types.conf +128 -0
- data/lib/ffi/platform/i386-solaris/types.conf +122 -0
- data/lib/ffi/platform/i386-windows/types.conf +105 -0
- data/lib/ffi/platform/ia64-linux/types.conf +104 -0
- data/lib/ffi/platform/mips-linux/types.conf +102 -0
- data/lib/ffi/platform/mips64-linux/types.conf +104 -0
- data/lib/ffi/platform/mips64el-linux/types.conf +104 -0
- data/lib/ffi/platform/mipsel-linux/types.conf +102 -0
- data/lib/ffi/platform/mipsisa32r6-linux/types.conf +102 -0
- data/lib/ffi/platform/mipsisa32r6el-linux/types.conf +102 -0
- data/lib/ffi/platform/mipsisa64r6-linux/types.conf +104 -0
- data/lib/ffi/platform/mipsisa64r6el-linux/types.conf +104 -0
- data/lib/ffi/platform/powerpc-aix/types.conf +180 -0
- data/lib/ffi/platform/powerpc-darwin/types.conf +100 -0
- data/lib/ffi/platform/powerpc-linux/types.conf +100 -0
- data/lib/ffi/platform/powerpc64-linux/types.conf +104 -0
- data/lib/ffi/platform/s390-linux/types.conf +102 -0
- data/lib/ffi/platform/s390x-linux/types.conf +102 -0
- data/lib/ffi/platform/sparc-linux/types.conf +102 -0
- data/lib/ffi/platform/sparc-solaris/types.conf +128 -0
- data/lib/ffi/platform/sparc64-linux/types.conf +102 -0
- data/lib/ffi/platform/sparcv9-solaris/types.conf +128 -0
- data/lib/ffi/platform/x86_64-cygwin/types.conf +3 -0
- data/lib/ffi/platform/x86_64-darwin/types.conf +126 -0
- data/lib/ffi/platform/x86_64-dragonflybsd/types.conf +148 -0
- data/lib/ffi/platform/x86_64-freebsd/types.conf +128 -0
- data/lib/ffi/platform/x86_64-freebsd12/types.conf +158 -0
- data/lib/ffi/platform/x86_64-linux/types.conf +111 -0
- data/lib/ffi/platform/x86_64-netbsd/types.conf +128 -0
- data/lib/ffi/platform/x86_64-openbsd/types.conf +134 -0
- data/lib/ffi/platform/x86_64-solaris/types.conf +122 -0
- data/lib/ffi/platform/x86_64-windows/types.conf +120 -0
- data/lib/ffi/pointer.rb +160 -0
- data/lib/ffi/struct.rb +311 -0
- data/lib/ffi/struct_by_reference.rb +72 -0
- data/lib/ffi/struct_layout.rb +96 -0
- data/lib/ffi/struct_layout_builder.rb +227 -0
- data/lib/ffi/tools/const_generator.rb +230 -0
- data/lib/ffi/tools/generator.rb +105 -0
- data/lib/ffi/tools/generator_task.rb +32 -0
- data/lib/ffi/tools/struct_generator.rb +194 -0
- data/lib/ffi/tools/types_generator.rb +135 -0
- data/lib/ffi/types.rb +194 -0
- data/lib/ffi/union.rb +43 -0
- data/lib/ffi/variadic.rb +78 -0
- data/lib/ffi/version.rb +3 -0
- data/samples/getlogin.rb +8 -0
- data/samples/getpid.rb +8 -0
- data/samples/gettimeofday.rb +18 -0
- data/samples/hello.rb +7 -0
- data/samples/inotify.rb +60 -0
- data/samples/pty.rb +76 -0
- data/samples/qsort.rb +21 -0
- data/samples/sample_helper.rb +6 -0
- metadata +677 -0
@@ -0,0 +1,394 @@
|
|
1
|
+
dnl Process this with autoconf to create configure
|
2
|
+
|
3
|
+
AC_PREREQ(2.68)
|
4
|
+
|
5
|
+
AC_INIT([libffi], [3.3-rc2], [http://github.com/libffi/libffi/issues])
|
6
|
+
AC_CONFIG_HEADERS([fficonfig.h])
|
7
|
+
|
8
|
+
AC_CANONICAL_SYSTEM
|
9
|
+
target_alias=${target_alias-$host_alias}
|
10
|
+
|
11
|
+
case "${host}" in
|
12
|
+
frv*-elf)
|
13
|
+
LDFLAGS=`echo $LDFLAGS | sed "s/\-B[^ ]*libgloss\/frv\///"`\ -B`pwd`/../libgloss/frv/
|
14
|
+
;;
|
15
|
+
esac
|
16
|
+
|
17
|
+
AX_ENABLE_BUILDDIR
|
18
|
+
|
19
|
+
AM_INIT_AUTOMAKE
|
20
|
+
|
21
|
+
# The same as in boehm-gc and libstdc++. Have to borrow it from there.
|
22
|
+
# We must force CC to /not/ be precious variables; otherwise
|
23
|
+
# the wrong, non-multilib-adjusted value will be used in multilibs.
|
24
|
+
# As a side effect, we have to subst CFLAGS ourselves.
|
25
|
+
# Also save and restore CFLAGS, since AC_PROG_CC will come up with
|
26
|
+
# defaults of its own if none are provided.
|
27
|
+
|
28
|
+
m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
|
29
|
+
m4_define([_AC_ARG_VAR_PRECIOUS],[])
|
30
|
+
save_CFLAGS=$CFLAGS
|
31
|
+
AC_PROG_CC
|
32
|
+
AC_PROG_CXX
|
33
|
+
CFLAGS=$save_CFLAGS
|
34
|
+
m4_undefine([_AC_ARG_VAR_PRECIOUS])
|
35
|
+
m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
|
36
|
+
|
37
|
+
AC_SUBST(CFLAGS)
|
38
|
+
|
39
|
+
AM_PROG_AS
|
40
|
+
AM_PROG_CC_C_O
|
41
|
+
AC_PROG_LIBTOOL
|
42
|
+
AC_CONFIG_MACRO_DIR([m4])
|
43
|
+
|
44
|
+
# Test for 64-bit build.
|
45
|
+
AC_CHECK_SIZEOF([size_t])
|
46
|
+
|
47
|
+
AX_COMPILER_VENDOR
|
48
|
+
AX_CC_MAXOPT
|
49
|
+
# The AX_CFLAGS_WARN_ALL macro doesn't currently work for sunpro
|
50
|
+
# compiler.
|
51
|
+
if test "$ax_cv_c_compiler_vendor" != "sun"; then
|
52
|
+
AX_CFLAGS_WARN_ALL
|
53
|
+
fi
|
54
|
+
|
55
|
+
if test "x$GCC" = "xyes"; then
|
56
|
+
CFLAGS="$CFLAGS -fexceptions"
|
57
|
+
fi
|
58
|
+
|
59
|
+
cat > local.exp <<EOF
|
60
|
+
set CC_FOR_TARGET "$CC"
|
61
|
+
set CXX_FOR_TARGET "$CXX"
|
62
|
+
EOF
|
63
|
+
|
64
|
+
AM_MAINTAINER_MODE
|
65
|
+
|
66
|
+
AC_CHECK_HEADERS(sys/mman.h)
|
67
|
+
AC_CHECK_FUNCS([mmap mkostemp])
|
68
|
+
AC_FUNC_MMAP_BLACKLIST
|
69
|
+
|
70
|
+
dnl The -no-testsuite modules omit the test subdir.
|
71
|
+
AM_CONDITIONAL(TESTSUBDIR, test -d $srcdir/testsuite)
|
72
|
+
|
73
|
+
TARGETDIR="unknown"
|
74
|
+
HAVE_LONG_DOUBLE_VARIANT=0
|
75
|
+
|
76
|
+
. ${srcdir}/configure.host
|
77
|
+
|
78
|
+
if test -n "${UNSUPPORTED}"; then
|
79
|
+
AC_MSG_ERROR(["libffi has not been ported to $host."])
|
80
|
+
fi
|
81
|
+
|
82
|
+
AC_SUBST(AM_RUNTESTFLAGS)
|
83
|
+
AC_SUBST(AM_LTLDFLAGS)
|
84
|
+
|
85
|
+
AC_HEADER_STDC
|
86
|
+
AC_CHECK_FUNCS(memcpy)
|
87
|
+
AC_FUNC_ALLOCA
|
88
|
+
|
89
|
+
AC_CHECK_SIZEOF(double)
|
90
|
+
AC_CHECK_SIZEOF(long double)
|
91
|
+
|
92
|
+
# Also AC_SUBST this variable for ffi.h.
|
93
|
+
if test -z "$HAVE_LONG_DOUBLE"; then
|
94
|
+
HAVE_LONG_DOUBLE=0
|
95
|
+
if test $ac_cv_sizeof_long_double != 0; then
|
96
|
+
if test $HAVE_LONG_DOUBLE_VARIANT != 0; then
|
97
|
+
AC_DEFINE(HAVE_LONG_DOUBLE_VARIANT, 1, [Define if you support more than one size of the long double type])
|
98
|
+
HAVE_LONG_DOUBLE=1
|
99
|
+
else
|
100
|
+
if test $ac_cv_sizeof_double != $ac_cv_sizeof_long_double; then
|
101
|
+
HAVE_LONG_DOUBLE=1
|
102
|
+
AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the long double type and it is bigger than a double])
|
103
|
+
fi
|
104
|
+
fi
|
105
|
+
fi
|
106
|
+
fi
|
107
|
+
AC_SUBST(HAVE_LONG_DOUBLE)
|
108
|
+
AC_SUBST(HAVE_LONG_DOUBLE_VARIANT)
|
109
|
+
|
110
|
+
AC_C_BIGENDIAN
|
111
|
+
|
112
|
+
GCC_AS_CFI_PSEUDO_OP
|
113
|
+
|
114
|
+
case "$TARGET" in
|
115
|
+
SPARC)
|
116
|
+
AC_CACHE_CHECK([assembler and linker support unaligned pc related relocs],
|
117
|
+
libffi_cv_as_sparc_ua_pcrel, [
|
118
|
+
save_CFLAGS="$CFLAGS"
|
119
|
+
save_LDFLAGS="$LDFLAGS"
|
120
|
+
CFLAGS="$CFLAGS -fpic"
|
121
|
+
LDFLAGS="$LDFLAGS -shared"
|
122
|
+
AC_TRY_LINK([asm (".text; foo: nop; .data; .align 4; .byte 0; .uaword %r_disp32(foo); .text");],,
|
123
|
+
[libffi_cv_as_sparc_ua_pcrel=yes],
|
124
|
+
[libffi_cv_as_sparc_ua_pcrel=no])
|
125
|
+
CFLAGS="$save_CFLAGS"
|
126
|
+
LDFLAGS="$save_LDFLAGS"])
|
127
|
+
if test "x$libffi_cv_as_sparc_ua_pcrel" = xyes; then
|
128
|
+
AC_DEFINE(HAVE_AS_SPARC_UA_PCREL, 1,
|
129
|
+
[Define if your assembler and linker support unaligned PC relative relocs.])
|
130
|
+
fi
|
131
|
+
|
132
|
+
AC_CACHE_CHECK([assembler .register pseudo-op support],
|
133
|
+
libffi_cv_as_register_pseudo_op, [
|
134
|
+
libffi_cv_as_register_pseudo_op=unknown
|
135
|
+
# Check if we have .register
|
136
|
+
AC_TRY_COMPILE(,[asm (".register %g2, #scratch");],
|
137
|
+
[libffi_cv_as_register_pseudo_op=yes],
|
138
|
+
[libffi_cv_as_register_pseudo_op=no])
|
139
|
+
])
|
140
|
+
if test "x$libffi_cv_as_register_pseudo_op" = xyes; then
|
141
|
+
AC_DEFINE(HAVE_AS_REGISTER_PSEUDO_OP, 1,
|
142
|
+
[Define if your assembler supports .register.])
|
143
|
+
fi
|
144
|
+
;;
|
145
|
+
|
146
|
+
X86*)
|
147
|
+
AC_CACHE_CHECK([assembler supports pc related relocs],
|
148
|
+
libffi_cv_as_x86_pcrel, [
|
149
|
+
libffi_cv_as_x86_pcrel=no
|
150
|
+
echo '.text; foo: nop; .data; .long foo-.; .text' > conftest.s
|
151
|
+
if $CC $CFLAGS -c conftest.s > /dev/null 2>&1; then
|
152
|
+
libffi_cv_as_x86_pcrel=yes
|
153
|
+
fi
|
154
|
+
])
|
155
|
+
if test "x$libffi_cv_as_x86_pcrel" = xyes; then
|
156
|
+
AC_DEFINE(HAVE_AS_X86_PCREL, 1,
|
157
|
+
[Define if your assembler supports PC relative relocs.])
|
158
|
+
fi
|
159
|
+
;;
|
160
|
+
|
161
|
+
S390)
|
162
|
+
AC_CACHE_CHECK([compiler uses zarch features],
|
163
|
+
libffi_cv_as_s390_zarch, [
|
164
|
+
libffi_cv_as_s390_zarch=no
|
165
|
+
echo 'void foo(void) { bar(); bar(); }' > conftest.c
|
166
|
+
if $CC $CFLAGS -S conftest.c > /dev/null 2>&1; then
|
167
|
+
if grep -q brasl conftest.s; then
|
168
|
+
libffi_cv_as_s390_zarch=yes
|
169
|
+
fi
|
170
|
+
fi
|
171
|
+
])
|
172
|
+
if test "x$libffi_cv_as_s390_zarch" = xyes; then
|
173
|
+
AC_DEFINE(HAVE_AS_S390_ZARCH, 1,
|
174
|
+
[Define if the compiler uses zarch features.])
|
175
|
+
fi
|
176
|
+
;;
|
177
|
+
esac
|
178
|
+
|
179
|
+
# On PaX enable kernels that have MPROTECT enable we can't use PROT_EXEC.
|
180
|
+
AC_ARG_ENABLE(pax_emutramp,
|
181
|
+
[ --enable-pax_emutramp enable pax emulated trampolines, for we can't use PROT_EXEC],
|
182
|
+
if test "$enable_pax_emutramp" = "yes"; then
|
183
|
+
AC_DEFINE(FFI_MMAP_EXEC_EMUTRAMP_PAX, 1,
|
184
|
+
[Define this if you want to enable pax emulated trampolines])
|
185
|
+
fi)
|
186
|
+
|
187
|
+
LT_SYS_SYMBOL_USCORE
|
188
|
+
if test "x$sys_symbol_underscore" = xyes; then
|
189
|
+
AC_DEFINE(SYMBOL_UNDERSCORE, 1, [Define if symbols are underscored.])
|
190
|
+
fi
|
191
|
+
|
192
|
+
FFI_EXEC_TRAMPOLINE_TABLE=0
|
193
|
+
case "$target" in
|
194
|
+
*arm*-apple-* | aarch64-apple-*)
|
195
|
+
FFI_EXEC_TRAMPOLINE_TABLE=1
|
196
|
+
AC_DEFINE(FFI_EXEC_TRAMPOLINE_TABLE, 1,
|
197
|
+
[Cannot use PROT_EXEC on this target, so, we revert to
|
198
|
+
alternative means])
|
199
|
+
;;
|
200
|
+
*-apple-* | *-*-freebsd* | *-*-kfreebsd* | *-*-openbsd* | *-pc-solaris* | *-linux-android*)
|
201
|
+
AC_DEFINE(FFI_MMAP_EXEC_WRIT, 1,
|
202
|
+
[Cannot use malloc on this target, so, we revert to
|
203
|
+
alternative means])
|
204
|
+
;;
|
205
|
+
esac
|
206
|
+
AM_CONDITIONAL(FFI_EXEC_TRAMPOLINE_TABLE, test x$FFI_EXEC_TRAMPOLINE_TABLE = x1)
|
207
|
+
AC_SUBST(FFI_EXEC_TRAMPOLINE_TABLE)
|
208
|
+
|
209
|
+
if test x$TARGET = xX86_64; then
|
210
|
+
AC_CACHE_CHECK([toolchain supports unwind section type],
|
211
|
+
libffi_cv_as_x86_64_unwind_section_type, [
|
212
|
+
cat > conftest1.s << EOF
|
213
|
+
.text
|
214
|
+
.globl foo
|
215
|
+
foo:
|
216
|
+
jmp bar
|
217
|
+
.section .eh_frame,"a",@unwind
|
218
|
+
bar:
|
219
|
+
EOF
|
220
|
+
|
221
|
+
cat > conftest2.c << EOF
|
222
|
+
extern void foo();
|
223
|
+
int main(){foo();}
|
224
|
+
EOF
|
225
|
+
|
226
|
+
libffi_cv_as_x86_64_unwind_section_type=no
|
227
|
+
# we ensure that we can compile _and_ link an assembly file containing an @unwind section
|
228
|
+
# since the compiler can support it and not the linker (ie old binutils)
|
229
|
+
if $CC -Wa,--fatal-warnings $CFLAGS -c conftest1.s > /dev/null 2>&1 && \
|
230
|
+
$CC conftest2.c conftest1.o > /dev/null 2>&1 ; then
|
231
|
+
libffi_cv_as_x86_64_unwind_section_type=yes
|
232
|
+
fi
|
233
|
+
])
|
234
|
+
if test "x$libffi_cv_as_x86_64_unwind_section_type" = xyes; then
|
235
|
+
AC_DEFINE(HAVE_AS_X86_64_UNWIND_SECTION_TYPE, 1,
|
236
|
+
[Define if your assembler supports unwind section type.])
|
237
|
+
fi
|
238
|
+
fi
|
239
|
+
|
240
|
+
if test "x$GCC" = "xyes"; then
|
241
|
+
AC_CACHE_CHECK([whether .eh_frame section should be read-only],
|
242
|
+
libffi_cv_ro_eh_frame, [
|
243
|
+
libffi_cv_ro_eh_frame=no
|
244
|
+
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
|
+
objdump -h conftest.o > conftest.dump 2>&1
|
247
|
+
libffi_eh_frame_line=`grep -n eh_frame conftest.dump | cut -d: -f 1`
|
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
|
254
|
+
fi
|
255
|
+
fi
|
256
|
+
rm -f conftest.*
|
257
|
+
])
|
258
|
+
if test "x$libffi_cv_ro_eh_frame" = xyes; then
|
259
|
+
AC_DEFINE(HAVE_RO_EH_FRAME, 1,
|
260
|
+
[Define if .eh_frame sections should be read-only.])
|
261
|
+
AC_DEFINE(EH_FRAME_FLAGS, "a",
|
262
|
+
[Define to the flags needed for the .section .eh_frame directive. ])
|
263
|
+
else
|
264
|
+
AC_DEFINE(EH_FRAME_FLAGS, "aw",
|
265
|
+
[Define to the flags needed for the .section .eh_frame directive. ])
|
266
|
+
fi
|
267
|
+
|
268
|
+
AC_CACHE_CHECK([for __attribute__((visibility("hidden")))],
|
269
|
+
libffi_cv_hidden_visibility_attribute, [
|
270
|
+
echo 'int __attribute__ ((visibility ("hidden"))) foo (void) { return 1 ; }' > conftest.c
|
271
|
+
libffi_cv_hidden_visibility_attribute=no
|
272
|
+
if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
|
273
|
+
if egrep '(\.hidden|\.private_extern).*foo' conftest.s >/dev/null; then
|
274
|
+
libffi_cv_hidden_visibility_attribute=yes
|
275
|
+
fi
|
276
|
+
fi
|
277
|
+
rm -f conftest.*
|
278
|
+
])
|
279
|
+
if test $libffi_cv_hidden_visibility_attribute = yes; then
|
280
|
+
AC_DEFINE(HAVE_HIDDEN_VISIBILITY_ATTRIBUTE, 1,
|
281
|
+
[Define if __attribute__((visibility("hidden"))) is supported.])
|
282
|
+
fi
|
283
|
+
fi
|
284
|
+
|
285
|
+
AC_ARG_ENABLE(docs,
|
286
|
+
AC_HELP_STRING([--disable-docs],
|
287
|
+
[Disable building of docs (default: no)]),
|
288
|
+
[enable_docs=no],
|
289
|
+
[enable_docs=yes])
|
290
|
+
AM_CONDITIONAL(BUILD_DOCS, [test x$enable_docs = xyes])
|
291
|
+
|
292
|
+
AH_BOTTOM([
|
293
|
+
#ifdef HAVE_HIDDEN_VISIBILITY_ATTRIBUTE
|
294
|
+
#ifdef LIBFFI_ASM
|
295
|
+
#ifdef __APPLE__
|
296
|
+
#define FFI_HIDDEN(name) .private_extern name
|
297
|
+
#else
|
298
|
+
#define FFI_HIDDEN(name) .hidden name
|
299
|
+
#endif
|
300
|
+
#else
|
301
|
+
#define FFI_HIDDEN __attribute__ ((visibility ("hidden")))
|
302
|
+
#endif
|
303
|
+
#else
|
304
|
+
#ifdef LIBFFI_ASM
|
305
|
+
#define FFI_HIDDEN(name)
|
306
|
+
#else
|
307
|
+
#define FFI_HIDDEN
|
308
|
+
#endif
|
309
|
+
#endif
|
310
|
+
])
|
311
|
+
|
312
|
+
AC_SUBST(TARGET)
|
313
|
+
AC_SUBST(TARGETDIR)
|
314
|
+
|
315
|
+
changequote(<,>)
|
316
|
+
TARGET_OBJ=
|
317
|
+
for i in $SOURCES; do
|
318
|
+
TARGET_OBJ="${TARGET_OBJ} src/${TARGETDIR}/"`echo $i | sed 's/[cS]$/lo/'`
|
319
|
+
done
|
320
|
+
changequote([,])
|
321
|
+
AC_SUBST(TARGET_OBJ)
|
322
|
+
|
323
|
+
AC_SUBST(SHELL)
|
324
|
+
|
325
|
+
AC_ARG_ENABLE(debug,
|
326
|
+
[ --enable-debug debugging mode],
|
327
|
+
if test "$enable_debug" = "yes"; then
|
328
|
+
AC_DEFINE(FFI_DEBUG, 1, [Define this if you want extra debugging.])
|
329
|
+
fi)
|
330
|
+
AM_CONDITIONAL(FFI_DEBUG, test "$enable_debug" = "yes")
|
331
|
+
|
332
|
+
AC_ARG_ENABLE(structs,
|
333
|
+
[ --disable-structs omit code for struct support],
|
334
|
+
if test "$enable_structs" = "no"; then
|
335
|
+
AC_DEFINE(FFI_NO_STRUCTS, 1, [Define this if you do not want support for aggregate types.])
|
336
|
+
fi)
|
337
|
+
AM_CONDITIONAL(FFI_DEBUG, test "$enable_debug" = "yes")
|
338
|
+
|
339
|
+
AC_ARG_ENABLE(raw-api,
|
340
|
+
[ --disable-raw-api make the raw api unavailable],
|
341
|
+
if test "$enable_raw_api" = "no"; then
|
342
|
+
AC_DEFINE(FFI_NO_RAW_API, 1, [Define this if you do not want support for the raw API.])
|
343
|
+
fi)
|
344
|
+
|
345
|
+
AC_ARG_ENABLE(purify-safety,
|
346
|
+
[ --enable-purify-safety purify-safe mode],
|
347
|
+
if test "$enable_purify_safety" = "yes"; then
|
348
|
+
AC_DEFINE(USING_PURIFY, 1, [Define this if you are using Purify and want to suppress spurious messages.])
|
349
|
+
fi)
|
350
|
+
|
351
|
+
AC_ARG_ENABLE(multi-os-directory,
|
352
|
+
[ --disable-multi-os-directory
|
353
|
+
disable use of gcc --print-multi-os-directory to change the library installation directory])
|
354
|
+
|
355
|
+
# These variables are only ever used when we cross-build to X86_WIN32.
|
356
|
+
# And we only support this with GCC, so...
|
357
|
+
if test "x$GCC" = "xyes"; then
|
358
|
+
if test -n "$with_cross_host" &&
|
359
|
+
test x"$with_cross_host" != x"no"; then
|
360
|
+
toolexecdir='${exec_prefix}'/'$(target_alias)'
|
361
|
+
toolexeclibdir='${toolexecdir}'/lib
|
362
|
+
else
|
363
|
+
toolexecdir='${libdir}'/gcc-lib/'$(target_alias)'
|
364
|
+
toolexeclibdir='${libdir}'
|
365
|
+
fi
|
366
|
+
if test x"$enable_multi_os_directory" != x"no"; then
|
367
|
+
multi_os_directory=`$CC $CFLAGS -print-multi-os-directory`
|
368
|
+
case $multi_os_directory in
|
369
|
+
.) ;; # Avoid trailing /.
|
370
|
+
../*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
|
371
|
+
esac
|
372
|
+
fi
|
373
|
+
AC_SUBST(toolexecdir)
|
374
|
+
else
|
375
|
+
toolexeclibdir='${libdir}'
|
376
|
+
fi
|
377
|
+
AC_SUBST(toolexeclibdir)
|
378
|
+
|
379
|
+
# Check linker support.
|
380
|
+
LIBFFI_ENABLE_SYMVERS
|
381
|
+
|
382
|
+
AC_CONFIG_COMMANDS(include, [test -d include || mkdir include])
|
383
|
+
AC_CONFIG_COMMANDS(src, [
|
384
|
+
test -d src || mkdir src
|
385
|
+
test -d src/$TARGETDIR || mkdir src/$TARGETDIR
|
386
|
+
], [TARGETDIR="$TARGETDIR"])
|
387
|
+
|
388
|
+
AC_CONFIG_FILES(include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile doc/Makefile libffi.pc)
|
389
|
+
|
390
|
+
AC_OUTPUT
|
391
|
+
|
392
|
+
# Copy this file instead of using AC_CONFIG_LINK in order to support
|
393
|
+
# compiling with MSVC, which won't understand cygwin style symlinks.
|
394
|
+
cp ${srcdir}/src/$TARGETDIR/ffitarget.h include/ffitarget.h
|
@@ -0,0 +1,303 @@
|
|
1
|
+
# configure.host
|
2
|
+
#
|
3
|
+
# This shell script handles all host based configuration for libffi.
|
4
|
+
#
|
5
|
+
|
6
|
+
# THIS TABLE IS SORTED. KEEP IT THAT WAY.
|
7
|
+
# Most of the time we can define all the variables all at once...
|
8
|
+
case "${host}" in
|
9
|
+
aarch64*-*-cygwin* | aarch64*-*-mingw* | aarch64*-*-win* )
|
10
|
+
TARGET=ARM_WIN64; TARGETDIR=aarch64
|
11
|
+
MSVC=1
|
12
|
+
;;
|
13
|
+
|
14
|
+
aarch64*-*-*)
|
15
|
+
TARGET=AARCH64; TARGETDIR=aarch64
|
16
|
+
SOURCES="ffi.c sysv.S"
|
17
|
+
;;
|
18
|
+
|
19
|
+
alpha*-*-*)
|
20
|
+
TARGET=ALPHA; TARGETDIR=alpha;
|
21
|
+
# Support 128-bit long double, changeable via command-line switch.
|
22
|
+
HAVE_LONG_DOUBLE='defined(__LONG_DOUBLE_128__)'
|
23
|
+
SOURCES="ffi.c osf.S"
|
24
|
+
;;
|
25
|
+
|
26
|
+
arc*-*-*)
|
27
|
+
TARGET=ARC; TARGETDIR=arc
|
28
|
+
SOURCES="ffi.c arcompact.S"
|
29
|
+
;;
|
30
|
+
|
31
|
+
arm*-*-cygwin* | arm*-*-mingw* | arm*-*-win* )
|
32
|
+
TARGET=ARM_WIN32; TARGETDIR=arm
|
33
|
+
MSVC=1
|
34
|
+
;;
|
35
|
+
|
36
|
+
arm*-*-*)
|
37
|
+
TARGET=ARM; TARGETDIR=arm
|
38
|
+
SOURCES="ffi.c sysv.S"
|
39
|
+
;;
|
40
|
+
|
41
|
+
avr32*-*-*)
|
42
|
+
TARGET=AVR32; TARGETDIR=avr32
|
43
|
+
SOURCES="ffi.c sysv.S"
|
44
|
+
;;
|
45
|
+
|
46
|
+
bfin*)
|
47
|
+
TARGET=BFIN; TARGETDIR=bfin
|
48
|
+
SOURCES="ffi.c sysv.S"
|
49
|
+
;;
|
50
|
+
|
51
|
+
cris-*-*)
|
52
|
+
TARGET=LIBFFI_CRIS; TARGETDIR=cris
|
53
|
+
SOURCES="ffi.c sysv.S"
|
54
|
+
;;
|
55
|
+
|
56
|
+
frv-*-*)
|
57
|
+
TARGET=FRV; TARGETDIR=frv
|
58
|
+
SOURCES="ffi.c eabi.S"
|
59
|
+
;;
|
60
|
+
|
61
|
+
hppa*-*-linux* | parisc*-*-linux* | hppa*-*-openbsd*)
|
62
|
+
TARGET=PA_LINUX; TARGETDIR=pa
|
63
|
+
SOURCES="ffi.c linux.S"
|
64
|
+
;;
|
65
|
+
hppa*64-*-hpux*)
|
66
|
+
TARGET=PA64_HPUX; TARGETDIR=pa
|
67
|
+
;;
|
68
|
+
hppa*-*-hpux*)
|
69
|
+
TARGET=PA_HPUX; TARGETDIR=pa
|
70
|
+
SOURCES="ffi.c hpux32.S"
|
71
|
+
;;
|
72
|
+
|
73
|
+
i?86-*-freebsd* | i?86-*-openbsd*)
|
74
|
+
TARGET=X86_FREEBSD; TARGETDIR=x86
|
75
|
+
;;
|
76
|
+
|
77
|
+
i?86-*-cygwin* | i?86-*-mingw* | i?86-*-os2* | i?86-*-interix* \
|
78
|
+
| x86_64-*-cygwin* | x86_64-*-mingw* | x86_64-*-win* )
|
79
|
+
TARGETDIR=x86
|
80
|
+
if test $ac_cv_sizeof_size_t = 4; then
|
81
|
+
TARGET=X86_WIN32
|
82
|
+
else
|
83
|
+
TARGET=X86_WIN64
|
84
|
+
fi
|
85
|
+
if test "${ax_cv_c_compiler_vendor}" = "microsoft"; then
|
86
|
+
MSVC=1
|
87
|
+
fi
|
88
|
+
# All mingw/cygwin/win32 builds require -no-undefined for sharedlib.
|
89
|
+
# We must also check with_cross_host to decide if this is a native
|
90
|
+
# or cross-build and select where to install dlls appropriately.
|
91
|
+
if test -n "$with_cross_host" &&
|
92
|
+
test x"$with_cross_host" != x"no"; then
|
93
|
+
AM_LTLDFLAGS='-no-undefined -bindir "$(toolexeclibdir)"';
|
94
|
+
else
|
95
|
+
AM_LTLDFLAGS='-no-undefined -bindir "$(bindir)"';
|
96
|
+
fi
|
97
|
+
;;
|
98
|
+
|
99
|
+
i?86-*-darwin* | x86_64-*-darwin* | i?86-*-ios | x86_64-*-ios)
|
100
|
+
TARGETDIR=x86
|
101
|
+
if test $ac_cv_sizeof_size_t = 4; then
|
102
|
+
TARGET=X86_DARWIN
|
103
|
+
else
|
104
|
+
TARGET=X86_64
|
105
|
+
fi
|
106
|
+
;;
|
107
|
+
|
108
|
+
i?86-*-* | x86_64-*-* | amd64-*)
|
109
|
+
TARGETDIR=x86
|
110
|
+
if test $ac_cv_sizeof_size_t = 4; then
|
111
|
+
case "$host" in
|
112
|
+
x86_64-*x32|x86_64-x32-*)
|
113
|
+
TARGET_X32=yes
|
114
|
+
TARGET=X86_64
|
115
|
+
;;
|
116
|
+
*)
|
117
|
+
echo 'int foo (void) { return __x86_64__; }' > conftest.c
|
118
|
+
if $CC $CFLAGS -Werror -S conftest.c -o conftest.s > /dev/null 2>&1; then
|
119
|
+
TARGET_X32=yes
|
120
|
+
TARGET=X86_64
|
121
|
+
else
|
122
|
+
TARGET=X86;
|
123
|
+
fi
|
124
|
+
rm -f conftest.*
|
125
|
+
;;
|
126
|
+
esac
|
127
|
+
else
|
128
|
+
TARGET=X86_64;
|
129
|
+
fi
|
130
|
+
;;
|
131
|
+
|
132
|
+
ia64*-*-*)
|
133
|
+
TARGET=IA64; TARGETDIR=ia64
|
134
|
+
SOURCES="ffi.c unix.S"
|
135
|
+
;;
|
136
|
+
|
137
|
+
m32r*-*-*)
|
138
|
+
TARGET=M32R; TARGETDIR=m32r
|
139
|
+
SOURCES="ffi.c sysv.S"
|
140
|
+
;;
|
141
|
+
|
142
|
+
m68k-*-*)
|
143
|
+
TARGET=M68K; TARGETDIR=m68k
|
144
|
+
SOURCES="ffi.c sysv.S"
|
145
|
+
;;
|
146
|
+
|
147
|
+
m88k-*-*)
|
148
|
+
TARGET=M88K; TARGETDIR=m88k
|
149
|
+
SOURCES="ffi.c obsd.S"
|
150
|
+
;;
|
151
|
+
|
152
|
+
microblaze*-*-*)
|
153
|
+
TARGET=MICROBLAZE; TARGETDIR=microblaze
|
154
|
+
SOURCES="ffi.c sysv.S"
|
155
|
+
;;
|
156
|
+
|
157
|
+
moxie-*-*)
|
158
|
+
TARGET=MOXIE; TARGETDIR=moxie
|
159
|
+
SOURCES="ffi.c eabi.S"
|
160
|
+
;;
|
161
|
+
|
162
|
+
metag-*-*)
|
163
|
+
TARGET=METAG; TARGETDIR=metag
|
164
|
+
SOURCES="ffi.c sysv.S"
|
165
|
+
;;
|
166
|
+
|
167
|
+
mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*)
|
168
|
+
TARGET=MIPS; TARGETDIR=mips
|
169
|
+
;;
|
170
|
+
mips*-*linux* | mips*-*-openbsd*)
|
171
|
+
# Support 128-bit long double for NewABI.
|
172
|
+
HAVE_LONG_DOUBLE='defined(__mips64)'
|
173
|
+
TARGET=MIPS; TARGETDIR=mips
|
174
|
+
;;
|
175
|
+
|
176
|
+
nios2*-linux*)
|
177
|
+
TARGET=NIOS2; TARGETDIR=nios2
|
178
|
+
SOURCES="ffi.c sysv.S"
|
179
|
+
;;
|
180
|
+
|
181
|
+
or1k*-linux*)
|
182
|
+
TARGET=OR1K; TARGETDIR=or1k
|
183
|
+
SOURCES="ffi.c sysv.S"
|
184
|
+
;;
|
185
|
+
|
186
|
+
powerpc*-*-linux* | powerpc-*-sysv*)
|
187
|
+
TARGET=POWERPC; TARGETDIR=powerpc
|
188
|
+
HAVE_LONG_DOUBLE_VARIANT=1
|
189
|
+
;;
|
190
|
+
powerpc-*-amigaos*)
|
191
|
+
TARGET=POWERPC; TARGETDIR=powerpc
|
192
|
+
;;
|
193
|
+
powerpc-*-beos*)
|
194
|
+
TARGET=POWERPC; TARGETDIR=powerpc
|
195
|
+
;;
|
196
|
+
powerpc-*-darwin* | powerpc64-*-darwin*)
|
197
|
+
TARGET=POWERPC_DARWIN; TARGETDIR=powerpc
|
198
|
+
;;
|
199
|
+
powerpc-*-aix* | rs6000-*-aix*)
|
200
|
+
TARGET=POWERPC_AIX; TARGETDIR=powerpc
|
201
|
+
;;
|
202
|
+
powerpc-*-freebsd* | powerpc-*-openbsd* | powerpc-*-netbsd*)
|
203
|
+
TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc
|
204
|
+
HAVE_LONG_DOUBLE_VARIANT=1
|
205
|
+
;;
|
206
|
+
powerpc64-*-freebsd*)
|
207
|
+
TARGET=POWERPC; TARGETDIR=powerpc
|
208
|
+
;;
|
209
|
+
powerpc*-*-rtems*)
|
210
|
+
TARGET=POWERPC; TARGETDIR=powerpc
|
211
|
+
;;
|
212
|
+
|
213
|
+
riscv*-*)
|
214
|
+
TARGET=RISCV; TARGETDIR=riscv
|
215
|
+
SOURCES="ffi.c sysv.S"
|
216
|
+
;;
|
217
|
+
|
218
|
+
s390-*-* | s390x-*-*)
|
219
|
+
TARGET=S390; TARGETDIR=s390
|
220
|
+
SOURCES="ffi.c sysv.S"
|
221
|
+
;;
|
222
|
+
|
223
|
+
sh-*-* | sh[34]*-*-*)
|
224
|
+
TARGET=SH; TARGETDIR=sh
|
225
|
+
SOURCES="ffi.c sysv.S"
|
226
|
+
;;
|
227
|
+
sh64-*-* | sh5*-*-*)
|
228
|
+
TARGET=SH64; TARGETDIR=sh64
|
229
|
+
SOURCES="ffi.c sysv.S"
|
230
|
+
;;
|
231
|
+
|
232
|
+
sparc*-*-*)
|
233
|
+
TARGET=SPARC; TARGETDIR=sparc
|
234
|
+
SOURCES="ffi.c ffi64.c v8.S v9.S"
|
235
|
+
;;
|
236
|
+
|
237
|
+
tile*-*)
|
238
|
+
TARGET=TILE; TARGETDIR=tile
|
239
|
+
SOURCES="ffi.c tile.S"
|
240
|
+
;;
|
241
|
+
|
242
|
+
vax-*-*)
|
243
|
+
TARGET=VAX; TARGETDIR=vax
|
244
|
+
SOURCES="ffi.c elfbsd.S"
|
245
|
+
;;
|
246
|
+
|
247
|
+
xtensa*-*)
|
248
|
+
TARGET=XTENSA; TARGETDIR=xtensa
|
249
|
+
SOURCES="ffi.c sysv.S"
|
250
|
+
;;
|
251
|
+
esac
|
252
|
+
|
253
|
+
# ... but some of the cases above share configury.
|
254
|
+
case "${TARGET}" in
|
255
|
+
ARM_WIN32)
|
256
|
+
SOURCES="ffi.c sysv_msvc_arm32.S"
|
257
|
+
;;
|
258
|
+
ARM_WIN64)
|
259
|
+
SOURCES="ffi.c win64_armasm.S"
|
260
|
+
;;
|
261
|
+
MIPS)
|
262
|
+
SOURCES="ffi.c o32.S n32.S"
|
263
|
+
;;
|
264
|
+
POWERPC)
|
265
|
+
SOURCES="ffi.c ffi_sysv.c ffi_linux64.c sysv.S ppc_closure.S"
|
266
|
+
SOURCES="${SOURCES} linux64.S linux64_closure.S"
|
267
|
+
;;
|
268
|
+
POWERPC_AIX)
|
269
|
+
SOURCES="ffi_darwin.c aix.S aix_closure.S"
|
270
|
+
;;
|
271
|
+
POWERPC_DARWIN)
|
272
|
+
SOURCES="ffi_darwin.c darwin.S darwin_closure.S"
|
273
|
+
;;
|
274
|
+
POWERPC_FREEBSD)
|
275
|
+
SOURCES="ffi.c ffi_sysv.c sysv.S ppc_closure.S"
|
276
|
+
;;
|
277
|
+
X86 | X86_DARWIN | X86_FREEBSD | X86_WIN32)
|
278
|
+
if test "$MSVC" = 1; then
|
279
|
+
SOURCES="ffi.c sysv_intel.S"
|
280
|
+
else
|
281
|
+
SOURCES="ffi.c sysv.S"
|
282
|
+
fi
|
283
|
+
;;
|
284
|
+
X86_64)
|
285
|
+
if test x"$TARGET_X32" = xyes; then
|
286
|
+
SOURCES="ffi64.c unix64.S"
|
287
|
+
else
|
288
|
+
SOURCES="ffi64.c unix64.S ffiw64.c win64.S"
|
289
|
+
fi
|
290
|
+
;;
|
291
|
+
X86_WIN64)
|
292
|
+
if test "$MSVC" = 1; then
|
293
|
+
SOURCES="ffiw64.c win64_intel.S"
|
294
|
+
else
|
295
|
+
SOURCES="ffiw64.c win64.S"
|
296
|
+
fi
|
297
|
+
;;
|
298
|
+
esac
|
299
|
+
|
300
|
+
# If we failed to configure SOURCES, we can't do anything.
|
301
|
+
if test -z "${SOURCES}"; then
|
302
|
+
UNSUPPORTED=1
|
303
|
+
fi
|