Re: MLton broken FFI on AMD64???
Matthew Fluet <[email protected]>
| Newsgroups | gmane.comp.lang.ml.mlton.devel |
|---|---|
| Message-ID | <[email protected]> |
On Fri, Feb 4, 2011 at 3:57 AM, Wesley W. Terpstra <[email protected]> wrote: > I then did some digging and found this choice quote in the "System V > Application Binary Interface AMD64 Architecture Processor Supplement Draft > Version 0.99.5": > " When a function taking variable-arguments is called, %rax must be set > to the > total number of floating point parameters passed to the function in vector > registers" > > ... either we need to add another tag to imports like: > _import "printf" stdarg : ... ; > ... or we should just always set rax for every FFI call on AMD64? Did you mean a "varargs" attribute? That is, I would expect "stdargs" (or "fixargs"?) to be the silent default. Interestingly, it seems that MacOSX also demands that rax be set to the the number of floating point parameters. It seems that setting rax for every FFI call on AMD64 would be the simplest solution.