rbdc 0.9.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/dyncall/BUGS +1 -1
- data/dyncall/CMakeLists.txt +19 -7
- data/dyncall/ChangeLog +61 -20
- data/dyncall/LICENSE +1 -1
- data/dyncall/Makefile.generic +2 -0
- data/dyncall/ToDo +97 -29
- data/dyncall/autovar/README.txt +1 -0
- data/dyncall/autovar/autovar_ABI.h +4 -2
- data/dyncall/autovar/autovar_ARCH.h +9 -5
- data/dyncall/autovar/autovar_CC.h +3 -1
- data/dyncall/autovar/autovar_OS.h +2 -2
- data/dyncall/autovar/autovar_OSFAMILY.h +1 -1
- data/dyncall/configure +94 -38
- data/dyncall/dyncall/dyncall.3 +8 -4
- data/dyncall/dyncall/dyncall.h +1 -1
- data/dyncall/dyncall/dyncall_alloc.h +1 -1
- data/dyncall/dyncall/dyncall_api.c +3 -1
- data/dyncall/dyncall/dyncall_call.S +13 -5
- data/dyncall/dyncall/dyncall_call_arm32_arm.S +1 -2
- data/dyncall/dyncall/dyncall_call_arm32_arm.h +1 -1
- data/dyncall/dyncall/dyncall_call_arm32_arm_armhf.S +24 -26
- data/dyncall/dyncall/dyncall_call_arm32_arm_armhf.h +1 -1
- data/dyncall/dyncall/dyncall_call_arm32_thumb.h +1 -1
- data/dyncall/dyncall/dyncall_call_arm32_thumb_armhf.S +1 -1
- data/dyncall/dyncall/dyncall_call_arm32_thumb_gas.s +3 -7
- data/dyncall/dyncall/dyncall_call_arm64.S +2 -2
- data/dyncall/dyncall/dyncall_call_arm64.h +2 -2
- data/dyncall/dyncall/dyncall_call_mips.h +1 -1
- data/dyncall/dyncall/dyncall_call_mips_eabi.h +1 -1
- data/dyncall/dyncall/dyncall_call_mips_eabi_gas.s +16 -16
- data/dyncall/dyncall/dyncall_call_mips_gas.S +2 -2
- data/dyncall/dyncall/dyncall_call_mips_n32.h +5 -4
- data/dyncall/dyncall/dyncall_call_mips_n32_gas.s +4 -4
- data/dyncall/dyncall/dyncall_call_mips_n64.h +3 -3
- data/dyncall/dyncall/dyncall_call_mips_n64_gas.s +2 -2
- data/dyncall/dyncall/dyncall_call_mips_o32.h +4 -3
- data/dyncall/dyncall/dyncall_call_mips_o32_gas.s +1 -3
- data/dyncall/dyncall/dyncall_call_ppc32.S +1 -1
- data/dyncall/dyncall/dyncall_call_ppc32.h +1 -1
- data/dyncall/dyncall/dyncall_call_sparc.h +1 -1
- data/dyncall/dyncall/{dyncall_call_sparc.S → dyncall_call_sparc.s} +39 -44
- data/dyncall/dyncall/dyncall_call_sparc64.h +5 -5
- data/dyncall/dyncall/dyncall_call_sparc64.s +177 -0
- data/dyncall/dyncall/dyncall_call_x64.S +83 -86
- data/dyncall/dyncall/dyncall_call_x64.h +1 -1
- data/dyncall/dyncall/dyncall_call_x86.S +9 -9
- data/dyncall/dyncall/dyncall_call_x86.h +1 -1
- data/dyncall/dyncall/dyncall_call_x86_nasm.asm +5 -5
- data/dyncall/dyncall/dyncall_callf.c +18 -18
- data/dyncall/dyncall/dyncall_callf.h +1 -1
- data/dyncall/dyncall/dyncall_callvm.c +3 -3
- data/dyncall/dyncall/dyncall_callvm.h +1 -1
- data/dyncall/dyncall/dyncall_callvm_arm32_arm.c +25 -40
- data/dyncall/dyncall/dyncall_callvm_arm32_arm.h +1 -5
- data/dyncall/dyncall/dyncall_callvm_arm32_arm_armhf.c +25 -33
- data/dyncall/dyncall/dyncall_callvm_arm32_arm_armhf.h +1 -5
- data/dyncall/dyncall/dyncall_callvm_arm32_thumb.c +24 -36
- data/dyncall/dyncall/dyncall_callvm_arm32_thumb.h +1 -5
- data/dyncall/dyncall/dyncall_callvm_arm64.c +23 -27
- data/dyncall/dyncall/dyncall_callvm_arm64.h +2 -6
- data/dyncall/dyncall/dyncall_callvm_arm64_apple.c +23 -30
- data/dyncall/dyncall/dyncall_callvm_base.c +1 -1
- data/dyncall/dyncall/dyncall_callvm_mips.c +1 -1
- data/dyncall/dyncall/dyncall_callvm_mips.h +1 -1
- data/dyncall/dyncall/dyncall_callvm_mips_eabi.c +30 -27
- data/dyncall/dyncall/dyncall_callvm_mips_eabi.h +1 -5
- data/dyncall/dyncall/dyncall_callvm_mips_n32.c +24 -30
- data/dyncall/dyncall/{dyncall_call_sparc_v9.h → dyncall_callvm_mips_n32.h} +18 -8
- data/dyncall/dyncall/dyncall_callvm_mips_n64.c +23 -30
- data/dyncall/dyncall/dyncall_callvm_mips_n64.h +4 -6
- data/dyncall/dyncall/dyncall_callvm_mips_o32.c +31 -29
- data/dyncall/dyncall/dyncall_callvm_mips_o32.h +1 -3
- data/dyncall/dyncall/dyncall_callvm_ppc32.c +22 -20
- data/dyncall/dyncall/dyncall_callvm_ppc32.h +1 -3
- data/dyncall/dyncall/dyncall_callvm_ppc64.c +54 -15
- data/dyncall/dyncall/dyncall_callvm_ppc64.h +0 -2
- data/dyncall/dyncall/dyncall_callvm_sparc.c +34 -26
- data/dyncall/dyncall/dyncall_callvm_sparc.h +1 -3
- data/dyncall/dyncall/dyncall_callvm_sparc64.c +94 -150
- data/dyncall/dyncall/dyncall_callvm_sparc64.h +11 -17
- data/dyncall/dyncall/dyncall_callvm_x64.c +37 -36
- data/dyncall/dyncall/dyncall_callvm_x64.h +1 -4
- data/dyncall/dyncall/dyncall_callvm_x86.c +22 -63
- data/dyncall/dyncall/dyncall_callvm_x86.h +1 -17
- data/dyncall/dyncall/dyncall_config.h +1 -1
- data/dyncall/dyncall/dyncall_macros.h +28 -19
- data/dyncall/dyncall/dyncall_signature.h +1 -1
- data/dyncall/dyncall/dyncall_types.h +17 -18
- data/dyncall/dyncall/dyncall_utils.h +1 -1
- data/dyncall/dyncall/dyncall_value.h +28 -21
- data/dyncall/dyncall/dyncall_vector.c +1 -1
- data/dyncall/dyncall/dyncall_vector.h +1 -1
- data/dyncall/dyncall/gen-masm.sh +2 -2
- data/dyncall/dyncallback/CMakeLists.txt +1 -2
- data/dyncall/dyncallback/Makefile.generic +1 -1
- data/dyncall/dyncallback/dyncall_alloc_wx.c +1 -1
- data/dyncall/dyncallback/dyncall_alloc_wx.h +4 -3
- data/dyncall/dyncallback/dyncall_alloc_wx_malloc.c +8 -2
- data/dyncall/dyncallback/dyncall_alloc_wx_mmap.c +67 -4
- data/dyncall/dyncallback/dyncall_alloc_wx_win32.c +7 -2
- data/dyncall/dyncallback/dyncall_args.c +19 -15
- data/dyncall/dyncallback/dyncall_args.h +1 -1
- data/dyncall/dyncallback/{dyncall_args_arm32_arm.c → dyncall_args_arm32.c} +4 -4
- data/dyncall/dyncallback/{dyncall_args_arm32_arm.h → dyncall_args_arm32.h} +6 -6
- data/dyncall/dyncallback/dyncall_args_arm64.c +2 -2
- data/dyncall/dyncallback/dyncall_args_arm64_apple.c +2 -2
- data/dyncall/dyncallback/dyncall_args_mips.c +26 -21
- data/dyncall/dyncallback/dyncall_args_mips.h +18 -6
- data/dyncall/dyncallback/dyncall_args_mips64.c +81 -0
- data/dyncall/dyncallback/dyncall_args_mips_o32.c +104 -0
- data/dyncall/dyncallback/dyncall_args_ppc32.c +2 -2
- data/dyncall/dyncallback/dyncall_args_ppc32.h +1 -1
- data/dyncall/dyncallback/dyncall_args_ppc32_sysv.c +1 -1
- data/dyncall/dyncallback/dyncall_args_ppc64.c +24 -3
- data/dyncall/dyncallback/dyncall_args_sparc32.c +41 -15
- data/dyncall/dyncallback/dyncall_args_sparc32.h +2 -2
- data/dyncall/dyncallback/dyncall_args_sparc64.c +28 -15
- data/dyncall/dyncallback/dyncall_args_sparc64.h +7 -3
- data/dyncall/dyncallback/dyncall_args_x64.c +1 -1
- data/dyncall/dyncallback/dyncall_args_x64.h +1 -1
- data/dyncall/dyncallback/dyncall_args_x86.c +1 -1
- data/dyncall/dyncallback/dyncall_args_x86.h +1 -1
- data/dyncall/dyncallback/dyncall_callback.c +10 -12
- data/dyncall/dyncallback/dyncall_callback.h +2 -4
- data/dyncall/dyncallback/dyncall_callback_arch.S +12 -2
- data/dyncall/dyncallback/{dyncall_callback_arm32_arm.c → dyncall_callback_arm32.c} +25 -10
- data/dyncall/dyncallback/dyncall_callback_arm32_arm_apple.s +7 -7
- data/dyncall/dyncallback/dyncall_callback_arm32_arm_gas.S +9 -9
- data/dyncall/dyncallback/dyncall_callback_arm32_thumb_apple.S +1 -1
- data/dyncall/dyncallback/dyncall_callback_arm32_thumb_gas.S +1 -1
- data/dyncall/dyncallback/dyncall_callback_arm64.S +2 -2
- data/dyncall/dyncallback/dyncall_callback_arm64.c +20 -14
- data/dyncall/dyncallback/dyncall_callback_mips.c +26 -9
- data/dyncall/dyncallback/dyncall_callback_mips_eabi_gas.s +99 -0
- data/dyncall/dyncallback/{dyncall_args_arm32_thumb.h → dyncall_callback_mips_gas.S} +14 -9
- data/dyncall/dyncallback/{dyncall_callback_arm32_thumb.c → dyncall_callback_mips_n32_gas.s} +12 -7
- data/dyncall/dyncallback/dyncall_callback_mips_n64_gas.s +98 -0
- data/dyncall/dyncallback/dyncall_callback_mips_o32_gas.s +100 -0
- data/dyncall/dyncallback/dyncall_callback_ppc32.S +54 -54
- data/dyncall/dyncallback/dyncall_callback_ppc32.c +23 -5
- data/dyncall/dyncallback/dyncall_callback_ppc32_apple.s +92 -117
- data/dyncall/dyncallback/dyncall_callback_ppc64.S +2 -2
- data/dyncall/dyncallback/dyncall_callback_ppc64.c +23 -5
- data/dyncall/dyncallback/dyncall_callback_sparc32.c +25 -7
- data/dyncall/dyncallback/dyncall_callback_sparc32.s +55 -4
- data/dyncall/dyncallback/dyncall_callback_sparc64.c +25 -7
- data/dyncall/dyncallback/dyncall_callback_sparc64.s +89 -5
- data/dyncall/dyncallback/dyncall_callback_x64.S +8 -8
- data/dyncall/dyncallback/dyncall_callback_x64.c +19 -6
- data/dyncall/dyncallback/dyncall_callback_x86.S +29 -25
- data/dyncall/dyncallback/dyncall_callback_x86.c +24 -11
- data/dyncall/dyncallback/dyncall_thunk.c +6 -6
- data/dyncall/dyncallback/dyncall_thunk.h +9 -7
- data/dyncall/dyncallback/{dyncall_thunk_arm32_arm.c → dyncall_thunk_arm32.c} +5 -3
- data/dyncall/dyncallback/{dyncall_thunk_arm32_arm.h → dyncall_thunk_arm32.h} +7 -7
- data/dyncall/dyncallback/dyncall_thunk_arm64.c +2 -2
- data/dyncall/dyncallback/dyncall_thunk_arm64.h +8 -13
- data/dyncall/dyncallback/dyncall_thunk_mips.c +16 -20
- data/dyncall/dyncallback/dyncall_thunk_mips.h +4 -2
- data/dyncall/dyncallback/dyncall_thunk_mips64.c +103 -0
- data/dyncall/dyncallback/{dyncall_callback_arm32_thumb.h → dyncall_thunk_mips64.h} +15 -8
- data/dyncall/dyncallback/dyncall_thunk_ppc32.c +4 -4
- data/dyncall/dyncallback/dyncall_thunk_ppc32.h +1 -1
- data/dyncall/dyncallback/dyncall_thunk_ppc32_sysv.c +9 -9
- data/dyncall/dyncallback/dyncall_thunk_ppc64.c +2 -2
- data/dyncall/dyncallback/dyncall_thunk_sparc32.c +19 -2
- data/dyncall/dyncallback/dyncall_thunk_sparc32.h +5 -4
- data/dyncall/dyncallback/dyncall_thunk_sparc64.c +42 -2
- data/dyncall/dyncallback/dyncall_thunk_sparc64.h +5 -5
- data/dyncall/dyncallback/dyncall_thunk_x64.c +1 -1
- data/dyncall/dyncallback/dyncall_thunk_x64.h +2 -2
- data/dyncall/dyncallback/dyncall_thunk_x86.c +1 -1
- data/dyncall/dyncallback/dyncall_thunk_x86.h +2 -2
- data/dyncall/dyncallback/dyncallback.3 +16 -11
- data/dyncall/dynload/dynload.3 +63 -8
- data/dyncall/dynload/dynload.c +2 -8
- data/dyncall/dynload/dynload.h +9 -5
- data/dyncall/dynload/dynload_alloc.h +1 -1
- data/dyncall/dynload/dynload_syms.c +1 -3
- data/dyncall/dynload/dynload_syms_elf.c +19 -11
- data/dyncall/dynload/dynload_syms_mach-o.c +151 -75
- data/dyncall/dynload/dynload_syms_pe.c +24 -24
- data/dyncall/dynload/dynload_unix.c +156 -13
- data/dyncall/dynload/dynload_windows.c +15 -11
- data/dyncall/portasm/portasm-arm.S +1 -1
- data/dyncall/portasm/portasm-ppc.S +1 -1
- data/dyncall/portasm/{portasm-x64-att.S → portasm-x64.S} +7 -4
- data/dyncall/portasm/portasm-x86.S +4 -2
- data/{dyncall-bindings/ruby/rbdc/extconf.rb → extconf.rb} +4 -4
- data/{dyncall-bindings/ruby/rbdc/rbdc.c → rbdc.c} +5 -5
- metadata +24 -48
- data/dyncall/Makefile.M +0 -15
- data/dyncall/buildsys/dynmake/Makefile.base.M +0 -82
- data/dyncall/buildsys/dynmake/dynmake.bat +0 -2
- data/dyncall/buildsys/dynmake/dynmake.sh +0 -4
- data/dyncall/dynMakefile +0 -4
- data/dyncall/dyncall/Makefile.M +0 -10
- data/dyncall/dyncall/TODO +0 -9
- data/dyncall/dyncall/dynMakefile +0 -4
- data/dyncall/dyncall/dyncall_call_sparc64.S +0 -362
- data/dyncall/dyncall/dyncall_call_sparc_v9.S +0 -222
- data/dyncall/dyncall/dyncall_call_x64-att.S +0 -147
- data/dyncall/dyncall/dyncall_callvm_sparc_v9.c +0 -182
- data/dyncall/dyncall/dyncall_callvm_sparc_v9.h +0 -46
- data/dyncall/dyncallback/Makefile.M +0 -10
- data/dyncall/dyncallback/README.txt +0 -9
- data/dyncall/dyncallback/TODO +0 -4
- data/dyncall/dyncallback/dynMakefile +0 -4
- data/dyncall/dyncallback/dyncall_args_arm32_thumb.c +0 -30
- data/dyncall/dyncallback/dyncall_callback_arm32_arm.h +0 -46
- data/dyncall/dyncallback/dyncall_callback_mips.h +0 -43
- data/dyncall/dyncallback/dyncall_callback_ppc32.h +0 -43
- data/dyncall/dyncallback/dyncall_callback_ppc64.h +0 -56
- data/dyncall/dyncallback/dyncall_callback_sparc32.h +0 -44
- data/dyncall/dyncallback/dyncall_callback_x64.h +0 -45
- data/dyncall/dyncallback/dyncall_callback_x86.h +0 -50
- data/dyncall/dyncallback/dyncall_thunk_arm32_thumb.c +0 -30
- data/dyncall/dyncallback/dyncall_thunk_arm32_thumb.h +0 -36
- data/dyncall/dynload/Makefile.M +0 -10
- data/dyncall/dynload/TODO +0 -20
- data/dyncall/dynload/dynMakefile +0 -4
- data/dyncall/dynload/dynload_darwin.c +0 -90
data/dyncall/autovar/README.txt
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
Description:
|
7
7
|
License:
|
8
8
|
|
9
|
-
Copyright (c) 2011-
|
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
|
-
#
|
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-
|
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(
|
54
|
-
#
|
55
|
-
#
|
56
|
-
#
|
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-
|
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-
|
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-
|
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
|
data/dyncall/configure
CHANGED
@@ -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
|
-
|
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
|
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
|
172
|
-
printf "CXX=`(which CC
|
173
|
-
printf "CCC
|
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
|
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
|
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
|
-
|
201
|
-
|
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
|
+
|
data/dyncall/dyncall/dyncall.3
CHANGED
@@ -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
|
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
|
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-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-
|
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-
|
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-
|
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
|
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(
|
72
|
-
# include "
|
71
|
+
# elif defined(DC__Arch_Sparc64)
|
72
|
+
# include "dyncall_call_sparc64.s"
|
73
73
|
# elif defined(DC__Arch_Sparc)
|
74
|
-
# include "dyncall_call_sparc.
|
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-
|
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-
|
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
|