rbdc 0.8.7 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/{bindings → dyncall-bindings}/ruby/rbdc/extconf.rb +1 -1
- data/{bindings → dyncall-bindings}/ruby/rbdc/rbdc.c +3 -1
- data/dyncall/AUTHORS +2 -0
- data/dyncall/BUGS +1 -0
- data/dyncall/CMakeLists.txt +10 -2
- data/dyncall/ChangeLog +46 -11
- data/dyncall/LICENSE +4 -1
- data/dyncall/Makefile.embedded +7 -3
- data/dyncall/README +23 -14
- data/dyncall/ToDo +27 -28
- data/dyncall/autovar/autovar_ABI.h +3 -2
- data/dyncall/autovar/autovar_ARCH.h +13 -10
- data/dyncall/autovar/autovar_CC.h +3 -2
- data/dyncall/autovar/autovar_OS.h +3 -2
- data/dyncall/autovar/autovar_OSFAMILY.h +3 -2
- data/dyncall/buildsys/scripts/batch-build-linux.sh +6 -2
- data/dyncall/buildsys/scripts/batch-build-minix.sh +2 -0
- data/dyncall/buildsys/scripts/batch-build-psp.sh +4 -1
- data/dyncall/buildsys/scripts/elf-to-psp-eboot.sh +19 -0
- data/dyncall/buildsys/scripts/setenv-cross-ios.sh +0 -0
- data/dyncall/buildsys/scripts/setenv-sdk-ios.sh +0 -0
- data/dyncall/configure +83 -30
- data/dyncall/dyncall/dyncall.3 +16 -4
- data/dyncall/dyncall/dyncall.h +9 -1
- data/dyncall/dyncall/dyncall_alloc.h +2 -1
- data/dyncall/dyncall/dyncall_api.c +2 -1
- data/dyncall/dyncall/dyncall_call.S +9 -2
- data/dyncall/dyncall/dyncall_call_arm32_arm.S +2 -1
- data/dyncall/dyncall/dyncall_call_arm32_arm.h +8 -2
- data/dyncall/dyncall/dyncall_call_arm32_arm_armhf.S +11 -19
- data/dyncall/dyncall/dyncall_call_arm32_arm_armhf.h +15 -2
- data/dyncall/dyncall/dyncall_call_arm32_thumb.h +8 -6
- data/dyncall/dyncall/dyncall_call_arm32_thumb_armhf.S +10 -18
- data/dyncall/dyncall/dyncall_call_arm32_thumb_gas.s +0 -16
- data/dyncall/dyncall/dyncall_call_arm64.S +226 -0
- data/dyncall/dyncall/dyncall_call_arm64.h +45 -0
- data/dyncall/dyncall/dyncall_call_mips.h +2 -1
- data/dyncall/dyncall/dyncall_call_mips_eabi.h +2 -1
- data/dyncall/dyncall/dyncall_call_mips_gas.S +2 -1
- data/dyncall/dyncall/dyncall_call_mips_n32.h +2 -1
- data/dyncall/dyncall/dyncall_call_mips_n64.h +2 -1
- data/dyncall/dyncall/dyncall_call_mips_o32.h +2 -1
- data/dyncall/dyncall/dyncall_call_ppc32.S +27 -2
- data/dyncall/dyncall/dyncall_call_ppc32.h +2 -2
- data/dyncall/dyncall/dyncall_call_ppc64.S +210 -0
- data/dyncall/dyncall/dyncall_call_ppc64.h +55 -0
- data/dyncall/dyncall/dyncall_call_sparc.S +2 -1
- data/dyncall/dyncall/dyncall_call_sparc.h +2 -1
- data/dyncall/dyncall/dyncall_call_sparc64.S +2 -1
- data/dyncall/dyncall/dyncall_call_sparc64.h +2 -1
- data/dyncall/dyncall/dyncall_call_sparc_v9.S +25 -23
- data/dyncall/dyncall/dyncall_call_sparc_v9.h +2 -1
- data/dyncall/dyncall/dyncall_call_x64-att.S +2 -1
- data/dyncall/dyncall/dyncall_call_x64.S +2 -1
- data/dyncall/dyncall/dyncall_call_x64.h +2 -1
- data/dyncall/dyncall/dyncall_call_x86.S +2 -1
- data/dyncall/dyncall/dyncall_call_x86.h +2 -1
- data/dyncall/dyncall/dyncall_callf.c +56 -66
- data/dyncall/dyncall/dyncall_callf.h +5 -1
- data/dyncall/dyncall/dyncall_callvm.c +11 -2
- data/dyncall/dyncall/dyncall_callvm.h +2 -1
- data/dyncall/dyncall/dyncall_callvm_arm32_arm.c +2 -1
- data/dyncall/dyncall/dyncall_callvm_arm32_arm.h +2 -1
- data/dyncall/dyncall/dyncall_callvm_arm32_arm_armhf.c +60 -30
- data/dyncall/dyncall/dyncall_callvm_arm32_arm_armhf.h +3 -2
- data/dyncall/dyncall/dyncall_callvm_arm32_thumb.c +2 -24
- data/dyncall/dyncall/dyncall_callvm_arm32_thumb.h +2 -1
- data/dyncall/dyncall/dyncall_callvm_arm64.c +165 -0
- data/dyncall/dyncall/dyncall_callvm_arm64.h +51 -0
- data/dyncall/dyncall/dyncall_callvm_arm64_apple.c +272 -0
- data/dyncall/dyncall/dyncall_callvm_base.c +2 -1
- data/dyncall/dyncall/dyncall_callvm_mips.c +2 -1
- data/dyncall/dyncall/dyncall_callvm_mips.h +2 -1
- data/dyncall/dyncall/dyncall_callvm_mips_eabi.c +2 -1
- data/dyncall/dyncall/dyncall_callvm_mips_eabi.h +2 -1
- data/dyncall/dyncall/dyncall_callvm_mips_n32.c +2 -1
- data/dyncall/dyncall/dyncall_callvm_mips_n64.c +2 -1
- data/dyncall/dyncall/dyncall_callvm_mips_n64.h +2 -1
- data/dyncall/dyncall/dyncall_callvm_mips_o32.c +2 -1
- data/dyncall/dyncall/dyncall_callvm_mips_o32.h +2 -1
- data/dyncall/dyncall/dyncall_callvm_ppc32.c +45 -2
- data/dyncall/dyncall/dyncall_callvm_ppc32.h +2 -1
- data/dyncall/dyncall/dyncall_callvm_ppc64.c +351 -0
- data/dyncall/dyncall/dyncall_callvm_ppc64.h +60 -0
- data/dyncall/dyncall/dyncall_callvm_sparc.c +2 -1
- data/dyncall/dyncall/dyncall_callvm_sparc.h +2 -1
- data/dyncall/dyncall/dyncall_callvm_sparc64.c +2 -2
- data/dyncall/dyncall/dyncall_callvm_sparc64.h +2 -1
- data/dyncall/dyncall/dyncall_callvm_sparc_v9.c +3 -3
- data/dyncall/dyncall/dyncall_callvm_sparc_v9.h +2 -1
- data/dyncall/dyncall/dyncall_callvm_x64.c +2 -1
- data/dyncall/dyncall/dyncall_callvm_x64.h +2 -1
- data/dyncall/dyncall/dyncall_callvm_x86.c +2 -1
- data/dyncall/dyncall/dyncall_callvm_x86.h +2 -1
- data/dyncall/dyncall/dyncall_config.h +2 -1
- data/dyncall/dyncall/dyncall_macros.h +46 -9
- data/dyncall/dyncall/dyncall_signature.h +2 -1
- data/dyncall/dyncall/dyncall_struct.c +2 -1
- data/dyncall/dyncall/dyncall_struct.h +2 -1
- data/dyncall/dyncall/dyncall_types.h +2 -1
- data/dyncall/dyncall/dyncall_utils.h +2 -1
- data/dyncall/dyncall/dyncall_value.h +19 -1
- data/dyncall/dyncall/dyncall_vector.c +2 -1
- data/dyncall/dyncall/dyncall_vector.h +3 -1
- data/dyncall/dyncall/gen-masm.sh +0 -0
- data/dyncall/dyncallback/Makefile.generic +1 -1
- data/dyncall/dyncallback/dyncall_alloc_wx.c +2 -1
- data/dyncall/dyncallback/dyncall_alloc_wx.h +2 -1
- data/dyncall/dyncallback/dyncall_alloc_wx_malloc.c +2 -1
- data/dyncall/dyncallback/dyncall_alloc_wx_mmap.c +2 -1
- data/dyncall/dyncallback/dyncall_alloc_wx_win32.c +2 -1
- data/dyncall/dyncallback/dyncall_args.c +22 -10
- data/dyncall/dyncallback/dyncall_args.h +2 -1
- data/dyncall/dyncallback/dyncall_args_arm32_arm.c +35 -4
- data/dyncall/dyncallback/dyncall_args_arm32_arm.h +7 -1
- data/dyncall/dyncallback/dyncall_args_arm32_thumb.c +2 -1
- data/dyncall/dyncallback/dyncall_args_arm32_thumb.h +2 -1
- data/dyncall/dyncallback/dyncall_args_arm64.c +77 -0
- data/dyncall/dyncallback/dyncall_args_arm64_apple.c +160 -0
- data/dyncall/dyncallback/dyncall_args_mips.c +3 -2
- data/dyncall/dyncallback/dyncall_args_mips.h +3 -2
- data/dyncall/dyncallback/dyncall_args_ppc32.c +2 -1
- data/dyncall/dyncallback/dyncall_args_ppc32.h +9 -7
- data/dyncall/dyncallback/dyncall_args_ppc32_sysv.c +95 -0
- data/dyncall/dyncallback/dyncall_args_ppc64.c +71 -0
- data/dyncall/dyncallback/dyncall_args_ppc64.h +40 -0
- data/dyncall/dyncallback/dyncall_args_sparc32.c +2 -1
- data/dyncall/dyncallback/dyncall_args_sparc32.h +2 -1
- data/dyncall/dyncallback/dyncall_args_sparc64.c +2 -1
- data/dyncall/dyncallback/dyncall_args_sparc64.h +2 -1
- data/dyncall/dyncallback/dyncall_args_x64.c +2 -1
- data/dyncall/dyncallback/dyncall_args_x64.h +2 -1
- data/dyncall/dyncallback/dyncall_args_x86.c +2 -1
- data/dyncall/dyncallback/dyncall_args_x86.h +2 -1
- data/dyncall/dyncallback/dyncall_callback.c +7 -2
- data/dyncall/dyncallback/dyncall_callback.h +3 -1
- data/dyncall/dyncallback/dyncall_callback_arch.S +14 -6
- data/dyncall/dyncallback/dyncall_callback_arm32_arm.c +2 -1
- data/dyncall/dyncallback/dyncall_callback_arm32_arm.h +2 -1
- data/dyncall/dyncallback/dyncall_callback_arm32_arm_apple.s +1 -1
- data/dyncall/dyncallback/{dyncall_callback_arm32_arm_gas.s → dyncall_callback_arm32_arm_gas.S} +17 -7
- data/dyncall/dyncallback/dyncall_callback_arm32_thumb.c +2 -1
- data/dyncall/dyncallback/dyncall_callback_arm32_thumb.h +2 -1
- data/dyncall/dyncallback/{dyncall_callback_arm32_thumb_apple.s → dyncall_callback_arm32_thumb_apple.S} +2 -2
- data/dyncall/dyncallback/{dyncall_callback_arm32_thumb_gas.s → dyncall_callback_arm32_thumb_gas.S} +2 -2
- data/dyncall/dyncallback/dyncall_callback_arm64.S +111 -0
- data/dyncall/dyncallback/dyncall_callback_arm64.c +71 -0
- data/dyncall/dyncallback/dyncall_callback_mips.c +3 -2
- data/dyncall/dyncallback/dyncall_callback_mips.h +3 -2
- data/dyncall/dyncallback/dyncall_callback_ppc32.S +115 -4
- data/dyncall/dyncallback/dyncall_callback_ppc32.c +3 -2
- data/dyncall/dyncallback/dyncall_callback_ppc32.h +6 -6
- data/dyncall/dyncallback/dyncall_callback_ppc32_apple.s +6 -5
- data/dyncall/dyncallback/dyncall_callback_ppc64.S +170 -0
- data/dyncall/dyncallback/dyncall_callback_ppc64.c +60 -0
- data/dyncall/dyncallback/dyncall_callback_ppc64.h +56 -0
- data/dyncall/dyncallback/dyncall_callback_sparc32.c +2 -1
- data/dyncall/dyncallback/dyncall_callback_sparc32.h +2 -1
- data/dyncall/dyncallback/dyncall_callback_sparc32.s +1 -1
- data/dyncall/dyncallback/dyncall_callback_sparc64.c +2 -1
- data/dyncall/dyncallback/dyncall_callback_sparc64.s +1 -1
- data/dyncall/dyncallback/dyncall_callback_x64.S +5 -12
- data/dyncall/dyncallback/dyncall_callback_x64.c +2 -1
- data/dyncall/dyncallback/dyncall_callback_x64.h +2 -1
- data/dyncall/dyncallback/dyncall_callback_x64_masm.asm +0 -7
- data/dyncall/dyncallback/dyncall_callback_x86.S +5 -12
- data/dyncall/dyncallback/dyncall_callback_x86.c +2 -1
- data/dyncall/dyncallback/dyncall_callback_x86.h +2 -1
- data/dyncall/dyncallback/dyncall_callback_x86_masm.asm +2 -11
- data/dyncall/dyncallback/dyncall_thunk.c +11 -3
- data/dyncall/dyncallback/dyncall_thunk.h +8 -2
- data/dyncall/dyncallback/dyncall_thunk_arm32_arm.c +7 -7
- data/dyncall/dyncallback/dyncall_thunk_arm32_arm.h +2 -1
- data/dyncall/dyncallback/dyncall_thunk_arm32_thumb.c +2 -1
- data/dyncall/dyncallback/dyncall_thunk_arm32_thumb.h +2 -1
- data/dyncall/dyncallback/dyncall_thunk_arm64.c +64 -0
- data/dyncall/dyncallback/dyncall_thunk_arm64.h +42 -0
- data/dyncall/dyncallback/dyncall_thunk_mips.c +49 -17
- data/dyncall/dyncallback/dyncall_thunk_mips.h +3 -2
- data/dyncall/dyncallback/dyncall_thunk_ppc32.c +3 -2
- data/dyncall/dyncallback/dyncall_thunk_ppc32.h +7 -7
- data/dyncall/dyncallback/dyncall_thunk_ppc32_sysv.c +50 -0
- data/dyncall/dyncallback/dyncall_thunk_ppc64.c +87 -0
- data/dyncall/dyncallback/dyncall_thunk_ppc64.h +55 -0
- data/dyncall/dyncallback/dyncall_thunk_sparc32.c +2 -1
- data/dyncall/dyncallback/dyncall_thunk_sparc32.h +2 -1
- data/dyncall/dyncallback/dyncall_thunk_sparc64.c +2 -1
- data/dyncall/dyncallback/dyncall_thunk_sparc64.h +2 -1
- data/dyncall/dyncallback/dyncall_thunk_x64.c +2 -1
- data/dyncall/dyncallback/dyncall_thunk_x64.h +2 -1
- data/dyncall/dyncallback/dyncall_thunk_x86.c +2 -1
- data/dyncall/dyncallback/dyncall_thunk_x86.h +2 -1
- data/dyncall/dyncallback/dyncallback.3 +3 -3
- data/dyncall/dyncallback/gen-masm.sh +0 -0
- data/dyncall/dynload/dynload.c +2 -1
- data/dyncall/dynload/dynload.h +2 -1
- data/dyncall/dynload/dynload_alloc.h +2 -1
- data/dyncall/dynload/dynload_darwin.c +2 -1
- data/dyncall/dynload/dynload_syms.c +2 -1
- data/dyncall/dynload/dynload_syms_elf.c +2 -1
- data/dyncall/dynload/dynload_syms_mach-o.c +3 -2
- data/dyncall/dynload/dynload_syms_pe.c +2 -1
- data/dyncall/dynload/dynload_unix.c +2 -1
- data/dyncall/dynload/dynload_windows.c +2 -1
- data/dyncall/portasm/gen-masm.sh +0 -0
- data/dyncall/portasm/portasm-arm.S +3 -2
- data/dyncall/portasm/portasm-ppc.S +2 -1
- data/dyncall/portasm/portasm-ppc64.S +119 -0
- data/dyncall/portasm/portasm-x64-att.S +2 -1
- data/dyncall/portasm/portasm-x86.S +2 -1
- metadata +39 -18
- data/dyncall/dyncallback/dyncall_callback_x64_apple.s +0 -122
- data/dyncall/dyncallback/dyncall_callback_x64_gas.s +0 -119
- 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
|
-
|
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
|
-
|
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
|
-
|
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.
|
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 ;
|
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 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
|
-
|
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
|
File without changes
|
File without changes
|
data/dyncall/configure
CHANGED
@@ -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
|
22
|
+
usage: $0 --<option>=<value> <var>=<value> ..
|
23
|
+
|
23
24
|
--prefix=<dir>
|
24
|
-
--target=<platform> MacOSX,iOS,iPhoneSimulator
|
25
|
-
|
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
|
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 "
|
70
|
+
printf "LDLIBS=-lm -ldl\n" >>$C
|
60
71
|
;;
|
61
|
-
OpenBSD
|
62
|
-
printf "
|
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
|
-
|
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
|
-
|
70
|
-
|
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.
|
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.
|
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
|
-
|
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
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
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
|
-
|
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
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
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
|
-
|
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
|
-
|
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"
|
data/dyncall/dyncall/dyncall.3
CHANGED
@@ -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
|
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
|
156
|
-
string encoding the argument types and return type. The
|
157
|
-
|
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
|
data/dyncall/dyncall/dyncall.h
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
Description: public header for library dyncall
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c) 2007-
|
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-
|
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-
|
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-
|
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(
|
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
|
+
|