Hash :
7f960d9a
Author :
Date :
2023-11-23T09:16:35
[powerpc][AIX] fix layout issues for nested struct types (#805)
* [powerpc][AIX] fix layout issues for nested struct types
On AIX under the default power alignment rules, the layout
of struct types which are nested inside other structs may
be different than the layout of those types on their own.
Specifically the first member double rules which would
apply an eight byte alignment if that type appears in the
first position of a struct:
1) apply recursively if the struct appear in the first member
of another struct
2) do not apply if that struct is itself a member of another struct
and not the first member.
The current implementation of the rules in libffi doesn't handle these
cases, causing a mismatch with the compiler and causing some crashes
we see when OpenJ9 is used with libffi on AIX.
This PR corrects this and adds some representative test cases.
* Fix code style
* Add a size check
* Add additional test
* Fix padding in internal structs
* Flip condition back to original form
* Add a comment