rbdc 0.8.7 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (215) hide show
  1. checksums.yaml +7 -0
  2. data/{bindings → dyncall-bindings}/ruby/rbdc/extconf.rb +1 -1
  3. data/{bindings → dyncall-bindings}/ruby/rbdc/rbdc.c +3 -1
  4. data/dyncall/AUTHORS +2 -0
  5. data/dyncall/BUGS +1 -0
  6. data/dyncall/CMakeLists.txt +10 -2
  7. data/dyncall/ChangeLog +46 -11
  8. data/dyncall/LICENSE +4 -1
  9. data/dyncall/Makefile.embedded +7 -3
  10. data/dyncall/README +23 -14
  11. data/dyncall/ToDo +27 -28
  12. data/dyncall/autovar/autovar_ABI.h +3 -2
  13. data/dyncall/autovar/autovar_ARCH.h +13 -10
  14. data/dyncall/autovar/autovar_CC.h +3 -2
  15. data/dyncall/autovar/autovar_OS.h +3 -2
  16. data/dyncall/autovar/autovar_OSFAMILY.h +3 -2
  17. data/dyncall/buildsys/scripts/batch-build-linux.sh +6 -2
  18. data/dyncall/buildsys/scripts/batch-build-minix.sh +2 -0
  19. data/dyncall/buildsys/scripts/batch-build-psp.sh +4 -1
  20. data/dyncall/buildsys/scripts/elf-to-psp-eboot.sh +19 -0
  21. data/dyncall/buildsys/scripts/setenv-cross-ios.sh +0 -0
  22. data/dyncall/buildsys/scripts/setenv-sdk-ios.sh +0 -0
  23. data/dyncall/configure +83 -30
  24. data/dyncall/dyncall/dyncall.3 +16 -4
  25. data/dyncall/dyncall/dyncall.h +9 -1
  26. data/dyncall/dyncall/dyncall_alloc.h +2 -1
  27. data/dyncall/dyncall/dyncall_api.c +2 -1
  28. data/dyncall/dyncall/dyncall_call.S +9 -2
  29. data/dyncall/dyncall/dyncall_call_arm32_arm.S +2 -1
  30. data/dyncall/dyncall/dyncall_call_arm32_arm.h +8 -2
  31. data/dyncall/dyncall/dyncall_call_arm32_arm_armhf.S +11 -19
  32. data/dyncall/dyncall/dyncall_call_arm32_arm_armhf.h +15 -2
  33. data/dyncall/dyncall/dyncall_call_arm32_thumb.h +8 -6
  34. data/dyncall/dyncall/dyncall_call_arm32_thumb_armhf.S +10 -18
  35. data/dyncall/dyncall/dyncall_call_arm32_thumb_gas.s +0 -16
  36. data/dyncall/dyncall/dyncall_call_arm64.S +226 -0
  37. data/dyncall/dyncall/dyncall_call_arm64.h +45 -0
  38. data/dyncall/dyncall/dyncall_call_mips.h +2 -1
  39. data/dyncall/dyncall/dyncall_call_mips_eabi.h +2 -1
  40. data/dyncall/dyncall/dyncall_call_mips_gas.S +2 -1
  41. data/dyncall/dyncall/dyncall_call_mips_n32.h +2 -1
  42. data/dyncall/dyncall/dyncall_call_mips_n64.h +2 -1
  43. data/dyncall/dyncall/dyncall_call_mips_o32.h +2 -1
  44. data/dyncall/dyncall/dyncall_call_ppc32.S +27 -2
  45. data/dyncall/dyncall/dyncall_call_ppc32.h +2 -2
  46. data/dyncall/dyncall/dyncall_call_ppc64.S +210 -0
  47. data/dyncall/dyncall/dyncall_call_ppc64.h +55 -0
  48. data/dyncall/dyncall/dyncall_call_sparc.S +2 -1
  49. data/dyncall/dyncall/dyncall_call_sparc.h +2 -1
  50. data/dyncall/dyncall/dyncall_call_sparc64.S +2 -1
  51. data/dyncall/dyncall/dyncall_call_sparc64.h +2 -1
  52. data/dyncall/dyncall/dyncall_call_sparc_v9.S +25 -23
  53. data/dyncall/dyncall/dyncall_call_sparc_v9.h +2 -1
  54. data/dyncall/dyncall/dyncall_call_x64-att.S +2 -1
  55. data/dyncall/dyncall/dyncall_call_x64.S +2 -1
  56. data/dyncall/dyncall/dyncall_call_x64.h +2 -1
  57. data/dyncall/dyncall/dyncall_call_x86.S +2 -1
  58. data/dyncall/dyncall/dyncall_call_x86.h +2 -1
  59. data/dyncall/dyncall/dyncall_callf.c +56 -66
  60. data/dyncall/dyncall/dyncall_callf.h +5 -1
  61. data/dyncall/dyncall/dyncall_callvm.c +11 -2
  62. data/dyncall/dyncall/dyncall_callvm.h +2 -1
  63. data/dyncall/dyncall/dyncall_callvm_arm32_arm.c +2 -1
  64. data/dyncall/dyncall/dyncall_callvm_arm32_arm.h +2 -1
  65. data/dyncall/dyncall/dyncall_callvm_arm32_arm_armhf.c +60 -30
  66. data/dyncall/dyncall/dyncall_callvm_arm32_arm_armhf.h +3 -2
  67. data/dyncall/dyncall/dyncall_callvm_arm32_thumb.c +2 -24
  68. data/dyncall/dyncall/dyncall_callvm_arm32_thumb.h +2 -1
  69. data/dyncall/dyncall/dyncall_callvm_arm64.c +165 -0
  70. data/dyncall/dyncall/dyncall_callvm_arm64.h +51 -0
  71. data/dyncall/dyncall/dyncall_callvm_arm64_apple.c +272 -0
  72. data/dyncall/dyncall/dyncall_callvm_base.c +2 -1
  73. data/dyncall/dyncall/dyncall_callvm_mips.c +2 -1
  74. data/dyncall/dyncall/dyncall_callvm_mips.h +2 -1
  75. data/dyncall/dyncall/dyncall_callvm_mips_eabi.c +2 -1
  76. data/dyncall/dyncall/dyncall_callvm_mips_eabi.h +2 -1
  77. data/dyncall/dyncall/dyncall_callvm_mips_n32.c +2 -1
  78. data/dyncall/dyncall/dyncall_callvm_mips_n64.c +2 -1
  79. data/dyncall/dyncall/dyncall_callvm_mips_n64.h +2 -1
  80. data/dyncall/dyncall/dyncall_callvm_mips_o32.c +2 -1
  81. data/dyncall/dyncall/dyncall_callvm_mips_o32.h +2 -1
  82. data/dyncall/dyncall/dyncall_callvm_ppc32.c +45 -2
  83. data/dyncall/dyncall/dyncall_callvm_ppc32.h +2 -1
  84. data/dyncall/dyncall/dyncall_callvm_ppc64.c +351 -0
  85. data/dyncall/dyncall/dyncall_callvm_ppc64.h +60 -0
  86. data/dyncall/dyncall/dyncall_callvm_sparc.c +2 -1
  87. data/dyncall/dyncall/dyncall_callvm_sparc.h +2 -1
  88. data/dyncall/dyncall/dyncall_callvm_sparc64.c +2 -2
  89. data/dyncall/dyncall/dyncall_callvm_sparc64.h +2 -1
  90. data/dyncall/dyncall/dyncall_callvm_sparc_v9.c +3 -3
  91. data/dyncall/dyncall/dyncall_callvm_sparc_v9.h +2 -1
  92. data/dyncall/dyncall/dyncall_callvm_x64.c +2 -1
  93. data/dyncall/dyncall/dyncall_callvm_x64.h +2 -1
  94. data/dyncall/dyncall/dyncall_callvm_x86.c +2 -1
  95. data/dyncall/dyncall/dyncall_callvm_x86.h +2 -1
  96. data/dyncall/dyncall/dyncall_config.h +2 -1
  97. data/dyncall/dyncall/dyncall_macros.h +46 -9
  98. data/dyncall/dyncall/dyncall_signature.h +2 -1
  99. data/dyncall/dyncall/dyncall_struct.c +2 -1
  100. data/dyncall/dyncall/dyncall_struct.h +2 -1
  101. data/dyncall/dyncall/dyncall_types.h +2 -1
  102. data/dyncall/dyncall/dyncall_utils.h +2 -1
  103. data/dyncall/dyncall/dyncall_value.h +19 -1
  104. data/dyncall/dyncall/dyncall_vector.c +2 -1
  105. data/dyncall/dyncall/dyncall_vector.h +3 -1
  106. data/dyncall/dyncall/gen-masm.sh +0 -0
  107. data/dyncall/dyncallback/Makefile.generic +1 -1
  108. data/dyncall/dyncallback/dyncall_alloc_wx.c +2 -1
  109. data/dyncall/dyncallback/dyncall_alloc_wx.h +2 -1
  110. data/dyncall/dyncallback/dyncall_alloc_wx_malloc.c +2 -1
  111. data/dyncall/dyncallback/dyncall_alloc_wx_mmap.c +2 -1
  112. data/dyncall/dyncallback/dyncall_alloc_wx_win32.c +2 -1
  113. data/dyncall/dyncallback/dyncall_args.c +22 -10
  114. data/dyncall/dyncallback/dyncall_args.h +2 -1
  115. data/dyncall/dyncallback/dyncall_args_arm32_arm.c +35 -4
  116. data/dyncall/dyncallback/dyncall_args_arm32_arm.h +7 -1
  117. data/dyncall/dyncallback/dyncall_args_arm32_thumb.c +2 -1
  118. data/dyncall/dyncallback/dyncall_args_arm32_thumb.h +2 -1
  119. data/dyncall/dyncallback/dyncall_args_arm64.c +77 -0
  120. data/dyncall/dyncallback/dyncall_args_arm64_apple.c +160 -0
  121. data/dyncall/dyncallback/dyncall_args_mips.c +3 -2
  122. data/dyncall/dyncallback/dyncall_args_mips.h +3 -2
  123. data/dyncall/dyncallback/dyncall_args_ppc32.c +2 -1
  124. data/dyncall/dyncallback/dyncall_args_ppc32.h +9 -7
  125. data/dyncall/dyncallback/dyncall_args_ppc32_sysv.c +95 -0
  126. data/dyncall/dyncallback/dyncall_args_ppc64.c +71 -0
  127. data/dyncall/dyncallback/dyncall_args_ppc64.h +40 -0
  128. data/dyncall/dyncallback/dyncall_args_sparc32.c +2 -1
  129. data/dyncall/dyncallback/dyncall_args_sparc32.h +2 -1
  130. data/dyncall/dyncallback/dyncall_args_sparc64.c +2 -1
  131. data/dyncall/dyncallback/dyncall_args_sparc64.h +2 -1
  132. data/dyncall/dyncallback/dyncall_args_x64.c +2 -1
  133. data/dyncall/dyncallback/dyncall_args_x64.h +2 -1
  134. data/dyncall/dyncallback/dyncall_args_x86.c +2 -1
  135. data/dyncall/dyncallback/dyncall_args_x86.h +2 -1
  136. data/dyncall/dyncallback/dyncall_callback.c +7 -2
  137. data/dyncall/dyncallback/dyncall_callback.h +3 -1
  138. data/dyncall/dyncallback/dyncall_callback_arch.S +14 -6
  139. data/dyncall/dyncallback/dyncall_callback_arm32_arm.c +2 -1
  140. data/dyncall/dyncallback/dyncall_callback_arm32_arm.h +2 -1
  141. data/dyncall/dyncallback/dyncall_callback_arm32_arm_apple.s +1 -1
  142. data/dyncall/dyncallback/{dyncall_callback_arm32_arm_gas.s → dyncall_callback_arm32_arm_gas.S} +17 -7
  143. data/dyncall/dyncallback/dyncall_callback_arm32_thumb.c +2 -1
  144. data/dyncall/dyncallback/dyncall_callback_arm32_thumb.h +2 -1
  145. data/dyncall/dyncallback/{dyncall_callback_arm32_thumb_apple.s → dyncall_callback_arm32_thumb_apple.S} +2 -2
  146. data/dyncall/dyncallback/{dyncall_callback_arm32_thumb_gas.s → dyncall_callback_arm32_thumb_gas.S} +2 -2
  147. data/dyncall/dyncallback/dyncall_callback_arm64.S +111 -0
  148. data/dyncall/dyncallback/dyncall_callback_arm64.c +71 -0
  149. data/dyncall/dyncallback/dyncall_callback_mips.c +3 -2
  150. data/dyncall/dyncallback/dyncall_callback_mips.h +3 -2
  151. data/dyncall/dyncallback/dyncall_callback_ppc32.S +115 -4
  152. data/dyncall/dyncallback/dyncall_callback_ppc32.c +3 -2
  153. data/dyncall/dyncallback/dyncall_callback_ppc32.h +6 -6
  154. data/dyncall/dyncallback/dyncall_callback_ppc32_apple.s +6 -5
  155. data/dyncall/dyncallback/dyncall_callback_ppc64.S +170 -0
  156. data/dyncall/dyncallback/dyncall_callback_ppc64.c +60 -0
  157. data/dyncall/dyncallback/dyncall_callback_ppc64.h +56 -0
  158. data/dyncall/dyncallback/dyncall_callback_sparc32.c +2 -1
  159. data/dyncall/dyncallback/dyncall_callback_sparc32.h +2 -1
  160. data/dyncall/dyncallback/dyncall_callback_sparc32.s +1 -1
  161. data/dyncall/dyncallback/dyncall_callback_sparc64.c +2 -1
  162. data/dyncall/dyncallback/dyncall_callback_sparc64.s +1 -1
  163. data/dyncall/dyncallback/dyncall_callback_x64.S +5 -12
  164. data/dyncall/dyncallback/dyncall_callback_x64.c +2 -1
  165. data/dyncall/dyncallback/dyncall_callback_x64.h +2 -1
  166. data/dyncall/dyncallback/dyncall_callback_x64_masm.asm +0 -7
  167. data/dyncall/dyncallback/dyncall_callback_x86.S +5 -12
  168. data/dyncall/dyncallback/dyncall_callback_x86.c +2 -1
  169. data/dyncall/dyncallback/dyncall_callback_x86.h +2 -1
  170. data/dyncall/dyncallback/dyncall_callback_x86_masm.asm +2 -11
  171. data/dyncall/dyncallback/dyncall_thunk.c +11 -3
  172. data/dyncall/dyncallback/dyncall_thunk.h +8 -2
  173. data/dyncall/dyncallback/dyncall_thunk_arm32_arm.c +7 -7
  174. data/dyncall/dyncallback/dyncall_thunk_arm32_arm.h +2 -1
  175. data/dyncall/dyncallback/dyncall_thunk_arm32_thumb.c +2 -1
  176. data/dyncall/dyncallback/dyncall_thunk_arm32_thumb.h +2 -1
  177. data/dyncall/dyncallback/dyncall_thunk_arm64.c +64 -0
  178. data/dyncall/dyncallback/dyncall_thunk_arm64.h +42 -0
  179. data/dyncall/dyncallback/dyncall_thunk_mips.c +49 -17
  180. data/dyncall/dyncallback/dyncall_thunk_mips.h +3 -2
  181. data/dyncall/dyncallback/dyncall_thunk_ppc32.c +3 -2
  182. data/dyncall/dyncallback/dyncall_thunk_ppc32.h +7 -7
  183. data/dyncall/dyncallback/dyncall_thunk_ppc32_sysv.c +50 -0
  184. data/dyncall/dyncallback/dyncall_thunk_ppc64.c +87 -0
  185. data/dyncall/dyncallback/dyncall_thunk_ppc64.h +55 -0
  186. data/dyncall/dyncallback/dyncall_thunk_sparc32.c +2 -1
  187. data/dyncall/dyncallback/dyncall_thunk_sparc32.h +2 -1
  188. data/dyncall/dyncallback/dyncall_thunk_sparc64.c +2 -1
  189. data/dyncall/dyncallback/dyncall_thunk_sparc64.h +2 -1
  190. data/dyncall/dyncallback/dyncall_thunk_x64.c +2 -1
  191. data/dyncall/dyncallback/dyncall_thunk_x64.h +2 -1
  192. data/dyncall/dyncallback/dyncall_thunk_x86.c +2 -1
  193. data/dyncall/dyncallback/dyncall_thunk_x86.h +2 -1
  194. data/dyncall/dyncallback/dyncallback.3 +3 -3
  195. data/dyncall/dyncallback/gen-masm.sh +0 -0
  196. data/dyncall/dynload/dynload.c +2 -1
  197. data/dyncall/dynload/dynload.h +2 -1
  198. data/dyncall/dynload/dynload_alloc.h +2 -1
  199. data/dyncall/dynload/dynload_darwin.c +2 -1
  200. data/dyncall/dynload/dynload_syms.c +2 -1
  201. data/dyncall/dynload/dynload_syms_elf.c +2 -1
  202. data/dyncall/dynload/dynload_syms_mach-o.c +3 -2
  203. data/dyncall/dynload/dynload_syms_pe.c +2 -1
  204. data/dyncall/dynload/dynload_unix.c +2 -1
  205. data/dyncall/dynload/dynload_windows.c +2 -1
  206. data/dyncall/portasm/gen-masm.sh +0 -0
  207. data/dyncall/portasm/portasm-arm.S +3 -2
  208. data/dyncall/portasm/portasm-ppc.S +2 -1
  209. data/dyncall/portasm/portasm-ppc64.S +119 -0
  210. data/dyncall/portasm/portasm-x64-att.S +2 -1
  211. data/dyncall/portasm/portasm-x86.S +2 -1
  212. metadata +39 -18
  213. data/dyncall/dyncallback/dyncall_callback_x64_apple.s +0 -122
  214. data/dyncall/dyncallback/dyncall_callback_x64_gas.s +0 -119
  215. data/dyncall/dyncallback/dyncall_callback_x64_gas_w64.s +0 -102
@@ -6,8 +6,8 @@
6
6
  Description:
7
7
  License:
8
8
 
9
- Copyright (c) 2011 Daniel Adler <dadler@uni-goettingen.de>,
10
- Tassilo Philipp <tphilipp@potion-studios.com>
9
+ Copyright (c) 2011-2015 Daniel Adler <dadler@uni-goettingen.de>,
10
+ Tassilo Philipp <tphilipp@potion-studios.com>
11
11
 
12
12
  Permission to use, copy, modify, and distribute this software for any
13
13
  purpose with or without fee is hereby granted, provided that the above
@@ -22,6 +22,7 @@
22
22
  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
23
23
 
24
24
  */
25
+
25
26
  #ifndef AUTOVAR_CC_H
26
27
  #define AUTOVAR_CC_H
27
28
 
@@ -6,8 +6,8 @@
6
6
  Description:
7
7
  License:
8
8
 
9
- Copyright (c) 2011 Daniel Adler <dadler@uni-goettingen.de>,
10
- Tassilo Philipp <tphilipp@potion-studios.com>
9
+ Copyright (c) 2011-2015 Daniel Adler <dadler@uni-goettingen.de>,
10
+ Tassilo Philipp <tphilipp@potion-studios.com>
11
11
 
12
12
  Permission to use, copy, modify, and distribute this software for any
13
13
  purpose with or without fee is hereby granted, provided that the above
@@ -22,6 +22,7 @@
22
22
  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
23
23
 
24
24
  */
25
+
25
26
  #ifndef AUTOVAR_OS_H
26
27
  #define AUTOVAR_OS_H
27
28
 
@@ -6,8 +6,8 @@
6
6
  Description:
7
7
  License:
8
8
 
9
- Copyright (c) 2011 Daniel Adler <dadler@uni-goettingen.de>,
10
- Tassilo Philipp <tphilipp@potion-studios.com>
9
+ Copyright (c) 2011-2015 Daniel Adler <dadler@uni-goettingen.de>,
10
+ Tassilo Philipp <tphilipp@potion-studios.com>
11
11
 
12
12
  Permission to use, copy, modify, and distribute this software for any
13
13
  purpose with or without fee is hereby granted, provided that the above
@@ -22,6 +22,7 @@
22
22
  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
23
23
 
24
24
  */
25
+
25
26
  #ifndef AUTOVAR_OSFAMILY_H
26
27
  #define AUTOVAR_OSFAMILY_H
27
28
 
@@ -1,11 +1,15 @@
1
+ #!/bin/sh
2
+
3
+ cd `dirname $0`/../../
4
+
1
5
  # Build libraries.
2
6
 
3
- make -f Makefile.generc clean all
7
+ make -f Makefile.generic clean all
4
8
 
5
9
  # Build tests: dynload tests need '-ldl'.
6
10
 
7
11
  ( cd test ; make -f Makefile.generic clean )
8
- ( cd test ; LDFLAGS=-ldl make -f Makefile.generic all-dynload )
12
+ ( cd test ; LDLIBS=-ldl make -f Makefile.generic all-dynload )
9
13
  ( cd test ; make -f Makefile.generic all )
10
14
 
11
15
 
@@ -1,5 +1,7 @@
1
1
  #!/bin/sh
2
2
 
3
+ cd `dirname $0`/../../
4
+
3
5
  # ---------------------------------------------------------- #
4
6
  # DynCall build script using Makefile.generic on Minix 3.1.8 #
5
7
  # ---------------------------------------------------------- #
@@ -1,5 +1,7 @@
1
1
  #!/bin/sh
2
2
 
3
+ cd `dirname $0`/../../
4
+
3
5
  # ------------------------------------------------------------- #
4
6
  # DynCall build script using Makefile.generic for PSP toolchain #
5
7
  # ------------------------------------------------------------- #
@@ -7,5 +9,6 @@
7
9
  # build libs and tests, but exclude dynload
8
10
 
9
11
  ./configure --target=PSP
10
- make libdyncall libdyncallback tests-libdyncallback tests-libdyncall
12
+ #no callback for mips, yet, but build 'empty' libdyncallback to make linker happy
13
+ make libdyncall libdyncallback tests-libdyncall # tests-libdyncallback
11
14
 
@@ -0,0 +1,19 @@
1
+ #!/bin/sh
2
+
3
+ if ! [ -x "$1" ]; then
4
+ echo Usage: $0 \<elf\>
5
+ exit 1
6
+ fi
7
+
8
+ TITLE=`basename $1`
9
+ SFO=/tmp/${TITLE}.sfo
10
+ FIXED_ELF=/tmp/${TITLE}.fixed
11
+ STRIPPED_ELF=/tmp/${TITLE}.stripped
12
+
13
+ mksfo dyncall_${TITLE} $SFO
14
+ psp-fixup-imports -o $FIXED_ELF $1
15
+ psp-strip $FIXED_ELF -o $STRIPPED_ELF
16
+ pack-pbp EBOOT.PBP $SFO NULL NULL NULL NULL NULL $STRIPPED_ELF NULL
17
+ rm $SFO
18
+ rm $FIXED_ELF
19
+ rm $STRIPPED_ELF
@@ -17,12 +17,20 @@ while [ $# -gt 0 ]; do
17
17
  shift 1
18
18
  # Shell common:
19
19
  case $X in
20
- --help|-h)
20
+ --help|-h|-?)
21
21
  cat <<EOF
22
- usage: $0 --prefix=<dir> var1=name1..
22
+ usage: $0 --<option>=<value> <var>=<value> ..
23
+
23
24
  --prefix=<dir>
24
- --target=<platform> MacOSX,iOS,iPhoneSimulator
25
- --sdk=<version>
25
+ --target=<platform> uname/special targets: MacOSX,iOS,iPhoneSimulator
26
+ use "?" to get a list of explicitly specifiable
27
+ targets
28
+ --sdk=<version> Mac OS X/iOS SDK version (e.g. '6.1' or '10.9.3')
29
+ Tested iOS SDK versions: 4.3, 6.1, 8.1
30
+ --sdkroot=<dir>
31
+
32
+ Useful variables CC, CXX, CFLAGS, CXXFLAGS, etc..
33
+
26
34
  EOF
27
35
  exit 1
28
36
  ;;
@@ -36,12 +44,15 @@ EOF
36
44
  --sdk=*)
37
45
  SDK=`printf -- "${X}" | cut -c 7-`
38
46
  ;;
47
+ --sdkroot=*)
48
+ SDKROOT=`printf -- "${X}" | cut -c 11-`
49
+ ;;
39
50
  # Environment variables:
40
51
  [A-Za-z_]*=*)
41
52
  printf "${X}\n" >>$C
42
53
  k=`printf "${X}" | cut -d = -f 1`
43
54
  v=`printf "${X}" | cut -d = -f 2`
44
- export $k=$v
55
+ export $k="$v"
45
56
  ;;
46
57
  # Others fail:
47
58
  *)
@@ -56,18 +67,41 @@ case ${TARGET:=`uname`} in
56
67
  if [ -z "${CFLAGS}" ]; then
57
68
  printf "CFLAGS=-fPIC\n" >>$C
58
69
  fi
59
- printf "LDFLAGS=-lm -ldl\n" >>$C
70
+ printf "LDLIBS=-lm -ldl\n" >>$C
60
71
  ;;
61
- OpenBSD|NetBSD)
62
- printf "LDFLAGS=-lm\n" >>$C
72
+ OpenBSD)
73
+ printf "LDLIBS=-lm\n" >>$C
74
+ ;;
75
+ DragonFly|NetBSD)
76
+ if [ -z "${CFLAGS}" ]; then
77
+ printf "CFLAGS=-fPIC\n" >>$C
78
+ fi
79
+ printf "LDLIBS=-lm\n" >>$C
63
80
  ;;
64
81
  FreeBSD)
65
- printf "LDFLAGS=-lm\n" >>$C
82
+ if [ -z "${CFLAGS}" ]; then
83
+ printf "CFLAGS=-fPIC\n" >>$C
84
+ fi
85
+ printf "LDLIBS=-lm\n" >>$C
66
86
  printf "RM=rm -f\n" >>$C
67
87
  ;;
88
+ GNU/kFreeBSD)
89
+ if [ -z "${CFLAGS}" ]; then
90
+ printf "CFLAGS=-fPIC\n" >>$C
91
+ fi
92
+ printf "LDLIBS=-lm -ldl\n" >>$C
93
+ ;;
68
94
  MacOSX|Darwin)
69
- printf "AR=libtool\n" >>$C
70
- printf "ARFLAGS=-static -o\n" >>$C
95
+ # if Apple's libtool (not to be confused with GNU's) is available, which is according to libtool(1) "with -static [...] intended
96
+ # 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
97
+ # intentionally used, and fall back to using 'ar rs' (the equivalent to 'libtool -static'), for compatibility:
98
+ if libtool -V >/dev/null 2>/dev/null; then # Apple's libtool has -V for version, which GNU does not.
99
+ printf "AR=libtool\n" >>$C
100
+ printf "ARFLAGS=-static -o\n" >>$C
101
+ else
102
+ printf "AR=ar\n" >>$C
103
+ printf "ARFLAGS=rs\n" >>$C # 's' is crucial for universal binary archives
104
+ fi
71
105
  if [ `uname -n` = 'iPhone' ]; then # building on iPhone itself, uname yields Darwin (gcc setup for current/correct arch)
72
106
  printf "CC=gcc\n" >>$C
73
107
  elif [ -z ${SDK} ]; then
@@ -75,13 +109,16 @@ case ${TARGET:=`uname`} in
75
109
  10.4.*)
76
110
  ARCHS="-arch ppc -arch i386 -arch x86_64"
77
111
  ;;
78
- 10.[56].*)
112
+ 10.5.*)
79
113
  ARCHS="-arch i386 -arch x86_64 -arch ppc"
80
114
  ;;
81
115
  10.6.*)
82
116
  ARCHS="-arch i386 -arch x86_64"
83
117
  ;;
84
- 10.[78].*)
118
+ 10.10.*)
119
+ ARCHS="-arch x86_64 -arch i386"
120
+ ;;
121
+ 10.[789].*)
85
122
  ARCHS="-arch x86_64 -arch i386"
86
123
  ;;
87
124
  esac
@@ -89,28 +126,40 @@ case ${TARGET:=`uname`} in
89
126
  printf "CFLAGS=${ARCHS}\n" >>$C
90
127
  printf "CXXFLAGS=${ARCHS}\n" >>$C
91
128
  else
92
- SDKROOT="`xcode-select -print-path`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${SDK}.sdk"
129
+ if [ -z ${SDKROOT} ]; then
130
+ SDKROOT="`xcode-select -print-path`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${SDK}.sdk"
131
+ fi
93
132
  printf "CFLAGS=-isysroot ${SDKROOT}\n" >>$C
94
133
  printf "CXXFLAGS=-isysroot ${SDKROOT}\n" >>$C
95
134
  fi
96
135
  ;;
97
136
  iPhoneOS|iOS)
98
- SDKROOT="`xcode-select -print-path`/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${SDK}.sdk"
99
- case "${SDK}" in
100
- 4.3)
101
- ARCHS="-arch armv6"
102
- ;;
103
- 6.1)
104
- ARCHS="-arch armv7"
105
- ;;
106
- esac
137
+ if [ -z ${SDKROOT} ]; then
138
+ SDKROOT="`xcode-select -print-path`/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS${SDK}.sdk"
139
+ fi
140
+ if [ -z "${ARCHS}" ]; then
141
+ case "${SDK}" in
142
+ [45].*)
143
+ ARCHS="-arch armv6"
144
+ ;;
145
+ [67].*)
146
+ ARCHS="-arch armv7"
147
+ ;;
148
+ [89].*)
149
+ ARCHS="-arch armv7 -arch arm64"
150
+ ;;
151
+ esac
152
+ fi
153
+ printf "ARFLAGS=rs\n" >>$C # 's' is crucial for universal binary archives
107
154
  printf "ASFLAGS=${ARCHS} -isysroot ${SDKROOT}\n" >>$C
108
155
  printf "CFLAGS=${ARCHS} -isysroot ${SDKROOT}\n" >>$C
109
156
  printf "CXXFLAGS=${ARCHS} -isysroot ${SDKROOT}\n" >>$C
110
157
  printf "LDFLAGS=-Wl,-syslibroot ${SDKROOT}\n" >>$C
111
158
  ;;
112
159
  iPhoneSimulator)
113
- SDKROOT="`xcode-select -print-path`/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator${SDK}.sdk"
160
+ if [ -z ${SDKROOT} ]; then
161
+ SDKROOT="`xcode-select -print-path`/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator${SDK}.sdk"
162
+ fi
114
163
  ARCHS="-arch i386"
115
164
  printf "ASFLAGS=${ARCHS} -isysroot ${SDKROOT}\n" >>$C
116
165
  printf "CFLAGS=${ARCHS} -isysroot ${SDKROOT}\n" >>$C
@@ -118,10 +167,10 @@ case ${TARGET:=`uname`} in
118
167
  printf "LDFLAGS=-Wl,-syslibroot ${SDKROOT}\n" >>$C
119
168
  ;;
120
169
  SunOS)
121
- X=`type CC`
122
- if [ $? -eq 0 ]; then
123
- printf "CXX=CC\n" >>$C
124
- fi
170
+ # 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
125
174
  printf "LDLIBS=-lm\n" >>$C
126
175
  ;;
127
176
  Minix)
@@ -137,11 +186,15 @@ case ${TARGET:=`uname`} in
137
186
  printf "CFLAGS=-I${SDKROOT}/include/\n" >>$C
138
187
  printf "CXXFLAGS=-I${SDKROOT}/include/\n" >>$C
139
188
  # Pulling in dyncall libs below is a hack, for some reason psp-ld is super-picky about order.
140
- # Use your C lib of choice, from the PSPSDK, or...
189
+ # Use your C lib of choice, from the PSPSDK, or...
141
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
142
- # ... newlib.
191
+ # ... newlib.
143
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
144
193
  ;;
194
+ ?)
195
+ 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'
196
+ exit 0
197
+ ;;
145
198
  esac
146
199
 
147
200
  BLDTOP="$PWD"
@@ -70,6 +70,10 @@ semantics
70
70
  .Ft DCpointer
71
71
  .Fn dcCallPointer "DCCallVM * vm" "DCpointer funcptr"
72
72
  .Ft void
73
+ .Fn dcArgF "DCCallVM * vm" "const DCsigchar * signature" "..."
74
+ .Ft void
75
+ .Fn dcVArgF "DCCallVM * vm" "const DCsigchar * signature" "va_list args"
76
+ .Ft void
73
77
  .Fn dcCallF "DCCallVM * vm" "DCValue * result" "DCpointer funcptr" "const DCsigchar * signature" "..."
74
78
  .Ft void
75
79
  .Fn dcVCallF "DCCallVM * vm" "DCValue * result" "DCpointer funcptr" "const DCsigchar * signature" "va_list args"
@@ -110,10 +114,12 @@ sense (e.g. using a PowerPC calling convention on a MIPS platform) and are
110
114
  silently ignored.
111
115
  .Pp
112
116
  .Fn dcReset
113
- resets the internal stack of arguments and prepares it for the selected mode.
117
+ resets the internal stack of arguments and prepares it for a new call.
114
118
  This function should be called after setting the call mode (using dcMode), but
115
119
  prior to binding arguments to the CallVM. Use it also when reusing a CallVM, as
116
120
  arguments don't get flushed automatically after a function call invocation.
121
+ Note: you should also call this function after initial creation of the a CallVM
122
+ object, as dcNewCallVM doesn't do this, implicitly.
117
123
  .Pp
118
124
  .Fn dcArgBool ,
119
125
  .Fn dcArgChar ,
@@ -149,12 +155,18 @@ using the same arguments can be issued. Call
149
155
  .Fn reset
150
156
  to clear the internal argument stack.
151
157
  .Pp
158
+ .Fn dcArgF ,
159
+ .Fn dcVArgF ,
152
160
  .Fn dcCallF
153
161
  and
154
162
  .Fn dcVCallF
155
- can be used to issue a printf-style function call, using a signature
156
- string encoding the argument types and return type. The return value will be
157
- stored in
163
+ can be used to bind arguments in a printf-style call, using a signature
164
+ string encoding the argument types and return type. The former 2 only bind
165
+ the arguments to the
166
+ .Ar vm
167
+ object (and ignore return types specified in the
168
+ signature), whereas the latter two issue a call to the given function pointer,
169
+ afterwards. The return value will be stored in
158
170
  .Ar result .
159
171
  For information about the signature format, refer to the
160
172
  .Nm
@@ -6,7 +6,7 @@
6
6
  Description: public header for library dyncall
7
7
  License:
8
8
 
9
- Copyright (c) 2007-2011 Daniel Adler <dadler@uni-goettingen.de>,
9
+ Copyright (c) 2007-2015 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
@@ -29,6 +29,8 @@
29
29
  dyncall C API
30
30
 
31
31
  REVISION
32
+ 2015/07/08 added SYS_PPC64 system call
33
+ 2015/01/16 added SYS_PPC32 system call
32
34
  2007/12/11 initial
33
35
 
34
36
  */
@@ -75,9 +77,15 @@ typedef struct DCstruct_ DCstruct;
75
77
  #define DC_CALL_C_X86_PLAN9 19
76
78
  #define DC_CALL_C_SPARC32 20
77
79
  #define DC_CALL_C_SPARC64 21
80
+ #define DC_CALL_C_ARM64 22
81
+ #define DC_CALL_C_PPC64 23
82
+ #define DC_CALL_C_PPC64_LINUX DC_CALL_C_PPC64 /* alias */
78
83
  #define DC_CALL_SYS_DEFAULT 200
79
84
  #define DC_CALL_SYS_X86_INT80H_LINUX 201
80
85
  #define DC_CALL_SYS_X86_INT80H_BSD 202
86
+ #define DC_CALL_SYS_PPC32 210
87
+ #define DC_CALL_SYS_PPC64 211
88
+
81
89
  /* Error codes. */
82
90
 
83
91
  #define DC_ERROR_NONE 0
@@ -6,7 +6,7 @@
6
6
  Description: heap memory management interface (header only)
7
7
  License:
8
8
 
9
- Copyright (c) 2007-2011 Daniel Adler <dadler@uni-goettingen.de>,
9
+ Copyright (c) 2007-2015 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
@@ -24,6 +24,7 @@
24
24
  */
25
25
 
26
26
 
27
+
27
28
  #ifndef DYNCALL_ALLOC_H
28
29
  #define DYNCALL_ALLOC_H
29
30
 
@@ -6,7 +6,7 @@
6
6
  Description: C interface to call vm
7
7
  License:
8
8
 
9
- Copyright (c) 2007-2011 Daniel Adler <dadler@uni-goettingen.de>,
9
+ Copyright (c) 2007-2015 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
@@ -24,6 +24,7 @@
24
24
  */
25
25
 
26
26
 
27
+
27
28
  #include "dyncall.h"
28
29
  #include "dyncall_callvm.h"
29
30
  #include "dyncall_alloc.h"
@@ -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-2011 Daniel Adler <dadler@uni-goettingen.de>,
9
+ Copyright (c) 2007-2015 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
@@ -23,7 +23,9 @@
23
23
 
24
24
  */
25
25
 
26
+
26
27
  #include "dyncall_macros.h"
28
+
27
29
  /* Plan9 */
28
30
  #if defined(DC__OS_Plan9)
29
31
  # if defined(DC__Arch_Intel_x86)
@@ -58,8 +60,12 @@
58
60
  # include "dyncall_call_arm32_thumb_gas.s"
59
61
  # endif
60
62
  # endif
61
- # elif defined(DC__Arch_PowerPC)
63
+ # elif defined(DC__Arch_ARM64)
64
+ # include "dyncall_call_arm64.S"
65
+ # elif defined(DC__Arch_PPC32)
62
66
  # include "dyncall_call_ppc32.S"
67
+ # elif defined(DC__Arch_PPC64)
68
+ # include "dyncall_call_ppc64.S"
63
69
  # elif defined(DC__Arch_MIPS) || defined(DC__Arch_MIPS64)
64
70
  # include "dyncall_call_mips_gas.S"
65
71
  # elif defined(DC__Arch_Sparcv9)
@@ -70,3 +76,4 @@
70
76
  # error Unsupported Architecture.
71
77
  # endif
72
78
  #endif
79
+