Hi Nicolas, Hi All,

this is an issue of funding the correct specification. I fond this one:
[http://people.freebsd.org/~obrien/amd64-elf-abi.pdf]
and it states:

The classification of aggregate (structures and arrays) and union types works as follows:
1. If the size of an object is larger than two eightbytes, or in C++, is a non- POD 10 structure or union type, or contains unaligned fields, it has class MEMORY.

This is far simpler than the alternatives. So at least what we have may be correct on FreeBSD ;-)

Can someone find out what version of the standard is operative on linux and macOS?

The spec that splits struct fields across available registers is horribly complex but doable. I did implement that spec for the VisualWorks FFI. We're in a much better position than the VisualWorks FFI because Andreas designed and implemented signature type information correctly in his (our) FFI. In his/our FFI, a function's type specification is associated with the function itself. In VisualWorks, what is associated with a function is a very simplified reduction of types, and rich type information is only available attached to actual parameters, so pass in a C object with the wrong type information in VW and it will be marshaled incorrectly.

So while this is work to do, I'm sure we can do it quite straight-forwardly. The key issue is to determine the right versions of ABI specification to use before we start implementation. As I showed above I took the easy route; I found a version of the spec that had simple semantics and implemented it. Mea culpa.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.