rbdc 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/dyncall/CMakeLists.txt +3 -3
- data/dyncall/ChangeLog +33 -0
- data/dyncall/ChangeLog.orig +274 -0
- data/dyncall/LICENSE +1 -1
- data/dyncall/README +3 -5
- data/dyncall/ToDo +27 -18
- data/dyncall/ToDo.orig +201 -0
- data/dyncall/autovar/autovar_ARCH.h +1 -1
- data/dyncall/buildsys/vs2005/vs2005.sln +0 -9
- data/dyncall/cconv.lang +36 -0
- data/dyncall/configure +17 -9
- data/dyncall/configure.bat +1 -1
- data/dyncall/dyncall/dyncall.h +2 -1
- data/dyncall/dyncall/dyncall_call.S +9 -1
- data/dyncall/dyncall/dyncall_call_mips_n32.S +192 -0
- data/dyncall/dyncall/dyncall_call_mips_n64.S +197 -0
- data/dyncall/dyncall/dyncall_call_mips_n64.h +2 -0
- data/dyncall/dyncall/{dyncall_call_mips_o32_gas.s → dyncall_call_mips_o32.S} +44 -42
- data/dyncall/dyncall/dyncall_call_mips_o32.h +8 -3
- data/dyncall/dyncall/dyncall_call_ppc32.S +3 -1
- data/dyncall/dyncall/dyncall_call_ppc32.h +4 -3
- data/dyncall/dyncall/dyncall_call_ppc64.S +1 -1
- data/dyncall/dyncall/dyncall_call_ppc64.h +3 -0
- data/dyncall/dyncall/dyncall_call_x64.S +27 -2
- data/dyncall/dyncall/dyncall_call_x64.h +2 -1
- data/dyncall/dyncall/dyncall_call_x64_generic_masm.asm +13 -2
- data/dyncall/dyncall/dyncall_call_x86.S +6 -6
- data/dyncall/dyncall/dyncall_call_x86.h +7 -7
- data/dyncall/dyncall/dyncall_call_x86_generic_masm.asm +6 -7
- data/dyncall/dyncall/dyncall_callvm_mips_n64.c +27 -9
- data/dyncall/dyncall/dyncall_callvm_mips_o32.c +38 -31
- data/dyncall/dyncall/dyncall_callvm_mips_o32.c.orig +247 -0
- data/dyncall/dyncall/dyncall_callvm_x64.c +57 -3
- data/dyncall/dyncall/dyncall_callvm_x86.c +32 -32
- data/dyncall/dyncall/dyncall_macros.h +11 -8
- data/dyncall/dyncall/dyncall_struct.c +12 -6
- data/dyncall/dyncall/dyncall_struct.h +1 -1
- data/dyncall/dyncall/dyncall_vector.c +13 -12
- data/dyncall/dyncall/dyncall_vector.c.orig +53 -0
- data/dyncall/dyncall/gen-masm.sh +4 -5
- data/dyncall/dyncallback/dyncall_args_mips.h +24 -6
- data/dyncall/dyncallback/dyncall_args_mips64.c +3 -3
- data/dyncall/dyncallback/dyncall_args_mips_o32.c +19 -6
- data/dyncall/dyncallback/dyncall_callback_arch.S +11 -1
- data/dyncall/dyncallback/{dyncall_callback_mips_n32_gas.s → dyncall_callback_mips_n32.S} +1 -1
- data/dyncall/dyncallback/{dyncall_callback_mips_n64_gas.s → dyncall_callback_mips_n64.S} +39 -25
- data/dyncall/dyncallback/{dyncall_callback_mips_o32_gas.s → dyncall_callback_mips_o32.S} +29 -13
- data/dyncall/dyncallback/dyncall_callback_x86_masm.asm +0 -1
- data/dyncall/dyncallback/dyncall_thunk.h +1 -1
- data/dyncall/dyncallback/gen-masm.sh +3 -5
- data/dyncall/dynload/dynload.3 +16 -4
- data/dyncall/dynload/dynload_unix.c +101 -53
- data/dyncall/dynload/dynload_windows.c +76 -3
- data/dyncall/portasm/README.txt +1 -1
- data/dyncall/portasm/gen-masm.sh +5 -1
- metadata +14 -13
- data/dyncall/buildsys/vs2005/test_plain/test_plain.vcproj +0 -202
- data/dyncall/dyncall/dyncall_call_mips_gas.S +0 -37
- data/dyncall/dyncall/dyncall_call_mips_n32_gas.s +0 -192
- data/dyncall/dyncall/dyncall_call_mips_n64_gas.s +0 -192
- data/dyncall/dyncallback/dyncall_callback_mips_gas.S +0 -38
data/dyncall/ToDo.orig
ADDED
@@ -0,0 +1,201 @@
|
|
1
|
+
1.1:
|
2
|
+
----
|
3
|
+
- test atpcs thumb on arm and verify if ellipse and C++ thiscalls work, if so adapt doc appendix
|
4
|
+
- test eabi thumb on arm and verify if ellipse and C++ thiscalls work, if so adapt doc appendix
|
5
|
+
- new platform matrix
|
6
|
+
* check dark green cells and validit in general
|
7
|
+
- dyncall/dyncall_call*h could probably be all removed, as forward declarations in corresponding .c
|
8
|
+
files would be enough; no headers are needed b/c those functions declared in there are of no public use
|
9
|
+
|
10
|
+
1.2:
|
11
|
+
----
|
12
|
+
- test/thunk win/x64 doesn't output anything decent for stack test (neither sigsegv nor output), which can create a problem for test log file as it'll mess with the subsequent test's output)
|
13
|
+
- remove test/gen-masm alltogether
|
14
|
+
- test code: add sparc tests for when out of register windows, meaning multiple layers deep in the call stack
|
15
|
+
- ./configure on macOS does not pass CFLAGS etc.. to Makefile.config
|
16
|
+
- support platforms without shared libraries so they can be built by just typing `./configure;make` (e.g. minix < 3.2.1)
|
17
|
+
* also make sure minix with shared library support builds and works in general (>= 3.2.1) as well as ELF on Minix (>= 3.2.0) to begin with (as that's the base, and we only test on 3.1.8 so far)
|
18
|
+
- dyncall supports calls to functions where prototype exists (with and without varargs); however not when no
|
19
|
+
prototype exist (e.g. just calling some pointer), without any declaration... even possible in C, as one has
|
20
|
+
to cast to the function type? need to support?
|
21
|
+
|
22
|
+
|
23
|
+
- dyncallback's "stack_cleanup" can be removed from non x86 impls... test if they still work
|
24
|
+
- target a minimum c version, for use with -pedantic, etc.? Right now we use e.g. extensions
|
25
|
+
for anon structs, etc. -> we do now target c99
|
26
|
+
- the CallVM-free functions are per VTable, however the latter can be changed out
|
27
|
+
at runtime... which basically changes potentially the deallocator...
|
28
|
+
same goes for functions setting the mode. think about how to make this safer - currently
|
29
|
+
we have a higher flexibility and we need to potentially clean up from the mode we are in,
|
30
|
+
however, this is open to misuse
|
31
|
+
- check all vararg calling conv implementations if they promote correctly
|
32
|
+
(e.g. float to double); we used to not care as it was the user's job to
|
33
|
+
think of that, but we allow users to use ArgFloat, etc. on "..." now,
|
34
|
+
taking care of the promotion; so it should be consistent all across the
|
35
|
+
implementations -> also write testcode specifically for that
|
36
|
+
- autovar was never really pushed all the way through and still plays second
|
37
|
+
fiddle to dyncall_macros.h, clean this all up, eventually (Tassilo: for now, I
|
38
|
+
removed out of sync files to avoid confusion; but still probably duped code)
|
39
|
+
- add portable "make install"
|
40
|
+
* make install should also install manpages
|
41
|
+
- mailing list announcements (html email?)
|
42
|
+
- fix for NDS:
|
43
|
+
* ARM:
|
44
|
+
- callback_plain retval wrong (not only platform), area on stack where
|
45
|
+
it's stored is probably not zeroed, so half-words, etc., come with garbage
|
46
|
+
* THUMB:
|
47
|
+
- ellipsis (might be test itself, not respecting fixed part of args)
|
48
|
+
- callback_plain retval, see above under ARM
|
49
|
+
- callf
|
50
|
+
- support Solaris11 CFLAGS with -D_FILE_OFFSET_BITS=64
|
51
|
+
- make sure selinux works (esp. regarding NX bits)
|
52
|
+
Daniel has a patch for it, if needed, implementing allocwx with two memory blocks, one for w^x, mmaped to one for r|x
|
53
|
+
- support /SAFESEH on cl/win32
|
54
|
+
- test code functions should be in .so files, optionally, so the suites can directly
|
55
|
+
be used to test dycnall bindings
|
56
|
+
- pkg-config support?
|
57
|
+
- quadmath support (long double)
|
58
|
+
- add tests using alloca(), as this might depend on the frame pointer being correctly set (we don't
|
59
|
+
check for this, currently, at all - but might not affect dyncall's stubs, anyways) - verify
|
60
|
+
|
61
|
+
portasm:
|
62
|
+
--------
|
63
|
+
- add solaris support for x64
|
64
|
+
|
65
|
+
dyncall:
|
66
|
+
--------
|
67
|
+
- merge arm32_thumb_{gas/apple} and include thumb support for portasm
|
68
|
+
- x64 verification: return values are passed via RAX and RDX, and XMM0 and XMM1.
|
69
|
+
- find big endian arm box (also hardfloat), e.g. cubietruck: http://blog.netbsd.org/tnf/entry/working_arm_multiprocessor_support
|
70
|
+
- test if armhf/thumb is actually working... pulls in arm mode code in dyncall_callvm.c
|
71
|
+
- dyncall_call_mips_n32.h and dyncall_call_mips_n64.h are pretty much the same, share code
|
72
|
+
- support for return values: aggregate return values
|
73
|
+
- support for argument values: structures, half-precision, vector types, long double
|
74
|
+
* make sure that struct support for ellipsis calls are not forgotten (copy everything by value)
|
75
|
+
- consider automatic type-promotion for arguments passed through DC_CALL_C_ELLIPSIS_VARARGS;
|
76
|
+
this would make it easier to just pass arguments instead of having to know about the C
|
77
|
+
type promotions (this is partly done, see todo-item above under 1.1)
|
78
|
+
- other syscalls
|
79
|
+
- test MIPS32 eabi big endian (current port works on psp, which is little endian)
|
80
|
+
- implement MIPS64 N32 (gcc -mabi=n32); both, little and big-endian (looks like NetNBSD on and
|
81
|
+
EdgeRouter lite uses this: https://blog.netbsd.org/tnf/entry/hands_on_experience_with_edgerouter)
|
82
|
+
- MIPS64 n32 softfloat support (-msoft-float)
|
83
|
+
- implement MIPS64 EABI (gcc -mabi=eabi); both, little and big-endian
|
84
|
+
- support for Minix/arm
|
85
|
+
- improve ellipsis test:
|
86
|
+
* test not just with one fixed arg, to also simulate alignment problems
|
87
|
+
* test return values
|
88
|
+
* convert from c++ to c, to have it also on plan9, and more portability
|
89
|
+
|
90
|
+
dynload:
|
91
|
+
--------
|
92
|
+
- dlGetLibraryPath: dl_iterate_phdr() used on OpenBSD, but not available on version < 3.7
|
93
|
+
- bug: test/nm crashes on qemu mips linux o32 debian etch
|
94
|
+
- rename SymsInit to InitSyms and similar for cleanup function to reflect naming
|
95
|
+
in dyncall
|
96
|
+
- get rid of Dl_info and friends (_GNU_SOURCE) in dynload/dynload_syms_elf.c
|
97
|
+
for implementation of dlSymsNameFromValue(..)
|
98
|
+
- check if PSP can support dynload (missing elf.h, dlfcn.h, etc.); fixup readme if successful
|
99
|
+
- some functionality like java's System.mapLibraryName('name') might be helpful?
|
100
|
+
- Failed On Open Solaris 11:
|
101
|
+
In file included from dynload_syms.c:28:
|
102
|
+
dynload_syms_elf.c:56: error: syntax error before "Elf_Dyn"
|
103
|
+
dynload_syms_elf.c:56: warning: data definition has no type or storage class
|
104
|
+
dynload_syms_elf.c: In function `dlSymsInit':
|
105
|
+
dynload_syms_elf.c:155: error: `pDyn' undeclared (first use in this function)
|
106
|
+
dynload_syms_elf.c:155: error: (Each undeclared identifier is reported only once
|
107
|
+
dynload_syms_elf.c:155: error: for each function it appears in.)
|
108
|
+
dynload_syms_elf.c:155: error: syntax error before ')' token
|
109
|
+
dynload_syms_elf.c:160: error: `DT_NULL' undeclared (first use in this function)
|
110
|
+
dynload_syms_elf.c:163: error: `DT_STRTAB' undeclared (first use in this function)
|
111
|
+
dynload_syms_elf.c:164: error: `DT_SYMTAB' undeclared (first use in this function)
|
112
|
+
dynload_syms_elf.c:165: error: `DT_HASH' undeclared (first use in this function)
|
113
|
+
make: *** [dynload_syms.o] Error 1
|
114
|
+
|
115
|
+
dyncallback:
|
116
|
+
------------
|
117
|
+
- callback_plain's return value not correct anymore on NDS (maybe just broken testcode?),
|
118
|
+
see above under 1.1 items
|
119
|
+
* check other platforms also, if asm stub initializes retval space, correctly
|
120
|
+
- test MIPS32 eabi big endian (current port works on psp, which is little endian)
|
121
|
+
- implement MIPS64 N32 (gcc -mabi=n32); both, little and big-endian (looks like NetNBSD on and
|
122
|
+
EdgeRouter lite uses this: https://blog.netbsd.org/tnf/entry/hands_on_experience_with_edgerouter)
|
123
|
+
- MIPS64 n32 softfloat support (-msoft-float)
|
124
|
+
- implement MIPS64 EABI (gcc -mabi=eabi); both, little and big-endian
|
125
|
+
- support for Minix/arm
|
126
|
+
|
127
|
+
bindings:
|
128
|
+
---------
|
129
|
+
- release bindings as standalone packages (already done for rbdc as a gem and rdyncall on cran)
|
130
|
+
* add note to documentation, where bindings are and that some bindings are svn-only ATM
|
131
|
+
- add rdoc documentation to ruby gem
|
132
|
+
- add pydoc for python
|
133
|
+
- add manpage for shdc
|
134
|
+
- expose callf-convenience functions to go
|
135
|
+
- add godoc for godc
|
136
|
+
- add javadoc to java
|
137
|
+
- add more bindings
|
138
|
+
- add callback support for erlang, go, java, lua, python and ruby (and shell? how?)
|
139
|
+
- add call-conv-mode-support for rbdc through signature
|
140
|
+
|
141
|
+
manual:
|
142
|
+
-------
|
143
|
+
- introduce doc overview tables and common vocab for calling convention specifics, following example of table on page 13 of https://www.linux-mips.org/pub/linux/mips/doc/ABI/MIPS-N32-ABI-Handbook.pdf; also as inspiration, e.g. user 'preserved' instead of 'permanent', etc. https://developer.apple.com/library/content/documentation/Xcode/Conceptual/iPhoneOSABIReference/Articles/ARMv6FunctionCallingConventions.html#//apple_ref/doc/uid/TP40009021-SW4
|
144
|
+
* also, get inspiration for naming for GCC predefs as talked about in https://stffrdhrn.github.io/software/embedded/openrisc/2018/06/08/gcc_stack_frames.html
|
145
|
+
- make stack layout diagrams better, e.g. add grow direction (example: https://developer.apple.com/library/content/documentation/Xcode/Conceptual/iPhoneOSABIReference/art/arm_stack.jpg on https://developer.apple.com/library/content/documentation/Xcode/Conceptual/iPhoneOSABIReference/Articles/ARMv6FunctionCallingConventions.html#//apple_ref/doc/uid/TP40009021-SW1)
|
146
|
+
* another example, chapter 3 of: ftp://www.sourceware.org/pub/binutils/ppc-docs/ppc-poweropen/
|
147
|
+
- provide more examples on how to use dyncall, dynload and dyncallback
|
148
|
+
* e.g. enhance manual with a couple of examples (e.g. calling MessageBoxA on windows, etc.)
|
149
|
+
- manuals for bindings (as stated in bindings-section, above)
|
150
|
+
- under "dyncall support", in each calling convention appendix, list crucial details of e.g. big/little endian support, etc.
|
151
|
+
- specify integer models in use, use common ILP32, LLP64, etc. terms
|
152
|
+
|
153
|
+
regressions:
|
154
|
+
------------
|
155
|
+
- Haiku/gmake build doesn't build dynload due to the fact, that elf.h is not found
|
156
|
+
on default installations (one has to install the system headers)
|
157
|
+
* add to doc
|
158
|
+
- Solaris/gmake build doesn't build dynload and tests anymore (maybe not even dyncallback)
|
159
|
+
- look over code and fix TODO or @@@ marks
|
160
|
+
- add ppc-support to doc (both, 32 and 64, as well as little and big endian remarks)
|
161
|
+
|
162
|
+
nice to have:
|
163
|
+
-------------
|
164
|
+
- update: microsoft visual c++ build files - integrate all test suites in solution file
|
165
|
+
- consistency: on x64 platforms: make both ABIs available ('win64','sysv') for all x64 OS ports
|
166
|
+
- microsoft build enhancement: autodetect assembly via C preprocessor (like with .S gcc files)
|
167
|
+
- test/thunk: some platforms do not allow for allocation of executable code on heap and stack --
|
168
|
+
currently this test will segfault (handled), maybe we should collect information which platforms allow and which not.
|
169
|
+
- PSP
|
170
|
+
- automate ppsspp stuff, seems to print to stdout for callback_suite? but not for call_suite.. (?)
|
171
|
+
- fix link with dummy versions of the following for test-bins:
|
172
|
+
void __stack_chk_fail(){}
|
173
|
+
void __stack_chk_guard(){}
|
174
|
+
|
175
|
+
bugs:
|
176
|
+
-----
|
177
|
+
- setting callconv, specifically for platforms that have only one (default)) excepts on some
|
178
|
+
platforms, eg. setting X64_sysv on amd64/Linux - keeping cdecl which is the same in
|
179
|
+
this case, works (this should work now...)
|
180
|
+
- vararg function calls don't work for ARM THUMB mode (Daniel's new interface for modesetting for varag
|
181
|
+
args should be used); adapt test/ellipsis and/or retest
|
182
|
+
|
183
|
+
missing implementations (descending priority):
|
184
|
+
----------------------------------------------
|
185
|
+
- riscv
|
186
|
+
- itanium
|
187
|
+
- superh/j-core
|
188
|
+
- 68k, 88k, 6502, etc.
|
189
|
+
- arc
|
190
|
+
- alpha
|
191
|
+
- cell
|
192
|
+
- blackfin
|
193
|
+
- seaforth
|
194
|
+
- s/390
|
195
|
+
- z80
|
196
|
+
- hppa
|
197
|
+
- vax
|
198
|
+
- atmel avr
|
199
|
+
- propeller
|
200
|
+
- amd29k
|
201
|
+
|
@@ -3,11 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 9.00
|
|
3
3
|
# Visual Studio 2005
|
4
4
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dyncall", "dyncall\dyncall.vcproj", "{DF67B85F-C8F8-4FB1-A701-867A9C835ABA}"
|
5
5
|
EndProject
|
6
|
-
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_plain", "test_plain\test_plain.vcproj", "{65E1A63C-079D-4F72-8307-E070A499D2EA}"
|
7
|
-
ProjectSection(ProjectDependencies) = postProject
|
8
|
-
{DF67B85F-C8F8-4FB1-A701-867A9C835ABA} = {DF67B85F-C8F8-4FB1-A701-867A9C835ABA}
|
9
|
-
EndProjectSection
|
10
|
-
EndProject
|
11
6
|
Global
|
12
7
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
13
8
|
Debug|Win32 = Debug|Win32
|
@@ -18,10 +13,6 @@ Global
|
|
18
13
|
{DF67B85F-C8F8-4FB1-A701-867A9C835ABA}.Debug|Win32.Build.0 = Debug|Win32
|
19
14
|
{DF67B85F-C8F8-4FB1-A701-867A9C835ABA}.Release|Win32.ActiveCfg = Release|Win32
|
20
15
|
{DF67B85F-C8F8-4FB1-A701-867A9C835ABA}.Release|Win32.Build.0 = Release|Win32
|
21
|
-
{65E1A63C-079D-4F72-8307-E070A499D2EA}.Debug|Win32.ActiveCfg = Debug|Win32
|
22
|
-
{65E1A63C-079D-4F72-8307-E070A499D2EA}.Debug|Win32.Build.0 = Debug|Win32
|
23
|
-
{65E1A63C-079D-4F72-8307-E070A499D2EA}.Release|Win32.ActiveCfg = Release|Win32
|
24
|
-
{65E1A63C-079D-4F72-8307-E070A499D2EA}.Release|Win32.Build.0 = Release|Win32
|
25
16
|
EndGlobalSection
|
26
17
|
GlobalSection(SolutionProperties) = preSolution
|
27
18
|
HideSolutionNode = FALSE
|
data/dyncall/cconv.lang
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
e.g. vx{r%eax%ebx l0pL}
|
2
|
+
|
3
|
+
NOTE: codes are regex style in left hand columns
|
4
|
+
|
5
|
+
[ ;] token delimiters (if needed)
|
6
|
+
[v^] stack direction: down/up
|
7
|
+
[1248xX] slot alignment: x=16, X=32
|
8
|
+
0 requires 0 in unused space (alignment/justification)
|
9
|
+
[if]?[<>] slot justification (i=int, f=float, both if ommitted)
|
10
|
+
[{}] frame begin/end (= fp/sp)
|
11
|
+
|
12
|
+
|
13
|
+
Areas
|
14
|
+
|
15
|
+
r([0-9]+|(%[a-z0-9])+) register save area, number is (aligned) slot count or alternatively names of registers in order
|
16
|
+
s([0-9]+|(%[a-z0-9])+) spill area, "
|
17
|
+
n[0-9]+ null/unused, number is aligned slot count
|
18
|
+
l[0-9]+ local data, number is minium aligned slot count
|
19
|
+
p([0-9]+|([if][<>1248xX]?)+) stack params, number is aligned slot count or alternatively float/int specs (with alignment/justification specifiers, if difference from global setting) @@@ this is an n-element space, so not sure if the hard specification of count/type makes any sense, here
|
20
|
+
L link address
|
21
|
+
@@@ needed?: S[0-9]+ special, "
|
22
|
+
|
23
|
+
|
24
|
+
conditionals:
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
see also wacom's #pragma aux, e.g.:
|
30
|
+
#pragma aux __mycall "_!" \ mangle with _prefix and lowercase
|
31
|
+
parm caller [eax ecx] \ use eax and ecx for params
|
32
|
+
value [edx] \ return in edx
|
33
|
+
modify [eax ecx edx] eax, ecx and edx are scratch
|
34
|
+
|
35
|
+
more: https://users.pja.edu.pl/~jms/qnx/help/watcom/compiler-tools/pragma32.html
|
36
|
+
|
data/dyncall/configure
CHANGED
@@ -5,7 +5,7 @@ cat <<EOF
|
|
5
5
|
usage: $0 --<option>=<value> <var>=<value> ..
|
6
6
|
|
7
7
|
--prefix=<dir>
|
8
|
-
--target=<platform> uname/special targets:
|
8
|
+
--target=<platform> uname/special targets: macos,iOS,iPhoneSimulator
|
9
9
|
use "?" to get a list of explicitly specifiable
|
10
10
|
targets
|
11
11
|
--sdk=<version> Mac OS X/iOS SDK version (e.g. '6.1' or '10.9.3')
|
@@ -91,12 +91,17 @@ case ${TARGET:=`uname`} in
|
|
91
91
|
;;
|
92
92
|
FreeBSD)
|
93
93
|
if [ -z "${CFLAGS}" ]; then
|
94
|
-
|
94
|
+
if [ `uname -m` = "mips" ] && make -V MACHINE_ARCH | grep 'hf$' >/dev/null 2>&1; then
|
95
|
+
# FBSD12-CURRENT/mipshf needs to be told explicitly to use -mhard-float (at least as of may 2018)
|
96
|
+
printf "CFLAGS=-fPIC -mhard-float\n" >>$C
|
97
|
+
else
|
98
|
+
printf "CFLAGS=-fPIC\n" >>$C
|
99
|
+
fi
|
95
100
|
fi
|
96
101
|
printf "LDLIBS=-lm\n" >>$C
|
97
102
|
printf "RM=rm -f\n" >>$C
|
98
103
|
;;
|
99
|
-
MacOSX|Darwin)
|
104
|
+
MacOSX|macos|Darwin)
|
100
105
|
# if Apple's libtool (not to be confused with GNU's) is available, which is according to libtool(1) "with -static [...] intended
|
101
106
|
# 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
|
102
107
|
# intentionally used, and fall back to using 'ar rs' (the equivalent to 'libtool -static'), for compatibility:
|
@@ -111,18 +116,21 @@ case ${TARGET:=`uname`} in
|
|
111
116
|
printf "CC=gcc\n" >>$C
|
112
117
|
elif [ -z ${SDK} ]; then
|
113
118
|
case `sw_vers -productVersion` in
|
114
|
-
10.4.*)
|
119
|
+
10.4.*) # == tiger (10.4.*)
|
115
120
|
ARCHS="-arch ppc -arch i386 -arch x86_64"
|
116
121
|
;;
|
117
|
-
10.5.*)
|
122
|
+
10.5.*) # == leopard (10.5.*)
|
118
123
|
ARCHS="-arch i386 -arch x86_64 -arch ppc"
|
119
124
|
;;
|
120
|
-
10.6.*)
|
121
|
-
ARCHS="-arch i386 -arch x86_64"
|
125
|
+
10.6.*) # == snow leopard (10.6.*)
|
126
|
+
ARCHS="-arch i386 -arch x86_64" # no more ppc
|
122
127
|
;;
|
123
|
-
10.[789].*|10.1
|
128
|
+
10.[789].*|10.1[0123].*|10.1[0123]) # >= lion (10.7.*), <= high sierra (10.13.*)
|
124
129
|
ARCHS="-arch x86_64 -arch i386"
|
125
130
|
;;
|
131
|
+
10.1?.*|10.1?) # >= mojave (10.14.*)
|
132
|
+
ARCHS="-arch x86_64" # mojave is final os to run x86 code, but removed build support for it
|
133
|
+
;;
|
126
134
|
esac
|
127
135
|
printf "ASFLAGS=${ARCHS}\n" >>$C
|
128
136
|
printf "CFLAGS=${ARCHS}\n" >>$C
|
@@ -147,7 +155,7 @@ case ${TARGET:=`uname`} in
|
|
147
155
|
[67].*)
|
148
156
|
ARCHS="-arch armv7"
|
149
157
|
;;
|
150
|
-
[89].*)
|
158
|
+
[89].*|1[0-9].*)
|
151
159
|
ARCHS="-arch armv7 -arch arm64"
|
152
160
|
;;
|
153
161
|
esac
|
data/dyncall/configure.bat
CHANGED
@@ -56,7 +56,7 @@ IF [%1]==[] (
|
|
56
56
|
ECHO. /prefix-bd PATH set build directory prefix ^(GNU make only^)
|
57
57
|
ECHO. ^(only for use with gmake^)
|
58
58
|
ECHO.
|
59
|
-
ECHO. /target-x86 build for x86 architecture
|
59
|
+
ECHO. /target-x86 build for x86 architecture
|
60
60
|
ECHO. /target-x64 build for x64 architecture
|
61
61
|
ECHO. /target-psp build for PlayStation Portable ^(homebrew SDK^)
|
62
62
|
ECHO. /target-nds-arm build for Nintendo DS ^(devkitPro, ARM mode^)
|
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-2020 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
|
@@ -83,6 +83,7 @@ typedef struct DCstruct_ DCstruct;
|
|
83
83
|
#define DC_CALL_SYS_DEFAULT 200
|
84
84
|
#define DC_CALL_SYS_X86_INT80H_LINUX 201
|
85
85
|
#define DC_CALL_SYS_X86_INT80H_BSD 202
|
86
|
+
#define DC_CALL_SYS_X64_SYSCALL_SYSV 204
|
86
87
|
#define DC_CALL_SYS_PPC32 210
|
87
88
|
#define DC_CALL_SYS_PPC64 211
|
88
89
|
|
@@ -67,7 +67,15 @@
|
|
67
67
|
# elif defined(DC__Arch_PPC64)
|
68
68
|
# include "dyncall_call_ppc64.S"
|
69
69
|
# elif defined(DC__Arch_MIPS) || defined(DC__Arch_MIPS64)
|
70
|
-
#
|
70
|
+
# if defined(DC__ABI_MIPS_O32)
|
71
|
+
# include "dyncall_call_mips_o32.S"
|
72
|
+
# elif defined(DC__ABI_MIPS_N64)
|
73
|
+
# include "dyncall_call_mips_n64.S"
|
74
|
+
# elif defined(DC__ABI_MIPS_N32)
|
75
|
+
# include "dyncall_call_mips_n32.S"
|
76
|
+
# else
|
77
|
+
# include "dyncall_call_mips_eabi_gas.s"
|
78
|
+
# endif
|
71
79
|
# elif defined(DC__Arch_Sparc64)
|
72
80
|
# include "dyncall_call_sparc64.s"
|
73
81
|
# elif defined(DC__Arch_Sparc)
|
@@ -0,0 +1,192 @@
|
|
1
|
+
/*
|
2
|
+
|
3
|
+
Package: dyncall
|
4
|
+
Library: dyncall
|
5
|
+
File: dyncall/dyncall_call_mips_n32.S
|
6
|
+
Description: mips64 "n32" abi call kernel implementation in GNU Assembler
|
7
|
+
License:
|
8
|
+
|
9
|
+
Copyright (c) 2007-2018 Daniel Adler <dadler@uni-goettingen.de>,
|
10
|
+
Tassilo Philipp <tphilipp@potion-studios.com>
|
11
|
+
|
12
|
+
Permission to use, copy, modify, and distribute this software for any
|
13
|
+
purpose with or without fee is hereby granted, provided that the above
|
14
|
+
copyright notice and this permission notice appear in all copies.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
17
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
18
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
19
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
20
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
21
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
22
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
23
|
+
|
24
|
+
*/
|
25
|
+
|
26
|
+
.section .mdebug.abiN32
|
27
|
+
.previous
|
28
|
+
.abicalls
|
29
|
+
.text
|
30
|
+
.align 2
|
31
|
+
.globl dcCall_mips_n32
|
32
|
+
.ent dcCall_mips_n32
|
33
|
+
dcCall_mips_n32:
|
34
|
+
|
35
|
+
/* Stack-frame prolog */
|
36
|
+
|
37
|
+
.frame $fp,64,$31 /* vars=16, regs=3/0, args=0, extra=16 */
|
38
|
+
.mask 0xd0000000,-8
|
39
|
+
.fmask 0x00000000,0
|
40
|
+
subu $sp,$sp,64
|
41
|
+
sd $31,48($sp) /* save return address register (ra) */
|
42
|
+
sd $30,40($sp) /* save frame pointer register (fp) */
|
43
|
+
sd $28,32($sp) /* save global pointer register (gp) */
|
44
|
+
move $fp,$sp
|
45
|
+
|
46
|
+
|
47
|
+
/* arguments: */
|
48
|
+
|
49
|
+
/* $4 target function */
|
50
|
+
/* $5 register data */
|
51
|
+
/* $6 stack size */
|
52
|
+
/* $7 stack data */
|
53
|
+
|
54
|
+
|
55
|
+
/* allocate argument stack space */
|
56
|
+
|
57
|
+
subu $sp, $sp, $6
|
58
|
+
|
59
|
+
/* copy stack data */
|
60
|
+
|
61
|
+
/* n32 abi call assumptions:
|
62
|
+
- stack data is 16-byte aligned.
|
63
|
+
- no extra-storage for arguments passed via registers.
|
64
|
+
*/
|
65
|
+
|
66
|
+
/* $12 source pointer (parameter stack data) */
|
67
|
+
/* $14 destination (stack pointer) */
|
68
|
+
/* $6 byte count */
|
69
|
+
|
70
|
+
move $12, $7
|
71
|
+
move $14, $sp
|
72
|
+
|
73
|
+
.next:
|
74
|
+
beq $6, $0, .skip
|
75
|
+
nop
|
76
|
+
daddiu $6, $6, -8
|
77
|
+
ld $2, 0($12)
|
78
|
+
sd $2, 0($14)
|
79
|
+
daddiu $12,$12, 8
|
80
|
+
daddiu $14,$14, 8
|
81
|
+
b .next
|
82
|
+
.skip:
|
83
|
+
move $25, $4
|
84
|
+
|
85
|
+
/* load registers */
|
86
|
+
|
87
|
+
/* locals: */
|
88
|
+
/* $13 = register data */
|
89
|
+
/* $14 = useDouble flags */
|
90
|
+
move $13, $5
|
91
|
+
ld $14, 128($13)
|
92
|
+
|
93
|
+
/* load integer parameter registers */
|
94
|
+
|
95
|
+
ld $4 , 0($13)
|
96
|
+
ld $5 , 8($13)
|
97
|
+
ld $6 ,16($13)
|
98
|
+
ld $7 ,24($13)
|
99
|
+
ld $8 ,32($13)
|
100
|
+
ld $9 ,40($13)
|
101
|
+
ld $10,48($13)
|
102
|
+
ld $11,56($13)
|
103
|
+
|
104
|
+
/* load float-or-double floating pointer parameter registers
|
105
|
+
a 64-bit bitmask given at byte offset 128 of regdata indicates
|
106
|
+
if loading a float (bit cleared) or double (bit set), starting
|
107
|
+
at bit position 0 in bitmask.
|
108
|
+
*/
|
109
|
+
.t0:
|
110
|
+
and $15, $14, 1
|
111
|
+
bgtz $15, .d0
|
112
|
+
.f0:
|
113
|
+
l.s $f12, 64($13)
|
114
|
+
j .t1
|
115
|
+
.d0:
|
116
|
+
l.d $f12, 64($13)
|
117
|
+
|
118
|
+
.t1:
|
119
|
+
and $15, $14, 2
|
120
|
+
bgtz $15, .d1
|
121
|
+
.f1:
|
122
|
+
l.s $f13, 72($13)
|
123
|
+
j .t2
|
124
|
+
.d1:
|
125
|
+
l.d $f13, 72($13)
|
126
|
+
.t2:
|
127
|
+
and $15, $14, 4
|
128
|
+
bgtz $15, .d2
|
129
|
+
.f2:
|
130
|
+
l.s $f14, 80($13)
|
131
|
+
j .t3
|
132
|
+
.d2:
|
133
|
+
l.d $f14, 80($13)
|
134
|
+
.t3:
|
135
|
+
and $15, $14, 8
|
136
|
+
bgtz $15, .d3
|
137
|
+
.f3:
|
138
|
+
l.s $f15, 88($13)
|
139
|
+
j .t4
|
140
|
+
.d3:
|
141
|
+
l.d $f15, 88($13)
|
142
|
+
.t4:
|
143
|
+
and $15, $14, 16
|
144
|
+
bgtz $15, .d4
|
145
|
+
.f4:
|
146
|
+
l.s $f16, 96($13)
|
147
|
+
j .t5
|
148
|
+
.d4:
|
149
|
+
l.d $f16, 96($13)
|
150
|
+
.t5:
|
151
|
+
and $15, $14, 32
|
152
|
+
bgtz $15, .d5
|
153
|
+
.f5:
|
154
|
+
l.s $f17,104($13)
|
155
|
+
j .t6
|
156
|
+
.d5:
|
157
|
+
l.d $f17,104($13)
|
158
|
+
.t6:
|
159
|
+
and $15, $14, 64
|
160
|
+
bgtz $15, .d6
|
161
|
+
.f6:
|
162
|
+
l.s $f18,112($13)
|
163
|
+
j .t7
|
164
|
+
.d6:
|
165
|
+
l.d $f18,112($13)
|
166
|
+
.t7:
|
167
|
+
and $15, $14, 128
|
168
|
+
bgtz $15, .d7
|
169
|
+
.f7:
|
170
|
+
l.s $f19,120($13)
|
171
|
+
j .fregend
|
172
|
+
.d7:
|
173
|
+
l.d $f19,120($13)
|
174
|
+
|
175
|
+
.fregend:
|
176
|
+
|
177
|
+
/* jump-and-link to register $25 */
|
178
|
+
|
179
|
+
jal $31, $25
|
180
|
+
nop /* branch-delay slot - no nop according to gcc assembly */
|
181
|
+
/* output, but let's play safe */
|
182
|
+
|
183
|
+
/* Stack-frame epilog */
|
184
|
+
move $sp,$fp
|
185
|
+
ld $31,48($sp) /* restore ra register */
|
186
|
+
ld $fp,40($sp) /* restore fp register */
|
187
|
+
ld $28,32($sp) /* restore gp register */
|
188
|
+
daddu $sp,$sp,64
|
189
|
+
j $31
|
190
|
+
.end dcCall_mips_n64
|
191
|
+
.size dcCall_mips_n64, .-dcCall_mips_n64
|
192
|
+
|