ffi 1.0.11 → 1.0.12.pre

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 (159) hide show
  1. data/Rakefile +1 -1
  2. data/ext/ffi_c/AbstractMemory.c +9 -0
  3. data/ext/ffi_c/AbstractMemory.h +4 -0
  4. data/ext/ffi_c/Buffer.c +8 -0
  5. data/ext/ffi_c/Call.c +8 -0
  6. data/ext/ffi_c/ClosurePool.c +12 -0
  7. data/ext/ffi_c/DynamicLibrary.c +7 -1
  8. data/ext/ffi_c/Function.c +11 -1
  9. data/ext/ffi_c/Function.h +6 -0
  10. data/ext/ffi_c/FunctionInfo.c +8 -0
  11. data/ext/ffi_c/LastError.c +8 -0
  12. data/ext/ffi_c/MemoryPointer.c +8 -0
  13. data/ext/ffi_c/MemoryPointer.h +6 -0
  14. data/ext/ffi_c/MethodHandle.c +8 -0
  15. data/ext/ffi_c/Platform.c +8 -0
  16. data/ext/ffi_c/Pointer.c +8 -0
  17. data/ext/ffi_c/Pointer.h +6 -0
  18. data/ext/ffi_c/Struct.c +6 -0
  19. data/ext/ffi_c/StructByReference.c +8 -0
  20. data/ext/ffi_c/StructByValue.c +8 -0
  21. data/ext/ffi_c/StructLayout.c +6 -0
  22. data/ext/ffi_c/Thread.c +7 -0
  23. data/ext/ffi_c/Thread.h +6 -0
  24. data/ext/ffi_c/Type.c +3 -0
  25. data/ext/ffi_c/Types.h +4 -0
  26. data/ext/ffi_c/Variadic.c +8 -0
  27. data/ext/ffi_c/endian.h +3 -0
  28. data/ext/ffi_c/extconf.rb +6 -1
  29. data/ext/ffi_c/libffi.vc.mk +26 -0
  30. data/ext/ffi_c/libffi.vc64.mk +26 -0
  31. data/ext/ffi_c/libffi/ChangeLog +541 -0
  32. data/ext/ffi_c/libffi/ChangeLog.libffi +13 -87
  33. data/ext/ffi_c/libffi/LICENSE +3 -3
  34. data/ext/ffi_c/libffi/Makefile.am +41 -32
  35. data/ext/ffi_c/libffi/Makefile.in +95 -66
  36. data/ext/ffi_c/libffi/Makefile.vc +141 -0
  37. data/ext/ffi_c/libffi/Makefile.vc64 +141 -0
  38. data/ext/ffi_c/libffi/README +40 -4
  39. data/ext/ffi_c/libffi/aclocal.m4 +729 -7854
  40. data/ext/ffi_c/libffi/build-ios.sh +67 -0
  41. data/ext/ffi_c/libffi/compile +11 -10
  42. data/ext/ffi_c/libffi/config.guess +4 -1
  43. data/ext/ffi_c/libffi/config.sub +6 -3
  44. data/ext/ffi_c/libffi/configure +6264 -6354
  45. data/ext/ffi_c/libffi/configure.ac +155 -63
  46. data/ext/ffi_c/libffi/depcomp +81 -35
  47. data/ext/ffi_c/libffi/doc/libffi.info +78 -18
  48. data/ext/ffi_c/libffi/doc/libffi.texi +64 -5
  49. data/ext/ffi_c/libffi/doc/stamp-vti +4 -4
  50. data/ext/ffi_c/libffi/doc/version.texi +4 -4
  51. data/ext/ffi_c/libffi/fficonfig.h.in +18 -0
  52. data/ext/ffi_c/libffi/fficonfig.hw +57 -0
  53. data/ext/ffi_c/libffi/include/Makefile.in +21 -3
  54. data/ext/ffi_c/libffi/include/ffi.h.in +42 -14
  55. data/ext/ffi_c/libffi/include/ffi.h.vc +427 -0
  56. data/ext/ffi_c/libffi/include/ffi.h.vc64 +427 -0
  57. data/ext/ffi_c/libffi/include/ffi_common.h +9 -5
  58. data/ext/ffi_c/libffi/install-sh +364 -167
  59. data/ext/ffi_c/libffi/ltmain.sh +2599 -1369
  60. data/ext/ffi_c/libffi/m4/ax_cc_maxopt.m4 +176 -0
  61. data/ext/ffi_c/libffi/m4/ax_cflags_warn_all.m4 +195 -0
  62. data/ext/ffi_c/libffi/m4/ax_check_compiler_flags.m4 +76 -0
  63. data/ext/ffi_c/libffi/m4/ax_compiler_vendor.m4 +63 -0
  64. data/ext/ffi_c/libffi/m4/ax_configure_args.m4 +70 -0
  65. data/ext/ffi_c/libffi/m4/ax_enable_builddir.m4 +300 -0
  66. data/ext/ffi_c/libffi/m4/ax_gcc_archflag.m4 +215 -0
  67. data/ext/ffi_c/libffi/m4/ax_gcc_x86_cpuid.m4 +79 -0
  68. data/ext/ffi_c/libffi/m4/libtool.m4 +1239 -768
  69. data/ext/ffi_c/libffi/m4/ltoptions.m4 +7 -6
  70. data/ext/ffi_c/libffi/m4/ltversion.m4 +6 -6
  71. data/ext/ffi_c/libffi/m4/lt~obsolete.m4 +9 -3
  72. data/ext/ffi_c/libffi/man/Makefile.in +21 -3
  73. data/ext/ffi_c/libffi/mdate-sh +0 -0
  74. data/ext/ffi_c/libffi/missing +60 -44
  75. data/ext/ffi_c/libffi/msvcc.sh +197 -0
  76. data/ext/ffi_c/libffi/src/alpha/osf.S +39 -18
  77. data/ext/ffi_c/libffi/src/arm/ffi.c +443 -24
  78. data/ext/ffi_c/libffi/src/arm/ffitarget.h +17 -1
  79. data/ext/ffi_c/libffi/src/arm/gentramp.sh +118 -0
  80. data/ext/ffi_c/libffi/src/arm/sysv.S +206 -15
  81. data/ext/ffi_c/libffi/src/arm/trampoline.S +4450 -0
  82. data/ext/ffi_c/libffi/src/avr32/ffi.c +4 -2
  83. data/ext/ffi_c/libffi/src/avr32/ffitarget.h +2 -2
  84. data/ext/ffi_c/libffi/src/closures.c +17 -35
  85. data/ext/ffi_c/libffi/src/cris/ffi.c +1 -1
  86. data/ext/ffi_c/libffi/src/cris/ffitarget.h +2 -2
  87. data/ext/ffi_c/libffi/src/dlmalloc.c +66 -4
  88. data/ext/ffi_c/libffi/src/frv/ffitarget.h +2 -6
  89. data/ext/ffi_c/libffi/src/ia64/ffi.c +7 -5
  90. data/ext/ffi_c/libffi/src/ia64/ffitarget.h +2 -2
  91. data/ext/ffi_c/libffi/src/java_raw_api.c +1 -1
  92. data/ext/ffi_c/libffi/src/m32r/ffitarget.h +2 -2
  93. data/ext/ffi_c/libffi/src/m68k/ffi.c +10 -0
  94. data/ext/ffi_c/libffi/src/m68k/ffitarget.h +2 -2
  95. data/ext/ffi_c/libffi/src/m68k/sysv.S +36 -0
  96. data/ext/ffi_c/libffi/src/mips/ffi.c +12 -5
  97. data/ext/ffi_c/libffi/src/mips/ffitarget.h +18 -11
  98. data/ext/ffi_c/libffi/src/mips/n32.S +4 -4
  99. data/ext/ffi_c/libffi/src/moxie/eabi.S +128 -0
  100. data/ext/ffi_c/libffi/src/moxie/ffi.c +276 -0
  101. data/ext/ffi_c/libffi/src/pa/ffi.c +7 -4
  102. data/ext/ffi_c/libffi/src/pa/ffitarget.h +6 -5
  103. data/ext/ffi_c/libffi/src/powerpc/aix.S +5 -1
  104. data/ext/ffi_c/libffi/src/powerpc/aix_closure.S +2 -0
  105. data/ext/ffi_c/libffi/src/powerpc/asm.h +1 -1
  106. data/ext/ffi_c/libffi/src/powerpc/darwin.S +215 -77
  107. data/ext/ffi_c/libffi/src/powerpc/darwin_closure.S +358 -100
  108. data/ext/ffi_c/libffi/src/powerpc/ffi.c +11 -5
  109. data/ext/ffi_c/libffi/src/powerpc/ffi_darwin.c +603 -172
  110. data/ext/ffi_c/libffi/src/powerpc/ffitarget.h +17 -4
  111. data/ext/ffi_c/libffi/src/prep_cif.c +16 -13
  112. data/ext/ffi_c/libffi/src/s390/ffitarget.h +4 -2
  113. data/ext/ffi_c/libffi/src/sh/ffitarget.h +2 -2
  114. data/ext/ffi_c/libffi/src/sh64/ffitarget.h +2 -2
  115. data/ext/ffi_c/libffi/src/sparc/ffi.c +55 -11
  116. data/ext/ffi_c/libffi/src/sparc/ffitarget.h +5 -3
  117. data/ext/ffi_c/libffi/src/x86/ffi.c +54 -92
  118. data/ext/ffi_c/libffi/src/x86/ffi64.c +17 -8
  119. data/ext/ffi_c/libffi/src/x86/ffitarget.h +15 -14
  120. data/ext/ffi_c/libffi/src/x86/sysv.S +40 -26
  121. data/ext/ffi_c/libffi/src/x86/unix64.S +4 -0
  122. data/ext/ffi_c/libffi/src/x86/win32.S +379 -191
  123. data/ext/ffi_c/libffi/src/x86/win64.S +15 -7
  124. data/ext/ffi_c/libffi/testsuite/Makefile.am +1 -1
  125. data/ext/ffi_c/libffi/testsuite/Makefile.in +22 -4
  126. data/ext/ffi_c/libffi/testsuite/lib/libffi.exp +350 -0
  127. data/ext/ffi_c/libffi/testsuite/libffi.call/call.exp +1 -5
  128. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_longdouble_split.c +1 -1
  129. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_longdouble_split2.c +1 -1
  130. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_sint64.c +1 -0
  131. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_uint64.c +1 -0
  132. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_double_va.c +3 -0
  133. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_longdouble.c +2 -2
  134. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_longdouble_va.c +3 -0
  135. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_pointer.c +1 -1
  136. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_pointer_stack.c +1 -1
  137. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_ulonglong.c +1 -0
  138. data/ext/ffi_c/libffi/testsuite/libffi.call/err_bad_abi.c +2 -3
  139. data/ext/ffi_c/libffi/testsuite/libffi.call/err_bad_typedef.c +2 -1
  140. data/ext/ffi_c/libffi/testsuite/libffi.call/ffitest.h +36 -0
  141. data/ext/ffi_c/libffi/testsuite/libffi.call/huge_struct.c +17 -17
  142. data/ext/ffi_c/libffi/testsuite/libffi.call/return_ll1.c +1 -0
  143. data/ext/ffi_c/libffi/testsuite/libffi.call/stret_medium2.c +1 -0
  144. data/ext/ffi_c/libffi/testsuite/libffi.special/ffitestcxx.h +1 -1
  145. data/ext/ffi_c/libffi/testsuite/libffi.special/special.exp +1 -3
  146. data/ext/ffi_c/win32/stdint.h +199 -0
  147. data/gen/Rakefile +18 -2
  148. data/lib/ffi/platform/arm-linux/types.conf +102 -0
  149. data/lib/ffi/platform/i486-gnu/types.conf +107 -0
  150. data/lib/ffi/platform/ia64-linux/types.conf +102 -0
  151. data/lib/ffi/platform/mips-linux/types.conf +102 -0
  152. data/lib/ffi/platform/mipsel-linux/types.conf +102 -0
  153. data/lib/ffi/platform/powerpc-linux/types.conf +100 -0
  154. data/lib/ffi/platform/s390-linux/types.conf +102 -0
  155. data/lib/ffi/platform/s390x-linux/types.conf +102 -0
  156. data/lib/ffi/platform/sparc-linux/types.conf +102 -0
  157. data/lib/ffi/tools/types_generator.rb +8 -1
  158. data/lib/ffi_c.bundle +0 -0
  159. metadata +72 -42
@@ -2,7 +2,7 @@ dnl Process this with autoconf to create configure
2
2
 
3
3
  AC_PREREQ(2.63)
4
4
 
5
- AC_INIT([libffi], [3.0.9], [http://gcc.gnu.org/bugs.html])
5
+ AC_INIT([libffi], [3.0.10], [http://sourceware.org/libffi.html])
6
6
  AC_CONFIG_HEADERS([fficonfig.h])
7
7
 
8
8
  AC_CANONICAL_SYSTEM
@@ -10,16 +10,22 @@ target_alias=${target_alias-$host_alias}
10
10
 
11
11
  . ${srcdir}/configure.host
12
12
 
13
+ AX_ENABLE_BUILDDIR
14
+
13
15
  AM_INIT_AUTOMAKE
14
16
 
15
17
  # The same as in boehm-gc and libstdc++. Have to borrow it from there.
16
18
  # We must force CC to /not/ be precious variables; otherwise
17
19
  # the wrong, non-multilib-adjusted value will be used in multilibs.
18
20
  # As a side effect, we have to subst CFLAGS ourselves.
21
+ # Also save and restore CFLAGS, since AC_PROG_CC will come up with
22
+ # defaults of its own if none are provided.
19
23
 
20
24
  m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
21
25
  m4_define([_AC_ARG_VAR_PRECIOUS],[])
26
+ save_CFLAGS=$CFLAGS
22
27
  AC_PROG_CC
28
+ CFLAGS=$save_CFLAGS
23
29
  m4_undefine([_AC_ARG_VAR_PRECIOUS])
24
30
  m4_rename([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
25
31
 
@@ -30,6 +36,12 @@ AM_PROG_CC_C_O
30
36
  AC_PROG_LIBTOOL
31
37
  AC_CONFIG_MACRO_DIR([m4])
32
38
 
39
+ AX_CC_MAXOPT
40
+ AX_CFLAGS_WARN_ALL
41
+ if test "x$GCC" = "xyes"; then
42
+ CFLAGS="$CFLAGS -fexceptions"
43
+ fi
44
+
33
45
  AM_MAINTAINER_MODE
34
46
 
35
47
  AC_CHECK_HEADERS(sys/mman.h)
@@ -43,7 +55,7 @@ TARGETDIR="unknown"
43
55
  case "$host" in
44
56
  alpha*-*-*)
45
57
  TARGET=ALPHA; TARGETDIR=alpha;
46
- # Support 128-bit long double, changable via command-line switch.
58
+ # Support 128-bit long double, changeable via command-line switch.
47
59
  HAVE_LONG_DOUBLE='defined(__LONG_DOUBLE_128__)'
48
60
  ;;
49
61
 
@@ -55,6 +67,10 @@ case "$host" in
55
67
  TARGET=X86_64; TARGETDIR=x86
56
68
  ;;
57
69
 
70
+ amd64-*-freebsd*)
71
+ TARGET=X86_64; TARGETDIR=x86
72
+ ;;
73
+
58
74
  avr32*-*-*)
59
75
  TARGET=AVR32; TARGETDIR=avr32
60
76
  ;;
@@ -67,7 +83,7 @@ case "$host" in
67
83
  TARGET=FRV; TARGETDIR=frv
68
84
  ;;
69
85
 
70
- hppa*-*-linux* | parisc*-*-linux*)
86
+ hppa*-*-linux* | parisc*-*-linux* | hppa*-*-openbsd*)
71
87
  TARGET=PA_LINUX; TARGETDIR=pa
72
88
  ;;
73
89
  hppa*64-*-hpux*)
@@ -80,10 +96,17 @@ case "$host" in
80
96
  i?86-*-freebsd* | i?86-*-openbsd*)
81
97
  TARGET=X86_FREEBSD; TARGETDIR=x86
82
98
  ;;
83
- i?86-win32* | i?86-*-cygwin* | i?86-*-mingw*)
99
+ i?86-win32* | i?86-*-cygwin* | i?86-*-mingw* | i?86-*-os2* | i?86-*-interix*)
84
100
  TARGET=X86_WIN32; TARGETDIR=x86
85
- # All mingw/cygwin/win32 builds require this for sharedlib
86
- AM_LTLDFLAGS="-no-undefined"
101
+ # All mingw/cygwin/win32 builds require -no-undefined for sharedlib.
102
+ # We must also check with_cross_host to decide if this is a native
103
+ # or cross-build and select where to install dlls appropriately.
104
+ if test -n "$with_cross_host" &&
105
+ test x"$with_cross_host" != x"no"; then
106
+ AM_LTLDFLAGS='-no-undefined -bindir "$(toolexeclibdir)"';
107
+ else
108
+ AM_LTLDFLAGS='-no-undefined -bindir "$(bindir)"';
109
+ fi
87
110
  ;;
88
111
  i?86-*-darwin*)
89
112
  TARGET=X86_DARWIN; TARGETDIR=x86
@@ -107,10 +130,10 @@ case "$host" in
107
130
  TARGET=M68K; TARGETDIR=m68k
108
131
  ;;
109
132
 
110
- mips-sgi-irix5.* | mips-sgi-irix6.*)
133
+ mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*)
111
134
  TARGET=MIPS; TARGETDIR=mips
112
135
  ;;
113
- mips*-*-linux*)
136
+ mips*-*-linux* | mips*-*-openbsd*)
114
137
  # Support 128-bit long double for NewABI.
115
138
  HAVE_LONG_DOUBLE='defined(__mips64)'
116
139
  TARGET=MIPS; TARGETDIR=mips
@@ -122,15 +145,18 @@ case "$host" in
122
145
  powerpc-*-beos*)
123
146
  TARGET=POWERPC; TARGETDIR=powerpc
124
147
  ;;
125
- powerpc-*-darwin*)
148
+ powerpc-*-darwin* | powerpc64-*-darwin*)
126
149
  TARGET=POWERPC_DARWIN; TARGETDIR=powerpc
127
150
  ;;
128
151
  powerpc-*-aix* | rs6000-*-aix*)
129
152
  TARGET=POWERPC_AIX; TARGETDIR=powerpc
130
153
  ;;
131
- powerpc-*-freebsd*)
154
+ powerpc-*-freebsd* | powerpc-*-openbsd*)
132
155
  TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc
133
156
  ;;
157
+ powerpc64-*-freebsd*)
158
+ TARGET=POWERPC; TARGETDIR=powerpc
159
+ ;;
134
160
  powerpc*-*-rtems*)
135
161
  TARGET=POWERPC; TARGETDIR=powerpc
136
162
  ;;
@@ -181,6 +207,7 @@ AM_CONDITIONAL(ALPHA, test x$TARGET = xALPHA)
181
207
  AM_CONDITIONAL(IA64, test x$TARGET = xIA64)
182
208
  AM_CONDITIONAL(M32R, test x$TARGET = xM32R)
183
209
  AM_CONDITIONAL(M68K, test x$TARGET = xM68K)
210
+ AM_CONDITIONAL(MOXIE, test x$TARGET = xMOXIE)
184
211
  AM_CONDITIONAL(POWERPC, test x$TARGET = xPOWERPC)
185
212
  AM_CONDITIONAL(POWERPC_AIX, test x$TARGET = xPOWERPC_AIX)
186
213
  AM_CONDITIONAL(POWERPC_DARWIN, test x$TARGET = xPOWERPC_DARWIN)
@@ -264,64 +291,124 @@ fi
264
291
  if test x$TARGET = xX86 || test x$TARGET = xX86_WIN32 || test x$TARGET = xX86_64; then
265
292
  AC_CACHE_CHECK([assembler supports pc related relocs],
266
293
  libffi_cv_as_x86_pcrel, [
267
- libffi_cv_as_x86_pcrel=yes
294
+ libffi_cv_as_x86_pcrel=no
268
295
  echo '.text; foo: nop; .data; .long foo-.; .text' > conftest.s
269
- if $CC $CFLAGS -c conftest.s 2>&1 | grep -i warning > /dev/null; then
270
- libffi_cv_as_x86_pcrel=no
296
+ if $CC $CFLAGS -c conftest.s > /dev/null; then
297
+ libffi_cv_as_x86_pcrel=yes
271
298
  fi
272
299
  ])
273
300
  if test "x$libffi_cv_as_x86_pcrel" = xyes; then
274
301
  AC_DEFINE(HAVE_AS_X86_PCREL, 1,
275
302
  [Define if your assembler supports PC relative relocs.])
276
303
  fi
304
+
305
+ AC_CACHE_CHECK([assembler .ascii pseudo-op support],
306
+ libffi_cv_as_ascii_pseudo_op, [
307
+ libffi_cv_as_ascii_pseudo_op=unknown
308
+ # Check if we have .ascii
309
+ AC_TRY_COMPILE([asm (".ascii \\"string\\"");],,
310
+ [libffi_cv_as_ascii_pseudo_op=yes],
311
+ [libffi_cv_as_ascii_pseudo_op=no])
312
+ ])
313
+ if test "x$libffi_cv_as_ascii_pseudo_op" = xyes; then
314
+ AC_DEFINE(HAVE_AS_ASCII_PSEUDO_OP, 1,
315
+ [Define if your assembler supports .ascii.])
316
+ fi
317
+
318
+ AC_CACHE_CHECK([assembler .string pseudo-op support],
319
+ libffi_cv_as_string_pseudo_op, [
320
+ libffi_cv_as_string_pseudo_op=unknown
321
+ # Check if we have .string
322
+ AC_TRY_COMPILE([asm (".string \\"string\\"");],,
323
+ [libffi_cv_as_string_pseudo_op=yes],
324
+ [libffi_cv_as_string_pseudo_op=no])
325
+ ])
326
+ if test "x$libffi_cv_as_string_pseudo_op" = xyes; then
327
+ AC_DEFINE(HAVE_AS_STRING_PSEUDO_OP, 1,
328
+ [Define if your assembler supports .string.])
329
+ fi
330
+ fi
331
+
332
+ if test x$TARGET = xX86_WIN64; then
333
+ LT_SYS_SYMBOL_USCORE
334
+ if test "x$sys_symbol_underscore" = xyes; then
335
+ AC_DEFINE(SYMBOL_UNDERSCORE, 1, [Define if symbols are underscored.])
336
+ fi
277
337
  fi
278
338
 
339
+
340
+ FFI_EXEC_TRAMPOLINE_TABLE=0
279
341
  case "$target" in
342
+ *arm*-apple-darwin*)
343
+ FFI_EXEC_TRAMPOLINE_TABLE=1
344
+ AC_DEFINE(FFI_EXEC_TRAMPOLINE_TABLE, 1,
345
+ [Cannot use PROT_EXEC on this target, so, we revert to
346
+ alternative means])
347
+ ;;
280
348
  *-apple-darwin10* | *-*-freebsd* | *-*-openbsd* | *-pc-solaris*)
281
349
  AC_DEFINE(FFI_MMAP_EXEC_WRIT, 1,
282
350
  [Cannot use malloc on this target, so, we revert to
283
351
  alternative means])
284
352
  ;;
285
353
  esac
286
-
287
- AC_CACHE_CHECK([whether .eh_frame section should be read-only],
288
- libffi_cv_ro_eh_frame, [
289
- libffi_cv_ro_eh_frame=no
290
- echo 'extern void foo (void); void bar (void) { foo (); foo (); }' > conftest.c
291
- if $CC $CFLAGS -S -fpic -fexceptions -o conftest.s conftest.c > /dev/null 2>&1; then
292
- if grep '.section.*eh_frame.*"a"' conftest.s > /dev/null; then
293
- libffi_cv_ro_eh_frame=yes
294
- elif grep '.section.*eh_frame.*#alloc' conftest.c \
295
- | grep -v '#write' > /dev/null; then
296
- libffi_cv_ro_eh_frame=yes
297
- fi
354
+ AM_CONDITIONAL(FFI_EXEC_TRAMPOLINE_TABLE, test x$FFI_EXEC_TRAMPOLINE_TABLE = x1)
355
+ AC_SUBST(FFI_EXEC_TRAMPOLINE_TABLE)
356
+
357
+ if test x$TARGET = xX86_64; then
358
+ AC_CACHE_CHECK([assembler supports unwind section type],
359
+ libffi_cv_as_x86_64_unwind_section_type, [
360
+ libffi_cv_as_x86_64_unwind_section_type=yes
361
+ echo '.section .eh_frame,"a",@unwind' > conftest.s
362
+ if $CC $CFLAGS -c conftest.s 2>&1 | grep -i warning > /dev/null; then
363
+ libffi_cv_as_x86_64_unwind_section_type=no
298
364
  fi
299
- rm -f conftest.*
300
- ])
301
- if test "x$libffi_cv_ro_eh_frame" = xyes; then
302
- AC_DEFINE(HAVE_RO_EH_FRAME, 1,
303
- [Define if .eh_frame sections should be read-only.])
304
- AC_DEFINE(EH_FRAME_FLAGS, "a",
305
- [Define to the flags needed for the .section .eh_frame directive.])
306
- else
307
- AC_DEFINE(EH_FRAME_FLAGS, "aw",
308
- [Define to the flags needed for the .section .eh_frame directive.])
365
+ ])
366
+ if test "x$libffi_cv_as_x86_64_unwind_section_type" = xyes; then
367
+ AC_DEFINE(HAVE_AS_X86_64_UNWIND_SECTION_TYPE, 1,
368
+ [Define if your assembler supports unwind section type.])
369
+ fi
309
370
  fi
310
371
 
311
- AC_CACHE_CHECK([for __attribute__((visibility("hidden")))],
312
- libffi_cv_hidden_visibility_attribute, [
313
- echo 'int __attribute__ ((visibility ("hidden"))) foo (void) { return 1; }' > conftest.c
314
- libffi_cv_hidden_visibility_attribute=no
315
- if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
316
- if grep '\.hidden.*foo' conftest.s >/dev/null; then
317
- libffi_cv_hidden_visibility_attribute=yes
318
- fi
319
- fi
320
- rm -f conftest.*
321
- ])
322
- if test $libffi_cv_hidden_visibility_attribute = yes; then
323
- AC_DEFINE(HAVE_HIDDEN_VISIBILITY_ATTRIBUTE, 1,
324
- [Define if __attribute__((visibility("hidden"))) is supported.])
372
+ if test "x$GCC" = "xyes"; then
373
+ AC_CACHE_CHECK([whether .eh_frame section should be read-only],
374
+ libffi_cv_ro_eh_frame, [
375
+ libffi_cv_ro_eh_frame=no
376
+ echo 'extern void foo (void); void bar (void) { foo (); foo (); }' > conftest.c
377
+ if $CC $CFLAGS -S -fpic -fexceptions -o conftest.s conftest.c > /dev/null 2>&1; then
378
+ if grep '.section.*eh_frame.*"a"' conftest.s > /dev/null; then
379
+ libffi_cv_ro_eh_frame=yes
380
+ elif grep '.section.*eh_frame.*#alloc' conftest.c \
381
+ | grep -v '#write' > /dev/null; then
382
+ libffi_cv_ro_eh_frame=yes
383
+ fi
384
+ fi
385
+ rm -f conftest.*
386
+ ])
387
+ if test "x$libffi_cv_ro_eh_frame" = xyes; then
388
+ AC_DEFINE(HAVE_RO_EH_FRAME, 1,
389
+ [Define if .eh_frame sections should be read-only.])
390
+ AC_DEFINE(EH_FRAME_FLAGS, "a",
391
+ [Define to the flags needed for the .section .eh_frame directive. ])
392
+ else
393
+ AC_DEFINE(EH_FRAME_FLAGS, "aw",
394
+ [Define to the flags needed for the .section .eh_frame directive. ])
395
+ fi
396
+
397
+ AC_CACHE_CHECK([for __attribute__((visibility("hidden")))],
398
+ libffi_cv_hidden_visibility_attribute, [
399
+ echo 'int __attribute__ ((visibility ("hidden"))) foo (void) { return 1 ; }' > conftest.c
400
+ libffi_cv_hidden_visibility_attribute=no
401
+ if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
402
+ if grep '\.hidden.*foo' conftest.s >/dev/null; then
403
+ libffi_cv_hidden_visibility_attribute=yes
404
+ fi
405
+ fi
406
+ rm -f conftest.*
407
+ ])
408
+ if test $libffi_cv_hidden_visibility_attribute = yes; then
409
+ AC_DEFINE(HAVE_HIDDEN_VISIBILITY_ATTRIBUTE, 1,
410
+ [Define if __attribute__((visibility("hidden"))) is supported.])
411
+ fi
325
412
  fi
326
413
 
327
414
  AH_BOTTOM([
@@ -350,6 +437,7 @@ AC_ARG_ENABLE(debug,
350
437
  if test "$enable_debug" = "yes"; then
351
438
  AC_DEFINE(FFI_DEBUG, 1, [Define this if you want extra debugging.])
352
439
  fi)
440
+ AM_CONDITIONAL(FFI_DEBUG, test "$enable_debug" = "yes")
353
441
 
354
442
  AC_ARG_ENABLE(structs,
355
443
  [ --disable-structs omit code for struct support],
@@ -369,21 +457,25 @@ AC_ARG_ENABLE(purify-safety,
369
457
  AC_DEFINE(USING_PURIFY, 1, [Define this if you are using Purify and want to suppress spurious messages.])
370
458
  fi)
371
459
 
372
- if test -n "$with_cross_host" &&
373
- test x"$with_cross_host" != x"no"; then
374
- toolexecdir='$(exec_prefix)/$(target_alias)'
375
- toolexeclibdir='$(toolexecdir)/lib'
376
- else
377
- toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
378
- toolexeclibdir='$(libdir)'
460
+ # These variables are only ever used when we cross-build to X86_WIN32.
461
+ # And we only support this with GCC, so...
462
+ if test x"$GCC" != x"no"; then
463
+ if test -n "$with_cross_host" &&
464
+ test x"$with_cross_host" != x"no"; then
465
+ toolexecdir='$(exec_prefix)/$(target_alias)'
466
+ toolexeclibdir='$(toolexecdir)/lib'
467
+ else
468
+ toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
469
+ toolexeclibdir='$(libdir)'
470
+ fi
471
+ multi_os_directory=`$CC -print-multi-os-directory`
472
+ case $multi_os_directory in
473
+ .) ;; # Avoid trailing /.
474
+ *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
475
+ esac
476
+ AC_SUBST(toolexecdir)
477
+ AC_SUBST(toolexeclibdir)
379
478
  fi
380
- multi_os_directory=`$CC -print-multi-os-directory`
381
- case $multi_os_directory in
382
- .) ;; # Avoid trailing /.
383
- *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
384
- esac
385
- AC_SUBST(toolexecdir)
386
- AC_SUBST(toolexeclibdir)
387
479
 
388
480
  if test "${multilib}" = "yes"; then
389
481
  multilib_arg="--enable-multilib"
@@ -1,10 +1,10 @@
1
1
  #! /bin/sh
2
2
  # depcomp - compile a program generating dependencies as side-effects
3
3
 
4
- scriptversion=2006-10-15.18
4
+ scriptversion=2009-04-28.21; # UTC
5
5
 
6
- # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software
7
- # Foundation, Inc.
6
+ # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free
7
+ # Software Foundation, Inc.
8
8
 
9
9
  # This program is free software; you can redistribute it and/or modify
10
10
  # it under the terms of the GNU General Public License as published by
@@ -17,9 +17,7 @@ scriptversion=2006-10-15.18
17
17
  # GNU General Public License for more details.
18
18
 
19
19
  # You should have received a copy of the GNU General Public License
20
- # along with this program; if not, write to the Free Software
21
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22
- # 02110-1301, USA.
20
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
23
21
 
24
22
  # As a special exception to the GNU General Public License, if you
25
23
  # distribute this file as part of a program that contains a
@@ -87,6 +85,15 @@ if test "$depmode" = dashXmstdout; then
87
85
  depmode=dashmstdout
88
86
  fi
89
87
 
88
+ cygpath_u="cygpath -u -f -"
89
+ if test "$depmode" = msvcmsys; then
90
+ # This is just like msvisualcpp but w/o cygpath translation.
91
+ # Just convert the backslash-escaped backslashes to single forward
92
+ # slashes to satisfy depend.m4
93
+ cygpath_u="sed s,\\\\\\\\,/,g"
94
+ depmode=msvisualcpp
95
+ fi
96
+
90
97
  case "$depmode" in
91
98
  gcc3)
92
99
  ## gcc 3 implements dependency tracking that does exactly what
@@ -192,14 +199,14 @@ sgi)
192
199
  ' < "$tmpdepfile" \
193
200
  | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
194
201
  tr '
195
- ' ' ' >> $depfile
196
- echo >> $depfile
202
+ ' ' ' >> "$depfile"
203
+ echo >> "$depfile"
197
204
 
198
205
  # The second pass generates a dummy entry for each header file.
199
206
  tr ' ' '
200
207
  ' < "$tmpdepfile" \
201
208
  | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
202
- >> $depfile
209
+ >> "$depfile"
203
210
  else
204
211
  # The sourcefile does not contain any dependencies, so just
205
212
  # store a dummy comment line, to avoid errors with the Makefile
@@ -215,34 +222,39 @@ aix)
215
222
  # current directory. Also, the AIX compiler puts `$object:' at the
216
223
  # start of each line; $object doesn't have directory information.
217
224
  # Version 6 uses the directory in both cases.
218
- stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
219
- tmpdepfile="$stripped.u"
225
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
226
+ test "x$dir" = "x$object" && dir=
227
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
220
228
  if test "$libtool" = yes; then
229
+ tmpdepfile1=$dir$base.u
230
+ tmpdepfile2=$base.u
231
+ tmpdepfile3=$dir.libs/$base.u
221
232
  "$@" -Wc,-M
222
233
  else
234
+ tmpdepfile1=$dir$base.u
235
+ tmpdepfile2=$dir$base.u
236
+ tmpdepfile3=$dir$base.u
223
237
  "$@" -M
224
238
  fi
225
239
  stat=$?
226
240
 
227
- if test -f "$tmpdepfile"; then :
228
- else
229
- stripped=`echo "$stripped" | sed 's,^.*/,,'`
230
- tmpdepfile="$stripped.u"
231
- fi
232
-
233
241
  if test $stat -eq 0; then :
234
242
  else
235
- rm -f "$tmpdepfile"
243
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
236
244
  exit $stat
237
245
  fi
238
246
 
247
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
248
+ do
249
+ test -f "$tmpdepfile" && break
250
+ done
239
251
  if test -f "$tmpdepfile"; then
240
- outname="$stripped.o"
241
252
  # Each line is of the form `foo.o: dependent.h'.
242
253
  # Do two passes, one to just change these to
243
254
  # `$object: dependent.h' and one to simply `dependent.h:'.
244
- sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
245
- sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
255
+ sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
256
+ # That's a tab and a space in the [].
257
+ sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
246
258
  else
247
259
  # The sourcefile does not contain any dependencies, so just
248
260
  # store a dummy comment line, to avoid errors with the Makefile
@@ -323,7 +335,12 @@ hp2)
323
335
  if test -f "$tmpdepfile"; then
324
336
  sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
325
337
  # Add `dependent.h:' lines.
326
- sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
338
+ sed -ne '2,${
339
+ s/^ *//
340
+ s/ \\*$//
341
+ s/$/:/
342
+ p
343
+ }' "$tmpdepfile" >> "$depfile"
327
344
  else
328
345
  echo "#dummy" > "$depfile"
329
346
  fi
@@ -399,7 +416,7 @@ dashmstdout)
399
416
 
400
417
  # Remove the call to Libtool.
401
418
  if test "$libtool" = yes; then
402
- while test $1 != '--mode=compile'; do
419
+ while test "X$1" != 'X--mode=compile'; do
403
420
  shift
404
421
  done
405
422
  shift
@@ -450,32 +467,39 @@ makedepend)
450
467
  "$@" || exit $?
451
468
  # Remove any Libtool call
452
469
  if test "$libtool" = yes; then
453
- while test $1 != '--mode=compile'; do
470
+ while test "X$1" != 'X--mode=compile'; do
454
471
  shift
455
472
  done
456
473
  shift
457
474
  fi
458
475
  # X makedepend
459
476
  shift
460
- cleared=no
461
- for arg in "$@"; do
477
+ cleared=no eat=no
478
+ for arg
479
+ do
462
480
  case $cleared in
463
481
  no)
464
482
  set ""; shift
465
483
  cleared=yes ;;
466
484
  esac
485
+ if test $eat = yes; then
486
+ eat=no
487
+ continue
488
+ fi
467
489
  case "$arg" in
468
490
  -D*|-I*)
469
491
  set fnord "$@" "$arg"; shift ;;
470
492
  # Strip any option that makedepend may not understand. Remove
471
493
  # the object too, otherwise makedepend will parse it as a source file.
494
+ -arch)
495
+ eat=yes ;;
472
496
  -*|$object)
473
497
  ;;
474
498
  *)
475
499
  set fnord "$@" "$arg"; shift ;;
476
500
  esac
477
501
  done
478
- obj_suffix="`echo $object | sed 's/^.*\././'`"
502
+ obj_suffix=`echo "$object" | sed 's/^.*\././'`
479
503
  touch "$tmpdepfile"
480
504
  ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
481
505
  rm -f "$depfile"
@@ -495,7 +519,7 @@ cpp)
495
519
 
496
520
  # Remove the call to Libtool.
497
521
  if test "$libtool" = yes; then
498
- while test $1 != '--mode=compile'; do
522
+ while test "X$1" != 'X--mode=compile'; do
499
523
  shift
500
524
  done
501
525
  shift
@@ -533,13 +557,27 @@ cpp)
533
557
 
534
558
  msvisualcpp)
535
559
  # Important note: in order to support this mode, a compiler *must*
536
- # always write the preprocessed file to stdout, regardless of -o,
537
- # because we must use -o when running libtool.
560
+ # always write the preprocessed file to stdout.
538
561
  "$@" || exit $?
562
+
563
+ # Remove the call to Libtool.
564
+ if test "$libtool" = yes; then
565
+ while test "X$1" != 'X--mode=compile'; do
566
+ shift
567
+ done
568
+ shift
569
+ fi
570
+
539
571
  IFS=" "
540
572
  for arg
541
573
  do
542
574
  case "$arg" in
575
+ -o)
576
+ shift
577
+ ;;
578
+ $object)
579
+ shift
580
+ ;;
543
581
  "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
544
582
  set fnord "$@"
545
583
  shift
@@ -552,16 +590,23 @@ msvisualcpp)
552
590
  ;;
553
591
  esac
554
592
  done
555
- "$@" -E |
556
- sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
593
+ "$@" -E 2>/dev/null |
594
+ sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
557
595
  rm -f "$depfile"
558
596
  echo "$object : \\" > "$depfile"
559
- . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
597
+ sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
560
598
  echo " " >> "$depfile"
561
- . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
599
+ sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
562
600
  rm -f "$tmpdepfile"
563
601
  ;;
564
602
 
603
+ msvcmsys)
604
+ # This case exists only to let depend.m4 do its work. It works by
605
+ # looking at the text of this script. This case will never be run,
606
+ # since it is checked for above.
607
+ exit 1
608
+ ;;
609
+
565
610
  none)
566
611
  exec "$@"
567
612
  ;;
@@ -580,5 +625,6 @@ exit 0
580
625
  # eval: (add-hook 'write-file-hooks 'time-stamp)
581
626
  # time-stamp-start: "scriptversion="
582
627
  # time-stamp-format: "%:y-%02m-%02d.%02H"
583
- # time-stamp-end: "$"
628
+ # time-stamp-time-zone: "UTC"
629
+ # time-stamp-end: "; # UTC"
584
630
  # End: