Repository navigation
Commit 2472245
aarch64: give small composites full stack slots on Darwin
Darwin packs scalar arguments on the stack to their natural alignment,
and libffi applies the same rule to composites of up to 16 bytes that
are not HFAs. Apple's compilers coerce such composites, structs and
complex types alike, to an array of register-sized words, so each takes
a pointer-aligned slot whose size is a multiple of the pointer size. A
struct of two chars or a _Complex char after the eighth integer
argument therefore lands at the wrong offset, as does every argument
behind it, in ffi_call and in closures (cf. issue #750).
Round the alignment and the occupied size of such a composite up to the
pointer size on Apple targets. The generic cif->bytes accounting
already reserves a full slot per argument, so the stack frame stays
large enough.
Fixes: 4330fdc ("Darwin/aarch64: Respect iOS ABI re: stack argument alignment")
Assisted-by: LLM
Signed-off-by: Daniel Golle <[email protected]>1 parent fc345b3 commit 2472245
1 file changed
Lines changed: 19 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
408 | 408 | | |
409 | 409 | | |
410 | 410 | | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
411 | 428 | | |
412 | 429 | | |
413 | 430 | | |
| |||
966 | 983 | | |
967 | 984 | | |
968 | 985 | | |
969 | | - | |
| 986 | + | |
970 | 987 | | |
971 | 988 | | |
972 | 989 | | |
| |||
1266 | 1283 | | |
1267 | 1284 | | |
1268 | 1285 | | |
1269 | | - | |
1270 | | - | |
| 1286 | + | |
1271 | 1287 | | |
1272 | 1288 | | |
1273 | 1289 | | |
| |||
0 commit comments