[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 12:33:45 UTC 2022


> 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

-------------

Changes:
  - all: https://git.openjdk.org/panama-foreign/pull/728/files
  - new: https://git.openjdk.org/panama-foreign/pull/728/files/82e2e1db..c574717b

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=panama-foreign&pr=728&range=01
 - incr: https://webrevs.openjdk.org/?repo=panama-foreign&pr=728&range=00-01

  Stats: 116 lines in 7 files changed: 34 ins; 70 del; 12 mod
  Patch: https://git.openjdk.org/panama-foreign/pull/728.diff
  Fetch: git fetch https://git.openjdk.org/panama-foreign pull/728/head:pull/728

PR: https://git.openjdk.org/panama-foreign/pull/728


More information about the panama-dev mailing list