[fpc-pascal] ppc64le ABI problem

tobiasgiesen at gmail.com tobiasgiesen at gmail.com
Mon Aug 26 14:40:05 CEST 2019


Hello,
many thanks, I will try it!

I haven't compiled FPC for ppc64le myself so it can take a few days
but I will let you know about the result.

Cheers,
Tobias

----

On Mon, 26 Aug 2019 14:22:01 +0200
Florian Klämpfl <florian at freepascal.org> wrote:

> 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.
> 
> 
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Kind Regards,
Tobias Giesen

Super Flexible Software GmbH & Co. KG
Buddenstr. 29-31
48143 Münster, Germany
www.superflexible.com
www.tgtools.com

-----------------------------------------------------------
Registered at register court Münster as HRA 9716
Liability / general partner: TGTools GmbH
Registered at register court Münster as HRB 17763
Directors: Tobias Giesen and Claudia Giesen



More information about the fpc-pascal mailing list