ffi 1.0.9-x86-mingw32 → 1.0.12.pre-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of ffi might be problematic. Click here for more details.

Files changed (218) hide show
  1. data/Rakefile +16 -16
  2. data/ext/ffi_c/AbstractMemory.c +376 -14
  3. data/ext/ffi_c/AbstractMemory.h +8 -0
  4. data/ext/ffi_c/ArrayType.c +28 -0
  5. data/ext/ffi_c/Buffer.c +109 -25
  6. data/ext/ffi_c/Call.c +16 -5
  7. data/ext/ffi_c/ClosurePool.c +21 -8
  8. data/ext/ffi_c/DataConverter.c +29 -0
  9. data/ext/ffi_c/DynamicLibrary.c +71 -2
  10. data/ext/ffi_c/Function.c +122 -11
  11. data/ext/ffi_c/Function.h +6 -0
  12. data/ext/ffi_c/FunctionInfo.c +21 -1
  13. data/ext/ffi_c/LastError.c +24 -0
  14. data/ext/ffi_c/MappedType.c +22 -0
  15. data/ext/ffi_c/MemoryPointer.c +19 -1
  16. data/ext/ffi_c/MemoryPointer.h +6 -0
  17. data/ext/ffi_c/MethodHandle.c +26 -11
  18. data/ext/ffi_c/Platform.c +17 -3
  19. data/ext/ffi_c/Pointer.c +106 -0
  20. data/ext/ffi_c/Pointer.h +6 -0
  21. data/ext/ffi_c/Struct.c +10 -4
  22. data/ext/ffi_c/Struct.h +2 -1
  23. data/ext/ffi_c/StructByReference.c +8 -0
  24. data/ext/ffi_c/StructByValue.c +8 -0
  25. data/ext/ffi_c/StructLayout.c +8 -2
  26. data/ext/ffi_c/Thread.c +131 -1
  27. data/ext/ffi_c/Thread.h +6 -0
  28. data/ext/ffi_c/Type.c +111 -17
  29. data/ext/ffi_c/Types.c +9 -2
  30. data/ext/ffi_c/Types.h +4 -0
  31. data/ext/ffi_c/Variadic.c +13 -4
  32. data/ext/ffi_c/compat.h +8 -0
  33. data/ext/ffi_c/endian.h +10 -1
  34. data/ext/ffi_c/extconf.rb +51 -35
  35. data/ext/ffi_c/ffi.c +5 -0
  36. data/ext/ffi_c/libffi.darwin.mk +15 -15
  37. data/ext/ffi_c/libffi.gnu.mk +3 -3
  38. data/ext/ffi_c/libffi.mk +4 -4
  39. data/ext/ffi_c/libffi.vc.mk +26 -0
  40. data/ext/ffi_c/libffi.vc64.mk +26 -0
  41. data/ext/ffi_c/libffi/ChangeLog +541 -0
  42. data/ext/ffi_c/libffi/ChangeLog.libffi +13 -87
  43. data/ext/ffi_c/libffi/LICENSE +3 -3
  44. data/ext/ffi_c/libffi/Makefile.am +41 -32
  45. data/ext/ffi_c/libffi/Makefile.in +95 -66
  46. data/ext/ffi_c/libffi/Makefile.vc +141 -0
  47. data/ext/ffi_c/libffi/Makefile.vc64 +141 -0
  48. data/ext/ffi_c/libffi/README +40 -4
  49. data/ext/ffi_c/libffi/aclocal.m4 +729 -7854
  50. data/ext/ffi_c/libffi/build-ios.sh +67 -0
  51. data/ext/ffi_c/libffi/compile +11 -10
  52. data/ext/ffi_c/libffi/config.guess +4 -1
  53. data/ext/ffi_c/libffi/config.sub +6 -3
  54. data/ext/ffi_c/libffi/configure +6264 -6354
  55. data/ext/ffi_c/libffi/configure.ac +155 -63
  56. data/ext/ffi_c/libffi/depcomp +81 -35
  57. data/ext/ffi_c/libffi/doc/libffi.info +78 -18
  58. data/ext/ffi_c/libffi/doc/libffi.texi +64 -5
  59. data/ext/ffi_c/libffi/doc/stamp-vti +4 -4
  60. data/ext/ffi_c/libffi/doc/version.texi +4 -4
  61. data/ext/ffi_c/libffi/fficonfig.h.in +18 -0
  62. data/ext/ffi_c/libffi/fficonfig.hw +57 -0
  63. data/ext/ffi_c/libffi/include/Makefile.in +21 -3
  64. data/ext/ffi_c/libffi/include/ffi.h.in +42 -14
  65. data/ext/ffi_c/libffi/include/ffi.h.vc +427 -0
  66. data/ext/ffi_c/libffi/include/ffi.h.vc64 +427 -0
  67. data/ext/ffi_c/libffi/include/ffi_common.h +9 -5
  68. data/ext/ffi_c/libffi/install-sh +364 -167
  69. data/ext/ffi_c/libffi/ltmain.sh +2599 -1369
  70. data/ext/ffi_c/libffi/m4/ax_cc_maxopt.m4 +176 -0
  71. data/ext/ffi_c/libffi/m4/ax_cflags_warn_all.m4 +195 -0
  72. data/ext/ffi_c/libffi/m4/ax_check_compiler_flags.m4 +76 -0
  73. data/ext/ffi_c/libffi/m4/ax_compiler_vendor.m4 +63 -0
  74. data/ext/ffi_c/libffi/m4/ax_configure_args.m4 +70 -0
  75. data/ext/ffi_c/libffi/m4/ax_enable_builddir.m4 +300 -0
  76. data/ext/ffi_c/libffi/m4/ax_gcc_archflag.m4 +215 -0
  77. data/ext/ffi_c/libffi/m4/ax_gcc_x86_cpuid.m4 +79 -0
  78. data/ext/ffi_c/libffi/m4/libtool.m4 +1239 -768
  79. data/ext/ffi_c/libffi/m4/ltoptions.m4 +7 -6
  80. data/ext/ffi_c/libffi/m4/ltversion.m4 +6 -6
  81. data/ext/ffi_c/libffi/m4/lt~obsolete.m4 +9 -3
  82. data/ext/ffi_c/libffi/man/Makefile.in +21 -3
  83. data/ext/ffi_c/libffi/mdate-sh +0 -0
  84. data/ext/ffi_c/libffi/missing +60 -44
  85. data/ext/ffi_c/libffi/msvcc.sh +197 -0
  86. data/ext/ffi_c/libffi/src/alpha/osf.S +39 -18
  87. data/ext/ffi_c/libffi/src/arm/ffi.c +443 -24
  88. data/ext/ffi_c/libffi/src/arm/ffitarget.h +17 -1
  89. data/ext/ffi_c/libffi/src/arm/gentramp.sh +118 -0
  90. data/ext/ffi_c/libffi/src/arm/sysv.S +206 -15
  91. data/ext/ffi_c/libffi/src/arm/trampoline.S +4450 -0
  92. data/ext/ffi_c/libffi/src/avr32/ffi.c +4 -2
  93. data/ext/ffi_c/libffi/src/avr32/ffitarget.h +2 -2
  94. data/ext/ffi_c/libffi/src/closures.c +17 -35
  95. data/ext/ffi_c/libffi/src/cris/ffi.c +1 -1
  96. data/ext/ffi_c/libffi/src/cris/ffitarget.h +2 -2
  97. data/ext/ffi_c/libffi/src/dlmalloc.c +66 -4
  98. data/ext/ffi_c/libffi/src/frv/ffitarget.h +2 -6
  99. data/ext/ffi_c/libffi/src/ia64/ffi.c +7 -5
  100. data/ext/ffi_c/libffi/src/ia64/ffitarget.h +2 -2
  101. data/ext/ffi_c/libffi/src/java_raw_api.c +1 -1
  102. data/ext/ffi_c/libffi/src/m32r/ffitarget.h +2 -2
  103. data/ext/ffi_c/libffi/src/m68k/ffi.c +10 -0
  104. data/ext/ffi_c/libffi/src/m68k/ffitarget.h +2 -2
  105. data/ext/ffi_c/libffi/src/m68k/sysv.S +36 -0
  106. data/ext/ffi_c/libffi/src/mips/ffi.c +12 -5
  107. data/ext/ffi_c/libffi/src/mips/ffitarget.h +18 -11
  108. data/ext/ffi_c/libffi/src/mips/n32.S +4 -4
  109. data/ext/ffi_c/libffi/src/moxie/eabi.S +128 -0
  110. data/ext/ffi_c/libffi/src/moxie/ffi.c +276 -0
  111. data/ext/ffi_c/libffi/src/pa/ffi.c +7 -4
  112. data/ext/ffi_c/libffi/src/pa/ffitarget.h +6 -5
  113. data/ext/ffi_c/libffi/src/powerpc/aix.S +5 -1
  114. data/ext/ffi_c/libffi/src/powerpc/aix_closure.S +2 -0
  115. data/ext/ffi_c/libffi/src/powerpc/asm.h +1 -1
  116. data/ext/ffi_c/libffi/src/powerpc/darwin.S +215 -77
  117. data/ext/ffi_c/libffi/src/powerpc/darwin_closure.S +358 -100
  118. data/ext/ffi_c/libffi/src/powerpc/ffi.c +11 -5
  119. data/ext/ffi_c/libffi/src/powerpc/ffi_darwin.c +603 -172
  120. data/ext/ffi_c/libffi/src/powerpc/ffitarget.h +17 -4
  121. data/ext/ffi_c/libffi/src/prep_cif.c +16 -13
  122. data/ext/ffi_c/libffi/src/s390/ffitarget.h +4 -2
  123. data/ext/ffi_c/libffi/src/sh/ffitarget.h +2 -2
  124. data/ext/ffi_c/libffi/src/sh64/ffitarget.h +2 -2
  125. data/ext/ffi_c/libffi/src/sparc/ffi.c +55 -11
  126. data/ext/ffi_c/libffi/src/sparc/ffitarget.h +5 -3
  127. data/ext/ffi_c/libffi/src/x86/ffi.c +54 -92
  128. data/ext/ffi_c/libffi/src/x86/ffi64.c +17 -8
  129. data/ext/ffi_c/libffi/src/x86/ffitarget.h +15 -14
  130. data/ext/ffi_c/libffi/src/x86/sysv.S +40 -26
  131. data/ext/ffi_c/libffi/src/x86/unix64.S +4 -0
  132. data/ext/ffi_c/libffi/src/x86/win32.S +379 -191
  133. data/ext/ffi_c/libffi/src/x86/win64.S +15 -7
  134. data/ext/ffi_c/libffi/testsuite/Makefile.am +1 -1
  135. data/ext/ffi_c/libffi/testsuite/Makefile.in +22 -4
  136. data/ext/ffi_c/libffi/testsuite/lib/libffi.exp +350 -0
  137. data/ext/ffi_c/libffi/testsuite/libffi.call/call.exp +1 -5
  138. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_longdouble_split.c +1 -1
  139. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_longdouble_split2.c +1 -1
  140. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_sint64.c +1 -0
  141. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_uint64.c +1 -0
  142. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_double_va.c +3 -0
  143. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_longdouble.c +2 -2
  144. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_longdouble_va.c +3 -0
  145. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_pointer.c +1 -1
  146. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_pointer_stack.c +1 -1
  147. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_ulonglong.c +1 -0
  148. data/ext/ffi_c/libffi/testsuite/libffi.call/err_bad_abi.c +2 -3
  149. data/ext/ffi_c/libffi/testsuite/libffi.call/err_bad_typedef.c +2 -1
  150. data/ext/ffi_c/libffi/testsuite/libffi.call/ffitest.h +36 -0
  151. data/ext/ffi_c/libffi/testsuite/libffi.call/huge_struct.c +17 -17
  152. data/ext/ffi_c/libffi/testsuite/libffi.call/return_ll1.c +1 -0
  153. data/ext/ffi_c/libffi/testsuite/libffi.call/stret_medium2.c +1 -0
  154. data/ext/ffi_c/libffi/testsuite/libffi.special/ffitestcxx.h +1 -1
  155. data/ext/ffi_c/libffi/testsuite/libffi.special/special.exp +1 -3
  156. data/ext/ffi_c/win32/stdint.h +199 -0
  157. data/gen/Rakefile +18 -2
  158. data/lib/1.8/ffi_c.so +0 -0
  159. data/lib/ffi.rb +13 -9
  160. data/lib/ffi/autopointer.rb +88 -26
  161. data/lib/ffi/enum.rb +42 -0
  162. data/lib/ffi/errno.rb +6 -1
  163. data/lib/ffi/ffi.rb +1 -0
  164. data/lib/ffi/io.rb +13 -2
  165. data/lib/ffi/library.rb +219 -24
  166. data/lib/ffi/memorypointer.rb +1 -33
  167. data/lib/ffi/platform.rb +21 -7
  168. data/lib/ffi/platform/arm-linux/types.conf +102 -0
  169. data/lib/ffi/platform/i386-freebsd/types.conf +152 -0
  170. data/lib/ffi/platform/i386-netbsd/types.conf +126 -0
  171. data/lib/ffi/platform/i486-gnu/types.conf +107 -0
  172. data/lib/ffi/platform/ia64-linux/types.conf +102 -0
  173. data/lib/ffi/platform/mips-linux/types.conf +102 -0
  174. data/lib/ffi/platform/mipsel-linux/types.conf +102 -0
  175. data/lib/ffi/platform/powerpc-linux/types.conf +100 -0
  176. data/lib/ffi/platform/s390-linux/types.conf +102 -0
  177. data/lib/ffi/platform/s390x-linux/types.conf +102 -0
  178. data/lib/ffi/platform/sparc-linux/types.conf +102 -0
  179. data/lib/ffi/platform/x86_64-freebsd/types.conf +126 -0
  180. data/lib/ffi/platform/x86_64-netbsd/types.conf +126 -0
  181. data/lib/ffi/pointer.rb +44 -0
  182. data/lib/ffi/struct.rb +2 -6
  183. data/lib/ffi/struct_layout_builder.rb +2 -1
  184. data/lib/ffi/tools/const_generator.rb +78 -26
  185. data/lib/ffi/tools/types_generator.rb +8 -1
  186. data/lib/ffi/types.rb +21 -1
  187. data/spec/ffi/async_callback_spec.rb +2 -2
  188. data/spec/ffi/bool_spec.rb +6 -6
  189. data/spec/ffi/buffer_spec.rb +23 -23
  190. data/spec/ffi/callback_spec.rb +101 -102
  191. data/spec/ffi/custom_type_spec.rb +20 -24
  192. data/spec/ffi/dup_spec.rb +7 -7
  193. data/spec/ffi/enum_spec.rb +127 -127
  194. data/spec/ffi/errno_spec.rb +2 -2
  195. data/spec/ffi/ffi_spec.rb +3 -3
  196. data/spec/ffi/function_spec.rb +10 -10
  197. data/spec/ffi/library_spec.rb +30 -12
  198. data/spec/ffi/managed_struct_spec.rb +4 -4
  199. data/spec/ffi/number_spec.rb +40 -40
  200. data/spec/ffi/pointer_spec.rb +21 -24
  201. data/spec/ffi/rbx/memory_pointer_spec.rb +17 -15
  202. data/spec/ffi/rbx/struct_spec.rb +2 -2
  203. data/spec/ffi/spec_helper.rb +1 -1
  204. data/spec/ffi/string_spec.rb +9 -9
  205. data/spec/ffi/strptr_spec.rb +3 -3
  206. data/spec/ffi/struct_callback_spec.rb +7 -7
  207. data/spec/ffi/struct_initialize_spec.rb +2 -2
  208. data/spec/ffi/struct_packed_spec.rb +6 -6
  209. data/spec/ffi/struct_spec.rb +94 -84
  210. data/spec/ffi/typedef_spec.rb +15 -4
  211. data/spec/ffi/union_spec.rb +3 -3
  212. data/spec/ffi/variadic_spec.rb +17 -14
  213. data/tasks/extension.rake +0 -1
  214. data/tasks/gem.rake +0 -1
  215. data/tasks/rdoc.rake +1 -1
  216. data/tasks/yard.rake +11 -0
  217. metadata +50 -11
  218. data/lib/1.9/ffi_c.so +0 -0
@@ -86,6 +86,8 @@ rbffi_NativeValue_ToRuby(Type* type, VALUE rbType, const void* ptr)
86
86
 
87
87
  Data_Get_Struct(rbMemory, AbstractMemory, mem);
88
88
  memcpy(mem->address, ptr, sbv->base.ffiType->size);
89
+ RB_GC_GUARD(rbMemory);
90
+ RB_GC_GUARD(rbType);
89
91
 
90
92
  return rb_class_new_instance(1, &rbMemory, sbv->rbStructClass);
91
93
  }
@@ -94,12 +96,17 @@ rbffi_NativeValue_ToRuby(Type* type, VALUE rbType, const void* ptr)
94
96
  // For mapped types, first convert to the real native type, then upcall to
95
97
  // ruby to convert to the expected return type
96
98
  MappedType* m = (MappedType *) type;
97
- VALUE values[2];
99
+ VALUE values[2], rbReturnValue;
98
100
 
99
101
  values[0] = rbffi_NativeValue_ToRuby(m->type, m->rbType, ptr);
100
102
  values[1] = Qnil;
103
+
101
104
 
102
- return rb_funcall2(m->rbConverter, id_from_native, 2, values);
105
+ rbReturnValue = rb_funcall2(m->rbConverter, id_from_native, 2, values);
106
+ RB_GC_GUARD(values[0]);
107
+ RB_GC_GUARD(rbType);
108
+
109
+ return rbReturnValue;
103
110
  }
104
111
 
105
112
  default:
@@ -68,6 +68,10 @@ typedef enum {
68
68
  #include <ffi.h>
69
69
  #include "Type.h"
70
70
 
71
+ #ifndef FFI_STDCALL
72
+ #define FFI_STDCALL FFI_DEFAULT_ABI
73
+ #endif
74
+
71
75
  VALUE rbffi_NativeValue_ToRuby(Type* type, VALUE rbType, const void* ptr);
72
76
  void rbffi_Types_Init(VALUE moduleFFI);
73
77
 
@@ -17,12 +17,20 @@
17
17
  * version 3 along with this work. If not, see <http://www.gnu.org/licenses/>.
18
18
  */
19
19
 
20
+ #ifndef _MSC_VER
20
21
  #include <sys/param.h>
22
+ #endif
21
23
  #include <sys/types.h>
22
24
 
23
25
  #include <stdio.h>
26
+ #ifndef _MSC_VER
24
27
  #include <stdint.h>
25
28
  #include <stdbool.h>
29
+ #else
30
+ typedef int bool;
31
+ #define true 1
32
+ #define false 0
33
+ #endif
26
34
  #include <ruby.h>
27
35
 
28
36
  #include <ffi.h>
@@ -86,7 +94,8 @@ variadic_initialize(VALUE self, VALUE rbFunction, VALUE rbParameterTypes, VALUE
86
94
  VALUE retval = Qnil;
87
95
  VALUE convention = Qnil;
88
96
  VALUE fixed = Qnil;
89
- int i;
97
+ VALUE rbConventionStr;
98
+ int i;
90
99
 
91
100
  Check_Type(options, T_HASH);
92
101
  convention = rb_hash_aref(options, ID2SYM(rb_intern("convention")));
@@ -97,7 +106,7 @@ variadic_initialize(VALUE self, VALUE rbFunction, VALUE rbParameterTypes, VALUE
97
106
  invoker->function = rbffi_AbstractMemory_Cast(rbFunction, rbffi_PointerClass)->address;
98
107
 
99
108
  #if defined(_WIN32) || defined(__WIN32__)
100
- VALUE rbConventionStr = rb_funcall2(convention, rb_intern("to_s"), 0, NULL);
109
+ rbConventionStr = rb_funcall2(convention, rb_intern("to_s"), 0, NULL);
101
110
  invoker->abi = (RTEST(convention) && strcmp(StringValueCStr(rbConventionStr), "stdcall") == 0)
102
111
  ? FFI_STDCALL : FFI_DEFAULT_ABI;
103
112
  #else
@@ -159,7 +168,7 @@ variadic_invoke(VALUE self, VALUE parameterTypes, VALUE parameterValues)
159
168
  Check_Type(parameterValues, T_ARRAY);
160
169
 
161
170
  Data_Get_Struct(self, VariadicInvoker, invoker);
162
- paramCount = RARRAY_LEN(parameterTypes);
171
+ paramCount = (int) RARRAY_LEN(parameterTypes);
163
172
  paramTypes = ALLOCA_N(Type *, paramCount);
164
173
  ffiParamTypes = ALLOCA_N(ffi_type *, paramCount);
165
174
  params = ALLOCA_N(FFIStorage, paramCount);
@@ -201,7 +210,7 @@ variadic_invoke(VALUE self, VALUE parameterTypes, VALUE parameterValues)
201
210
 
202
211
  ffiParamTypes[i] = paramTypes[i]->ffiType;
203
212
  if (ffiParamTypes[i] == NULL) {
204
- rb_raise(rb_eArgError, "Invalid parameter type #%x", paramTypes[i]);
213
+ rb_raise(rb_eArgError, "Invalid parameter type #%x", paramTypes[i]->nativeType);
205
214
  }
206
215
  argv[i] = rb_ary_entry(parameterValues, i);
207
216
  }
@@ -62,5 +62,13 @@
62
62
  # define MIN(a, b) ((a) < (b) ? (a) : (b))
63
63
  #endif
64
64
 
65
+ #ifndef RB_GC_GUARD
66
+ # define RB_GC_GUARD(x) (x)
67
+ #endif
68
+
69
+ #ifndef RB_GC_GUARD_PTR
70
+ # define RB_GC_GUARD_PTR(x) (x)
71
+ #endif
72
+
65
73
  #endif /* RBFFI_COMPAT_H */
66
74
 
@@ -1,10 +1,13 @@
1
1
  #ifndef JFFI_ENDIAN_H
2
2
  #define JFFI_ENDIAN_H
3
3
 
4
+ #ifndef _MSC_VER
4
5
  #include <sys/param.h>
6
+ #endif
7
+
5
8
  #include <sys/types.h>
6
9
 
7
- #if defined(__linux__) || defined(__CYGWIN__)
10
+ #if defined(__linux__) || defined(__CYGWIN__) || defined(__GNU__) || defined(__GLIBC__)
8
11
  # include_next <endian.h>
9
12
  #endif
10
13
 
@@ -33,6 +36,12 @@
33
36
  # endif
34
37
  #endif
35
38
 
39
+ #if defined(_WIN32)
40
+ # define LITTLE_ENDIAN 1234
41
+ # define BIG_ENDIAN 4321
42
+ # define BYTE_ORDER LITTLE_ENDIAN
43
+ #endif
44
+
36
45
  #if !defined(BYTE_ORDER) || !defined(LITTLE_ENDIAN) || !defined(BIG_ENDIAN)
37
46
  # error "Cannot determine the endian-ness of this platform"
38
47
  #endif
@@ -1,46 +1,62 @@
1
1
  #!/usr/bin/env ruby
2
- require 'mkmf'
3
- require 'rbconfig'
4
- dir_config("ffi_c")
5
2
 
6
- unless RbConfig::CONFIG['host_os'] =~ /mswin32|mingw32/
7
- if pkg_config("libffi") || find_header("ffi.h", "/usr/local/include")
3
+ if !defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby"
4
+ require 'mkmf'
5
+ require 'rbconfig'
6
+ dir_config("ffi_c")
7
+
8
+ if ENV['RUBY_CC_VERSION'].nil? && (pkg_config("libffi") ||
9
+ have_header("ffi.h") ||
10
+ find_header("ffi.h", "/usr/local/include"))
8
11
 
9
12
  # We need at least ffi_call and ffi_prep_closure
10
- libffi_ok = have_library("ffi", "ffi_call", [ "ffi.h" ]) && have_func("ffi_prep_closure")
11
-
13
+ libffi_ok = have_library("ffi", "ffi_call", [ "ffi.h" ]) ||
14
+ have_library("libffi", "ffi_call", [ "ffi.h" ])
15
+ libffi_ok &&= have_func("ffi_prep_closure")
16
+
12
17
  # Check if the raw api is available.
13
18
  $defs << "-DHAVE_RAW_API" if have_func("ffi_raw_call") && have_func("ffi_prep_raw_closure")
14
19
  end
15
- end
16
-
17
- have_func('rb_thread_blocking_region')
18
- have_func('ruby_thread_has_gvl_p')
19
- have_func('ruby_native_thread_p')
20
- have_func('rb_thread_call_with_gvl')
21
-
22
- $defs << "-DHAVE_EXTCONF_H" if $defs.empty? # needed so create_header works
23
- $defs << "-DUSE_INTERNAL_LIBFFI" unless libffi_ok
24
- $defs << "-DRUBY_1_9" if RUBY_VERSION >= "1.9.0"
25
-
26
- create_header
20
+
21
+ have_func('rb_thread_blocking_region')
22
+ have_func('ruby_thread_has_gvl_p') unless RUBY_VERSION >= "1.9.3"
23
+ have_func('ruby_native_thread_p')
24
+ have_func('rb_thread_call_with_gvl')
25
+
26
+ $defs << "-DHAVE_EXTCONF_H" if $defs.empty? # needed so create_header works
27
+ $defs << "-DUSE_INTERNAL_LIBFFI" unless libffi_ok
28
+ $defs << "-DRUBY_1_9" if RUBY_VERSION >= "1.9.0"
27
29
 
28
- $CFLAGS << " -mwin32 " if RbConfig::CONFIG['host_os'] =~ /cygwin/
29
- #$CFLAGS << " -Werror -Wunused -Wformat -Wimplicit -Wreturn-type "
30
- if (ENV['CC'] || RbConfig::MAKEFILE_CONFIG['CC']) =~ /gcc/
31
- $CFLAGS << " -Wno-declaration-after-statement "
32
- end
33
-
34
- create_makefile("ffi_c")
35
- unless libffi_ok
36
- File.open("Makefile", "a") do |mf|
37
- mf.puts "LIBFFI_HOST=--host=#{RbConfig::CONFIG['host_alias']}" if RbConfig::CONFIG.has_key?("host_alias")
38
- if RbConfig::CONFIG['host_os'].downcase =~ /darwin/
39
- mf.puts "include ${srcdir}/libffi.darwin.mk"
40
- elsif RbConfig::CONFIG['host_os'].downcase =~ /bsd/
41
- mf.puts '.include "${srcdir}/libffi.bsd.mk"'
42
- else
43
- mf.puts "include ${srcdir}/libffi.mk"
30
+ create_header
31
+
32
+ $CFLAGS << " -mwin32 " if RbConfig::CONFIG['host_os'] =~ /cygwin/
33
+ $LOCAL_LIBS << " ./libffi/.libs/libffi_convenience.lib" if RbConfig::CONFIG['host_os'] =~ /mswin/
34
+ #$CFLAGS << " -Werror -Wunused -Wformat -Wimplicit -Wreturn-type "
35
+ if (ENV['CC'] || RbConfig::MAKEFILE_CONFIG['CC']) =~ /gcc/
36
+ # $CFLAGS << " -Wno-declaration-after-statement "
37
+ end
38
+
39
+ create_makefile("ffi_c")
40
+ unless libffi_ok
41
+ File.open("Makefile", "a") do |mf|
42
+ mf.puts "LIBFFI_HOST=--host=#{RbConfig::CONFIG['host_alias']}" if RbConfig::CONFIG.has_key?("host_alias")
43
+ if RbConfig::CONFIG['host_os'].downcase =~ /darwin/
44
+ mf.puts "include ${srcdir}/libffi.darwin.mk"
45
+ elsif RbConfig::CONFIG['host_os'].downcase =~ /bsd/
46
+ mf.puts '.include "${srcdir}/libffi.bsd.mk"'
47
+ elsif RbConfig::CONFIG['host_os'].downcase =~ /mswin64/
48
+ mf.puts '!include $(srcdir)/libffi.vc64.mk'
49
+ elsif RbConfig::CONFIG['host_os'].downcase =~ /mswin32/
50
+ mf.puts '!include $(srcdir)/libffi.vc.mk'
51
+ else
52
+ mf.puts "include ${srcdir}/libffi.mk"
53
+ end
44
54
  end
45
55
  end
56
+
57
+ else
58
+ File.open("Makefile", "w") do |mf|
59
+ mf.puts "# Dummy makefile for non-mri rubies"
60
+ mf.puts "all install::\n"
61
+ end
46
62
  end
@@ -50,6 +50,11 @@ static VALUE moduleFFI = Qnil;
50
50
 
51
51
  void
52
52
  Init_ffi_c(void) {
53
+ /*
54
+ * Document-module: FFI
55
+ *
56
+ * This module embbed type constants from {FFI::NativeType}.
57
+ */
53
58
  rbffi_FFIModule = moduleFFI = rb_define_module("FFI");
54
59
  rb_global_variable(&moduleFFI);
55
60
 
@@ -5,7 +5,7 @@ include ${srcdir}/libffi.gnu.mk
5
5
  CCACHE := $(shell type -p ccache)
6
6
  BUILD_DIR := $(shell pwd)
7
7
 
8
- INCFLAGS += -I${BUILD_DIR}
8
+ INCFLAGS += -I"$(BUILD_DIR)"
9
9
 
10
10
  # Work out which arches we need to compile the lib for
11
11
  ARCHES :=
@@ -24,35 +24,35 @@ endif
24
24
  ifeq ($(strip $(ARCHES)),)
25
25
  # Just build the one (default) architecture
26
26
  $(LIBFFI):
27
- @mkdir -p $(LIBFFI_BUILD_DIR)
28
- @if [ ! -f $(LIBFFI_BUILD_DIR)/Makefile ]; then \
27
+ @mkdir -p "$(LIBFFI_BUILD_DIR)"
28
+ @if [ ! -f "$(LIBFFI_BUILD_DIR)"/Makefile ]; then \
29
29
  echo "Configuring libffi"; \
30
- cd $(LIBFFI_BUILD_DIR) && \
30
+ cd "$(LIBFFI_BUILD_DIR)" && \
31
31
  /usr/bin/env CC="$(CC)" LD="$(LD)" CFLAGS="$(LIBFFI_CFLAGS)" \
32
32
  /bin/sh $(LIBFFI_CONFIGURE) $(LIBFFI_HOST) > /dev/null; \
33
33
  fi
34
- cd $(LIBFFI_BUILD_DIR) && $(MAKE)
34
+ cd "$(LIBFFI_BUILD_DIR)" && $(MAKE)
35
35
 
36
36
  else
37
37
  # Build a fat binary and assemble
38
38
  build_ffi = \
39
- mkdir -p $(BUILD_DIR)/libffi-$(1); \
40
- (if [ ! -f $(BUILD_DIR)/libffi-$(1)/Makefile ]; then \
39
+ mkdir -p "$(BUILD_DIR)"/libffi-$(1); \
40
+ (if [ ! -f "$(BUILD_DIR)"/libffi-$(1)/Makefile ]; then \
41
41
  echo "Configuring libffi for $(1)"; \
42
- cd $(BUILD_DIR)/libffi-$(1) && \
42
+ cd "$(BUILD_DIR)"/libffi-$(1) && \
43
43
  env CC="$(CCACHE) $(CC)" CFLAGS="-arch $(1) $(LIBFFI_CFLAGS)" LDFLAGS="-arch $(1)" \
44
44
  $(LIBFFI_CONFIGURE) --host=$(1)-apple-darwin > /dev/null; \
45
45
  fi); \
46
- env MACOSX_DEPLOYMENT_TARGET=10.4 $(MAKE) -C $(BUILD_DIR)/libffi-$(1)
46
+ env MACOSX_DEPLOYMENT_TARGET=10.4 $(MAKE) -C "$(BUILD_DIR)"/libffi-$(1)
47
47
 
48
48
  $(LIBFFI):
49
49
  @for arch in $(ARCHES); do $(call build_ffi,$$arch);done
50
50
  # Assemble into a FAT (x86_64, i386, ppc) library
51
- @mkdir -p $(BUILD_DIR)/libffi/.libs
51
+ @mkdir -p "$(BUILD_DIR)"/libffi/.libs
52
52
  /usr/bin/libtool -static -o $@ \
53
- $(foreach arch, $(ARCHES),$(BUILD_DIR)/libffi-$(arch)/.libs/libffi_convenience.a)
54
- @mkdir -p $(LIBFFI_BUILD_DIR)/include
55
- $(RM) $(LIBFFI_BUILD_DIR)/include/ffi.h
53
+ $(foreach arch, $(ARCHES),"$(BUILD_DIR)"/libffi-$(arch)/.libs/libffi_convenience.a)
54
+ @mkdir -p "$(LIBFFI_BUILD_DIR)"/include
55
+ $(RM) "$(LIBFFI_BUILD_DIR)"/include/ffi.h
56
56
  @( \
57
57
  printf "#if defined(__i386__)\n"; \
58
58
  printf "#include \"libffi-i386/include/ffi.h\"\n"; \
@@ -61,7 +61,7 @@ $(LIBFFI):
61
61
  printf "#elif defined(__ppc__)\n"; \
62
62
  printf "#include \"libffi-ppc/include/ffi.h\"\n";\
63
63
  printf "#endif\n";\
64
- ) > $(LIBFFI_BUILD_DIR)/include/ffi.h
64
+ ) > "$(LIBFFI_BUILD_DIR)"/include/ffi.h
65
65
  @( \
66
66
  printf "#if defined(__i386__)\n"; \
67
67
  printf "#include \"libffi-i386/include/ffitarget.h\"\n"; \
@@ -70,6 +70,6 @@ $(LIBFFI):
70
70
  printf "#elif defined(__ppc__)\n"; \
71
71
  printf "#include \"libffi-ppc/include/ffitarget.h\"\n";\
72
72
  printf "#endif\n";\
73
- ) > $(LIBFFI_BUILD_DIR)/include/ffitarget.h
73
+ ) > "$(LIBFFI_BUILD_DIR)"/include/ffitarget.h
74
74
 
75
75
  endif
@@ -5,7 +5,7 @@
5
5
 
6
6
 
7
7
  # Tack the extra deps onto the autogenerated variables
8
- INCFLAGS += -I$(LIBFFI_BUILD_DIR)/include
8
+ INCFLAGS += -I"$(LIBFFI_BUILD_DIR)"/include
9
9
  LOCAL_LIBS += $(LIBFFI)
10
10
  BUILD_DIR = $(shell pwd)
11
11
  LIBFFI_CFLAGS = $(FFI_MMAP_EXEC)
@@ -17,8 +17,8 @@ else
17
17
  LIBFFI_SRC_DIR := $(abspath $(srcdir)/libffi)
18
18
  endif
19
19
 
20
- LIBFFI = $(LIBFFI_BUILD_DIR)/.libs/libffi_convenience.a
21
- LIBFFI_CONFIGURE = $(LIBFFI_SRC_DIR)/configure --disable-static \
20
+ LIBFFI = "$(LIBFFI_BUILD_DIR)"/.libs/libffi_convenience.a
21
+ LIBFFI_CONFIGURE = "$(LIBFFI_SRC_DIR)"/configure --disable-static \
22
22
  --with-pic=yes --disable-dependency-tracking
23
23
 
24
24
  $(OBJS): $(LIBFFI)
@@ -3,11 +3,11 @@
3
3
  include ${srcdir}/libffi.gnu.mk
4
4
 
5
5
  $(LIBFFI):
6
- @mkdir -p $(LIBFFI_BUILD_DIR)
7
- @if [ ! -f $(LIBFFI_BUILD_DIR)/Makefile ]; then \
6
+ @mkdir -p "$(LIBFFI_BUILD_DIR)"
7
+ @if [ ! -f "$(LIBFFI_BUILD_DIR)"/Makefile ]; then \
8
8
  echo "Configuring libffi"; \
9
- cd $(LIBFFI_BUILD_DIR) && \
9
+ cd "$(LIBFFI_BUILD_DIR)" && \
10
10
  /usr/bin/env CFLAGS="$(LIBFFI_CFLAGS)" \
11
11
  /bin/sh $(LIBFFI_CONFIGURE) $(LIBFFI_HOST) > /dev/null; \
12
12
  fi
13
- cd $(LIBFFI_BUILD_DIR) && $(MAKE)
13
+ $(MAKE) -C "$(LIBFFI_BUILD_DIR)"
@@ -0,0 +1,26 @@
1
+ # -*- makefile -*-
2
+ #
3
+ # Makefile for msvc
4
+ #
5
+
6
+ # Tack the extra deps onto the autogenerated variables
7
+ INCFLAGS = $(INCFLAGS) -I$(LIBFFI_BUILD_DIR)/include -I$(LIBFFI_BUILD_DIR)/src/x86
8
+ LOCAL_LIBS = $(LOCAL_LIBS) $(LIBFFI)
9
+ BUILD_DIR = $(MAKEDIR)
10
+ LIBFFI_BUILD_DIR = $(BUILD_DIR)/libffi
11
+
12
+ !IF "$(srcdir)" == "."
13
+ LIBFFI_SRC_DIR = $(MAKEDIR)/libffi
14
+ !ELSE
15
+ LIBFFI_SRC_DIR = $(srcdir)/libffi
16
+ !ENDIF
17
+
18
+ LIBFFI = $(LIBFFI_BUILD_DIR)/.libs/libffi_convenience.lib
19
+
20
+ $(OBJS): $(LIBFFI)
21
+
22
+ $(LIBFFI):
23
+ @$(MAKEDIRS) $(LIBFFI_BUILD_DIR)
24
+ @cd $(LIBFFI_BUILD_DIR) && $(MAKE) -f Makefile.vc
25
+
26
+
@@ -0,0 +1,26 @@
1
+ # -*- makefile -*-
2
+ #
3
+ # Makefile for msvc
4
+ #
5
+
6
+ # Tack the extra deps onto the autogenerated variables
7
+ INCFLAGS = $(INCFLAGS) -I$(LIBFFI_BUILD_DIR)/include -I$(LIBFFI_BUILD_DIR)/src/x86
8
+ LOCAL_LIBS = $(LOCAL_LIBS) $(LIBFFI)
9
+ BUILD_DIR = $(MAKEDIR)
10
+ LIBFFI_BUILD_DIR = $(BUILD_DIR)/libffi
11
+
12
+ !IF "$(srcdir)" == "."
13
+ LIBFFI_SRC_DIR = $(MAKEDIR)/libffi
14
+ !ELSE
15
+ LIBFFI_SRC_DIR = $(srcdir)/libffi
16
+ !ENDIF
17
+
18
+ LIBFFI = $(LIBFFI_BUILD_DIR)/.libs/libffi_convenience.lib
19
+
20
+ $(OBJS): $(LIBFFI)
21
+
22
+ $(LIBFFI):
23
+ @$(MAKEDIRS) $(LIBFFI_BUILD_DIR)
24
+ @cd $(LIBFFI_BUILD_DIR) && $(MAKE) -f Makefile.vc64
25
+
26
+
@@ -1,3 +1,544 @@
1
+ 2011-08-22 Jasper Lievisse Adriaanse <jasper@openbsd.org>
2
+
3
+ * configure.ac: Add OpenBSD/hppa and OpenBSD/powerpc support.
4
+ * configure: Rebuilt.
5
+
6
+ 2011-07-11 Andrew Haley <aph@redhat.com>
7
+
8
+ * src/arm/ffi.c (FFI_INIT_TRAMPOLINE): Clear icache.
9
+
10
+ 2011-06-29 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
11
+
12
+ * testsuite/libffi.call/cls_double_va.c: Move PR number to comment.
13
+ * testsuite/libffi.call/cls_longdouble_va.c: Likewise.
14
+
15
+ 2011-06-29 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
16
+
17
+ PR libffi/46660
18
+ * testsuite/libffi.call/cls_double_va.c: xfail dg-output on
19
+ mips-sgi-irix6*.
20
+ * testsuite/libffi.call/cls_longdouble_va.c: Likewise.
21
+
22
+ 2011-06-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
23
+
24
+ * testsuite/libffi.call/huge_struct.c (test_large_fn): Use PRIu8,
25
+ PRId8 instead of %hhu, %hhd.
26
+ * testsuite/libffi.call/ffitest.h [__alpha__ && __osf__] (PRId8,
27
+ PRIu8): Define.
28
+ [__sgi__] (PRId8, PRIu8): Define.
29
+
30
+ 2011-04-29 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
31
+
32
+ * src/alpha/osf.S (UA_SI, FDE_ENCODING, FDE_ENCODE, FDE_ARANGE):
33
+ Define.
34
+ Use them to handle ELF vs. ECOFF differences.
35
+ [__osf__] (_GLOBAL__F_ffi_call_osf): Define.
36
+
37
+ 2011-03-30 Timothy Wall <twall@users.sf.net>
38
+
39
+ * src/powerpc/darwin.S: Fix unknown FDE encoding.
40
+ * src/powerpc/darwin_closure.S: ditto.
41
+
42
+ 2011-02-25 Anthony Green <green@moxielogic.com>
43
+
44
+ * src/powerpc/ffi.c (ffi_prep_closure_loc): Allow for more
45
+ 32-bit ABIs.
46
+
47
+ 2011-02-15 Anthony Green <green@moxielogic.com>
48
+
49
+ * m4/ax_cc_maxopt.m4: Don't -malign-double or use -ffast-math.
50
+ * configure: Rebuilt.
51
+
52
+ 2011-02-13 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
53
+
54
+ * configure: Regenerate.
55
+
56
+ 2011-02-13 Anthony Green <green@moxielogic.com>
57
+
58
+ * include/ffi_common.h (UNLIKELY, LIKELY): Define.
59
+ * src/x86/ffi64.c (UNLIKELY, LIKELY): Remove definition.
60
+ * src/prep_cif.c (UNLIKELY, LIKELY): Remove definition.
61
+
62
+ * src/prep_cif.c (initialize_aggregate): Convert assertion into
63
+ FFI_BAD_TYPEDEF return. Initialize arg size and alignment to 0.
64
+
65
+ * src/pa/ffi.c (ffi_prep_closure_loc): Don't ASSERT ABI test,
66
+ just return FFI_BAD_ABI when things are wrong.
67
+ * src/arm/ffi.c (ffi_prep_closure_loc): Ditto.
68
+ * src/powerpc/ffi.c (ffi_prep_closure_loc): Ditto.
69
+ * src/mips/ffi.c (ffi_prep_closure_loc): Ditto.
70
+ * src/ia64/ffi.c (ffi_prep_closure_loc): Ditto.
71
+ * src/avr32/ffi.c (ffi_prep_closure_loc): Ditto.
72
+
73
+ 2011-02-11 Anthony Green <green@moxielogic.com>
74
+
75
+ * src/sparc/ffi.c (ffi_prep_closure_loc): Don't ASSERT ABI test,
76
+ just return FFI_BAD_ABI when things are wrong.
77
+
78
+ 2011-02-09 Stuart Shelton <srcshelton@gmail.com>
79
+
80
+ http://bugs.gentoo.org/show_bug.cgi?id=286911
81
+ * src/mips/ffitarget.h: Clean up error messages.
82
+ * src/java_raw_api.c (ffi_java_translate_args): Cast raw arg to
83
+ ffi_raw*.
84
+ * include/ffi.h.in: Add pragma for SGI compiler.
85
+
86
+ 2011-02-09 Anthony Green <green@moxielogic.com>
87
+
88
+ * configure.ac: Add powerpc64-*-darwin* support.
89
+
90
+ 2011-02-09 Anthony Green <green@moxielogic.com>
91
+
92
+ * README: Mention Interix.
93
+
94
+ 2011-02-09 Jonathan Callen <abcd@gentoo.org>
95
+
96
+ * configure.ac: Add Interix to win32/cygwin/mingw case.
97
+ * configure: Ditto.
98
+ * src/closures.c: Treat Interix like Cygwin, instead of as a
99
+ generic win32.
100
+
101
+ 2011-02-09 Anthony Green <green@moxielogic.com>
102
+
103
+ * testsuite/libffi.call/err_bad_typedef.c: Remove xfail.
104
+ * testsuite/libffi.call/err_bad_abi.c: Remove xfail.
105
+ * src/x86/ffi64.c (UNLIKELY, LIKELY): Define.
106
+ (ffi_prep_closure_loc): Check for bad ABI.
107
+ * src/prep_cif.c (UNLIKELY, LIKELY): Define.
108
+ (initialize_aggregate): Check for bad types.
109
+
110
+ 2011-02-09 Landon Fuller <landonf@plausible.coop>
111
+
112
+ * Makefile.am (EXTRA_DIST): Add build-ios.sh, src/arm/gentramp.sh,
113
+ src/arm/trampoline.S.
114
+ (nodist_libffi_la_SOURCES): Add src/arc/trampoline.S.
115
+ * configure.ac (FFI_EXEC_TRAMPOLINE_TABLE): Define.
116
+ * src/arm/ffi.c (ffi_trampoline_table)
117
+ (ffi_closure_trampoline_table_page, ffi_trampoline_table_entry)
118
+ (FFI_TRAMPOLINE_CODELOC_CONFIG, FFI_TRAMPOLINE_CONFIG_PAGE_OFFSET)
119
+ (FFI_TRAMPOLINE_COUNT, ffi_trampoline_lock, ffi_trampoline_tables)
120
+ (ffi_trampoline_table_alloc, ffi_closure_alloc, ffi_closure_free):
121
+ Define for FFI_EXEC_TRAMPOLINE_TABLE case (iOS).
122
+ (ffi_prep_closure_loc): Handl FFI_EXEC_TRAMPOLINE_TABLE case
123
+ separately.
124
+ * src/arm/sysv.S: Handle Apple iOS host.
125
+ * src/closures.c: Handle FFI_EXEC_TRAMPOLINE_TABLE case.
126
+ * build-ios.sh: New file.
127
+ * fficonfig.h.in, configure, Makefile.in: Rebuilt.
128
+ * README: Mention ARM iOS.
129
+
130
+ 2011-02-08 Oren Held <orenhe@il.ibm.com>
131
+
132
+ * src/dlmalloc.c (_STRUCT_MALLINFO): Define in order to avoid
133
+ redefinition of mallinfo on HP-UX.
134
+
135
+ 2011-02-08 Ginn Chen <ginn.chen@oracle.com>
136
+
137
+ * src/sparc/ffi.c (ffi_call): Make compatible with Solaris Studio
138
+ aggregate return ABI. Flush cache.
139
+ (ffi_prep_closure_loc): Flush cache.
140
+
141
+ 2011-02-11 Anthony Green <green@moxielogic.com>
142
+
143
+ From Tom Honermann <tom.honermann@oracle.com>:
144
+ * src/powerpc/aix.S (ffi_call_AIX): Support for xlc toolchain on
145
+ AIX. Declare .ffi_prep_args. Insert nops after branch
146
+ instructions so that the AIX linker can insert TOC reload
147
+ instructions.
148
+ * src/powerpc/aix_closure.S: Declare .ffi_closure_helper_DARWIN.
149
+
150
+ 2011-02-08 Ed <ed@kdtc.net>
151
+
152
+ * src/powerpc/asm.h: Fix grammar nit in comment.
153
+
154
+ 2011-02-08 Uli Link <ul.mcamafia@linkitup.de>
155
+
156
+ * include/ffi.h.in (FFI_64_BIT_MAX): Define and use.
157
+
158
+ 2011-02-09 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
159
+
160
+ PR libffi/46661
161
+ * testsuite/libffi.call/cls_pointer.c (main): Cast void * to
162
+ uintptr_t first.
163
+ * testsuite/libffi.call/cls_pointer_stack.c (main): Likewise.
164
+
165
+ 2011-02-08 Rafael Avila de Espindola <respindola@mozilla.com>
166
+
167
+ * configure.ac: Fix x86 test for pc related relocs.
168
+ * configure: Rebuilt.
169
+
170
+ 2011-02-07 Joel Sherrill <joel.sherrill@oarcorp.com>
171
+
172
+ * libffi/src/m68k/ffi.c: Add RTEMS support for cache flushing.
173
+ Handle case when CPU variant does not have long double support.
174
+ * libffi/src/m68k/sysv.S: Add support for mc68000, Coldfire,
175
+ and cores with soft floating point.
176
+
177
+ 2011-02-07 Joel Sherrill <joel.sherrill@oarcorp.com>
178
+
179
+ * configure.ac: Add mips*-*-rtems* support.
180
+ * configure: Regenerate.
181
+ * src/mips/ffitarget.h: Ensure needed constants are available
182
+ for targets which do not have sgidefs.h.
183
+
184
+ 2011-01-26 Dave Korn <dave.korn.cygwin@gmail.com>
185
+
186
+ PR target/40125
187
+ * configure.ac (AM_LTLDFLAGS): Add -bindir option for windows DLLs.
188
+ * configure: Regenerate.
189
+
190
+ 2010-12-18 Iain Sandoe <iains@gcc.gnu.org>
191
+
192
+ PR libffi/29152
193
+ PR libffi/42378
194
+ * src/powerpc/darwin_closure.S: Provide Darwin64 implementation,
195
+ update comments.
196
+ * src/powerpc/ffitarget.h (POWERPC_DARWIN64): New,
197
+ (FFI_TRAMPOLINE_SIZE): Update for Darwin64.
198
+ * src/powerpc/darwin.S: Provide Darwin64 implementation,
199
+ update comments.
200
+ * src/powerpc/ffi_darwin.c: Likewise.
201
+
202
+ 2010-12-06 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
203
+
204
+ * configure.ac (libffi_cv_as_ascii_pseudo_op): Use double
205
+ backslashes.
206
+ (libffi_cv_as_string_pseudo_op): Likewise.
207
+ * configure: Regenerate.
208
+
209
+ 2010-12-03 Chung-Lin Tang <cltang@codesourcery.com>
210
+
211
+ * src/arm/sysv.S (ffi_closure_SYSV): Add UNWIND to .pad directive.
212
+ (ffi_closure_VFP): Same.
213
+ (ffi_call_VFP): Move down to before ffi_closure_VFP. Add '.fpu vfp'
214
+ directive.
215
+
216
+ 2010-12-01 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
217
+
218
+ * testsuite/libffi.call/ffitest.h [__sgi] (PRId64, PRIu64): Define.
219
+ (PRIuPTR): Define.
220
+
221
+ 2010-11-29 Richard Henderson <rth@redhat.com>
222
+ Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
223
+
224
+ * src/x86/sysv.S (FDE_ENCODING, FDE_ENCODE): Define.
225
+ (.eh_frame): Use FDE_ENCODING.
226
+ (.LASFDE1, .LASFDE2, LASFDE3): Simplify with FDE_ENCODE.
227
+
228
+ 2010-11-22 Jacek Caban <jacek@codeweavers.com>
229
+
230
+ * configure.ac: Check for symbol underscores on mingw-w64.
231
+ * configure: Rebuilt.
232
+ * src/x86/win64.S: Correctly access extern symbols in respect to
233
+ underscores.
234
+
235
+ 2010-11-15 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
236
+
237
+ * testsuite/lib/libffi-dg.exp: Rename ...
238
+ * testsuite/lib/libffi.exp: ... to this.
239
+ * libffi/testsuite/libffi.call/call.exp: Don't load libffi-dg.exp.
240
+ * libffi/testsuite/libffi.special/special.exp: Likewise.
241
+
242
+ 2010-10-28 Chung-Lin Tang <cltang@codesourcery.com>
243
+
244
+ * src/arm/ffi.c (ffi_prep_args): Add VFP register argument handling
245
+ code, new parameter, and return value. Update comments.
246
+ (ffi_prep_cif_machdep): Add case for VFP struct return values. Add
247
+ call to layout_vfp_args().
248
+ (ffi_call_SYSV): Update declaration.
249
+ (ffi_call_VFP): New declaration.
250
+ (ffi_call): Add VFP struct return conditions. Call ffi_call_VFP()
251
+ when ABI is FFI_VFP.
252
+ (ffi_closure_VFP): New declaration.
253
+ (ffi_closure_SYSV_inner): Add new vfp_args parameter, update call to
254
+ ffi_prep_incoming_args_SYSV().
255
+ (ffi_prep_incoming_args_SYSV): Update parameters. Add VFP argument
256
+ case handling.
257
+ (ffi_prep_closure_loc): Pass ffi_closure_VFP to trampoline
258
+ construction under VFP hard-float.
259
+ (rec_vfp_type_p): New function.
260
+ (vfp_type_p): Same.
261
+ (place_vfp_arg): Same.
262
+ (layout_vfp_args): Same.
263
+ * src/arm/ffitarget.h (ffi_abi): Add FFI_VFP. Define FFI_DEFAULT_ABI
264
+ based on __ARM_PCS_VFP.
265
+ (FFI_EXTRA_CIF_FIELDS): Define for adding VFP hard-float specific
266
+ fields.
267
+ (FFI_TYPE_STRUCT_VFP_FLOAT): Define internally used type code.
268
+ (FFI_TYPE_STRUCT_VFP_DOUBLE): Same.
269
+ * src/arm/sysv.S (ffi_call_SYSV): Change call of ffi_prep_args() to
270
+ direct call. Move function pointer load upwards.
271
+ (ffi_call_VFP): New function.
272
+ (ffi_closure_VFP): Same.
273
+
274
+ * testsuite/lib/libffi-dg.exp (check-flags): New function.
275
+ (dg-skip-if): New function.
276
+ * testsuite/libffi.call/cls_double_va.c: Skip if target is arm*-*-*
277
+ and compiler options include -mfloat-abi=hard.
278
+ * testsuite/libffi.call/cls_longdouble_va.c: Same.
279
+
280
+ 2010-10-01 Jakub Jelinek <jakub@redhat.com>
281
+
282
+ PR libffi/45677
283
+ * src/x86/ffi64.c (ffi_prep_cif_machdep): Ensure cif->bytes is
284
+ a multiple of 8.
285
+ * testsuite/libffi.call/many2.c: New test.
286
+
287
+ 2010-08-20 Mark Wielaard <mjw@redhat.com>
288
+
289
+ * src/closures.c (open_temp_exec_file_mnt): Check if getmntent_r
290
+ returns NULL.
291
+
292
+ 2010-08-09 Andreas Tobler <andreast@fgznet.ch>
293
+
294
+ * configure.ac: Add target powerpc64-*-freebsd*.
295
+ * configure: Regenerate.
296
+ * testsuite/libffi.call/cls_align_longdouble_split.c: Pass
297
+ -mlong-double-128 only to linux targets.
298
+ * testsuite/libffi.call/cls_align_longdouble_split2.c: Likewise.
299
+ * testsuite/libffi.call/cls_longdouble.c: Likewise.
300
+ * testsuite/libffi.call/huge_struct.c: Likewise.
301
+
302
+ 2010-08-05 Dan Witte <dwitte@mozilla.com>
303
+
304
+ * Makefile.am: Pass FFI_DEBUG define to msvcc.sh for linking to the
305
+ debug CRT when --enable-debug is given.
306
+ * configure.ac: Define it.
307
+ * msvcc.sh: Translate -g and -DFFI_DEBUG appropriately.
308
+
309
+ 2010-08-04 Dan Witte <dwitte@mozilla.com>
310
+
311
+ * src/x86/ffitarget.h: Add X86_ANY define for all x86/x86_64
312
+ platforms.
313
+ * src/x86/ffi.c: Remove redundant ifdef checks.
314
+ * src/prep_cif.c: Push stack space computation into src/x86/ffi.c
315
+ for X86_ANY so return value space doesn't get added twice.
316
+
317
+ 2010-08-03 Neil Rashbrooke <neil@parkwaycc.co.uk>
318
+
319
+ * msvcc.sh: Don't pass -safeseh to ml64 because behavior is buggy.
320
+
321
+ 2010-07-22 Dan Witte <dwitte@mozilla.com>
322
+
323
+ * src/*/ffitarget.h: Make FFI_LAST_ABI one past the last valid ABI.
324
+ * src/prep_cif.c: Fix ABI assertion.
325
+ * src/cris/ffi.c: Ditto.
326
+
327
+ 2010-07-10 Evan Phoenix <evan@fallingsnow.net>
328
+
329
+ * src/closures.c (selinux_enabled_check): Fix strncmp usage bug.
330
+
331
+ 2010-07-07 Dan Horák <dan@danny.cz>
332
+
333
+ * include/ffi.h.in: Protect #define with #ifndef.
334
+ * src/powerpc/ffitarget.h: Ditto.
335
+ * src/s390/ffitarget.h: Ditto.
336
+ * src/sparc/ffitarget.h: Ditto.
337
+
338
+ 2010-07-07 Neil Roberts <neil@linux.intel.com>
339
+
340
+ * src/x86/sysv.S (ffi_call_SYSV): Align the stack pointer to
341
+ 16-bytes.
342
+
343
+ 2010-07-02 Jakub Jelinek <jakub@redhat.com>
344
+
345
+ * Makefile.am (AM_MAKEFLAGS): Pass also mandir to submakes.
346
+ * Makefile.in: Regenerated.
347
+
348
+ 2010-05-19 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
349
+
350
+ * configure.ac (libffi_cv_as_x86_pcrel): Check for illegal in as
351
+ output, too.
352
+ (libffi_cv_as_ascii_pseudo_op): Check for .ascii.
353
+ (libffi_cv_as_string_pseudo_op): Check for .string.
354
+ * configure: Regenerate.
355
+ * fficonfig.h.in: Regenerate.
356
+ * src/x86/sysv.S (.eh_frame): Use .ascii, .string or error.
357
+
358
+ 2010-05-11 Dan Witte <dwitte@mozilla.com>
359
+
360
+ * doc/libffi.tex: Document previous change.
361
+
362
+ 2010-05-11 Makoto Kato <m_kato@ga2.so-net.ne.jp>
363
+
364
+ * src/x86/ffi.c (ffi_call): Don't copy structs passed by value.
365
+
366
+ 2010-05-05 Michael Kohler <michaelkohler@live.com>
367
+
368
+ * src/dlmalloc.c (dlfree): Fix spelling.
369
+ * src/ia64/ffi.c (ffi_prep_cif_machdep): Ditto.
370
+ * configure.ac: Ditto.
371
+ * configure: Rebuilt.
372
+
373
+ 2010-04-13 Dan Witte <dwitte@mozilla.com>
374
+
375
+ * msvcc.sh: Build with -W3 instead of -Wall.
376
+ * src/powerpc/ffi_darwin.c: Remove build warnings.
377
+ * src/x86/ffi.c: Ditto.
378
+ * src/x86/ffitarget.h: Ditto.
379
+
380
+ 2010-04-12 Dan Witte <dwitte@mozilla.com>
381
+ Walter Meinl <wuno@lsvw.de>
382
+
383
+ * configure.ac: Add OS/2 support.
384
+ * configure: Rebuilt.
385
+ * src/closures.c: Ditto.
386
+ * src/dlmalloc.c: Ditto.
387
+ * src/x86/win32.S: Ditto.
388
+
389
+ 2010-04-07 Jakub Jelinek <jakub@redhat.com>
390
+
391
+ * testsuite/libffi.call/err_bad_abi.c: Remove unused args variable.
392
+
393
+ 2010-04-02 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
394
+
395
+ * Makefile.in: Regenerate.
396
+ * aclocal.m4: Regenerate.
397
+ * include/Makefile.in: Regenerate.
398
+ * man/Makefile.in: Regenerate.
399
+ * testsuite/Makefile.in: Regenerate.
400
+
401
+ 2010-03-30 Dan Witte <dwitte@mozilla.com>
402
+
403
+ * msvcc.sh: Disable build warnings.
404
+ * README (tested): Clarify windows build procedure.
405
+
406
+ 2010-03-15 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
407
+
408
+ * configure.ac (libffi_cv_as_x86_64_unwind_section_type): New test.
409
+ * configure: Regenerate.
410
+ * fficonfig.h.in: Regenerate.
411
+ * libffi/src/x86/unix64.S (.eh_frame)
412
+ [HAVE_AS_X86_64_UNWIND_SECTION_TYPE]: Use @unwind section type.
413
+
414
+ 2010-03-14 Matthias Klose <doko@ubuntu.com>
415
+
416
+ * src/x86/ffi64.c: Fix typo in comment.
417
+ * src/x86/ffi.c: Use /* ... */ comment style.
418
+
419
+ 2010-02-24 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
420
+
421
+ * doc/libffi.texi (The Closure API): Fix typo.
422
+ * doc/libffi.info: Remove.
423
+
424
+ 2010-02-15 Matthias Klose <doko@ubuntu.com>
425
+
426
+ * src/arm/sysv.S (__ARM_ARCH__): Define for processor
427
+ __ARM_ARCH_7EM__.
428
+
429
+ 2010-01-15 Anthony Green <green@redhat.com>
430
+
431
+ * README: Add notes on building with Microsoft Visual C++.
432
+
433
+ 2010-01-15 Daniel Witte <dwitte@mozilla.com>
434
+
435
+ * msvcc.sh: New file.
436
+
437
+ * src/x86/win32.S: Port assembly routines to MSVC and #ifdef.
438
+ * src/x86/ffi.c: Tweak function declaration and remove excess
439
+ parens.
440
+ * include/ffi.h.in: Add __declspec(align(8)) to typedef struct
441
+ ffi_closure.
442
+
443
+ * src/x86/ffi.c: Merge ffi_call_SYSV and ffi_call_STDCALL into new
444
+ function ffi_call_win32 on X86_WIN32.
445
+ * src/x86/win32.S (ffi_call_SYSV): Rename to ffi_call_win32.
446
+ (ffi_call_STDCALL): Remove.
447
+
448
+ * src/prep_cif.c (ffi_prep_cif): Move stack space allocation code
449
+ to ffi_prep_cif_machdep for x86.
450
+ * src/x86/ffi.c (ffi_prep_cif_machdep): To here.
451
+
452
+ 2010-01-15 Oliver Kiddle <okiddle@yahoo.co.uk>
453
+
454
+ * src/x86/ffitarget.h (ffi_abi): Check for __i386 and __amd64 for
455
+ Sun Studio compiler compatibility.
456
+
457
+ 2010-01-12 Conrad Irwin <conrad.irwin@gmail.com>
458
+
459
+ * doc/libffi.texi: Add closure example.
460
+
461
+ 2010-01-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
462
+
463
+ PR libffi/40701
464
+ * testsuite/libffi.call/ffitest.h [__alpha__ && __osf__] (PRIdLL,
465
+ PRIuLL, PRId64, PRIu64, PRIuPTR): Define.
466
+ * testsuite/libffi.call/cls_align_sint64.c: Add -Wno-format on
467
+ alpha*-dec-osf*.
468
+ * testsuite/libffi.call/cls_align_uint64.c: Likewise.
469
+ * testsuite/libffi.call/cls_ulonglong.c: Likewise.
470
+ * testsuite/libffi.call/return_ll1.c: Likewise.
471
+ * testsuite/libffi.call/stret_medium2.c: Likewise.
472
+ * testsuite/libffi.special/ffitestcxx.h (allocate_mmap): Cast
473
+ MAP_FAILED to char *.
474
+
475
+ 2010-01-06 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
476
+
477
+ * src/mips/n32.S: Use .abicalls and .eh_frame with __GNUC__.
478
+
479
+ 2009-12-31 Anthony Green <green@redhat.com>
480
+
481
+ * README: Update for libffi 3.0.9.
482
+
483
+ 2009-12-27 Matthias Klose <doko@ubuntu.com>
484
+
485
+ * configure.ac (HAVE_LONG_DOUBLE): Define for mips when
486
+ appropriate.
487
+ * configure: Rebuilt.
488
+
489
+ 2009-12-26 Anthony Green <green@redhat.com>
490
+
491
+ * testsuite/libffi.call/cls_longdouble_va.c: Mark as xfail for
492
+ avr32*-*-*.
493
+ * testsuite/libffi.call/cls_double_va.c: Ditto.
494
+
495
+ 2009-12-26 Andreas Tobler <a.tobler@schweiz.org>
496
+
497
+ * testsuite/libffi.call/ffitest.h: Conditionally include stdint.h
498
+ and inttypes.h.
499
+ * testsuite/libffi.special/unwindtest.cc: Ditto.
500
+
501
+ 2009-12-26 Andreas Tobler <a.tobler@schweiz.org>
502
+
503
+ * configure.ac: Add amd64-*-openbsd*.
504
+ * configure: Rebuilt.
505
+ * testsuite/lib/libffi-dg.exp (libffi_target_compile): Link
506
+ openbsd programs with -lpthread.
507
+
508
+ 2009-12-26 Anthony Green <green@redhat.com>
509
+
510
+ * testsuite/libffi.call/cls_double_va.c,
511
+ testsuite/libffi.call/cls_longdouble.c,
512
+ testsuite/libffi.call/cls_longdouble_va.c,
513
+ testsuite/libffi.call/cls_pointer.c,
514
+ testsuite/libffi.call/cls_pointer_stack.c: Remove xfail for
515
+ mips*-*-* and arm*-*-*.
516
+ * testsuite/libffi.call/cls_align_longdouble_split.c,
517
+ testsuite/libffi.call/cls_align_longdouble_split2.c,
518
+ testsuite/libffi.call/stret_medium2.c,
519
+ testsuite/libffi.call/stret_medium.c,
520
+ testsuite/libffi.call/stret_large.c,
521
+ testsuite/libffi.call/stret_large2.c: Remove xfail for arm*-*-*.
522
+
523
+ 2009-12-31 Kay Tietz <ktietz70@googlemail.com>
524
+
525
+ * testsuite/libffi.call/ffitest.h,
526
+ testsuite/libffi.special/ffitestcxx.h (PRIdLL, PRuLL): Fix
527
+ definitions.
528
+
529
+ 2009-12-31 Carlo Bramini <carlo.bramix@libero.it>
530
+
531
+ * configure.ac (AM_LTLDFLAGS): Define for windows hosts.
532
+ * Makefile.am (libffi_la_LDFLAGS): Add AM_LTLDFLAGS.
533
+ * configure: Rebuilt.
534
+ * Makefile.in: Rebuilt.
535
+
536
+ 2009-12-31 Anthony Green <green@redhat.com>
537
+ Blake Chaffin.
538
+
539
+ * testsuite/libffi.call/huge_struct.c: New test case from Blake
540
+ Chaffin @ Apple.
541
+
1
542
  2009-12-28 David Edelsohn <edelsohn@gnu.org>
2
543
 
3
544
  * src/powerpc/ffi_darwin.c (ffi_prep_args): Copy abi and nargs to