-
Notifications
You must be signed in to change notification settings - Fork 27
Fix the alignment issue with long & pointer on AIX #44
Fix the alignment issue with long & pointer on AIX #44
Conversation
The changes revert part of fix specific to Reviewer: @tajila |
So, on AIX, |
Yes. the previous alignment adjustment only applies to |
The changes aim to restore the original alignment setting for long and pointer on AIX given the padding is required in native in the case of struct [int/float,long] and [int/float,pointer]. Signed-off-by: Cheng Jin <jincheng@ca.ibm.com>
95b1330
to
841354b
Compare
I don't understand your use of the word "previous" here. I am trying to understand what the alignment rules on AIX should be. Consider these C structs:
The bottom line is that we want to know what offset C compilers assign to |
Yes, that's what happens in such case. The offset should be 8 for |
It's my understanding that we only intend to produce 64-bit builds for AIX, so the discussion of None of the structures should have 4-byte padding - that would leave |
Re-reading your comment, I realize there's another way to take it: that is "4-byte alignment padding" means the following field must be at a byte offset that is a multiple of 4. Perhaps you meant "8-byte alignment padding", otherwise the code before this change is what we want. Please clarify, paying attention to the details and be precise. |
I think the debugging results better explain what I meant:
|
As discussed with @keithc-ca offline, the intention of this PR is to correct what we used to do for |
@ChengJin01 do the tests verify this behaviour? |
Yes, this behaviour was verified with all downcall & upcall jtreg test suites, including the failing tests in https://github.com/ibmruntimes/openj9-openjdk-jdk19/blob/openj9/test/jdk/java/foreign/TestUpcallScope.java and https://github.com/ibmruntimes/openj9-openjdk-jdk19/blob/openj9/test/jdk/java/foreign/TestUpcallStack.java where this issue was captured on AIX, plus our own FFI specific tests in https://github.com/eclipse-openj9/openj9/tree/master/test/functional/Java19andUp/src/org/openj9/test/jep424. |
jenkins test sanity aix jdk19 |
The changes aim to restore the original alignment setting for long and pointer on AIX given the padding is required in native in the case of struct [int/float,long] and [int/float,pointer].
Signed-off-by: Cheng Jin jincheng@ca.ibm.com