[foreign-memaccess+abi] RFR: 8284300: Explicitly reject layouts that don't have the correct alignment during linking [v2]
Jorn Vernee
jvernee at openjdk.org
Wed Sep 21 13:42:30 UTC 2022
On Wed, 21 Sep 2022 12:33:45 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:
>> I realized that rejecting layouts that don't have natural alignment also prevents us from supporting packed structs in the future. I tested out the packed struct support and it works on Windows pretty much out of the box. It doesn't work on SysV, some changes to CallArranger are needed. So, there are some options:
>> 1. reject layouts that don't have natural alignment on all platforms (Windows won't be able to use packed structs)
>> 2. reject layouts that don't have natural alignment on platforms besides Windows (yay Windows users)
>> 3. align the status quos: Windows and AArch64 re-compute the alignment. It's not used on Windows, so it can be dropped there. On AArch64 we could "trust" the alignment that is attached to the layout given by the user, same as SysV, but it would fail for packed structs. With the intention of fixing the failure in the future.
>>
>> I'm leaning most towards 1 at the moment, and that's what this patch implements. We can change that approach when we add reliable support for packed structs across platforms.
>
> Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision:
>
> review comments
Should be good now. I've amended the test as well to check the recursive case. Sorry for the messy patch.
-------------
PR: https://git.openjdk.org/panama-foreign/pull/728
More information about the panama-dev
mailing list