ffi 1.15.5 → 1.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (343) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/CHANGELOG.md +118 -0
  4. data/Gemfile +10 -3
  5. data/README.md +4 -3
  6. data/Rakefile +25 -10
  7. data/ext/ffi_c/AbstractMemory.c +99 -74
  8. data/ext/ffi_c/AbstractMemory.h +3 -2
  9. data/ext/ffi_c/ArrayType.c +51 -15
  10. data/ext/ffi_c/ArrayType.h +1 -0
  11. data/ext/ffi_c/Buffer.c +90 -33
  12. data/ext/ffi_c/Call.c +29 -12
  13. data/ext/ffi_c/Call.h +3 -2
  14. data/ext/ffi_c/DynamicLibrary.c +90 -27
  15. data/ext/ffi_c/Function.c +244 -98
  16. data/ext/ffi_c/Function.h +1 -0
  17. data/ext/ffi_c/FunctionInfo.c +81 -25
  18. data/ext/ffi_c/LastError.c +29 -11
  19. data/ext/ffi_c/MappedType.c +66 -23
  20. data/ext/ffi_c/MappedType.h +0 -2
  21. data/ext/ffi_c/MemoryPointer.c +36 -9
  22. data/ext/ffi_c/MethodHandle.c +3 -1
  23. data/ext/ffi_c/Pointer.c +82 -40
  24. data/ext/ffi_c/Pointer.h +1 -0
  25. data/ext/ffi_c/Struct.c +166 -84
  26. data/ext/ffi_c/Struct.h +7 -4
  27. data/ext/ffi_c/StructByValue.c +48 -16
  28. data/ext/ffi_c/StructLayout.c +130 -61
  29. data/ext/ffi_c/Type.c +120 -51
  30. data/ext/ffi_c/Type.h +3 -1
  31. data/ext/ffi_c/Types.c +8 -2
  32. data/ext/ffi_c/Types.h +0 -1
  33. data/ext/ffi_c/Variadic.c +71 -26
  34. data/ext/ffi_c/compat.h +22 -22
  35. data/ext/ffi_c/extconf.rb +19 -2
  36. data/ext/ffi_c/ffi.c +4 -0
  37. data/ext/ffi_c/libffi/.allow-ai-service +0 -0
  38. data/ext/ffi_c/libffi/.appveyor/site.exp +16 -0
  39. data/ext/ffi_c/libffi/.appveyor/unix-noexec.exp +7 -0
  40. data/ext/ffi_c/libffi/.appveyor.yml +27 -9
  41. data/ext/ffi_c/libffi/.ci/build-cross-in-container.sh +18 -0
  42. data/ext/ffi_c/libffi/{.travis → .ci}/build-in-container.sh +4 -6
  43. data/ext/ffi_c/libffi/.ci/build.sh +124 -0
  44. data/ext/ffi_c/libffi/{.travis → .ci}/install.sh +14 -7
  45. data/ext/ffi_c/libffi/.ci/msvs-detect +1103 -0
  46. data/ext/ffi_c/libffi/{.travis → .ci}/site.exp +5 -3
  47. data/ext/ffi_c/libffi/.circleci/config.yml +156 -0
  48. data/ext/ffi_c/libffi/.github/workflows/build.yml +479 -0
  49. data/ext/ffi_c/libffi/.github/workflows/emscripten.yml +172 -0
  50. data/ext/ffi_c/libffi/.gitignore +10 -2
  51. data/ext/ffi_c/libffi/LICENSE +1 -1
  52. data/ext/ffi_c/libffi/Makefile.am +12 -5
  53. data/ext/ffi_c/libffi/Makefile.in +118 -51
  54. data/ext/ffi_c/libffi/README.md +150 -105
  55. data/ext/ffi_c/libffi/acinclude.m4 +10 -112
  56. data/ext/ffi_c/libffi/compile +348 -0
  57. data/ext/ffi_c/libffi/config.guess +623 -556
  58. data/ext/ffi_c/libffi/config.sub +75 -34
  59. data/ext/ffi_c/libffi/configure +4571 -3830
  60. data/ext/ffi_c/libffi/configure.ac +64 -28
  61. data/ext/ffi_c/libffi/configure.host +26 -7
  62. data/ext/ffi_c/libffi/doc/Makefile.in +9 -6
  63. data/ext/ffi_c/libffi/doc/libffi.texi +82 -33
  64. data/ext/ffi_c/libffi/doc/version.texi +4 -4
  65. data/ext/ffi_c/libffi/fficonfig.h.in +12 -47
  66. data/ext/ffi_c/libffi/generate-darwin-source-and-headers.py +163 -52
  67. data/ext/ffi_c/libffi/include/Makefile.am +1 -1
  68. data/ext/ffi_c/libffi/include/Makefile.in +10 -9
  69. data/ext/ffi_c/libffi/include/ffi.h.in +55 -60
  70. data/ext/ffi_c/libffi/include/ffi_cfi.h +21 -0
  71. data/ext/ffi_c/libffi/include/ffi_common.h +33 -2
  72. data/ext/ffi_c/libffi/include/tramp.h +45 -0
  73. data/ext/ffi_c/libffi/install-sh +92 -69
  74. data/ext/ffi_c/libffi/libffi.map.in +5 -0
  75. data/ext/ffi_c/libffi/libtool-version +2 -2
  76. data/ext/ffi_c/libffi/ltmain.sh +518 -333
  77. data/ext/ffi_c/libffi/m4/ax_cc_maxopt.m4 +18 -14
  78. data/ext/ffi_c/libffi/m4/ax_cflags_warn_all.m4 +108 -72
  79. data/ext/ffi_c/libffi/m4/ax_compiler_vendor.m4 +76 -45
  80. data/ext/ffi_c/libffi/m4/ax_prepend_flag.m4 +51 -0
  81. data/ext/ffi_c/libffi/man/Makefile.in +9 -6
  82. data/ext/ffi_c/libffi/missing +1 -1
  83. data/ext/ffi_c/libffi/msvc_build/aarch64/aarch64_include/ffi.h +2 -2
  84. data/ext/ffi_c/libffi/msvcc.sh +1 -1
  85. data/ext/ffi_c/libffi/src/aarch64/ffi.c +172 -55
  86. data/ext/ffi_c/libffi/src/aarch64/internal.h +32 -0
  87. data/ext/ffi_c/libffi/src/aarch64/sysv.S +331 -87
  88. data/ext/ffi_c/libffi/src/arc/arcompact.S +169 -94
  89. data/ext/ffi_c/libffi/src/arc/ffi.c +325 -148
  90. data/ext/ffi_c/libffi/src/arc/ffitarget.h +14 -0
  91. data/ext/ffi_c/libffi/src/arm/ffi.c +62 -17
  92. data/ext/ffi_c/libffi/src/arm/ffitarget.h +3 -3
  93. data/ext/ffi_c/libffi/src/arm/internal.h +10 -0
  94. data/ext/ffi_c/libffi/src/arm/sysv.S +113 -42
  95. data/ext/ffi_c/libffi/src/closures.c +136 -50
  96. data/ext/ffi_c/libffi/src/debug.c +2 -2
  97. data/ext/ffi_c/libffi/src/dlmalloc.c +6 -1
  98. data/ext/ffi_c/libffi/src/ia64/ffi.c +12 -0
  99. data/ext/ffi_c/libffi/src/ia64/unix.S +20 -2
  100. data/ext/ffi_c/libffi/src/loongarch64/ffi.c +624 -0
  101. data/ext/ffi_c/libffi/src/loongarch64/ffitarget.h +82 -0
  102. data/ext/ffi_c/libffi/src/loongarch64/sysv.S +327 -0
  103. data/ext/ffi_c/libffi/src/m32r/ffi.c +31 -14
  104. data/ext/ffi_c/libffi/src/mips/ffi.c +250 -67
  105. data/ext/ffi_c/libffi/src/mips/ffitarget.h +7 -0
  106. data/ext/ffi_c/libffi/src/mips/n32.S +193 -33
  107. data/ext/ffi_c/libffi/src/mips/o32.S +61 -4
  108. data/ext/ffi_c/libffi/src/moxie/ffi.c +47 -22
  109. data/ext/ffi_c/libffi/src/or1k/ffi.c +25 -12
  110. data/ext/ffi_c/libffi/src/pa/ffi.c +32 -33
  111. data/ext/ffi_c/libffi/src/pa/ffi64.c +614 -0
  112. data/ext/ffi_c/libffi/src/pa/ffitarget.h +22 -8
  113. data/ext/ffi_c/libffi/src/pa/hpux32.S +83 -36
  114. data/ext/ffi_c/libffi/src/pa/hpux64.S +681 -0
  115. data/ext/ffi_c/libffi/src/pa/linux.S +82 -35
  116. data/ext/ffi_c/libffi/src/powerpc/ffi_darwin.c +36 -24
  117. data/ext/ffi_c/libffi/src/powerpc/ffi_linux64.c +1 -1
  118. data/ext/ffi_c/libffi/src/powerpc/linux64.S +2 -0
  119. data/ext/ffi_c/libffi/src/powerpc/linux64_closure.S +2 -0
  120. data/ext/ffi_c/libffi/src/powerpc/t-aix +5 -0
  121. data/ext/ffi_c/libffi/src/prep_cif.c +22 -2
  122. data/ext/ffi_c/libffi/src/riscv/ffi.c +37 -4
  123. data/ext/ffi_c/libffi/src/sparc/ffi64.c +23 -1
  124. data/ext/ffi_c/libffi/src/tramp.c +716 -0
  125. data/ext/ffi_c/libffi/src/types.c +4 -6
  126. data/ext/ffi_c/libffi/src/wasm32/ffi.c +947 -0
  127. data/ext/ffi_c/libffi/src/wasm32/ffitarget.h +62 -0
  128. data/ext/ffi_c/libffi/src/x86/ffi.c +99 -37
  129. data/ext/ffi_c/libffi/src/x86/ffi64.c +67 -12
  130. data/ext/ffi_c/libffi/src/x86/ffitarget.h +9 -5
  131. data/ext/ffi_c/libffi/src/x86/ffiw64.c +44 -1
  132. data/ext/ffi_c/libffi/src/x86/internal.h +14 -0
  133. data/ext/ffi_c/libffi/src/x86/internal64.h +14 -0
  134. data/ext/ffi_c/libffi/src/x86/sysv.S +172 -38
  135. data/ext/ffi_c/libffi/src/x86/sysv_intel.S +91 -88
  136. data/ext/ffi_c/libffi/src/x86/unix64.S +96 -6
  137. data/ext/ffi_c/libffi/src/x86/win64.S +20 -7
  138. data/ext/ffi_c/libffi/src/xtensa/ffi.c +16 -8
  139. data/ext/ffi_c/libffi/src/xtensa/ffitarget.h +4 -0
  140. data/ext/ffi_c/libffi/src/xtensa/sysv.S +26 -16
  141. data/ext/ffi_c/libffi/testsuite/Makefile.am +79 -114
  142. data/ext/ffi_c/libffi/testsuite/Makefile.in +89 -121
  143. data/ext/ffi_c/libffi/testsuite/emscripten/build-tests.sh +54 -0
  144. data/ext/ffi_c/libffi/testsuite/emscripten/build.sh +63 -0
  145. data/ext/ffi_c/libffi/testsuite/emscripten/conftest.py +86 -0
  146. data/ext/ffi_c/libffi/testsuite/emscripten/node-tests.sh +48 -0
  147. data/ext/ffi_c/libffi/testsuite/emscripten/test.html +7 -0
  148. data/ext/ffi_c/libffi/testsuite/emscripten/test_libffi.py +51 -0
  149. data/ext/ffi_c/libffi/testsuite/lib/libffi.exp +43 -21
  150. data/ext/ffi_c/libffi/testsuite/lib/target-libpath.exp +2 -2
  151. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-call.c +1 -0
  152. data/ext/ffi_c/libffi/testsuite/libffi.bhaible/testcases.c +5 -1
  153. data/ext/ffi_c/libffi/testsuite/libffi.call/bpo_38748.c +41 -0
  154. data/ext/ffi_c/libffi/testsuite/libffi.call/callback.c +99 -0
  155. data/ext/ffi_c/libffi/testsuite/libffi.call/callback2.c +108 -0
  156. data/ext/ffi_c/libffi/testsuite/libffi.call/callback3.c +114 -0
  157. data/ext/ffi_c/libffi/testsuite/libffi.call/callback4.c +119 -0
  158. data/ext/ffi_c/libffi/testsuite/libffi.call/ffitest.h +28 -3
  159. data/ext/ffi_c/libffi/testsuite/libffi.call/float_va.c +3 -0
  160. data/ext/ffi_c/libffi/testsuite/libffi.call/return_ll1.c +5 -0
  161. data/ext/ffi_c/libffi/testsuite/libffi.call/return_sl.c +4 -0
  162. data/ext/ffi_c/libffi/testsuite/libffi.call/return_ul.c +4 -0
  163. data/ext/ffi_c/libffi/testsuite/libffi.call/s55.c +60 -0
  164. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen.c +8 -9
  165. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen2.c +2 -2
  166. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen3.c +2 -2
  167. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen4.c +2 -2
  168. data/ext/ffi_c/libffi/testsuite/libffi.call/struct10.c +1 -1
  169. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_2.c +63 -0
  170. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_3.c +65 -0
  171. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_3f.c +65 -0
  172. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_4.c +67 -0
  173. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_4f.c +67 -0
  174. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_big.c +93 -0
  175. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_small.c +61 -0
  176. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_return_2H.c +63 -0
  177. data/ext/ffi_c/libffi/testsuite/libffi.call/struct_return_8H.c +90 -0
  178. data/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c +1 -119
  179. data/ext/ffi_c/libffi/testsuite/libffi.call/va_2.c +220 -0
  180. data/ext/ffi_c/libffi/testsuite/libffi.call/va_3.c +154 -0
  181. data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct1.c +13 -0
  182. data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct2.c +11 -0
  183. data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct3.c +15 -0
  184. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn0.c +3 -2
  185. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn1.c +2 -0
  186. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn2.c +2 -0
  187. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn3.c +21 -1
  188. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn4.c +2 -0
  189. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn5.c +2 -0
  190. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_fn6.c +2 -0
  191. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_loc_fn0.c +7 -6
  192. data/ext/ffi_c/libffi/testsuite/libffi.closures/closure_simple.c +6 -0
  193. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_12byte.c +18 -0
  194. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_16byte.c +22 -0
  195. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_18byte.c +24 -0
  196. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_19byte.c +29 -0
  197. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_1_1byte.c +4 -0
  198. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_20byte.c +19 -1
  199. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_20byte1.c +21 -1
  200. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_24byte.c +35 -3
  201. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_2byte.c +13 -0
  202. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3_1byte.c +19 -0
  203. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3byte1.c +13 -0
  204. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3byte2.c +13 -0
  205. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_3float.c +18 -0
  206. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_4_1byte.c +22 -0
  207. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_4byte.c +13 -0
  208. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_5_1_byte.c +29 -1
  209. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_5byte.c +19 -1
  210. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_64byte.c +24 -0
  211. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_6_1_byte.c +28 -1
  212. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_6byte.c +24 -2
  213. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_7_1_byte.c +39 -1
  214. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_7byte.c +25 -1
  215. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_8byte.c +14 -0
  216. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_9byte1.c +14 -1
  217. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_9byte2.c +14 -2
  218. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_double.c +19 -1
  219. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_float.c +19 -1
  220. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_longdouble.c +20 -1
  221. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_longdouble_split.c +40 -25
  222. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_longdouble_split2.c +40 -3
  223. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_pointer.c +19 -1
  224. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_sint16.c +18 -1
  225. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_sint32.c +18 -3
  226. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_sint64.c +18 -1
  227. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_uint16.c +18 -1
  228. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_uint32.c +19 -1
  229. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_align_uint64.c +19 -1
  230. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_dbls_struct.c +3 -1
  231. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_double_va.c +9 -1
  232. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_float.c +4 -0
  233. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_longdouble.c +11 -1
  234. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_longdouble_va.c +22 -3
  235. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_schar.c +5 -1
  236. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_sshort.c +6 -1
  237. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_sshortchar.c +9 -1
  238. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_uchar.c +9 -1
  239. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_ushort.c +6 -2
  240. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_multi_ushortchar.c +9 -1
  241. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_pointer.c +5 -0
  242. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_pointer_stack.c +10 -0
  243. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_schar.c +3 -0
  244. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_sint.c +2 -0
  245. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_sshort.c +3 -0
  246. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_struct_va1.c +11 -0
  247. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uchar.c +3 -0
  248. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uint.c +4 -0
  249. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uint_va.c +4 -0
  250. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ulong_va.c +4 -0
  251. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ulonglong.c +2 -0
  252. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ushort.c +3 -0
  253. data/ext/ffi_c/libffi/testsuite/libffi.closures/ffitest.h +1 -138
  254. data/ext/ffi_c/libffi/testsuite/libffi.closures/huge_struct.c +21 -21
  255. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct.c +32 -9
  256. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct1.c +1 -1
  257. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct10.c +12 -0
  258. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct11.c +21 -5
  259. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct12.c +86 -0
  260. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct13.c +115 -0
  261. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct2.c +10 -1
  262. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct3.c +10 -1
  263. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct4.c +9 -0
  264. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct5.c +9 -0
  265. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct6.c +11 -0
  266. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct7.c +9 -0
  267. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct8.c +11 -0
  268. data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct9.c +11 -0
  269. data/ext/ffi_c/libffi/testsuite/libffi.closures/single_entry_structs1.c +86 -0
  270. data/ext/ffi_c/libffi/testsuite/libffi.closures/single_entry_structs2.c +102 -0
  271. data/ext/ffi_c/libffi/testsuite/libffi.closures/single_entry_structs3.c +101 -0
  272. data/ext/ffi_c/libffi/testsuite/libffi.closures/stret_medium.c +1 -1
  273. data/ext/ffi_c/libffi/testsuite/libffi.closures/stret_medium2.c +1 -1
  274. data/ext/ffi_c/libffi/testsuite/libffi.closures/testclosure.c +6 -1
  275. data/ext/ffi_c/libffi/testsuite/libffi.closures/unwindtest.cc +2 -1
  276. data/ext/ffi_c/libffi/testsuite/libffi.closures/unwindtest_ffi_call.cc +1 -0
  277. data/ext/ffi_c/libffi.bsd.mk +2 -2
  278. data/ext/ffi_c/libffi.darwin.mk +2 -2
  279. data/ext/ffi_c/libffi.gnu.mk +2 -2
  280. data/ext/ffi_c/rbffi.h +1 -1
  281. data/ffi.gemspec +3 -3
  282. data/lib/ffi/autopointer.rb +8 -31
  283. data/lib/ffi/compat.rb +43 -0
  284. data/lib/ffi/data_converter.rb +2 -2
  285. data/lib/ffi/dynamic_library.rb +118 -0
  286. data/lib/ffi/enum.rb +18 -12
  287. data/lib/ffi/ffi.rb +3 -0
  288. data/lib/ffi/function.rb +71 -0
  289. data/lib/ffi/io.rb +2 -2
  290. data/lib/ffi/library.rb +72 -88
  291. data/lib/ffi/library_path.rb +109 -0
  292. data/lib/ffi/managedstruct.rb +1 -1
  293. data/lib/ffi/platform/aarch64-linux/types.conf +74 -3
  294. data/lib/ffi/platform/aarch64-windows/types.conf +52 -0
  295. data/lib/ffi/platform/hppa1.1-linux/types.conf +178 -0
  296. data/lib/ffi/platform/hppa2.0-linux/types.conf +178 -0
  297. data/lib/ffi/platform/loongarch64-linux/types.conf +141 -0
  298. data/lib/ffi/platform/sw_64-linux/types.conf +141 -0
  299. data/lib/ffi/platform.rb +15 -13
  300. data/lib/ffi/pointer.rb +6 -6
  301. data/lib/ffi/struct.rb +6 -5
  302. data/lib/ffi/struct_layout.rb +3 -3
  303. data/lib/ffi/struct_layout_builder.rb +9 -9
  304. data/lib/ffi/types.rb +65 -37
  305. data/lib/ffi/variadic.rb +19 -8
  306. data/lib/ffi/version.rb +1 -1
  307. data/samples/hello_ractor.rb +11 -0
  308. data/samples/qsort_ractor.rb +28 -0
  309. data/sig/ffi/abstract_memory.rbs +165 -0
  310. data/sig/ffi/auto_pointer.rbs +27 -0
  311. data/sig/ffi/buffer.rbs +18 -0
  312. data/sig/ffi/data_converter.rbs +10 -0
  313. data/sig/ffi/dynamic_library.rbs +9 -0
  314. data/sig/ffi/enum.rbs +38 -0
  315. data/sig/ffi/function.rbs +39 -0
  316. data/sig/ffi/library.rbs +42 -0
  317. data/sig/ffi/native_type.rbs +86 -0
  318. data/sig/ffi/pointer.rbs +42 -0
  319. data/sig/ffi/struct.rbs +76 -0
  320. data/sig/ffi/struct_by_reference.rbs +11 -0
  321. data/sig/ffi/struct_by_value.rbs +7 -0
  322. data/sig/ffi/struct_layout.rbs +9 -0
  323. data/sig/ffi/struct_layout_builder.rbs +5 -0
  324. data/sig/ffi/type.rbs +39 -0
  325. data/sig/ffi.rbs +26 -0
  326. data.tar.gz.sig +0 -0
  327. metadata +122 -28
  328. metadata.gz.sig +1 -0
  329. data/ext/ffi_c/libffi/.travis/build-cross-in-container.sh +0 -14
  330. data/ext/ffi_c/libffi/.travis/build.sh +0 -142
  331. data/ext/ffi_c/libffi/.travis.yml +0 -83
  332. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_uchar_va.c +0 -44
  333. data/ext/ffi_c/libffi/testsuite/libffi.closures/cls_ushort_va.c +0 -44
  334. /data/ext/ffi_c/libffi/{.travis → .ci}/ar-lib +0 -0
  335. /data/ext/ffi_c/libffi/{.travis → .ci}/bfin-sim.exp +0 -0
  336. /data/ext/ffi_c/libffi/{.travis → .ci}/compile +0 -0
  337. /data/ext/ffi_c/libffi/{.travis → .ci}/m32r-sim.exp +0 -0
  338. /data/ext/ffi_c/libffi/{.travis → .ci}/moxie-sim.exp +0 -0
  339. /data/ext/ffi_c/libffi/{.travis → .ci}/or1k-sim.exp +0 -0
  340. /data/ext/ffi_c/libffi/{.travis → .ci}/powerpc-eabisim.exp +0 -0
  341. /data/ext/ffi_c/libffi/{.travis → .ci}/wine-sim.exp +0 -0
  342. /data/ext/ffi_c/libffi/testsuite/libffi.call/{pyobjc-tc.c → pyobjc_tc.c} +0 -0
  343. /data/lib/ffi/platform/{sparc64-linux → sparcv9-linux}/types.conf +0 -0
@@ -1,11 +1,11 @@
1
- # Copyright (C) 2008, 2010, 2018, 2019 Anthony Green
1
+ # Copyright (C) 2008, 2010, 2018, 2019, 2021 Anthony Green
2
2
 
3
3
  # Make sure we look in the right place for the board description files.
4
4
  if ![info exists boards_dir] {
5
5
  set boards_dir {}
6
6
  }
7
7
 
8
- lappend boards_dir $::env(TRAVIS_BUILD_DIR)/.travis
8
+ lappend boards_dir $::env(BOARDSDIR)
9
9
 
10
10
  verbose "Global Config File: target_triplet is $target_triplet" 2
11
11
  global target_list
@@ -23,5 +23,7 @@ case "$target_triplet" in {
23
23
  { "or1k-elf" } {
24
24
  set target_list "or1k-sim"
25
25
  }
26
+ { "powerpc-eabisim" } {
27
+ set target_list "powerpc-eabisim"
28
+ }
26
29
  }
27
-
@@ -0,0 +1,156 @@
1
+ version: 2.1
2
+
3
+ defaults: &defaults
4
+ working_directory: ~/repo
5
+ docker:
6
+ # Built from:
7
+ # https://github.com/pyodide/pyodide/blob/2ab4b0ab6aefe99fd994bb4f9ab086e5c0aebb7b/Dockerfile
8
+ - image: pyodide/pyodide-env:20230126-chrome109-firefox109-py311
9
+
10
+ jobs:
11
+ install-emsdk:
12
+ <<: *defaults
13
+ steps:
14
+ - checkout
15
+ - run:
16
+ name: install emsdk
17
+ command: |
18
+ git clone https://github.com/emscripten-core/emsdk.git --depth=1
19
+ cd emsdk
20
+ ./emsdk install 3.1.30
21
+ ./emsdk activate 3.1.30
22
+
23
+ - persist_to_workspace:
24
+ root: .
25
+ paths:
26
+ - emsdk
27
+
28
+ build:
29
+ parameters:
30
+ wasm-bigint:
31
+ description: Should we build with wasm-bigint?
32
+ type: string
33
+ default: ""
34
+ environment:
35
+ WASM_BIGINT: << parameters.wasm-bigint >>
36
+ <<: *defaults
37
+ steps:
38
+ - checkout
39
+ - attach_workspace:
40
+ at: .
41
+
42
+ - run:
43
+ name: build
44
+ command: |
45
+ source ./emsdk/emsdk_env.sh
46
+ ./testsuite/emscripten/build.sh
47
+
48
+ - run:
49
+ name: build tests
50
+ command: |
51
+ source ./emsdk/emsdk_env.sh
52
+ cp -r testsuite/libffi.call testsuite/libffi.call.test
53
+ cp -r testsuite/libffi.closures testsuite/libffi.closures.test
54
+ ./testsuite/emscripten/build-tests.sh testsuite/libffi.call.test
55
+ ./testsuite/emscripten/build-tests.sh testsuite/libffi.closures.test
56
+
57
+ - persist_to_workspace:
58
+ root: .
59
+ paths:
60
+ - target
61
+ - testsuite
62
+
63
+ test:
64
+ parameters:
65
+ test-params:
66
+ description: The tests to run.
67
+ type: string
68
+ <<: *defaults
69
+ steps:
70
+ - checkout
71
+
72
+ - attach_workspace:
73
+ at: .
74
+
75
+ - run:
76
+ name: run tests
77
+ command: |
78
+ git reset --hard
79
+ cd testsuite/emscripten/
80
+ mkdir test-results
81
+ pytest \
82
+ --junitxml=test-results/junit.xml \
83
+ test_libffi.py \
84
+ << parameters.test-params >>
85
+ - store_test_results:
86
+ path: testsuite/emscripten/test-results
87
+
88
+ test-dejagnu:
89
+ parameters:
90
+ params:
91
+ description: Parameters to node-tests
92
+ type: string
93
+ default: ""
94
+
95
+ <<: *defaults
96
+ steps:
97
+ - checkout
98
+
99
+ - attach_workspace:
100
+ at: .
101
+
102
+ - run:
103
+ name: run tests
104
+ command: |
105
+ source ./emsdk/emsdk_env.sh
106
+ testsuite/emscripten/node-tests.sh << parameters.params >>
107
+
108
+ workflows:
109
+ version: 2
110
+ build-and-test:
111
+ jobs:
112
+ - install-emsdk
113
+
114
+ - build:
115
+ name: build
116
+ requires:
117
+ - install-emsdk
118
+
119
+ - build:
120
+ name: build-bigint
121
+ wasm-bigint: "true"
122
+ requires:
123
+ - install-emsdk
124
+
125
+ - test:
126
+ name: test-firefox
127
+ test-params: -k firefox
128
+ requires:
129
+ - build
130
+ - test:
131
+ name: test-chrome
132
+ test-params: -k chrome
133
+ requires:
134
+ - build
135
+
136
+ - test:
137
+ name: test-firefox-bigint
138
+ test-params: -k firefox
139
+ requires:
140
+ - build-bigint
141
+
142
+ - test:
143
+ name: test-chrome-bigint
144
+ test-params: -k chrome
145
+ requires:
146
+ - build-bigint
147
+
148
+ - test-dejagnu:
149
+ name: test-dejagnu
150
+ requires:
151
+ - install-emsdk
152
+ - test-dejagnu:
153
+ name: test-dejagnu-bigint
154
+ params: --wasm-bigint
155
+ requires:
156
+ - install-emsdk
@@ -0,0 +1,479 @@
1
+ name: CI
2
+
3
+ # Controls when the action will run.
4
+ on:
5
+ # Triggers the workflow on push or pull request events but only for the master branch
6
+ push:
7
+ branches: [ master ]
8
+ pull_request:
9
+ branches: [ master ]
10
+
11
+ # Allows you to run this workflow manually from the Actions tab
12
+ workflow_dispatch:
13
+
14
+ # A workflow run is made up of one or more jobs that can run sequentially or in parallel
15
+ jobs:
16
+
17
+ build-warp:
18
+ name: ${{ matrix.HOST }} ${{ matrix.CONFIGURE_OPTIONS }} ${{ matrix.MEVAL }} ${{ matrix.LIBFFI_TEST_OPTIMIZATION }}
19
+ runs-on: warp-ubuntu-latest-arm64-2x
20
+
21
+ strategy:
22
+ fail-fast: false
23
+ matrix:
24
+ include:
25
+ - HOST: "aarch64-linux-gnu"
26
+
27
+ steps:
28
+ - uses: actions/checkout@v3
29
+
30
+ - env:
31
+ MEVAL: ${{ matrix.MEVAL }}
32
+ HOST: ${{ matrix.HOST }}
33
+ LDFLAGS: ${{ matrix.LDFLAGS }}
34
+ RUNTESTFLAGS: ${{ matrix.RUNTESTFLAGS }}
35
+ CONFIGURE_OPTIONS: ${{ matrix.CONFIGURE_OPTIONS }}
36
+ run: |
37
+ if test x"$MEVAL" != x; then eval ${MEVAL}; fi
38
+ ./.ci/install.sh
39
+ ./.ci/build.sh
40
+
41
+ build-sim:
42
+ name: ${{ matrix.HOST }} ${{ matrix.CONFIGURE_OPTIONS }} ${{ matrix.MEVAL }} ${{ matrix.LIBFFI_TEST_OPTIMIZATION }}
43
+ runs-on: ubuntu-latest
44
+
45
+ strategy:
46
+ fail-fast: false
47
+ matrix:
48
+ include:
49
+ - HOST: "x86_64-pc-linux-gnu"
50
+ MEVAL: "export CC=clang CXX=clang"
51
+ - HOST: "i386-pc-linux-gnu"
52
+ MEVAL: 'export CC="gcc -m32" CXX="g++ -m32"'
53
+ - HOST: "x86_64-pc-linux-gnu"
54
+ CONFIGURE_OPTIONS: "--disable-shared"
55
+ - HOST: "x86_64-pc-linux-gnu"
56
+ CONFIGURE_OPTIONS: "--enable-shared"
57
+ - HOST: "m68k-linux-gnu"
58
+ MEVAL: 'export CC="m68k-linux-gnu-gcc-8 -mcpu=547x" CXX="m68k-linux-gnu-g++-8 -mcpu=547x"'
59
+ CONFIGURE_OPTIONS: '--disable-shared'
60
+ QEMU_LD_PREFIX: '/usr/m68k-linux-gnu'
61
+ QEMU_CPU: 'cfv4e'
62
+ - HOST: "sh4-linux-gnu"
63
+ CONFIGURE_OPTIONS: "--disable-shared"
64
+ QEMU_LD_PREFIX: "/usr/sh4-linux-gnu"
65
+ QEMU_CPU: 'sh7785'
66
+ - HOST: "alpha-linux-gnu"
67
+ CONFIGURE_OPTIONS: "--disable-shared"
68
+ QEMU_LD_PREFIX: "/usr/alpha-linux-gnu"
69
+ QEMU_CPU: 'ev4-alpha-cpu'
70
+ - HOST: "arm32v7-linux-gnu"
71
+ LIBFFI_TEST_OPTIMIZATION: "-O0"
72
+ QEMU_CPU: 'any'
73
+ - HOST: "arm32v7-linux-gnu"
74
+ LIBFFI_TEST_OPTIMIZATION: "-O2"
75
+ QEMU_CPU: 'any'
76
+ - HOST: "arm32v7-linux-gnu"
77
+ LIBFFI_TEST_OPTIMIZATION: "-O2 -fomit-frame-pointer"
78
+ QEMU_CPU: 'any'
79
+ - HOST: "powerpc-eabisim"
80
+ RUNTESTFLAGS: "--target_board powerpc-eabisim"
81
+ - HOST: "or1k-elf"
82
+ RUNTESTFLAGS: "--target_board or1k-sim"
83
+ - HOST: "m32r-elf"
84
+ RUNTESTFLAGS: "--target_board m32r-sim"
85
+ - HOST: "bfin-elf"
86
+ RUNTESTFLAGS: "--target_board bfin-sim"
87
+ - MEVAL: "export PATH=/opt/moxielogic/bin:$PATH CC=moxie-elf-gcc CXX=moxie-elf-g++"
88
+ HOST: "moxie-elf"
89
+ LDFLAGS: "-Tsim.ld"
90
+ RUNTESTFLAGS: "--target_board moxie-sim"
91
+
92
+ steps:
93
+ - uses: actions/checkout@v3
94
+
95
+ - env:
96
+ MEVAL: ${{ matrix.MEVAL }}
97
+ HOST: ${{ matrix.HOST }}
98
+ LDFLAGS: ${{ matrix.LDFLAGS }}
99
+ RUNTESTFLAGS: ${{ matrix.RUNTESTFLAGS }}
100
+ CONFIGURE_OPTIONS: ${{ matrix.CONFIGURE_OPTIONS }}
101
+ QEMU_LD_PREFIX: ${{ matrix.QEMU_LD_PREFIX }}
102
+ QEMU_CPU: ${{ matrix.QEMU_CPU }}
103
+ run: |
104
+ if test x"$MEVAL" != x; then eval ${MEVAL}; fi
105
+ ./.ci/install.sh
106
+ ./.ci/build.sh
107
+
108
+ build-cfarm:
109
+ name: ${{ matrix.CFARM_TRIPLE }} ${{ matrix.CFARM_CC }}
110
+ runs-on: ubuntu-latest
111
+
112
+ strategy:
113
+ fail-fast: false
114
+ matrix:
115
+ include:
116
+ - CFARM_HOST: cfarm185.cfarm.net
117
+ CFARM_PORT: 22
118
+ CFARM_TRIPLE: aarch64-linux-gnu
119
+ CFARM_CC: "gcc"
120
+ CFARM_CXX: "g++"
121
+ - CFARM_HOST: cfarm185.fsffrance.org
122
+ CFARM_PORT: 22
123
+ CFARM_TRIPLE: aarch64-lto-linux-gnu
124
+ CFARM_CC: "gcc -flto"
125
+ CFARM_CXX: "g++ -flto"
126
+ - CFARM_HOST: cfarm400.cfarm.net
127
+ CFARM_PORT: 25465
128
+ CFARM_TRIPLE: loongarch64-linux-gnu
129
+ CFARM_CC: "gcc"
130
+ CFARM_CXX: "g++"
131
+ - CFARM_HOST: cfarm230.cfarm.net
132
+ CFARM_PORT: 22
133
+ CFARM_TRIPLE: mips-linux-gnu
134
+ CFARM_CC: "gcc"
135
+ CFARM_CXX: "g++"
136
+ - CFARM_HOST: cfarm211.cfarm.net
137
+ CFARM_PORT: 22
138
+ CFARM_TRIPLE: sparc64-linux-gnu
139
+ CFARM_CC: "gcc"
140
+ CFARM_CXX: "g++"
141
+ - CFARM_HOST: cfarm211.cfarm.net
142
+ CFARM_PORT: 22
143
+ CFARM_TRIPLE: sparc64-linux-gnu
144
+ CFARM_CC: "gcc -m32"
145
+ CFARM_CXX: "g++ -m32"
146
+ - CFARM_HOST: cfarm91.cfarm.net
147
+ CFARM_PORT: 22
148
+ CFARM_TRIPLE: riscv64-linux-gnu
149
+ CFARM_CC: "gcc"
150
+ CFARM_CXX: "g++"
151
+ - CFARM_HOST: cfarm103.cfarm.net
152
+ CFARM_PORT: 22
153
+ CFARM_TRIPLE: aarch64-m1-linux-gnu
154
+ CFARM_CC: "gcc"
155
+ CFARM_CXX: "g++"
156
+ - CFARM_HOST: cfarm112.cfarm.net
157
+ CFARM_PORT: 22
158
+ CFARM_TRIPLE: powerpc64le-linux-gnu
159
+ CFARM_CC: "gcc"
160
+ CFARM_CXX: "g++"
161
+ - CFARM_HOST: cfarm111.cfarm.net
162
+ CFARM_PORT: 22
163
+ CFARM_TRIPLE: powerpc-ibm-aix7.1.5.0
164
+ CFARM_CC: "gcc"
165
+ CFARM_CXX: "g++"
166
+
167
+ steps:
168
+
169
+ - uses: actions/checkout@v3
170
+
171
+ - name: Run autogen
172
+ run: |
173
+ wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 -t 0 -qO - https://ftpmirror.gnu.org/autoconf/autoconf-2.71.tar.gz | tar -xvzf -
174
+ mkdir -p ~/i
175
+ (cd autoconf-2.71; ./configure --prefix=$HOME/i; make; make install)
176
+ rm -rf autoconf-2.71
177
+ PATH=$HOME/i/bin:$PATH ./autogen.sh
178
+ echo "${{ secrets.CFARM_KEY }}" > /tmp/cfk
179
+ chmod go-rw /tmp/cfk
180
+
181
+ - name: Generate build dir name
182
+ run: |
183
+ echo BUILD_DIR=t/$GITHUB_RUN_NUMBER-$RANDOM >> $GITHUB_ENV
184
+
185
+ - name: Check for host availability
186
+ id: check-host
187
+ run: |
188
+ set +e
189
+ ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 -o ConnectionAttempts=3 -i /tmp/cfk -p ${{ matrix.CFARM_PORT }} ${{ secrets.CFARM_USERNAME }}@${{ matrix.CFARM_HOST }} "mkdir -p ${{ env.BUILD_DIR }}"
190
+ if test $? -ne 0; then
191
+ echo "Remote host is unavailable."
192
+ echo "HOST_OK=NO" >> $GITHUB_OUTPUT
193
+ else
194
+ echo "Remote host is available."
195
+ echo "HOST_OK=YES" >> $GITHUB_OUTPUT
196
+ fi
197
+ set -e
198
+
199
+ - name: Show host availability
200
+ run: |
201
+ echo ${{ steps.check-host.outputs.HOST_OK }}
202
+
203
+ - name: Copy source to remote host
204
+ if: ${{ steps.check-host.outputs.HOST_OK == 'YES' }}
205
+ run: |
206
+ echo ${{ steps.check-host.outputs.HOST_OK }}
207
+ scp -o StrictHostKeyChecking=no -o ConnectTimeout=10 -o ConnectionAttempts=3 -i /tmp/cfk -P ${{ matrix.CFARM_PORT }} -r * ${{ secrets.CFARM_USERNAME }}@${{ matrix.CFARM_HOST }}:${{ env.BUILD_DIR }}
208
+
209
+ - name: Run configure and make
210
+ if: ${{ steps.check-host.outputs.HOST_OK == 'YES' }}
211
+ run: |
212
+ ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 -o ConnectionAttempts=3 -i /tmp/cfk -p ${{ matrix.CFARM_PORT }} ${{ secrets.CFARM_USERNAME }}@${{ matrix.CFARM_HOST }} "${{ matrix.CFARM_CC }} --version"
213
+ ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 -o ConnectionAttempts=3 -i /tmp/cfk -p ${{ matrix.CFARM_PORT }} ${{ secrets.CFARM_USERNAME }}@${{ matrix.CFARM_HOST }} "(cd ${{ env.BUILD_DIR }}; if test -f ~/.profile; then source ~/.profile; fi; CC='${{ matrix.CFARM_CC }}' CXX='${{ matrix.CFARM_CXX }}' ./configure --host=${{ matrix.CFARM_TRIPLE }}) || true; exit 0"
214
+ ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 -o ConnectionAttempts=3 -i /tmp/cfk -p ${{ matrix.CFARM_PORT }} ${{ secrets.CFARM_USERNAME }}@${{ matrix.CFARM_HOST }} "(cd ${{ env.BUILD_DIR }}; if test -f ~/.profile; then source ~/.profile; fi; make;) || true; exit 0"
215
+
216
+ - name: Run tests
217
+ if: ${{ steps.check-host.outputs.HOST_OK == 'YES' }}
218
+ run: |
219
+ ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 -o ConnectionAttempts=3 -i /tmp/cfk -p ${{ matrix.CFARM_PORT }} ${{ secrets.CFARM_USERNAME }}@${{ matrix.CFARM_HOST }} "(cd ${{ env.BUILD_DIR }}; if test -f ~/.profile; then source ~/.profile; fi; GCC_COLORS= make check & CHECKPID=\$!; while kill -0 \$CHECKPID 2>/dev/null; do echo 'Waiting for tests to finish'; sleep 5; done;)"
220
+
221
+ - name: Copy results and clean up
222
+ if: ${{ steps.check-host.outputs.HOST_OK == 'YES' }}
223
+ run: |
224
+ scp -o StrictHostKeyChecking=no -o ConnectTimeout=10 -o ConnectionAttempts=3 -i /tmp/cfk -P ${{ matrix.CFARM_PORT }} ${{ secrets.CFARM_USERNAME }}@${{ matrix.CFARM_HOST }}:${{ env.BUILD_DIR }}/*/testsuite/*.log .
225
+ ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 -o ConnectionAttempts=3 -i /tmp/cfk -p ${{ matrix.CFARM_PORT }} ${{ secrets.CFARM_USERNAME }}@${{ matrix.CFARM_HOST }} "rm -rf ${{ env.BUILD_DIR }}"
226
+
227
+ - name: Install rlgl and run
228
+ if: ${{ steps.check-host.outputs.HOST_OK == 'YES' }}
229
+ run: |
230
+ wget -qO - https://rl.gl/cli/rlgl-linux-amd64.tgz | \
231
+ tar --strip-components=2 -xvzf - ./rlgl/rlgl;
232
+ ./rlgl l --key=0LIBFFI-0LIBFFI-0LIBFFI-0LIBFFI https://rl.gl
233
+ ./rlgl e -l project=libffi -l sha=${GITHUB_SHA:0:7} -l CC='${{ matrix.CFARM_CC }}' -l build-host=${{ matrix.CFARM_TRIPLE }} --policy=https://github.com/libffi/rlgl-policy.git libffi.log
234
+ exit $?
235
+
236
+ build:
237
+ name: Cygwin ${{ matrix.arch }}
238
+ runs-on: windows-latest
239
+
240
+ strategy:
241
+ fail-fast: false
242
+ matrix:
243
+ include:
244
+ - host: i686-pc-cygwin
245
+ arch: x86
246
+ - host: x86_64-pc-cygwin
247
+ arch: x64
248
+
249
+ steps:
250
+ - run: git config --global core.autocrlf input
251
+
252
+ - uses: actions/checkout@v3
253
+
254
+ - name: Set up Cygwin
255
+ uses: egor-tensin/setup-cygwin@v3
256
+ with:
257
+ platform: ${{ matrix.arch }}
258
+ packages: wget gcc-core make dejagnu automake autoconf libtool texinfo dos2unix unzip
259
+
260
+ - run: |
261
+ set -x
262
+ cd $(cygpath $RUNNER_WORKSPACE)/libffi
263
+ wget https://rl.gl/cli/rlgl-windows-amd64.zip
264
+ unzip rlgl-windows-amd64.zip
265
+ autoreconf -f -v -i
266
+ ./configure
267
+ make -j 4
268
+ TERM=none DEJAGNU=$(pwd)/.ci/site.exp BOARDSDIR=$(pwd)/.ci GCC_COLORS= make check || true
269
+ ./rlgl/rlgl.exe l --key=0LIBFFI-0LIBFFI-0LIBFFI-0LIBFFI https://rl.gl
270
+ ./rlgl/rlgl.exe e \
271
+ -l project=libffi \
272
+ -l sha=${GITHUB_SHA:0:7} \
273
+ -l CC=gcc \
274
+ -l host=${{ matrix.host }} \
275
+ --policy=https://github.com/libffi/rlgl-policy.git $(find . -name libffi.log)
276
+ shell: C:\tools\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}'
277
+
278
+ build-msys2:
279
+
280
+ runs-on: windows-latest
281
+
282
+ strategy:
283
+ fail-fast: false
284
+ matrix:
285
+ include:
286
+ - MSYSTEM: MINGW32
287
+ MSYS2_ARCH: i686
288
+ - MSYSTEM: MINGW64
289
+ MSYS2_ARCH: x86_64
290
+ name: ${{ matrix.MSYSTEM }}
291
+
292
+ steps:
293
+ - run: git config --global core.autocrlf input
294
+ - uses: actions/checkout@v3
295
+
296
+ - uses: msys2/setup-msys2@v2
297
+ with:
298
+ msystem: ${{ matrix.MSYSTEM }}
299
+ update: true
300
+ install: >-
301
+ base-devel
302
+ autoconf-wrapper
303
+ autoconf
304
+ automake
305
+ libtool
306
+ make
307
+ dejagnu
308
+ mingw-w64-${{ matrix.MSYS2_ARCH }}-gcc
309
+ mingw-w64-${{ matrix.MSYS2_ARCH }}-gcc-libs
310
+ unzip
311
+
312
+ - run: |
313
+ set -x
314
+ cd $(cygpath $RUNNER_WORKSPACE)/libffi
315
+ wget https://rl.gl/cli/rlgl-windows-amd64.zip
316
+ unzip rlgl-windows-amd64.zip
317
+ autoreconf -f -v -i
318
+ CC=${{ matrix.MSYS2_ARCH }}-w64-mingw32-gcc CXX=${{ matrix.MSYS2_ARCH }}-w64-mingw32-g++ ./configure
319
+ make
320
+ TERM=none DEJAGNU=$(pwd)/.ci/site.exp BOARDSDIR=$(pwd)/.ci GCC_COLORS= make check || true
321
+ ./rlgl/rlgl.exe l --key=0LIBFFI-0LIBFFI-0LIBFFI-0LIBFFI https://rl.gl
322
+ ./rlgl/rlgl.exe e \
323
+ -l project=libffi \
324
+ -l sha=${GITHUB_SHA:0:7} \
325
+ -l CC=${{ matrix.MSYS2_ARCH }}-w64-mingw32-gcc \
326
+ -l host=x86_64-pc-cygwin \
327
+ --policy=https://github.com/libffi/rlgl-policy.git $(find . -name libffi.log)
328
+ shell: msys2 {0}
329
+
330
+ build-msys2-clang:
331
+
332
+ runs-on: windows-latest
333
+
334
+ strategy:
335
+ fail-fast: false
336
+ matrix:
337
+ include:
338
+ - MSYSTEM: MINGW32
339
+ MSYS2_ARCH: i686
340
+ - MSYSTEM: MINGW64
341
+ MSYS2_ARCH: x86_64
342
+ name: ${{ matrix.MSYSTEM }}
343
+
344
+ steps:
345
+ - run: git config --global core.autocrlf input
346
+ - uses: actions/checkout@v3
347
+
348
+ - uses: msys2/setup-msys2@v2
349
+ with:
350
+ msystem: ${{ matrix.MSYSTEM }}
351
+ update: true
352
+ install: >-
353
+ base-devel
354
+ autoconf-wrapper
355
+ autoconf
356
+ automake
357
+ libtool
358
+ make
359
+ dejagnu
360
+ clang
361
+ mingw-w64-${{ matrix.MSYS2_ARCH }}-gcc
362
+ mingw-w64-${{ matrix.MSYS2_ARCH }}-gcc-libs
363
+ unzip
364
+
365
+ - run: |
366
+ set -x
367
+ cd $(cygpath $RUNNER_WORKSPACE)/libffi
368
+ wget https://rl.gl/cli/rlgl-windows-amd64.zip
369
+ unzip rlgl-windows-amd64.zip
370
+ autoreconf -f -v -i
371
+ CC=clang CXX=clang ./configure
372
+ make
373
+ TERM=none DEJAGNU=$(pwd)/.ci/site.exp BOARDSDIR=$(pwd)/.ci make check || true
374
+ ./rlgl/rlgl.exe l --key=0LIBFFI-0LIBFFI-0LIBFFI-0LIBFFI https://rl.gl
375
+ ./rlgl/rlgl.exe e \
376
+ -l project=libffi \
377
+ -l sha=${GITHUB_SHA:0:7} \
378
+ -l CC=clang \
379
+ -l host=x86_64-pc-cygwin \
380
+ --policy=https://github.com/libffi/rlgl-policy.git $(find . -name libffi.log)
381
+ shell: msys2 {0}
382
+
383
+ build-macos:
384
+ runs-on: ${{ matrix.platform }}
385
+
386
+ strategy:
387
+ fail-fast: false
388
+ matrix:
389
+ platform: [macos-11, macos-12]
390
+ compilers: [CC=gcc CXX=g++, CC=clang CXX=clang]
391
+
392
+ name: ${{ matrix.platform }} ${{ matrix.compilers }}
393
+
394
+ steps:
395
+ - run: git config --global core.autocrlf input
396
+ - uses: actions/checkout@v3
397
+ - run: ./.ci/install.sh
398
+ - run: ${{ matrix.compilers }} ./.ci/build.sh
399
+
400
+ build-msvc:
401
+ name: Windows ${{ matrix.width }}-bit Visual C++
402
+ runs-on: windows-latest
403
+
404
+ strategy:
405
+ fail-fast: false
406
+ matrix:
407
+ include:
408
+ - host: i686-pc-cygwin
409
+ width: 32
410
+ arch: x86
411
+ tools: amd64_x86
412
+ - host: x86_64-pc-cygwin
413
+ width: 64
414
+ arch: x64
415
+ tools: amd64
416
+
417
+ steps:
418
+ - run: git config --global core.autocrlf input
419
+ - uses: actions/checkout@v3
420
+ - uses: egor-tensin/setup-cygwin@v3
421
+ with:
422
+ platform: x64
423
+ packages: wget make dejagnu automake autoconf libtool texinfo unzip dos2unix
424
+ - uses: ilammy/msvc-dev-cmd@v1.12.0
425
+ with:
426
+ arch: ${{ matrix.tools }}
427
+
428
+ - name: Build and test
429
+ run: |
430
+ # export PATH=$PATH:"/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.16.27023/bin/HostX64/x64"
431
+ cd $(cygpath $RUNNER_WORKSPACE)/libffi
432
+ wget https://rl.gl/cli/rlgl-windows-amd64.zip
433
+ unzip rlgl-windows-amd64.zip
434
+ autoreconf -f -v -i
435
+ ./configure --host=${{ matrix.host }} CC="$(pwd)/msvcc.sh -m${{ matrix.width }}" CXX="$(pwd)/msvcc.sh -m${{ matrix.width }}" LD='link' CPP='cl -nologo -EP' CXXCPP='cl -nologo -EP' CPPFLAGS='-DFFI_BUILDING_DLL' AR='$(pwd)/.ci/ar-lib lib' NM='dumpbin -symbols' STRIP=':' $DEBUG_ARG $SHARED_ARG || cat */config.log
436
+ make
437
+ cp $(find . -name 'libffi-?.dll') ${{ matrix.host }}/testsuite/
438
+ TERM=none DEJAGNU=$(pwd)/.ci/site.exp BOARDSDIR=$(pwd)/.ci GCC_COLORS= make check || true
439
+ ./rlgl/rlgl.exe l --key=0LIBFFI-0LIBFFI-0LIBFFI-0LIBFFI https://rl.gl
440
+ ./rlgl/rlgl.exe e \
441
+ -l project=libffi \
442
+ -l sha=${GITHUB_SHA:0:7} \
443
+ -l CC=msvcc.sh \
444
+ -l host=${{ matrix.host }} \
445
+ --policy=https://github.com/libffi/rlgl-policy.git $(find . -name libffi.log)
446
+ shell: C:\tools\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}'
447
+
448
+ build-android:
449
+ name: Android ${{ matrix.host }}
450
+ runs-on: ubuntu-latest
451
+
452
+ strategy:
453
+ fail-fast: false
454
+ matrix:
455
+ host: [armv7a-linux-androideabi, aarch64-linux-android, i686-linux-android, x86_64-linux-android]
456
+
457
+ steps:
458
+ - run: git config --global core.autocrlf input
459
+ - uses: actions/checkout@v3
460
+ - run: ./.ci/install.sh
461
+ - env:
462
+ HOST: ${{ matrix.HOST }}
463
+ ANDROID_API_LEVEL: 23
464
+ CONFIGURE_OPTIONS: "--disable-shared --disable-multi-os-directory" # fixes warning about unsupported -print-multi-os-directory with clang
465
+ run: |
466
+ # Relevant documentation:
467
+ # https://developer.android.com/ndk/guides/other_build_systems
468
+ # https://android.googlesource.com/platform/ndk/+/master/docs/BuildSystemMaintainers.md
469
+ export TOOLCHAIN="${ANDROID_NDK_ROOT}"/toolchains/llvm/prebuilt/linux-x86_64
470
+ export CC="${TOOLCHAIN}"/bin/${HOST}${ANDROID_API_LEVEL}-clang
471
+ export CXX="${TOOLCHAIN}"/bin/${HOST}${ANDROID_API_LEVEL}-clang++
472
+ export LD="${TOOLCHAIN}"/bin/ld.lld
473
+ export AR="${TOOLCHAIN}"/bin/llvm-ar
474
+ export AS="${CC}"
475
+ export RANLIB="${TOOLCHAIN}"/bin/llvm-ranlib
476
+ export STRIP="${TOOLCHAIN}"/bin/llvm-strip
477
+ export NM="${TOOLCHAIN}"/bin/llvm-nm
478
+ export OBJDUMP="${TOOLCHAIN}"/bin/llvm-objdump
479
+ ./.ci/build.sh