-
Notifications
You must be signed in to change notification settings - Fork 685
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[powerpc][AIX] fix layout issues for nested struct types #805
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
ChengJin01
pushed a commit
to ChengJin01/openj9
that referenced
this pull request
Oct 27, 2023
The change simply adopts the fix at libffi/libffi#805 to resolve the the issue with the nested struct in libffi on AIX. Signed-off-by: ChengJin01 <jincheng@ca.ibm.com>
FYI: @atgreen |
keithc-ca
reviewed
Oct 31, 2023
I've made some updates to correctly handle nested structs which have tail padding (and added such a test case) |
ChengJin01
pushed a commit
to ChengJin01/openj9
that referenced
this pull request
Nov 13, 2023
The change simply adopts the fix at libffi/libffi#805 to resolve the the issue with the nested struct in libffi on AIX. Related: eclipse-openj9#18287 Signed-off-by: ChengJin01 <jincheng@ca.ibm.com>
Gentle ping |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
On AIX under the default power alignment rules, the layout of struct types which are nested inside other structs may observe different alignment requirements than when we layout of those types on their own, resulting in a different total layout.
Specifically the first member double rules which would apply an eight byte alignment if that type appears in the first position of a struct:
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.