[fpc-pascal] ppc64le ABI problem

tobiasgiesen at gmail.com tobiasgiesen at gmail.com
Mon Aug 26 00:59:12 CEST 2019


Hello,

while examining a crash when running Lazarus on ppc64le, I found the
following issue in function calls.

Calls to functions with more than eight parameters seem to be
implemented differently from how gcc does it in a C program.

gcc uses the memory location 96(r1) for the ninth parameter, but FPC
uses 112(r1).

Therefore, calls to XGetWindowProperty crash. This function has 12
parameters. gcc puts the four last ones into  96(r1), 104(r1), 112(r1), 120(r1),
and FPC into 112(r1), 120(r1), 128(r1), 136(r1).

What can be done about this?

I also noticed that the "file" command in Linux mentioned an additional
property of the linked C program I wrote for testing:
"for GNU/Linux 3.10.0"

The FPC program did not have this tag.

The complete "file" outputs are:

a.out: ELF 64-bit LSB shared object, 64-bit PowerPC or cisco 7500, version
1 (SYSV), dynamically linked, interpreter /lib64/ld64.so.2,
BuildID[sha1]=6c5d2b5c7408e74eeda95fbf8d120fe8de0f2f30, for GNU/Linux
3.10.0, with debug_info, not stripped

minimalxcrash: ELF 64-bit LSB executable, 64-bit PowerPC or cisco 7500,
version 1 (SYSV), dynamically linked, interpreter /lib64/ld64.so.2, with
debug_info, not stripped

Hoping my find will be useful,
Best wishes,
Tobias Giesen



More information about the fpc-pascal mailing list