rbdc 0.9.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (223) hide show
  1. checksums.yaml +4 -4
  2. data/dyncall/BUGS +1 -1
  3. data/dyncall/CMakeLists.txt +19 -7
  4. data/dyncall/ChangeLog +61 -20
  5. data/dyncall/LICENSE +1 -1
  6. data/dyncall/Makefile.generic +2 -0
  7. data/dyncall/ToDo +97 -29
  8. data/dyncall/autovar/README.txt +1 -0
  9. data/dyncall/autovar/autovar_ABI.h +4 -2
  10. data/dyncall/autovar/autovar_ARCH.h +9 -5
  11. data/dyncall/autovar/autovar_CC.h +3 -1
  12. data/dyncall/autovar/autovar_OS.h +2 -2
  13. data/dyncall/autovar/autovar_OSFAMILY.h +1 -1
  14. data/dyncall/configure +94 -38
  15. data/dyncall/dyncall/dyncall.3 +8 -4
  16. data/dyncall/dyncall/dyncall.h +1 -1
  17. data/dyncall/dyncall/dyncall_alloc.h +1 -1
  18. data/dyncall/dyncall/dyncall_api.c +3 -1
  19. data/dyncall/dyncall/dyncall_call.S +13 -5
  20. data/dyncall/dyncall/dyncall_call_arm32_arm.S +1 -2
  21. data/dyncall/dyncall/dyncall_call_arm32_arm.h +1 -1
  22. data/dyncall/dyncall/dyncall_call_arm32_arm_armhf.S +24 -26
  23. data/dyncall/dyncall/dyncall_call_arm32_arm_armhf.h +1 -1
  24. data/dyncall/dyncall/dyncall_call_arm32_thumb.h +1 -1
  25. data/dyncall/dyncall/dyncall_call_arm32_thumb_armhf.S +1 -1
  26. data/dyncall/dyncall/dyncall_call_arm32_thumb_gas.s +3 -7
  27. data/dyncall/dyncall/dyncall_call_arm64.S +2 -2
  28. data/dyncall/dyncall/dyncall_call_arm64.h +2 -2
  29. data/dyncall/dyncall/dyncall_call_mips.h +1 -1
  30. data/dyncall/dyncall/dyncall_call_mips_eabi.h +1 -1
  31. data/dyncall/dyncall/dyncall_call_mips_eabi_gas.s +16 -16
  32. data/dyncall/dyncall/dyncall_call_mips_gas.S +2 -2
  33. data/dyncall/dyncall/dyncall_call_mips_n32.h +5 -4
  34. data/dyncall/dyncall/dyncall_call_mips_n32_gas.s +4 -4
  35. data/dyncall/dyncall/dyncall_call_mips_n64.h +3 -3
  36. data/dyncall/dyncall/dyncall_call_mips_n64_gas.s +2 -2
  37. data/dyncall/dyncall/dyncall_call_mips_o32.h +4 -3
  38. data/dyncall/dyncall/dyncall_call_mips_o32_gas.s +1 -3
  39. data/dyncall/dyncall/dyncall_call_ppc32.S +1 -1
  40. data/dyncall/dyncall/dyncall_call_ppc32.h +1 -1
  41. data/dyncall/dyncall/dyncall_call_sparc.h +1 -1
  42. data/dyncall/dyncall/{dyncall_call_sparc.S → dyncall_call_sparc.s} +39 -44
  43. data/dyncall/dyncall/dyncall_call_sparc64.h +5 -5
  44. data/dyncall/dyncall/dyncall_call_sparc64.s +177 -0
  45. data/dyncall/dyncall/dyncall_call_x64.S +83 -86
  46. data/dyncall/dyncall/dyncall_call_x64.h +1 -1
  47. data/dyncall/dyncall/dyncall_call_x86.S +9 -9
  48. data/dyncall/dyncall/dyncall_call_x86.h +1 -1
  49. data/dyncall/dyncall/dyncall_call_x86_nasm.asm +5 -5
  50. data/dyncall/dyncall/dyncall_callf.c +18 -18
  51. data/dyncall/dyncall/dyncall_callf.h +1 -1
  52. data/dyncall/dyncall/dyncall_callvm.c +3 -3
  53. data/dyncall/dyncall/dyncall_callvm.h +1 -1
  54. data/dyncall/dyncall/dyncall_callvm_arm32_arm.c +25 -40
  55. data/dyncall/dyncall/dyncall_callvm_arm32_arm.h +1 -5
  56. data/dyncall/dyncall/dyncall_callvm_arm32_arm_armhf.c +25 -33
  57. data/dyncall/dyncall/dyncall_callvm_arm32_arm_armhf.h +1 -5
  58. data/dyncall/dyncall/dyncall_callvm_arm32_thumb.c +24 -36
  59. data/dyncall/dyncall/dyncall_callvm_arm32_thumb.h +1 -5
  60. data/dyncall/dyncall/dyncall_callvm_arm64.c +23 -27
  61. data/dyncall/dyncall/dyncall_callvm_arm64.h +2 -6
  62. data/dyncall/dyncall/dyncall_callvm_arm64_apple.c +23 -30
  63. data/dyncall/dyncall/dyncall_callvm_base.c +1 -1
  64. data/dyncall/dyncall/dyncall_callvm_mips.c +1 -1
  65. data/dyncall/dyncall/dyncall_callvm_mips.h +1 -1
  66. data/dyncall/dyncall/dyncall_callvm_mips_eabi.c +30 -27
  67. data/dyncall/dyncall/dyncall_callvm_mips_eabi.h +1 -5
  68. data/dyncall/dyncall/dyncall_callvm_mips_n32.c +24 -30
  69. data/dyncall/dyncall/{dyncall_call_sparc_v9.h → dyncall_callvm_mips_n32.h} +18 -8
  70. data/dyncall/dyncall/dyncall_callvm_mips_n64.c +23 -30
  71. data/dyncall/dyncall/dyncall_callvm_mips_n64.h +4 -6
  72. data/dyncall/dyncall/dyncall_callvm_mips_o32.c +31 -29
  73. data/dyncall/dyncall/dyncall_callvm_mips_o32.h +1 -3
  74. data/dyncall/dyncall/dyncall_callvm_ppc32.c +22 -20
  75. data/dyncall/dyncall/dyncall_callvm_ppc32.h +1 -3
  76. data/dyncall/dyncall/dyncall_callvm_ppc64.c +54 -15
  77. data/dyncall/dyncall/dyncall_callvm_ppc64.h +0 -2
  78. data/dyncall/dyncall/dyncall_callvm_sparc.c +34 -26
  79. data/dyncall/dyncall/dyncall_callvm_sparc.h +1 -3
  80. data/dyncall/dyncall/dyncall_callvm_sparc64.c +94 -150
  81. data/dyncall/dyncall/dyncall_callvm_sparc64.h +11 -17
  82. data/dyncall/dyncall/dyncall_callvm_x64.c +37 -36
  83. data/dyncall/dyncall/dyncall_callvm_x64.h +1 -4
  84. data/dyncall/dyncall/dyncall_callvm_x86.c +22 -63
  85. data/dyncall/dyncall/dyncall_callvm_x86.h +1 -17
  86. data/dyncall/dyncall/dyncall_config.h +1 -1
  87. data/dyncall/dyncall/dyncall_macros.h +28 -19
  88. data/dyncall/dyncall/dyncall_signature.h +1 -1
  89. data/dyncall/dyncall/dyncall_types.h +17 -18
  90. data/dyncall/dyncall/dyncall_utils.h +1 -1
  91. data/dyncall/dyncall/dyncall_value.h +28 -21
  92. data/dyncall/dyncall/dyncall_vector.c +1 -1
  93. data/dyncall/dyncall/dyncall_vector.h +1 -1
  94. data/dyncall/dyncall/gen-masm.sh +2 -2
  95. data/dyncall/dyncallback/CMakeLists.txt +1 -2
  96. data/dyncall/dyncallback/Makefile.generic +1 -1
  97. data/dyncall/dyncallback/dyncall_alloc_wx.c +1 -1
  98. data/dyncall/dyncallback/dyncall_alloc_wx.h +4 -3
  99. data/dyncall/dyncallback/dyncall_alloc_wx_malloc.c +8 -2
  100. data/dyncall/dyncallback/dyncall_alloc_wx_mmap.c +67 -4
  101. data/dyncall/dyncallback/dyncall_alloc_wx_win32.c +7 -2
  102. data/dyncall/dyncallback/dyncall_args.c +19 -15
  103. data/dyncall/dyncallback/dyncall_args.h +1 -1
  104. data/dyncall/dyncallback/{dyncall_args_arm32_arm.c → dyncall_args_arm32.c} +4 -4
  105. data/dyncall/dyncallback/{dyncall_args_arm32_arm.h → dyncall_args_arm32.h} +6 -6
  106. data/dyncall/dyncallback/dyncall_args_arm64.c +2 -2
  107. data/dyncall/dyncallback/dyncall_args_arm64_apple.c +2 -2
  108. data/dyncall/dyncallback/dyncall_args_mips.c +26 -21
  109. data/dyncall/dyncallback/dyncall_args_mips.h +18 -6
  110. data/dyncall/dyncallback/dyncall_args_mips64.c +81 -0
  111. data/dyncall/dyncallback/dyncall_args_mips_o32.c +104 -0
  112. data/dyncall/dyncallback/dyncall_args_ppc32.c +2 -2
  113. data/dyncall/dyncallback/dyncall_args_ppc32.h +1 -1
  114. data/dyncall/dyncallback/dyncall_args_ppc32_sysv.c +1 -1
  115. data/dyncall/dyncallback/dyncall_args_ppc64.c +24 -3
  116. data/dyncall/dyncallback/dyncall_args_sparc32.c +41 -15
  117. data/dyncall/dyncallback/dyncall_args_sparc32.h +2 -2
  118. data/dyncall/dyncallback/dyncall_args_sparc64.c +28 -15
  119. data/dyncall/dyncallback/dyncall_args_sparc64.h +7 -3
  120. data/dyncall/dyncallback/dyncall_args_x64.c +1 -1
  121. data/dyncall/dyncallback/dyncall_args_x64.h +1 -1
  122. data/dyncall/dyncallback/dyncall_args_x86.c +1 -1
  123. data/dyncall/dyncallback/dyncall_args_x86.h +1 -1
  124. data/dyncall/dyncallback/dyncall_callback.c +10 -12
  125. data/dyncall/dyncallback/dyncall_callback.h +2 -4
  126. data/dyncall/dyncallback/dyncall_callback_arch.S +12 -2
  127. data/dyncall/dyncallback/{dyncall_callback_arm32_arm.c → dyncall_callback_arm32.c} +25 -10
  128. data/dyncall/dyncallback/dyncall_callback_arm32_arm_apple.s +7 -7
  129. data/dyncall/dyncallback/dyncall_callback_arm32_arm_gas.S +9 -9
  130. data/dyncall/dyncallback/dyncall_callback_arm32_thumb_apple.S +1 -1
  131. data/dyncall/dyncallback/dyncall_callback_arm32_thumb_gas.S +1 -1
  132. data/dyncall/dyncallback/dyncall_callback_arm64.S +2 -2
  133. data/dyncall/dyncallback/dyncall_callback_arm64.c +20 -14
  134. data/dyncall/dyncallback/dyncall_callback_mips.c +26 -9
  135. data/dyncall/dyncallback/dyncall_callback_mips_eabi_gas.s +99 -0
  136. data/dyncall/dyncallback/{dyncall_args_arm32_thumb.h → dyncall_callback_mips_gas.S} +14 -9
  137. data/dyncall/dyncallback/{dyncall_callback_arm32_thumb.c → dyncall_callback_mips_n32_gas.s} +12 -7
  138. data/dyncall/dyncallback/dyncall_callback_mips_n64_gas.s +98 -0
  139. data/dyncall/dyncallback/dyncall_callback_mips_o32_gas.s +100 -0
  140. data/dyncall/dyncallback/dyncall_callback_ppc32.S +54 -54
  141. data/dyncall/dyncallback/dyncall_callback_ppc32.c +23 -5
  142. data/dyncall/dyncallback/dyncall_callback_ppc32_apple.s +92 -117
  143. data/dyncall/dyncallback/dyncall_callback_ppc64.S +2 -2
  144. data/dyncall/dyncallback/dyncall_callback_ppc64.c +23 -5
  145. data/dyncall/dyncallback/dyncall_callback_sparc32.c +25 -7
  146. data/dyncall/dyncallback/dyncall_callback_sparc32.s +55 -4
  147. data/dyncall/dyncallback/dyncall_callback_sparc64.c +25 -7
  148. data/dyncall/dyncallback/dyncall_callback_sparc64.s +89 -5
  149. data/dyncall/dyncallback/dyncall_callback_x64.S +8 -8
  150. data/dyncall/dyncallback/dyncall_callback_x64.c +19 -6
  151. data/dyncall/dyncallback/dyncall_callback_x86.S +29 -25
  152. data/dyncall/dyncallback/dyncall_callback_x86.c +24 -11
  153. data/dyncall/dyncallback/dyncall_thunk.c +6 -6
  154. data/dyncall/dyncallback/dyncall_thunk.h +9 -7
  155. data/dyncall/dyncallback/{dyncall_thunk_arm32_arm.c → dyncall_thunk_arm32.c} +5 -3
  156. data/dyncall/dyncallback/{dyncall_thunk_arm32_arm.h → dyncall_thunk_arm32.h} +7 -7
  157. data/dyncall/dyncallback/dyncall_thunk_arm64.c +2 -2
  158. data/dyncall/dyncallback/dyncall_thunk_arm64.h +8 -13
  159. data/dyncall/dyncallback/dyncall_thunk_mips.c +16 -20
  160. data/dyncall/dyncallback/dyncall_thunk_mips.h +4 -2
  161. data/dyncall/dyncallback/dyncall_thunk_mips64.c +103 -0
  162. data/dyncall/dyncallback/{dyncall_callback_arm32_thumb.h → dyncall_thunk_mips64.h} +15 -8
  163. data/dyncall/dyncallback/dyncall_thunk_ppc32.c +4 -4
  164. data/dyncall/dyncallback/dyncall_thunk_ppc32.h +1 -1
  165. data/dyncall/dyncallback/dyncall_thunk_ppc32_sysv.c +9 -9
  166. data/dyncall/dyncallback/dyncall_thunk_ppc64.c +2 -2
  167. data/dyncall/dyncallback/dyncall_thunk_sparc32.c +19 -2
  168. data/dyncall/dyncallback/dyncall_thunk_sparc32.h +5 -4
  169. data/dyncall/dyncallback/dyncall_thunk_sparc64.c +42 -2
  170. data/dyncall/dyncallback/dyncall_thunk_sparc64.h +5 -5
  171. data/dyncall/dyncallback/dyncall_thunk_x64.c +1 -1
  172. data/dyncall/dyncallback/dyncall_thunk_x64.h +2 -2
  173. data/dyncall/dyncallback/dyncall_thunk_x86.c +1 -1
  174. data/dyncall/dyncallback/dyncall_thunk_x86.h +2 -2
  175. data/dyncall/dyncallback/dyncallback.3 +16 -11
  176. data/dyncall/dynload/dynload.3 +63 -8
  177. data/dyncall/dynload/dynload.c +2 -8
  178. data/dyncall/dynload/dynload.h +9 -5
  179. data/dyncall/dynload/dynload_alloc.h +1 -1
  180. data/dyncall/dynload/dynload_syms.c +1 -3
  181. data/dyncall/dynload/dynload_syms_elf.c +19 -11
  182. data/dyncall/dynload/dynload_syms_mach-o.c +151 -75
  183. data/dyncall/dynload/dynload_syms_pe.c +24 -24
  184. data/dyncall/dynload/dynload_unix.c +156 -13
  185. data/dyncall/dynload/dynload_windows.c +15 -11
  186. data/dyncall/portasm/portasm-arm.S +1 -1
  187. data/dyncall/portasm/portasm-ppc.S +1 -1
  188. data/dyncall/portasm/{portasm-x64-att.S → portasm-x64.S} +7 -4
  189. data/dyncall/portasm/portasm-x86.S +4 -2
  190. data/{dyncall-bindings/ruby/rbdc/extconf.rb → extconf.rb} +4 -4
  191. data/{dyncall-bindings/ruby/rbdc/rbdc.c → rbdc.c} +5 -5
  192. metadata +24 -48
  193. data/dyncall/Makefile.M +0 -15
  194. data/dyncall/buildsys/dynmake/Makefile.base.M +0 -82
  195. data/dyncall/buildsys/dynmake/dynmake.bat +0 -2
  196. data/dyncall/buildsys/dynmake/dynmake.sh +0 -4
  197. data/dyncall/dynMakefile +0 -4
  198. data/dyncall/dyncall/Makefile.M +0 -10
  199. data/dyncall/dyncall/TODO +0 -9
  200. data/dyncall/dyncall/dynMakefile +0 -4
  201. data/dyncall/dyncall/dyncall_call_sparc64.S +0 -362
  202. data/dyncall/dyncall/dyncall_call_sparc_v9.S +0 -222
  203. data/dyncall/dyncall/dyncall_call_x64-att.S +0 -147
  204. data/dyncall/dyncall/dyncall_callvm_sparc_v9.c +0 -182
  205. data/dyncall/dyncall/dyncall_callvm_sparc_v9.h +0 -46
  206. data/dyncall/dyncallback/Makefile.M +0 -10
  207. data/dyncall/dyncallback/README.txt +0 -9
  208. data/dyncall/dyncallback/TODO +0 -4
  209. data/dyncall/dyncallback/dynMakefile +0 -4
  210. data/dyncall/dyncallback/dyncall_args_arm32_thumb.c +0 -30
  211. data/dyncall/dyncallback/dyncall_callback_arm32_arm.h +0 -46
  212. data/dyncall/dyncallback/dyncall_callback_mips.h +0 -43
  213. data/dyncall/dyncallback/dyncall_callback_ppc32.h +0 -43
  214. data/dyncall/dyncallback/dyncall_callback_ppc64.h +0 -56
  215. data/dyncall/dyncallback/dyncall_callback_sparc32.h +0 -44
  216. data/dyncall/dyncallback/dyncall_callback_x64.h +0 -45
  217. data/dyncall/dyncallback/dyncall_callback_x86.h +0 -50
  218. data/dyncall/dyncallback/dyncall_thunk_arm32_thumb.c +0 -30
  219. data/dyncall/dyncallback/dyncall_thunk_arm32_thumb.h +0 -36
  220. data/dyncall/dynload/Makefile.M +0 -10
  221. data/dyncall/dynload/TODO +0 -20
  222. data/dyncall/dynload/dynMakefile +0 -4
  223. data/dyncall/dynload/dynload_darwin.c +0 -90
@@ -59,6 +59,7 @@ ABI:
59
59
  OSFAMILY:
60
60
  Windows
61
61
  Unix
62
+ GameConsole
62
63
 
63
64
  CC:
64
65
  INTEL
@@ -6,7 +6,7 @@
6
6
  Description:
7
7
  License:
8
8
 
9
- Copyright (c) 2011-2015 Daniel Adler <dadler@uni-goettingen.de>,
9
+ Copyright (c) 2011-2018 Daniel Adler <dadler@uni-goettingen.de>,
10
10
  Tassilo Philipp <tphilipp@potion-studios.com>
11
11
 
12
12
  Permission to use, copy, modify, and distribute this software for any
@@ -32,13 +32,15 @@
32
32
  #define ABI_PE
33
33
  #elif defined(OS_Darwin)
34
34
  #define ABI_Mach
35
- #else
35
+ #elif !defined(OS_Minix) || defined(__ELF__) /* Minix >= 3.2 (2012) uses ELF */
36
36
  #define ABI_ELF
37
37
  # if defined(__LP64__) || defined(_LP64)
38
38
  # define ABI_ELF64
39
39
  # else
40
40
  # define ABI_ELF32
41
41
  # endif
42
+ #else
43
+ #define ABI_Unknown
42
44
  #endif
43
45
 
44
46
  #endif /* AUTOVAR_ABI_H */
@@ -6,7 +6,7 @@
6
6
  Description:
7
7
  License:
8
8
 
9
- Copyright (c) 2011-2015 Daniel Adler <dadler@uni-goettingen.de>,
9
+ Copyright (c) 2011-2018 Daniel Adler <dadler@uni-goettingen.de>,
10
10
  Tassilo Philipp <tphilipp@potion-studios.com>
11
11
 
12
12
  Permission to use, copy, modify, and distribute this software for any
@@ -48,12 +48,16 @@
48
48
  # if defined(__thumb__)
49
49
  # define ARCH_THUMB
50
50
  # endif
51
+ #elif defined(__aarch64__)
52
+ # define ARCH_ARM64
51
53
  #elif defined(__sh__)
52
54
  # define ARCH_SH
53
- #elif defined(__sparcv9) || defined(__sparc64__) || ( defined(__sparc) && defined(__arch64__) )
54
- # define ARCH_SPARC64
55
- #elif defined(__sparc)
56
- # define ARCH_SPARC
55
+ #elif defined(__sparc) || defined(__sparc__)
56
+ # if defined(__sparcv9) || defined(__sparc_v9__) || defined(__sparc64__) || defined(__arch64__)
57
+ # define ARCH_SPARC64
58
+ # else
59
+ # define ARCH_SPARC
60
+ # endif
57
61
  #endif
58
62
 
59
63
  #endif /* AUTOVAR_ARCH_H */
@@ -6,7 +6,7 @@
6
6
  Description:
7
7
  License:
8
8
 
9
- Copyright (c) 2011-2015 Daniel Adler <dadler@uni-goettingen.de>,
9
+ Copyright (c) 2011-2018 Daniel Adler <dadler@uni-goettingen.de>,
10
10
  Tassilo Philipp <tphilipp@potion-studios.com>
11
11
 
12
12
  Permission to use, copy, modify, and distribute this software for any
@@ -33,6 +33,8 @@
33
33
  #define CC_INTEL
34
34
  #elif defined(_MSC_VER)
35
35
  #define CC_MSVC
36
+ #elif defined(__clang__) || defined(__llvm__)
37
+ #define CC_CLANG
36
38
  #elif defined(__GNUC__)
37
39
  #define CC_GNU
38
40
  #elif defined(__WATCOMC__)
@@ -6,7 +6,7 @@
6
6
  Description:
7
7
  License:
8
8
 
9
- Copyright (c) 2011-2015 Daniel Adler <dadler@uni-goettingen.de>,
9
+ Copyright (c) 2011-2018 Daniel Adler <dadler@uni-goettingen.de>,
10
10
  Tassilo Philipp <tphilipp@potion-studios.com>
11
11
 
12
12
  Permission to use, copy, modify, and distribute this software for any
@@ -39,7 +39,7 @@
39
39
  # endif
40
40
  #elif defined(__linux__) || defined(__linux) || defined(__gnu_linux__)
41
41
  # define OS_Linux
42
- #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
42
+ #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) /* latter is (also) used by systems using FreeBSD kernel, e.g. Debian/kFreeBSD, which could be detected specifically by also checking for __GLIBC__ */
43
43
  # define OS_FreeBSD
44
44
  #elif defined(__OpenBSD__)
45
45
  # define OS_OpenBSD
@@ -6,7 +6,7 @@
6
6
  Description:
7
7
  License:
8
8
 
9
- Copyright (c) 2011-2015 Daniel Adler <dadler@uni-goettingen.de>,
9
+ Copyright (c) 2011-2018 Daniel Adler <dadler@uni-goettingen.de>,
10
10
  Tassilo Philipp <tphilipp@potion-studios.com>
11
11
 
12
12
  Permission to use, copy, modify, and distribute this software for any
@@ -1,23 +1,6 @@
1
1
  #!/bin/sh
2
- C=Makefile.config
3
-
4
- # get full path
5
- case $0 in
6
- /*)
7
- FULL=$0
8
- ;;
9
- *)
10
- FULL=$PWD/$0
11
- ;;
12
- esac
13
2
 
14
- printf "# auto-generated by $0\n" >$C
15
- while [ $# -gt 0 ]; do
16
- X=$1
17
- shift 1
18
- # Shell common:
19
- case $X in
20
- --help|-h|-?)
3
+ usage() {
21
4
  cat <<EOF
22
5
  usage: $0 --<option>=<value> <var>=<value> ..
23
6
 
@@ -32,6 +15,24 @@ usage: $0 --<option>=<value> <var>=<value> ..
32
15
  Useful variables CC, CXX, CFLAGS, CXXFLAGS, etc..
33
16
 
34
17
  EOF
18
+ }
19
+
20
+ C=Makefile.config
21
+
22
+ # get full path to this file (portable way), and set where to build
23
+ SRCTOP="`cd \`dirname "$0"\` && pwd`"
24
+ BLDTOP="$PWD"
25
+
26
+
27
+ printf "# auto-generated by $0\n" >$C
28
+
29
+ while [ $# -gt 0 ]; do
30
+ X=$1
31
+ shift 1
32
+ case $X in
33
+ # Shell common:
34
+ --help|-h|-?)
35
+ usage
35
36
  exit 1
36
37
  ;;
37
38
  # GNU Compatibility:
@@ -61,18 +62,28 @@ EOF
61
62
  ;;
62
63
  esac
63
64
  done
65
+
64
66
  printf "PREFIX=${PREFIX:=/usr/local}\n" >>$C
67
+
65
68
  case ${TARGET:=`uname`} in
66
- Linux)
69
+ Linux|GNU/kFreeBSD)
67
70
  if [ -z "${CFLAGS}" ]; then
68
71
  printf "CFLAGS=-fPIC\n" >>$C
69
72
  fi
70
73
  printf "LDLIBS=-lm -ldl\n" >>$C
71
74
  ;;
72
75
  OpenBSD)
76
+ if [ -z "${CFLAGS}" ]; then
77
+ # dl_iterate_phdr() got introduced in 3.7, so for older versions force DL_DLADDR_TO_LIBPATH
78
+ if (uname -r | grep '^\([0-2]\.\|3\.[0-6]\)' > /dev/null); then
79
+ printf "CFLAGS=-fPIC -DDL_DLADDR_TO_LIBPATH\n" >>$C
80
+ else
81
+ printf "CFLAGS=-fPIC\n" >>$C
82
+ fi
83
+ fi
73
84
  printf "LDLIBS=-lm\n" >>$C
74
85
  ;;
75
- DragonFly|NetBSD)
86
+ NetBSD|DragonFly)
76
87
  if [ -z "${CFLAGS}" ]; then
77
88
  printf "CFLAGS=-fPIC\n" >>$C
78
89
  fi
@@ -85,12 +96,6 @@ case ${TARGET:=`uname`} in
85
96
  printf "LDLIBS=-lm\n" >>$C
86
97
  printf "RM=rm -f\n" >>$C
87
98
  ;;
88
- GNU/kFreeBSD)
89
- if [ -z "${CFLAGS}" ]; then
90
- printf "CFLAGS=-fPIC\n" >>$C
91
- fi
92
- printf "LDLIBS=-lm -ldl\n" >>$C
93
- ;;
94
99
  MacOSX|Darwin)
95
100
  # if Apple's libtool (not to be confused with GNU's) is available, which is according to libtool(1) "with -static [...] intended
96
101
  # to replace ar(5) and ranlib", use it - if it is shadowed by some install of GNU's libtool assume that a foreign environment is
@@ -115,10 +120,7 @@ case ${TARGET:=`uname`} in
115
120
  10.6.*)
116
121
  ARCHS="-arch i386 -arch x86_64"
117
122
  ;;
118
- 10.10.*)
119
- ARCHS="-arch x86_64 -arch i386"
120
- ;;
121
- 10.[789].*)
123
+ 10.[789].*|10.1?.*|10.1?)
122
124
  ARCHS="-arch x86_64 -arch i386"
123
125
  ;;
124
126
  esac
@@ -168,10 +170,10 @@ case ${TARGET:=`uname`} in
168
170
  ;;
169
171
  SunOS)
170
172
  # open distributions often don't come with default cc and CC, check for common alternatives.
171
- printf "CC=` (which cc || which gcc || which clang ) | grep -v '^no '`\n" >>$C
172
- printf "CXX=`(which CC || which g++ || which clang++) | grep -v '^no '`\n" >>$C # C++ compiler traditionally named CC
173
- printf "CCC=${CXX}\n" >>$C # Sun make's rules use CCC for c++ compiler
174
- printf "LDLIBS=-lm\n" >>$C
173
+ printf "CC=` (which cc gcc clang ) | grep -v '^no ' | head -1`\n" >>$C
174
+ printf "CXX=`(which CC g++ clang++) | grep -v '^no ' | head -1`\n" >>$C # C++ compiler traditionally named CC
175
+ printf "CCC=\${CXX}\n" >>$C # Sun make's rules use CCC for c++ compiler
176
+ printf "LDLIBS=-lm -ldl\n" >>$C
175
177
  ;;
176
178
  Minix)
177
179
  printf "CC=gcc\n" >>$C
@@ -187,9 +189,9 @@ case ${TARGET:=`uname`} in
187
189
  printf "CXXFLAGS=-I${SDKROOT}/include/\n" >>$C
188
190
  # Pulling in dyncall libs below is a hack, for some reason psp-ld is super-picky about order.
189
191
  # Use your C lib of choice, from the PSPSDK, or...
190
- #printf "LDLIBS=-L${SDKROOT}/lib/ -L`dirname ${FULL}`/dyncall -L`dirname ${FULL}`/dyncallback -ldyncall_s -ldyncallback_s -lm -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lstdc++ -lpsplibc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser \n" >>$C
192
+ #printf "LDLIBS=-L${SDKROOT}/lib/ -L${SRCTOP}/dyncall -L${SRCTOP}/dyncallback -ldyncall_s -ldyncallback_s -lm -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lstdc++ -lpsplibc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser \n" >>$C
191
193
  # ... newlib.
192
- printf "LDLIBS=-L${SDKROOT}/lib/ -L`dirname ${FULL}`/dyncall -L`dirname ${FULL}`/dyncallback -ldyncall_s -ldyncallback_s -lm -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lstdc++ -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser \n" >>$C
194
+ printf "LDLIBS=-L${SDKROOT}/lib/ -L${SRCTOP}/dyncall -L${SRCTOP}/dyncallback -ldyncall_s -ldyncallback_s -lm -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lstdc++ -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser \n" >>$C
193
195
  ;;
194
196
  ?)
195
197
  cat $0 | awk '/^esac$/{b=0}/^ [A-Za-z0-9|]+\)/{if(b==1) print substr($1,1,length($1)-1)}BEGIN{b=0}/^case.*TARGET.*uname.*in$/{b=1}' | tr '|' '\n'
@@ -197,8 +199,59 @@ case ${TARGET:=`uname`} in
197
199
  ;;
198
200
  esac
199
201
 
200
- BLDTOP="$PWD"
201
- SRCTOP=`dirname ${FULL}`
202
+
203
+ # removed, b/c platform support not consistent and ELF flags checked often not having any result
204
+ #
205
+ ## Assure objects not asking for an execstack (or binary that links dyncall might end
206
+ ## up with one, for no reason).
207
+ #
208
+ ## .s.o/.S.o rules often use ${CC} which then invokes the tools needed. GCC and
209
+ ## others might (annoyingly) assume that an executable stack may be required for
210
+ ## those sources, if not told explicitly that it isn't.
211
+ ## Neither specifying this per source (e.g. via .section .note.GNU-stack,"",...), nor
212
+ ## per toolchain flags (e.g. as' --noexecstack) turned out to be portable across our
213
+ ## supported platforms, toolchains, and different versions of the latter (some even
214
+ ## producing the opposite result).
215
+ ## Find needed build flags by running a few tests; use default if none result in "rw-".
216
+ #
217
+ #RWXTESTPREFIX="rwxtest" # @@@ put this maybe all in Makefile.generic? out of source builds?
218
+ #for s in S s ; do (
219
+ # cd "$BLDTOP"
220
+ # # asm test file, with main and _main for portability.
221
+ # (echo '.text';(echo '.globl main';echo 'main:') | sed 'p;s/m/_m/') > $RWXTESTPREFIX.$s
222
+ #
223
+ # # Check var to be used, which depends on inference rules of this platform. E.g. ASFLAGS is only common on GNU, and
224
+ # # on some other platforms only CFLAGS is the only one used, others use AFLAGS with cc and thus need -Wa,... Check
225
+ # # makes use of the config written so far, so use '+=' to not overwrite vars.
226
+ # for f in "" "ASFLAGS+=-Wa,--noexecstack" "ACFLAGS+=-Wa,--noexecstack" "AFLAGS+=--noexecstack" "AFLAGS+=-Wa,--noexecstack" "CFLAGS+=-Wa,--noexecstack"; do
227
+ # # dummy makefile triggering inference rules, reflecting dyncall's build
228
+ # make -f - <<MAKEFILE
229
+ #include $C
230
+ #$f
231
+ ## Force dependency via .o, to avoid .[sS].out rules that might be set - also set command as not all platforms set .o.out
232
+ #$RWXTESTPREFIX.out: $RWXTESTPREFIX.o
233
+ # \${CC} \${CFLAGS} \${LDFLAGS} $RWXTESTPREFIX.o \${LDLIBS} -o $RWXTESTPREFIX.out
234
+ #MAKEFILE
235
+ #
236
+ # # Check what stack of a built test binary would result in.
237
+ ## @@@ add xxd hexdump based versions for when objdump is not available; also check for those if we deal with ELF files
238
+ ## @@@ maybe also limit to ELF files
239
+ # STACKFLAGS=`(which objdump && objdump -p $RWXTESTPREFIX.out) | sed -e '/STACK/bx' -e 'd' -e ':x' -e 'N' -e 's/^.*flags[ \t]\([^ \t]*\).*/\1/'`
240
+ # rm $RWXTESTPREFIX.out $RWXTESTPREFIX.o
241
+ # if [ "$STACKFLAGS" = "rw-" ]; then
242
+ # printf "$f\n"
243
+ # break
244
+ # fi
245
+ #
246
+ # done
247
+ #
248
+ # rm $RWXTESTPREFIX.$s
249
+ #
250
+ #) done 2>&1 | grep '^[ASC]\+FLAGS.*noexecstack$' | uniq >>$C
251
+
252
+
253
+
254
+ # Generate all makefiles needed
202
255
 
203
256
  FILES=`( cd $SRCTOP ; find . -name "Makefile.generic" )`
204
257
  for FILE in $FILES ; do
@@ -213,3 +266,6 @@ include $BLDTOP/Makefile.config
213
266
  include \${VPATH}/Makefile.generic
214
267
  EOF
215
268
  done
269
+
270
+ echo "Configuration written to $C"
271
+
@@ -15,8 +15,6 @@
15
15
  .\"
16
16
  .Dd $Mdocdate$
17
17
  .Dt dyncall 3
18
- .Os
19
-
20
18
  .Sh NAME
21
19
  .Nm dyncall
22
20
  .Nd encapsulation of architecture-, OS- and compiler-specific function call
@@ -189,13 +187,19 @@ library, this function would be called as follows:
189
187
  r = dcCallDouble(vm, (DCpointer)&sqrt);
190
188
  dcFree(vm);
191
189
  .Ed
190
+ .Sh CONFORMING TO
191
+ The dyncall library needs at least a c99 compiler with additional support for
192
+ anonymous structs/unions (which were introduced officially in c11). Given that
193
+ those are generally supported by pretty much all major c99 conforming compilers
194
+ (as default extension), it should build fine with a c99 toolchain. Strictly
195
+ speaking, dyncall conforms to c11, though.
196
+ .Ed
192
197
  .Sh SEE ALSO
193
198
  .Xr dyncallback 3 ,
194
199
  .Xr dynload 3
195
200
  and the
196
201
  .Nm
197
- manual (available in PDF format) for a way more detailed documentation of this
198
- library.
202
+ manual (available in HTML and PDF format) for more information.
199
203
  .Sh AUTHORS
200
204
  .An "Daniel Adler" Aq dadler@uni-goettingen.de
201
205
  .An "Tassilo Philipp" Aq tphilipp@potion-studios.com
@@ -6,7 +6,7 @@
6
6
  Description: public header for library dyncall
7
7
  License:
8
8
 
9
- Copyright (c) 2007-2015 Daniel Adler <dadler@uni-goettingen.de>,
9
+ Copyright (c) 2007-2018 Daniel Adler <dadler@uni-goettingen.de>,
10
10
  Tassilo Philipp <tphilipp@potion-studios.com>
11
11
 
12
12
  Permission to use, copy, modify, and distribute this software for any
@@ -6,7 +6,7 @@
6
6
  Description: heap memory management interface (header only)
7
7
  License:
8
8
 
9
- Copyright (c) 2007-2015 Daniel Adler <dadler@uni-goettingen.de>,
9
+ Copyright (c) 2007-2018 Daniel Adler <dadler@uni-goettingen.de>,
10
10
  Tassilo Philipp <tphilipp@potion-studios.com>
11
11
 
12
12
  Permission to use, copy, modify, and distribute this software for any
@@ -6,7 +6,7 @@
6
6
  Description: C interface to call vm
7
7
  License:
8
8
 
9
- Copyright (c) 2007-2015 Daniel Adler <dadler@uni-goettingen.de>,
9
+ Copyright (c) 2007-2018 Daniel Adler <dadler@uni-goettingen.de>,
10
10
  Tassilo Philipp <tphilipp@potion-studios.com>
11
11
 
12
12
  Permission to use, copy, modify, and distribute this software for any
@@ -157,6 +157,7 @@ DCint dcGetError(DCCallVM *vm)
157
157
  return vm->mError;
158
158
  }
159
159
 
160
+ /*@@@ not used, (re)introduce or cleanup
160
161
  const char* dcGetErrorString(int mode)
161
162
  {
162
163
  switch(mode) {
@@ -165,4 +166,5 @@ const char* dcGetErrorString(int mode)
165
166
  default: return "(unknown mode id)";
166
167
  }
167
168
  }
169
+ */
168
170
 
@@ -6,7 +6,7 @@
6
6
  Description: assembly call kernel, auto-selected by gcc / Plan9 build system
7
7
  License:
8
8
 
9
- Copyright (c) 2007-2015 Daniel Adler <dadler@uni-goettingen.de>,
9
+ Copyright (c) 2007-2018 Daniel Adler <dadler@uni-goettingen.de>,
10
10
  Tassilo Philipp <tphilipp@potion-studios.com>
11
11
 
12
12
  Permission to use, copy, modify, and distribute this software for any
@@ -43,7 +43,7 @@
43
43
  # if defined(DC__Arch_Intel_x86)
44
44
  # include "dyncall_call_x86.S"
45
45
  # elif defined(DC__Arch_AMD64)
46
- # include "dyncall_call_x64-att.S"
46
+ # include "dyncall_call_x64.S"
47
47
  # elif defined(DC__Arch_ARM_ARM)
48
48
  # if defined(DC__ABI_ARM_HF)
49
49
  # include "dyncall_call_arm32_arm_armhf.S"
@@ -68,12 +68,20 @@
68
68
  # include "dyncall_call_ppc64.S"
69
69
  # elif defined(DC__Arch_MIPS) || defined(DC__Arch_MIPS64)
70
70
  # include "dyncall_call_mips_gas.S"
71
- # elif defined(DC__Arch_Sparcv9)
72
- # include "dyncall_call_sparc_v9.S"
71
+ # elif defined(DC__Arch_Sparc64)
72
+ # include "dyncall_call_sparc64.s"
73
73
  # elif defined(DC__Arch_Sparc)
74
- # include "dyncall_call_sparc.S"
74
+ # include "dyncall_call_sparc.s"
75
75
  # else
76
76
  # error Unsupported Architecture.
77
77
  # endif
78
78
  #endif
79
79
 
80
+
81
+ /* Use .note.GNU-stack to explicitly indicate a non-exec stack, b/c of bad */
82
+ /* default behaviour when translating handwritten assembly files (needed on */
83
+ /* GNU platforms, Android and FreeBSD, as tests have shown). */
84
+ #if (defined(DC__C_CLANG) || defined(DC__C_GNU)) && defined(__ELF__) && (defined(DC__OS_Linux) || defined(DC__OS_FreeBSD))
85
+ .section .note.GNU-stack,"",%progbits
86
+ #endif
87
+
@@ -6,7 +6,7 @@
6
6
  Description: Call Kernel for ARM 32-bit ARM Architecture
7
7
  License:
8
8
 
9
- Copyright (c) 2007-2015 Daniel Adler <dadler@uni-goettingen.de>,
9
+ Copyright (c) 2007-2018 Daniel Adler <dadler@uni-goettingen.de>,
10
10
  Tassilo Philipp <tphilipp@potion-studios.com>
11
11
 
12
12
  Permission to use, copy, modify, and distribute this software for any
@@ -34,7 +34,6 @@
34
34
  dcCall_arm32_arm(DCpointer target, DCpointer argv, DCsize size);
35
35
 
36
36
  This Call Kernel works across multiple OS.
37
- It has been tested on Nintendo DS, Linux and Darwin(iOS).
38
37
 
39
38
  */
40
39
 
@@ -6,7 +6,7 @@
6
6
  Description:
7
7
  License:
8
8
 
9
- Copyright (c) 2007-2015 Daniel Adler <dadler@uni-goettingen.de>,
9
+ Copyright (c) 2007-2018 Daniel Adler <dadler@uni-goettingen.de>,
10
10
  Tassilo Philipp <tphilipp@potion-studios.com>
11
11
 
12
12
  Permission to use, copy, modify, and distribute this software for any