POWER back-end: fix issue with call to `caml_call_realloc_stack` from a DLL
Currently, the required stack frame size is passed to caml_call_realloc_stack in register 12. However, this register is destroyed by the shims inserted by the dynamic loader. Consequently, the required size can be corrupted if the caller of caml_call_realloc_stack is in a DLL. This seems to be the root cause for https://github.com/LPCIC/coq-elpi/issues/678.
Trivial fix in this PR: use a different, non-temporary register to pass the required size.
With this PR, https://github.com/LPCIC/coq-elpi/issues/678 builds fine.
I made this PR against 5.2 to make testing on coq-elpi easier. Should we merge on 5.2 and cherry-pick on trunk, or should I rebase this PR?
Thanks you so much @xavierleroy !
For regularity's sake, I believe it is better to retarget the PR to trunk, and then cherry-pick it to 5.2 and 5.3.
Rebased on trunk... done! CI precheck... done! [probably unrelated random failures on tests/lib-runtime-events/test_dropped_events.ml on POWER, to be investigated] This looks ready for merging.
(CI kick)
Merged and cherry-picked to 5.2 7af0046399 and to 5.3 85c7730173.