[fpc-pascal] ppc64le ABI problem

Florian Klämpfl florian at freepascal.org
Mon Aug 26 14:22:01 CEST 2019


Am 26. August 2019 14:08:39 schrieb Sven Barth via fpc-pascal <fpc-pascal at lists.freepascal.org>:

> Florian Klämpfl <florian at freepascal.org> schrieb am Mo., 26. Aug. 2019,
> 14:01:
>
>> Am 26. August 2019 00:59:16 schrieb tobiasgiesen at gmail.com:
>>
>>> 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?
>>
>> Try to change the 48 in fpc/compiler/powerpc64/cpupara.pas line to 32 as a
>> temporary test.
>
> Line 302 in case anyone is wondering (thankfully that's the only "48" in
> that fike (plus its preceeding comment) ^^')

Indeed :-) If it works, it must be made dependent on the target ABI.




More information about the fpc-pascal mailing list