ffi 1.11.3 → 1.15.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (276) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +184 -0
  3. data/Gemfile +3 -4
  4. data/README.md +24 -3
  5. data/Rakefile +64 -69
  6. data/ext/ffi_c/AbstractMemory.c +24 -25
  7. data/ext/ffi_c/Buffer.c +4 -9
  8. data/ext/ffi_c/Call.c +4 -16
  9. data/ext/ffi_c/ClosurePool.c +75 -25
  10. data/ext/ffi_c/ClosurePool.h +3 -1
  11. data/ext/ffi_c/DynamicLibrary.c +1 -6
  12. data/ext/ffi_c/Function.c +38 -38
  13. data/ext/ffi_c/Function.h +0 -4
  14. data/ext/ffi_c/FunctionInfo.c +3 -8
  15. data/ext/ffi_c/LastError.c +2 -6
  16. data/ext/ffi_c/LongDouble.c +5 -3
  17. data/ext/ffi_c/LongDouble.h +0 -4
  18. data/ext/ffi_c/MemoryPointer.c +3 -8
  19. data/ext/ffi_c/MemoryPointer.h +0 -4
  20. data/ext/ffi_c/MethodHandle.c +21 -31
  21. data/ext/ffi_c/MethodHandle.h +3 -2
  22. data/ext/ffi_c/Platform.c +5 -9
  23. data/ext/ffi_c/Pointer.c +25 -26
  24. data/ext/ffi_c/Pointer.h +0 -4
  25. data/ext/ffi_c/Struct.c +49 -56
  26. data/ext/ffi_c/Struct.h +12 -6
  27. data/ext/ffi_c/StructByValue.c +2 -7
  28. data/ext/ffi_c/StructLayout.c +22 -20
  29. data/ext/ffi_c/Thread.c +0 -8
  30. data/ext/ffi_c/Thread.h +1 -9
  31. data/ext/ffi_c/Type.c +1 -1
  32. data/ext/ffi_c/Types.c +6 -7
  33. data/ext/ffi_c/Types.h +3 -4
  34. data/ext/ffi_c/Variadic.c +14 -9
  35. data/ext/ffi_c/compat.h +4 -0
  36. data/ext/ffi_c/extconf.rb +36 -24
  37. data/ext/ffi_c/libffi/.travis/bfin-sim.exp +58 -0
  38. data/ext/ffi_c/libffi/.travis/build-cross-in-container.sh +14 -0
  39. data/ext/ffi_c/libffi/.travis/build-in-container.sh +2 -12
  40. data/ext/ffi_c/libffi/.travis/build.sh +62 -30
  41. data/ext/ffi_c/libffi/.travis/install.sh +65 -37
  42. data/ext/ffi_c/libffi/.travis/m32r-sim.exp +58 -0
  43. data/ext/ffi_c/libffi/.travis/moxie-sim.exp +1 -1
  44. data/ext/ffi_c/libffi/.travis/or1k-sim.exp +58 -0
  45. data/ext/ffi_c/libffi/.travis/powerpc-eabisim.exp +58 -0
  46. data/ext/ffi_c/libffi/.travis/site.exp +10 -1
  47. data/ext/ffi_c/libffi/.travis/wine-sim.exp +55 -0
  48. data/ext/ffi_c/libffi/.travis.yml +32 -12
  49. data/ext/ffi_c/libffi/{ChangeLog.libffi-3.1 → ChangeLog.old} +1407 -0
  50. data/ext/ffi_c/libffi/LICENSE +1 -1
  51. data/ext/ffi_c/libffi/Makefile.am +53 -61
  52. data/ext/ffi_c/libffi/Makefile.in +458 -207
  53. data/ext/ffi_c/libffi/README.md +22 -6
  54. data/ext/ffi_c/libffi/config.guess +552 -331
  55. data/ext/ffi_c/libffi/config.sub +1321 -1306
  56. data/ext/ffi_c/libffi/configure +414 -342
  57. data/ext/ffi_c/libffi/configure.ac +32 -11
  58. data/ext/ffi_c/libffi/configure.host +37 -22
  59. data/ext/ffi_c/libffi/doc/Makefile.in +9 -5
  60. data/ext/ffi_c/libffi/doc/libffi.texi +26 -14
  61. data/ext/ffi_c/libffi/doc/version.texi +4 -4
  62. data/ext/ffi_c/libffi/fficonfig.h.in +13 -0
  63. data/ext/ffi_c/libffi/generate-darwin-source-and-headers.py +2 -4
  64. data/ext/ffi_c/libffi/include/Makefile.in +10 -6
  65. data/ext/ffi_c/libffi/include/ffi.h.in +15 -7
  66. data/ext/ffi_c/libffi/install-sh +23 -13
  67. data/ext/ffi_c/libffi/libffi.map.in +8 -12
  68. data/ext/ffi_c/libffi/libffi.xcodeproj/project.pbxproj +2 -48
  69. data/ext/ffi_c/libffi/libtool-version +1 -1
  70. data/ext/ffi_c/libffi/ltmain.sh +156 -61
  71. data/ext/ffi_c/libffi/m4/ax_append_flag.m4 +5 -26
  72. data/ext/ffi_c/libffi/m4/ax_check_compile_flag.m4 +5 -26
  73. data/ext/ffi_c/libffi/m4/ax_compiler_vendor.m4 +2 -1
  74. data/ext/ffi_c/libffi/m4/ax_configure_args.m4 +5 -26
  75. data/ext/ffi_c/libffi/m4/ax_gcc_archflag.m4 +7 -3
  76. data/ext/ffi_c/libffi/man/Makefile.in +9 -5
  77. data/ext/ffi_c/libffi/missing +8 -8
  78. data/ext/ffi_c/libffi/msvcc.sh +11 -11
  79. data/ext/ffi_c/libffi/src/aarch64/ffi.c +51 -35
  80. data/ext/ffi_c/libffi/src/aarch64/ffitarget.h +10 -5
  81. data/ext/ffi_c/libffi/src/aarch64/internal.h +1 -0
  82. data/ext/ffi_c/libffi/src/aarch64/sysv.S +14 -3
  83. data/ext/ffi_c/libffi/src/aarch64/win64_armasm.S +1 -1
  84. data/ext/ffi_c/libffi/src/arm/ffi.c +22 -0
  85. data/ext/ffi_c/libffi/src/arm/sysv.S +4 -4
  86. data/ext/ffi_c/libffi/src/closures.c +43 -12
  87. data/ext/ffi_c/libffi/src/csky/ffi.c +395 -0
  88. data/ext/ffi_c/libffi/src/csky/ffitarget.h +63 -0
  89. data/ext/ffi_c/libffi/src/csky/sysv.S +371 -0
  90. data/ext/ffi_c/libffi/src/dlmalloc.c +1 -1
  91. data/ext/ffi_c/libffi/src/kvx/asm.h +5 -0
  92. data/ext/ffi_c/libffi/src/kvx/ffi.c +273 -0
  93. data/ext/ffi_c/libffi/src/kvx/ffitarget.h +75 -0
  94. data/ext/ffi_c/libffi/src/kvx/sysv.S +127 -0
  95. data/ext/ffi_c/libffi/src/mips/ffi.c +5 -1
  96. data/ext/ffi_c/libffi/src/mips/ffitarget.h +1 -1
  97. data/ext/ffi_c/libffi/src/mips/o32.S +2 -0
  98. data/ext/ffi_c/libffi/src/pa/ffi.c +46 -91
  99. data/ext/ffi_c/libffi/src/pa/ffitarget.h +1 -6
  100. data/ext/ffi_c/libffi/src/pa/hpux32.S +4 -2
  101. data/ext/ffi_c/libffi/src/pa/linux.S +4 -2
  102. data/ext/ffi_c/libffi/src/powerpc/ffi.c +3 -2
  103. data/ext/ffi_c/libffi/src/powerpc/ffi_darwin.c +13 -1
  104. data/ext/ffi_c/libffi/src/powerpc/ffi_linux64.c +154 -8
  105. data/ext/ffi_c/libffi/src/powerpc/ffi_powerpc.h +18 -7
  106. data/ext/ffi_c/libffi/src/powerpc/ffitarget.h +10 -4
  107. data/ext/ffi_c/libffi/src/powerpc/linux64.S +91 -28
  108. data/ext/ffi_c/libffi/src/powerpc/linux64_closure.S +80 -4
  109. data/ext/ffi_c/libffi/src/powerpc/sysv.S +5 -7
  110. data/ext/ffi_c/libffi/src/prep_cif.c +1 -1
  111. data/ext/ffi_c/libffi/src/x86/ffi.c +15 -6
  112. data/ext/ffi_c/libffi/src/x86/ffi64.c +17 -8
  113. data/ext/ffi_c/libffi/src/x86/ffitarget.h +15 -2
  114. data/ext/ffi_c/libffi/src/x86/ffiw64.c +15 -8
  115. data/ext/ffi_c/libffi/src/x86/sysv.S +15 -6
  116. data/ext/ffi_c/libffi/src/x86/unix64.S +59 -4
  117. data/ext/ffi_c/libffi/src/x86/win64.S +7 -3
  118. data/ext/ffi_c/libffi/src/x86/win64_intel.S +3 -2
  119. data/ext/ffi_c/libffi/testsuite/Makefile.am +78 -75
  120. data/ext/ffi_c/libffi/testsuite/Makefile.in +124 -84
  121. data/ext/ffi_c/libffi/testsuite/lib/libffi.exp +7 -4
  122. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/bhaible.exp +7 -2
  123. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-call.c +4 -4
  124. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-callback.c +2 -2
  125. data/ext/ffi_c/libffi/testsuite/libffi.call/call.exp +12 -1
  126. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure.exp +67 -0
  127. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn0.c +0 -0
  128. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn1.c +0 -0
  129. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn2.c +0 -0
  130. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn3.c +0 -0
  131. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn4.c +0 -0
  132. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn5.c +0 -0
  133. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn6.c +0 -0
  134. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_loc_fn0.c +0 -0
  135. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_simple.c +0 -0
  136. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_12byte.c +0 -0
  137. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_16byte.c +0 -0
  138. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_18byte.c +0 -0
  139. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_19byte.c +0 -0
  140. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_1_1byte.c +0 -0
  141. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_20byte.c +0 -0
  142. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_20byte1.c +0 -0
  143. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_24byte.c +0 -0
  144. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_2byte.c +0 -0
  145. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3_1byte.c +0 -0
  146. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3byte1.c +0 -0
  147. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3byte2.c +0 -0
  148. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3float.c +0 -0
  149. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_4_1byte.c +0 -0
  150. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_4byte.c +0 -0
  151. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_5_1_byte.c +0 -0
  152. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_5byte.c +0 -0
  153. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_64byte.c +0 -0
  154. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_6_1_byte.c +0 -0
  155. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_6byte.c +0 -0
  156. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_7_1_byte.c +0 -0
  157. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_7byte.c +0 -0
  158. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_8byte.c +0 -0
  159. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_9byte1.c +0 -0
  160. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_9byte2.c +0 -0
  161. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_double.c +0 -0
  162. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_float.c +0 -0
  163. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble.c +0 -0
  164. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble_split.c +0 -0
  165. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble_split2.c +0 -0
  166. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_pointer.c +0 -0
  167. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint16.c +0 -0
  168. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint32.c +0 -0
  169. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint64.c +0 -0
  170. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint16.c +0 -0
  171. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint32.c +0 -0
  172. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint64.c +0 -0
  173. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_dbls_struct.c +0 -0
  174. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_double.c +0 -0
  175. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_double_va.c +0 -0
  176. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_float.c +0 -0
  177. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_longdouble.c +0 -0
  178. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_longdouble_va.c +0 -0
  179. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_many_mixed_args.c +0 -0
  180. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_many_mixed_float_double.c +0 -0
  181. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_schar.c +0 -0
  182. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_sshort.c +0 -0
  183. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_sshortchar.c +0 -0
  184. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_uchar.c +0 -0
  185. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_ushort.c +0 -0
  186. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_ushortchar.c +0 -0
  187. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_pointer.c +0 -0
  188. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_pointer_stack.c +0 -0
  189. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_schar.c +0 -0
  190. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_sint.c +0 -0
  191. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_sshort.c +0 -0
  192. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_struct_va1.c +0 -0
  193. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uchar.c +0 -0
  194. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uchar_va.c +0 -0
  195. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uint.c +0 -0
  196. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uint_va.c +0 -0
  197. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ulong_va.c +0 -0
  198. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ulonglong.c +0 -0
  199. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ushort.c +0 -0
  200. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ushort_va.c +0 -0
  201. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/err_bad_abi.c +0 -0
  202. data/ext/ffi_c/libffi/testsuite/libffi.closures/ffitest.h +138 -0
  203. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/huge_struct.c +3 -1
  204. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct.c +0 -0
  205. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct1.c +0 -0
  206. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct10.c +0 -0
  207. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct11.c +0 -0
  208. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct2.c +0 -0
  209. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct3.c +0 -0
  210. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct4.c +0 -0
  211. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct5.c +0 -0
  212. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct6.c +0 -0
  213. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct7.c +0 -0
  214. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct8.c +0 -0
  215. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct9.c +0 -0
  216. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/problem1.c +0 -0
  217. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_large.c +0 -0
  218. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_large2.c +0 -0
  219. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_medium.c +0 -0
  220. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_medium2.c +0 -0
  221. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/testclosure.c +0 -0
  222. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/unwindtest.cc +0 -0
  223. data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/unwindtest_ffi_call.cc +0 -0
  224. data/ffi.gemspec +4 -5
  225. data/lib/ffi/abstract_memory.rb +44 -0
  226. data/lib/ffi/autopointer.rb +1 -1
  227. data/lib/ffi/ffi.rb +2 -0
  228. data/lib/ffi/io.rb +3 -3
  229. data/lib/ffi/library.rb +8 -4
  230. data/lib/ffi/managedstruct.rb +2 -2
  231. data/lib/ffi/platform/aarch64-darwin/types.conf +130 -0
  232. data/lib/ffi/platform/aarch64-freebsd/types.conf +2 -2
  233. data/lib/ffi/platform/aarch64-freebsd12/types.conf +113 -60
  234. data/lib/ffi/platform/aarch64-openbsd/types.conf +134 -0
  235. data/lib/ffi/platform/arm-linux/types.conf +32 -4
  236. data/lib/ffi/platform/i386-windows/types.conf +26 -79
  237. data/lib/ffi/platform/powerpc-linux/types.conf +32 -2
  238. data/lib/ffi/platform/powerpc-openbsd/types.conf +156 -0
  239. data/lib/ffi/platform/powerpc64le-linux/types.conf +100 -0
  240. data/lib/ffi/platform/riscv64-linux/types.conf +104 -0
  241. data/lib/ffi/platform/sparcv9-openbsd/types.conf +156 -0
  242. data/lib/ffi/platform/x86_64-darwin/types.conf +4 -0
  243. data/lib/ffi/platform/x86_64-dragonflybsd/types.conf +4 -22
  244. data/lib/ffi/platform/x86_64-haiku/types.conf +117 -0
  245. data/lib/ffi/platform/x86_64-linux/types.conf +21 -0
  246. data/lib/ffi/platform/x86_64-msys/types.conf +119 -0
  247. data/lib/ffi/platform/x86_64-windows/types.conf +10 -78
  248. data/lib/ffi/platform.rb +18 -8
  249. data/lib/ffi/pointer.rb +21 -14
  250. data/lib/ffi/struct.rb +10 -5
  251. data/lib/ffi/tools/const_generator.rb +6 -4
  252. data/lib/ffi/tools/struct_generator.rb +2 -1
  253. data/lib/ffi/tools/types_generator.rb +2 -0
  254. data/lib/ffi/variadic.rb +1 -10
  255. data/lib/ffi/version.rb +1 -1
  256. data/lib/ffi.rb +10 -3
  257. data/rakelib/ffi_gem_helper.rb +65 -0
  258. data/samples/getlogin.rb +1 -1
  259. data/samples/getpid.rb +1 -1
  260. data/samples/gettimeofday.rb +8 -8
  261. data/samples/hello.rb +2 -1
  262. data/samples/inotify.rb +1 -1
  263. data/samples/pty.rb +1 -2
  264. data/samples/qsort.rb +0 -1
  265. metadata +133 -134
  266. data/.appveyor.yml +0 -27
  267. data/.gitignore +0 -25
  268. data/.gitmodules +0 -4
  269. data/.travis.yml +0 -42
  270. data/.yardopts +0 -5
  271. data/ext/ffi_c/libffi/ChangeLog.libffi +0 -584
  272. data/ext/ffi_c/libffi/ChangeLog.libgcj +0 -40
  273. data/ext/ffi_c/libffi/ChangeLog.v1 +0 -764
  274. data/ext/ffi_c/win32/stdbool.h +0 -8
  275. data/ext/ffi_c/win32/stdint.h +0 -201
  276. data/samples/sample_helper.rb +0 -6
@@ -0,0 +1,75 @@
1
+ /* -----------------------------------------------------------------------
2
+ ffitarget.h - Copyright (c) 2020 Kalray
3
+
4
+ KVX Target configuration macros
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining
7
+ a copy of this software and associated documentation files (the
8
+ ``Software''), to deal in the Software without restriction, including
9
+ without limitation the rights to use, copy, modify, merge, publish,
10
+ distribute, sublicense, and/or sell copies of the Software, and to
11
+ permit persons to whom the Software is furnished to do so, subject to
12
+ the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included
15
+ in all copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
18
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
24
+ DEALINGS IN THE SOFTWARE.
25
+ ----------------------------------------------------------------------- */
26
+
27
+ #ifndef LIBFFI_TARGET_H
28
+ #define LIBFFI_TARGET_H
29
+
30
+ #ifndef LIBFFI_H
31
+ #error "Please do not include ffitarget.h directly into your source. Use ffi.h instead."
32
+ #endif
33
+
34
+ /* ---- System specific configurations ----------------------------------- */
35
+
36
+ #ifndef LIBFFI_ASM
37
+ typedef unsigned long ffi_arg;
38
+ typedef signed long ffi_sarg;
39
+
40
+ typedef enum ffi_abi {
41
+ FFI_FIRST_ABI = 0,
42
+ FFI_SYSV,
43
+ FFI_LAST_ABI,
44
+ FFI_DEFAULT_ABI = FFI_SYSV
45
+ } ffi_abi;
46
+
47
+ /* Those values are set depending on return type
48
+ * they are used in the assembly code in sysv.S
49
+ */
50
+ typedef enum kvx_intext_method {
51
+ KVX_RET_NONE = 0,
52
+ KVX_RET_SXBD = 1,
53
+ KVX_RET_SXHD = 2,
54
+ KVX_RET_SXWD = 3,
55
+ KVX_RET_ZXBD = 4,
56
+ KVX_RET_ZXHD = 5,
57
+ KVX_RET_ZXWD = 6
58
+ } kvx_intext_method;
59
+
60
+ #endif
61
+
62
+ /* ---- Definitions for closures ----------------------------------------- */
63
+
64
+ /* This is only to allow Python to compile
65
+ * but closures are not supported yet
66
+ */
67
+ #define FFI_CLOSURES 1
68
+ #define FFI_TRAMPOLINE_SIZE 0
69
+
70
+ #define FFI_NATIVE_RAW_API 0
71
+ #define FFI_TARGET_SPECIFIC_VARIADIC 1
72
+ #define FFI_TARGET_HAS_COMPLEX_TYPE
73
+
74
+ #endif
75
+
@@ -0,0 +1,127 @@
1
+ /* Copyright (c) 2020 Kalray
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ ``Software''), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
21
+
22
+ #if defined(__kvx__)
23
+ #define LIBFFI_ASM
24
+ #include <fficonfig.h>
25
+ #include <ffi.h>
26
+ #include <ffi_cfi.h>
27
+ #include <kvx/asm.h>
28
+
29
+ .text
30
+ .global ffi_call_SYSV
31
+ .type ffi_call_SYSV, @function
32
+ .type ffi_prep_args, @function
33
+ .align 8
34
+
35
+ /* ffi_call_SYSV
36
+
37
+ r0: total size to allocate on stack
38
+ r1: size of arg slots
39
+ r2: extended cif structure, DO NOT REMOVE: it is used by ffi_prep_args()
40
+ r3: return value address
41
+ r4: function to call
42
+ r5: integer sign extension method to be used
43
+ */
44
+ ffi_call_SYSV:
45
+ addd $r12 = $r12, -64
46
+ so (-32)[$r12] = $r20r21r22r23
47
+ ;;
48
+ sd (0)[$r12] = $r24
49
+ ;;
50
+ get $r23 = $ra
51
+ copyd $r20 = $r12
52
+ sbfd $r12 = $r0, $r12
53
+ ;;
54
+ copyd $r0 = $r12
55
+ copyd $r21 = $r3
56
+ copyd $r22 = $r4
57
+ copyd $r24 = $r5
58
+ call ffi_prep_args
59
+ ;;
60
+ lo $r8r9r10r11 = (64)[$r12]
61
+ ;;
62
+ lo $r4r5r6r7 = (32)[$r12]
63
+ ;;
64
+ lo $r0r1r2r3 = (0)[$r12]
65
+ copyd $r12 = $r0
66
+ /* $r15 is the register used by the ABI to return big (>32 bytes)
67
+ * structs by value.
68
+ * It is also referred to as the "struct register" in the ABI.
69
+ */
70
+ copyd $r15 = $r21
71
+ icall $r22
72
+ ;;
73
+ pcrel $r4 = @pcrel(.Ltable)
74
+ cb.deqz $r24 ? .Lend
75
+ ;;
76
+ addx8d $r24 = $r24, $r4
77
+ ;;
78
+ igoto $r24
79
+ ;;
80
+ .Ltable:
81
+ 0: /* we should never arrive here */
82
+ goto .Lerror
83
+ nop
84
+ ;;
85
+ 1: /* Sign extend byte to double */
86
+ sxbd $r0 = $r0
87
+ goto .Lend
88
+ ;;
89
+ 2: /* Sign extend half to double */
90
+ sxhd $r0 = $r0
91
+ goto .Lend
92
+ ;;
93
+ 3: /* Sign extend word to double */
94
+ sxwd $r0 = $r0
95
+ goto .Lend
96
+ ;;
97
+ 4: /* Zero extend byte to double */
98
+ zxbd $r0 = $r0
99
+ goto .Lend
100
+ ;;
101
+ 5: /* Zero extend half to double */
102
+ zxhd $r0 = $r0
103
+ goto .Lend
104
+ ;;
105
+ 6: /* Zero extend word to double */
106
+ zxwd $r0 = $r0
107
+ /* Fallthrough to .Lend */
108
+ ;;
109
+ .Lend:
110
+ ld $r24 = (0)[$r12]
111
+ ;;
112
+ set $ra = $r23
113
+ lo $r20r21r22r23 = (32)[$r20]
114
+ addd $r12 = $r20, 64
115
+ ;;
116
+ ret
117
+ ;;
118
+ .Lerror:
119
+ errop
120
+ ;;
121
+
122
+ #endif /* __kvx__ */
123
+
124
+ #if defined __ELF__ && defined __linux__
125
+ .section .note.GNU-stack,"",%progbits
126
+ #endif
127
+
@@ -39,7 +39,9 @@
39
39
  #endif
40
40
 
41
41
  #ifndef USE__BUILTIN___CLEAR_CACHE
42
- # if defined(__OpenBSD__)
42
+ # if defined(__FreeBSD__)
43
+ # include <machine/sysarch.h>
44
+ # elif defined(__OpenBSD__)
43
45
  # include <mips64/sysarch.h>
44
46
  # else
45
47
  # include <sys/cachectl.h>
@@ -777,11 +779,13 @@ ffi_prep_closure_loc (ffi_closure *closure,
777
779
  closure->fun = fun;
778
780
  closure->user_data = user_data;
779
781
 
782
+ #if !defined(__FreeBSD__)
780
783
  #ifdef USE__BUILTIN___CLEAR_CACHE
781
784
  __builtin___clear_cache(clear_location, clear_location + FFI_TRAMPOLINE_SIZE);
782
785
  #else
783
786
  cacheflush (clear_location, FFI_TRAMPOLINE_SIZE, ICACHE);
784
787
  #endif
788
+ #endif /* ! __FreeBSD__ */
785
789
  return FFI_OK;
786
790
  }
787
791
 
@@ -41,7 +41,7 @@
41
41
  #define _MIPS_SIM_ABI32 1
42
42
  #define _MIPS_SIM_NABI32 2
43
43
  #define _MIPS_SIM_ABI64 3
44
- #elif !defined(__OpenBSD__)
44
+ #elif !defined(__OpenBSD__) && !defined(__FreeBSD__)
45
45
  # include <sgidefs.h>
46
46
  #endif
47
47
 
@@ -282,9 +282,11 @@ $LCFI12:
282
282
  li $13, 1 # FFI_O32
283
283
  bne $16, $13, 1f # Skip fp save if FFI_O32_SOFT_FLOAT
284
284
 
285
+ #ifndef __mips_soft_float
285
286
  # Store all possible float/double registers.
286
287
  s.d $f12, FA_0_0_OFF2($fp)
287
288
  s.d $f14, FA_1_0_OFF2($fp)
289
+ #endif
288
290
  1:
289
291
  # prepare arguments for ffi_closure_mips_inner_O32
290
292
  REG_L a0, 4($15) # cif
@@ -421,12 +421,15 @@ ffi_status ffi_closure_inner_pa32(ffi_closure *closure, UINT32 *stack)
421
421
  ffi_cif *cif;
422
422
  void **avalue;
423
423
  void *rvalue;
424
- UINT32 ret[2]; /* function can return up to 64-bits in registers */
424
+ /* Functions can return up to 64-bits in registers. Return address
425
+ must be double word aligned. */
426
+ union { double rd; UINT32 ret[2]; } u;
425
427
  ffi_type **p_arg;
426
428
  char *tmp;
427
429
  int i, avn;
428
430
  unsigned int slot = FIRST_ARG_SLOT;
429
431
  register UINT32 r28 asm("r28");
432
+ ffi_closure *c = (ffi_closure *)FFI_RESTORE_PTR (closure);
430
433
 
431
434
  cif = closure->cif;
432
435
 
@@ -434,7 +437,7 @@ ffi_status ffi_closure_inner_pa32(ffi_closure *closure, UINT32 *stack)
434
437
  if (cif->flags == FFI_TYPE_STRUCT)
435
438
  rvalue = (void *)r28;
436
439
  else
437
- rvalue = &ret[0];
440
+ rvalue = &u;
438
441
 
439
442
  avalue = (void **)alloca(cif->nargs * FFI_SIZEOF_ARG);
440
443
  avn = cif->nargs;
@@ -529,35 +532,35 @@ ffi_status ffi_closure_inner_pa32(ffi_closure *closure, UINT32 *stack)
529
532
  }
530
533
 
531
534
  /* Invoke the closure. */
532
- (closure->fun) (cif, rvalue, avalue, closure->user_data);
535
+ (c->fun) (cif, rvalue, avalue, c->user_data);
533
536
 
534
- debug(3, "after calling function, ret[0] = %08x, ret[1] = %08x\n", ret[0],
535
- ret[1]);
537
+ debug(3, "after calling function, ret[0] = %08x, ret[1] = %08x\n", u.ret[0],
538
+ u.ret[1]);
536
539
 
537
540
  /* Store the result using the lower 2 bytes of the flags. */
538
541
  switch (cif->flags)
539
542
  {
540
543
  case FFI_TYPE_UINT8:
541
- *(stack - FIRST_ARG_SLOT) = (UINT8)(ret[0] >> 24);
544
+ *(stack - FIRST_ARG_SLOT) = (UINT8)(u.ret[0] >> 24);
542
545
  break;
543
546
  case FFI_TYPE_SINT8:
544
- *(stack - FIRST_ARG_SLOT) = (SINT8)(ret[0] >> 24);
547
+ *(stack - FIRST_ARG_SLOT) = (SINT8)(u.ret[0] >> 24);
545
548
  break;
546
549
  case FFI_TYPE_UINT16:
547
- *(stack - FIRST_ARG_SLOT) = (UINT16)(ret[0] >> 16);
550
+ *(stack - FIRST_ARG_SLOT) = (UINT16)(u.ret[0] >> 16);
548
551
  break;
549
552
  case FFI_TYPE_SINT16:
550
- *(stack - FIRST_ARG_SLOT) = (SINT16)(ret[0] >> 16);
553
+ *(stack - FIRST_ARG_SLOT) = (SINT16)(u.ret[0] >> 16);
551
554
  break;
552
555
  case FFI_TYPE_INT:
553
556
  case FFI_TYPE_SINT32:
554
557
  case FFI_TYPE_UINT32:
555
- *(stack - FIRST_ARG_SLOT) = ret[0];
558
+ *(stack - FIRST_ARG_SLOT) = u.ret[0];
556
559
  break;
557
560
  case FFI_TYPE_SINT64:
558
561
  case FFI_TYPE_UINT64:
559
- *(stack - FIRST_ARG_SLOT) = ret[0];
560
- *(stack - FIRST_ARG_SLOT - 1) = ret[1];
562
+ *(stack - FIRST_ARG_SLOT) = u.ret[0];
563
+ *(stack - FIRST_ARG_SLOT - 1) = u.ret[1];
561
564
  break;
562
565
 
563
566
  case FFI_TYPE_DOUBLE:
@@ -577,7 +580,7 @@ ffi_status ffi_closure_inner_pa32(ffi_closure *closure, UINT32 *stack)
577
580
  case FFI_TYPE_SMALL_STRUCT4:
578
581
  tmp = (void*)(stack - FIRST_ARG_SLOT);
579
582
  tmp += 4 - cif->rtype->size;
580
- memcpy((void*)tmp, &ret[0], cif->rtype->size);
583
+ memcpy((void*)tmp, &u, cif->rtype->size);
581
584
  break;
582
585
 
583
586
  case FFI_TYPE_SMALL_STRUCT5:
@@ -598,7 +601,7 @@ ffi_status ffi_closure_inner_pa32(ffi_closure *closure, UINT32 *stack)
598
601
  }
599
602
 
600
603
  memset (ret2, 0, sizeof (ret2));
601
- memcpy ((char *)ret2 + off, ret, 8 - off);
604
+ memcpy ((char *)ret2 + off, &u, 8 - off);
602
605
 
603
606
  *(stack - FIRST_ARG_SLOT) = ret2[0];
604
607
  *(stack - FIRST_ARG_SLOT - 1) = ret2[1];
@@ -630,89 +633,41 @@ ffi_prep_closure_loc (ffi_closure* closure,
630
633
  void *user_data,
631
634
  void *codeloc)
632
635
  {
633
- UINT32 *tramp = (UINT32 *)(closure->tramp);
634
- #ifdef PA_HPUX
635
- UINT32 *tmp;
636
- #endif
636
+ ffi_closure *c = (ffi_closure *)FFI_RESTORE_PTR (closure);
637
+
638
+ /* The layout of a function descriptor. A function pointer with the PLABEL
639
+ bit set points to a function descriptor. */
640
+ struct pa32_fd
641
+ {
642
+ UINT32 code_pointer;
643
+ UINT32 gp;
644
+ };
645
+
646
+ struct ffi_pa32_trampoline_struct
647
+ {
648
+ UINT32 code_pointer; /* Pointer to ffi_closure_unix. */
649
+ UINT32 fake_gp; /* Pointer to closure, installed as gp. */
650
+ UINT32 real_gp; /* Real gp value. */
651
+ };
652
+
653
+ struct ffi_pa32_trampoline_struct *tramp;
654
+ struct pa32_fd *fd;
637
655
 
638
656
  if (cif->abi != FFI_PA32)
639
657
  return FFI_BAD_ABI;
640
658
 
641
- /* Make a small trampoline that will branch to our
642
- handler function. Use PC-relative addressing. */
643
-
644
- #ifdef PA_LINUX
645
- tramp[0] = 0xeaa00000; /* b,l .+8,%r21 ; %r21 <- pc+8 */
646
- tramp[1] = 0xd6a01c1e; /* depi 0,31,2,%r21 ; mask priv bits */
647
- tramp[2] = 0x4aa10028; /* ldw 20(%r21),%r1 ; load plabel */
648
- tramp[3] = 0x36b53ff1; /* ldo -8(%r21),%r21 ; get closure addr */
649
- tramp[4] = 0x0c201096; /* ldw 0(%r1),%r22 ; address of handler */
650
- tramp[5] = 0xeac0c000; /* bv%r0(%r22) ; branch to handler */
651
- tramp[6] = 0x0c281093; /* ldw 4(%r1),%r19 ; GP of handler */
652
- tramp[7] = ((UINT32)(ffi_closure_pa32) & ~2);
653
-
654
- /* Flush d/icache -- have to flush up 2 two lines because of
655
- alignment. */
656
- __asm__ volatile(
657
- "fdc 0(%0)\n\t"
658
- "fdc %1(%0)\n\t"
659
- "fic 0(%%sr4, %0)\n\t"
660
- "fic %1(%%sr4, %0)\n\t"
661
- "sync\n\t"
662
- "nop\n\t"
663
- "nop\n\t"
664
- "nop\n\t"
665
- "nop\n\t"
666
- "nop\n\t"
667
- "nop\n\t"
668
- "nop\n"
669
- :
670
- : "r"((unsigned long)tramp & ~31),
671
- "r"(32 /* stride */)
672
- : "memory");
673
- #endif
659
+ /* Get function descriptor address for ffi_closure_pa32. */
660
+ fd = (struct pa32_fd *)((UINT32)ffi_closure_pa32 & ~3);
674
661
 
675
- #ifdef PA_HPUX
676
- tramp[0] = 0xeaa00000; /* b,l .+8,%r21 ; %r21 <- pc+8 */
677
- tramp[1] = 0xd6a01c1e; /* depi 0,31,2,%r21 ; mask priv bits */
678
- tramp[2] = 0x4aa10038; /* ldw 28(%r21),%r1 ; load plabel */
679
- tramp[3] = 0x36b53ff1; /* ldo -8(%r21),%r21 ; get closure addr */
680
- tramp[4] = 0x0c201096; /* ldw 0(%r1),%r22 ; address of handler */
681
- tramp[5] = 0x02c010b4; /* ldsid (%r22),%r20 ; load space id */
682
- tramp[6] = 0x00141820; /* mtsp %r20,%sr0 ; into %sr0 */
683
- tramp[7] = 0xe2c00000; /* be 0(%sr0,%r22) ; branch to handler */
684
- tramp[8] = 0x0c281093; /* ldw 4(%r1),%r19 ; GP of handler */
685
- tramp[9] = ((UINT32)(ffi_closure_pa32) & ~2);
686
-
687
- /* Flush d/icache -- have to flush three lines because of alignment. */
688
- __asm__ volatile(
689
- "copy %1,%0\n\t"
690
- "fdc,m %2(%0)\n\t"
691
- "fdc,m %2(%0)\n\t"
692
- "fdc,m %2(%0)\n\t"
693
- "ldsid (%1),%0\n\t"
694
- "mtsp %0,%%sr0\n\t"
695
- "copy %1,%0\n\t"
696
- "fic,m %2(%%sr0,%0)\n\t"
697
- "fic,m %2(%%sr0,%0)\n\t"
698
- "fic,m %2(%%sr0,%0)\n\t"
699
- "sync\n\t"
700
- "nop\n\t"
701
- "nop\n\t"
702
- "nop\n\t"
703
- "nop\n\t"
704
- "nop\n\t"
705
- "nop\n\t"
706
- "nop\n"
707
- : "=&r" ((unsigned long)tmp)
708
- : "r" ((unsigned long)tramp & ~31),
709
- "r" (32/* stride */)
710
- : "memory");
711
- #endif
662
+ /* Setup trampoline. */
663
+ tramp = (struct ffi_pa32_trampoline_struct *)c->tramp;
664
+ tramp->code_pointer = fd->code_pointer;
665
+ tramp->fake_gp = (UINT32)codeloc & ~3;
666
+ tramp->real_gp = fd->gp;
712
667
 
713
- closure->cif = cif;
714
- closure->user_data = user_data;
715
- closure->fun = fun;
668
+ c->cif = cif;
669
+ c->user_data = user_data;
670
+ c->fun = fun;
716
671
 
717
672
  return FFI_OK;
718
673
  }
@@ -68,12 +68,7 @@ typedef enum ffi_abi {
68
68
 
69
69
  #define FFI_CLOSURES 1
70
70
  #define FFI_NATIVE_RAW_API 0
71
-
72
- #ifdef PA_LINUX
73
- #define FFI_TRAMPOLINE_SIZE 32
74
- #else
75
- #define FFI_TRAMPOLINE_SIZE 40
76
- #endif
71
+ #define FFI_TRAMPOLINE_SIZE 12
77
72
 
78
73
  #define FFI_TYPE_SMALL_STRUCT2 -1
79
74
  #define FFI_TYPE_SMALL_STRUCT3 -2
@@ -259,7 +259,7 @@ L$done
259
259
  L$FE1
260
260
 
261
261
  /* void ffi_closure_pa32(void);
262
- Called with closure argument in %r21 */
262
+ Called with closure argument in %r19 */
263
263
 
264
264
  .SPACE $TEXT$
265
265
  .SUBSPA $CODE$
@@ -285,7 +285,9 @@ L$CFI22
285
285
  stw %arg2, -44(%r3)
286
286
  stw %arg3, -48(%r3)
287
287
 
288
- copy %r21, %arg0
288
+ /* Retrieve closure pointer and real gp. */
289
+ copy %r19, %arg0
290
+ ldw 8(%r19), %r19
289
291
  bl ffi_closure_inner_pa32, %r2
290
292
  copy %r3, %arg1
291
293
  ldwm -64(%sp), %r3
@@ -252,7 +252,7 @@ ffi_call_pa32:
252
252
  .LFE1:
253
253
 
254
254
  /* void ffi_closure_pa32(void);
255
- Called with closure argument in %r21 */
255
+ Called with closure argument in %r19 */
256
256
  .export ffi_closure_pa32,code
257
257
  .import ffi_closure_inner_pa32,code
258
258
 
@@ -277,7 +277,9 @@ ffi_closure_pa32:
277
277
  stw %arg2, -44(%r3)
278
278
  stw %arg3, -48(%r3)
279
279
 
280
- copy %r21, %arg0
280
+ /* Retrieve closure pointer and real gp. */
281
+ copy %r19, %arg0
282
+ ldw 8(%r19), %r19
281
283
  bl ffi_closure_inner_pa32, %r2
282
284
  copy %r3, %arg1
283
285
 
@@ -85,8 +85,9 @@ ffi_call_int (ffi_cif *cif,
85
85
  can write r3 and r4 to memory without worrying about struct size.
86
86
 
87
87
  For ELFv2 ABI, use a bounce buffer for homogeneous structs too,
88
- for similar reasons. */
89
- unsigned long smst_buffer[8];
88
+ for similar reasons. This bounce buffer must be aligned to 16
89
+ bytes for use with homogeneous structs of vectors (float128). */
90
+ float128 smst_buffer[8];
90
91
  extended_cif ecif;
91
92
 
92
93
  ecif.cif = cif;
@@ -33,7 +33,10 @@
33
33
  #include <stdlib.h>
34
34
 
35
35
  extern void ffi_closure_ASM (void);
36
+
37
+ #if defined (FFI_GO_CLOSURES)
36
38
  extern void ffi_go_closure_ASM (void);
39
+ #endif
37
40
 
38
41
  enum {
39
42
  /* The assembly depends on these exact flags.
@@ -909,8 +912,10 @@ ffi_prep_cif_machdep (ffi_cif *cif)
909
912
  extern void ffi_call_AIX(extended_cif *, long, unsigned, unsigned *,
910
913
  void (*fn)(void), void (*fn2)(void));
911
914
 
915
+ #if defined (FFI_GO_CLOSURES)
912
916
  extern void ffi_call_go_AIX(extended_cif *, long, unsigned, unsigned *,
913
917
  void (*fn)(void), void (*fn2)(void), void *closure);
918
+ #endif
914
919
 
915
920
  extern void ffi_call_DARWIN(extended_cif *, long, unsigned, unsigned *,
916
921
  void (*fn)(void), void (*fn2)(void), ffi_type*);
@@ -950,6 +955,7 @@ ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
950
955
  }
951
956
  }
952
957
 
958
+ #if defined (FFI_GO_CLOSURES)
953
959
  void
954
960
  ffi_call_go (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue,
955
961
  void *closure)
@@ -981,6 +987,7 @@ ffi_call_go (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue,
981
987
  break;
982
988
  }
983
989
  }
990
+ #endif
984
991
 
985
992
  static void flush_icache(char *);
986
993
  static void flush_range(char *, int);
@@ -1110,6 +1117,7 @@ ffi_prep_closure_loc (ffi_closure* closure,
1110
1117
  return FFI_OK;
1111
1118
  }
1112
1119
 
1120
+ #if defined (FFI_GO_CLOSURES)
1113
1121
  ffi_status
1114
1122
  ffi_prep_go_closure (ffi_go_closure* closure,
1115
1123
  ffi_cif* cif,
@@ -1133,6 +1141,7 @@ ffi_prep_go_closure (ffi_go_closure* closure,
1133
1141
  }
1134
1142
  return FFI_OK;
1135
1143
  }
1144
+ #endif
1136
1145
 
1137
1146
  static void
1138
1147
  flush_icache(char *addr)
@@ -1168,9 +1177,11 @@ ffi_type *
1168
1177
  ffi_closure_helper_DARWIN (ffi_closure *, void *,
1169
1178
  unsigned long *, ffi_dblfl *);
1170
1179
 
1180
+ #if defined (FFI_GO_CLOSURES)
1171
1181
  ffi_type *
1172
1182
  ffi_go_closure_helper_DARWIN (ffi_go_closure*, void *,
1173
1183
  unsigned long *, ffi_dblfl *);
1184
+ #endif
1174
1185
 
1175
1186
  /* Basically the trampoline invokes ffi_closure_ASM, and on
1176
1187
  entry, r11 holds the address of the closure.
@@ -1430,6 +1441,7 @@ ffi_closure_helper_DARWIN (ffi_closure *closure, void *rvalue,
1430
1441
  closure->user_data, rvalue, pgr, pfr);
1431
1442
  }
1432
1443
 
1444
+ #if defined (FFI_GO_CLOSURES)
1433
1445
  ffi_type *
1434
1446
  ffi_go_closure_helper_DARWIN (ffi_go_closure *closure, void *rvalue,
1435
1447
  unsigned long *pgr, ffi_dblfl *pfr)
@@ -1437,4 +1449,4 @@ ffi_go_closure_helper_DARWIN (ffi_go_closure *closure, void *rvalue,
1437
1449
  return ffi_closure_helper_common (closure->cif, closure->fun,
1438
1450
  closure, rvalue, pgr, pfr);
1439
1451
  }
1440
-
1452
+ #endif