Welcome, Guest
Username: Password: Remember me
CodeTyphon Cross-Build Development, discussions and problems
  • Page:
  • 1

TOPIC:

Invalid floating point operation. 6 months 2 weeks ago #18128

  • Greg
  • Greg's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 12
  • Thank you received: 3
Hello everyone,
I've noticed strange CT v8.21 behavior related to cross-build.

Test scenario:
New fresh installation of CT v8.21. Platform: VBoxVM with Win10 x64 CPU: Intel Core i5 2520M.
I used Typhon64 and prepared most simple aplication with a single form.
Compilation default target : x86_64-win64. Building process: No errors. Application execution: No errors.
Now I use CT Center: CrossBuild->FreePascal 64bits->FPC64 build cross element i386-win32.
The whole process ends with success.
Now I prepare new build mode for my application and set on "Target Platform" :
Target OS: Win32
Target CPU: i386
Compilation this target: No errors. Application execution: Errors as follows:
An unhandled exception occurred at $004A039E:
EZeroDivide: Floating point division by zero...


The same situation when I try to cross-compile other application to x86_64-linux64 and x86_64-linux32 too.
Cross compilation with Typhon64 on the same machine passthrough without errors but execution this binaries on Ubuntu 20.04 generates similar error releated to floating point operation :
An unhandled exception occurred at $0000000000465E57:
EInvalidOp: Invalid floating point operation
  $0000000000465E57


I checked with VBoxVM with Win7 x64. The same error.
Interestingly, cross-compilation using typhon32 was successful and the binaries run fine on the mentioned Ubuntu. Typhon64 cross-compilation to arm-linux and aarch64-linux seems fine too. Is there something wrong with fpc64/ppcrossx64.exe?
I don't know in which version this problem occurred, but in the old version CT v7.7 everything works fine.
I noticed that CrossEng subdirectory environment has changed to msys2. Maybe problem is related to this change?
I tried to search recent forum posts for similar errors and found this: 18122 The error looks familiar, but it may just be a coincidence.

Next case. On the same fresh installation of CT v8.21 i tried to rebuild toolchain for "win64 x86_64-win64 xxxx i386 win32 xxxx xxxx":

Warning: Spoiler!


next try:
Warning: Spoiler!


I'm counting on your help.

Please Log in or Create an account to join the conversation.

Invalid floating point operation. 6 months 2 weeks ago #18130

  • Matis A.
  • Matis A.'s Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1076
  • Thank you received: 153
Sir
To build Toolchains for i386-win32 you must set:

 

Anything you build with new Cross engine MSYS2, Toolchains, GNU make, GNU GDB etc
for i386-win32 the
Tatget CPU is: i686
Target OS is  : w64-mingw32

Did you test your cross-build application to Latest Ubuntu versions?
PilotLogic Core Programmer
Attachments:

Please Log in or Create an account to join the conversation.

Invalid floating point operation. 6 months 2 weeks ago #18131

  • Greg
  • Greg's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 12
  • Thank you received: 3
OK. I'll try it with w64-mingw32 as you suggest but my Host is x86_64 not i386 ...
More important is the case with cross-compilation to x86_64-linux64 from win64/typhon64 and use scenario described by me. Have I made a mistake somewhere if this scenario worked fine on CT v7.7?
I generated application binaries with Win64/Typhon64 cross-compilation to x86_64-linux64 and tested this bineries with Ubuntu 20.04LTS. "EInvalidOp: Invalid floating point operation" appear.
I know it's not the latest version of this linux distribution but it's still supported and I think the problem is not the Linux because a similar error occurred when I try cross-build simple application from x86_64-win64 to i386-win32 and similar error appear.
Can you test my scenario in your lab ?

Please Log in or Create an account to join the conversation.

Last edit: by Greg.

Invalid floating point operation. 6 months 2 weeks ago #18132

  • Matis A.
  • Matis A.'s Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1076
  • Thank you received: 153
You can't cross build from x86_64-win64 to i386-win32.
It's MS Windows problem...
Please search to our forum.
 
PilotLogic Core Programmer

Please Log in or Create an account to join the conversation.

Invalid floating point operation. 6 months 2 weeks ago #18133

  • Greg
  • Greg's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 12
  • Thank you received: 3
That's right, I can't. I can't with CT 8.21. But I just checked again with CT 7.7 and I can. i386-win32 application (Target OS: win32, Target CPU family: i386 ) generated by typhon64 on win64 works fine as 32-bit application.
Let's leave that case with i386-win32 ... What about described cross-compilation from typhon64 x86_64-win64 to x86_64-linux64 and executing application on linux64? Can you check it?

Please Log in or Create an account to join the conversation.

Invalid floating point operation. 6 months 2 weeks ago #18134

  • Matis A.
  • Matis A.'s Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1076
  • Thank you received: 153
Yes we will test this.
Please, give us time, we have a lot open tasks in our LAB....
PilotLogic Core Programmer

Please Log in or Create an account to join the conversation.

Invalid floating point operation. 6 months 2 weeks ago #18135

  • Greg
  • Greg's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 12
  • Thank you received: 3
Thank you.
The most important thing is to detect and fix the problem. I just checked the changes log file and noticed the entry:
======> 31-May-2022 ver 7.80 ========================================
...............
   -COSMIC 3: New CrossBuld Engine for Ms Windows, based to msys2 64Bits.
Perhaps my described problems are related to these changes...
I will try to install CT7.8 and see if this version has lost the ability to properly cross compile like in version 7.7. Later, I may try next versions of CT to find out when the problem was appear.

Please Log in or Create an account to join the conversation.

Invalid floating point operation. 6 months 1 week ago #18136

  • Greg
  • Greg's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 12
  • Thank you received: 3
I checked CT 7.8, CT 8.0, CT8.1 and the problem I described before did not occur :
Cross-build from Win64/Typhon64 to i386_win32: No errors. Application execution: No errors.
Cross-build from Win64/Typhon64 to x86_64_linux64: No errors. Application execution: No errors.
It seems that only the latest version CT 8.21 is affected.

Please Log in or Create an account to join the conversation.

Invalid floating point operation. 6 months 1 week ago #18137

  • Matis A.
  • Matis A.'s Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1076
  • Thank you received: 153
Can you try and LAB CT 8.30 ?
PilotLogic Core Programmer

Please Log in or Create an account to join the conversation.

Invalid floating point operation. 6 months 1 week ago #18138

  • Greg
  • Greg's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 12
  • Thank you received: 3
Unfortunately, using LAB CT 8.30 causes the same errors as CT 8.21. The last version that works properly seems to be version 8.1.

Please Log in or Create an account to join the conversation.

Last edit: by Greg.
  • Page:
  • 1