Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2017-12

System call ABI problem on ppc Linux

5 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Tobias Giesen

Hello,

I just filed a bug report about FpFtruncate passing the parameters incorrectly to the system. For example, setting a file size to $D would cause the file to have the size $D 0000 000D. Apparently the conditional define FPC_ABI_EABI would fix it, but what other impact does it have?

I wonder which other system calls might be affected? My application seems to work fine except for this function.

https://bugs.freepascal.org/view.php?id=32772

Cheers,
Tobias

Marco van de Voort
to Tobias Giesen

In our previous episode, Tobias Giesen said:

Show quoted text 9 lines
I just filed a bug report about FpFtruncate passing the parameters incorrectly to the system. For example, setting a file size to $D would cause the file to have the size $D 0000 000D. Apparently the conditional define FPC_ABI_EABI would fix it, but what other impact does it have? I wonder which other system calls might be affected? My application seems to work fine except for this function. https://bugs.freepascal.org/view.php?id=32772

I replied. Roughly anything with an 64-bit argument, (typically off_t) most notably mmap.

Unknown author
to Marco van de Voort

Hi,
I will check it but the app really runs fine now after changing only FpFtruncate, and also FppRead and FppWrite (which nobody seems to use anyway). These are the occurrences of {$ifdef FPC_ABI_EABI}.

I think the only problem is with fpmake, which doesn't include FPC_ABI_EABI for powerpc 32-bit processors.

My use case is running my software on a Synology DS-413 NAS, which has a PowerPC processor. It's only a few years old. Nowadays they use only Intel and ARM.

For old times' sake I will also release it for Mac OS / ppc.

Cheers,
Tobias

----

Show quoted text 16 lines
In our previous episode, Tobias Giesen said: > I just filed a bug report about FpFtruncate passing the parameters incorrectly to the > system. For example, setting a file size to $D would cause the file to have the size > $D 0000 000D. Apparently the conditional define FPC_ABI_EABI would fix it, but what > other impact does it have? > > I wonder which other system calls might be affected? My application seems to work > fine except for this function. > > https://bugs.freepascal.org/view.php?id=32772 I replied. Roughly anything with an 64-bit argument, (typically off_t) most notably mmap. _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Kind Regards,
Tobias Giesen

Super Flexible Software Ltd. & 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 Ltd.
Company No. 05513299
Registered in England and Wales
Directors: Tobias Giesen and Claudia Giesen

Karoly Balogh (Charlie/SGR
to Unknown author

Hi,

Show quoted text 6 lines
I think the only problem is with fpmake, which doesn't include FPC_ABI_EABI for powerpc 32-bit processors. My use case is running my software on a Synology DS-413 NAS, which has a PowerPC processor. It's only a few years old. Nowadays they use only Intel and ARM.

Please note that your NAS has a Freescale P1022 CPU, which has an e500v2 CPU core. In Linux architecture terms, this isn't a regular PowerPC but PowerPCSPE, as it has a non-standard FPU. This means that classic PowerPC FPU instructions are not supported, or supported only with kernel emulation. It's also entirely incompatible with regular applications using Altivec or VMX SIMD, as the instruction encoding overlaps. It could also mean that the syscall ABI *could* be different to regular PowerPCs. I don't know if it is, but could be.

Free Pascal doesn't support PPCSPE CPUs officially (we always generate classic FPU code for memory copies for example, and the PPC code generator doesn't support the SPE FPU or the softfpu at this point), so at least we should verify if your patch doesn't cause problems on regular PPC Linux installations, or if this bug also exist there.

Charlie

Tobias Giesen
to Karoly Balogh (Charlie/SGR

Interesting! But my report was based on my development machine, a PowerBook G4.

Apparently the special instructions are not used or not causing a problem because it also runs fine on the NAS.

-----

Please excuse the shortness of this mail which was sent from my mobile phone. If necessary, I will send more information later.

Cheers,
Tobias Giesen

Show quoted text 32 lines
Am 05.12.2017 um 19:20 schrieb Karoly Balogh (Charlie/SGR) : Hi, > On Tue, 5 Dec 2017, wrote: > > I think the only problem is with fpmake, which doesn't include > FPC_ABI_EABI for powerpc 32-bit processors. > > My use case is running my software on a Synology DS-413 NAS, which has a > PowerPC processor. It's only a few years old. Nowadays they use only > Intel and ARM. Please note that your NAS has a Freescale P1022 CPU, which has an e500v2 CPU core. In Linux architecture terms, this isn't a regular PowerPC but PowerPCSPE, as it has a non-standard FPU. This means that classic PowerPC FPU instructions are not supported, or supported only with kernel emulation. It's also entirely incompatible with regular applications using Altivec or VMX SIMD, as the instruction encoding overlaps. It could also mean that the syscall ABI *could* be different to regular PowerPCs. I don't know if it is, but could be. Free Pascal doesn't support PPCSPE CPUs officially (we always generate classic FPU code for memory copies for example, and the PPC code generator doesn't support the SPE FPU or the softfpu at this point), so at least we should verify if your patch doesn't cause problems on regular PPC Linux installations, or if this bug also exist there. Charlie _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal