Comment #0 by andrew.stevenson — 2015-04-17T13:26:52Z
Created attachment 1513
example code
On Linux/amd64 an argument to a C function which is a structure larger than 64 bits should be passed across multiple registers. Making this call with DMD however does something else (probably trying to pass on the stack).
I attach some example code to demonstrate the problem. "make c" produces a binary from C code and "make d" produces a binary from D calling into C. Both should produce the same output.
I currently use a workaround of calling the C function via inline ASM. The correct ASM for the attached example would be something like:
mov RDI, qword ptr a;
mov RSI, qword ptr a + 8;
call prettify;
Comment #1 by andrew.stevenson — 2015-04-17T13:28:59Z