Recent

Author Topic: [SOLVED] To be OR not to be? Lazarus x64 or x32?  (Read 11732 times)

PeterX

  • Sr. Member
  • ****
  • Posts: 404
Re: To be OR not to be? Lazarus x64 or x32?
« Reply #15 on: February 06, 2019, 10:59:50 am »
.. you only need to refactor your code... That's much easier...
The Lazarus IDE can do that for you for much of the issues.
Ah, where's the button for refactor ?

And what are the seldom issues where refactoring fails ?
usually using latest Lazarus release version with Windows 10

ccrause

  • Hero Member
  • *****
  • Posts: 856
Re: To be OR not to be? Lazarus x64 or x32?
« Reply #16 on: February 06, 2019, 11:38:31 am »
Ah, where's the button for refactor ?
The mouse pointer should be on the identifier, then the Rename identifier option should be available in the context popup menu, see attached picture.  The shortcut [F2] should also work when the editor caret is inside an identifier (the shortcut doesn't work on my Windows machine, but does work on my Linux laptop).

PeterX

  • Sr. Member
  • ****
  • Posts: 404
Re: To be OR not to be? Lazarus x64 or x32?
« Reply #17 on: February 06, 2019, 12:19:32 pm »
Thanks, Thaddy, ccrause,

I'll give it a try.

( leaving 32 bit will be the next big step for me, lots of work, more than 10 projects waiting ..  %) )
usually using latest Lazarus release version with Windows 10

ASBzone

  • Hero Member
  • *****
  • Posts: 678
  • Automation leads to relaxation...
    • Free Console Utilities for Windows (and a few for Linux) from BrainWaveCC
Re: To be OR not to be? Lazarus x64 or x32?
« Reply #18 on: February 06, 2019, 12:44:56 pm »
There are, since using x86_64 FPC cross compiler to i386 is not possible any more. Take a look at this:
https://forum.lazarus.freepascal.org/index.php/topic,34645.msg308417.html
So, running 32-bit Lazarus 2.x with cross compiler to 64-bit is the winning combination.


I'm running the 64-bit version of Lazarus 2.0 and generating both native 64-bit utilities and cross-compiled 32-bit utilities for Windows, without issue.


I was testing that for much of yesterday.
-ASB: https://www.BrainWaveCC.com/

Lazarus v2.2.7-ada7a90186 / FPC v3.2.3-706-gaadb53e72c
(Windows 64-bit install w/Win32 and Linux/Arm cross-compiles via FpcUpDeluxe on both instances)

My Systems: Windows 10/11 Pro x64 (Current)

ASBzone

  • Hero Member
  • *****
  • Posts: 678
  • Automation leads to relaxation...
    • Free Console Utilities for Windows (and a few for Linux) from BrainWaveCC
Re: To be OR not to be? Lazarus x64 or x32?
« Reply #19 on: February 06, 2019, 12:46:33 pm »
I still use 32bits compiler to compile for 64bits because I noticed issues when i needed to crosscompile from 64bits compiler to 32bits.


What kind of issues?
-ASB: https://www.BrainWaveCC.com/

Lazarus v2.2.7-ada7a90186 / FPC v3.2.3-706-gaadb53e72c
(Windows 64-bit install w/Win32 and Linux/Arm cross-compiles via FpcUpDeluxe on both instances)

My Systems: Windows 10/11 Pro x64 (Current)

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: To be OR not to be? Lazarus x64 or x32?
« Reply #20 on: February 06, 2019, 02:16:32 pm »
So, running 32-bit Lazarus 2.x with cross compiler to 64-bit is the winning combination.

It's not though. That's the point of having the separate 32-bit cross compiler. That is to say, you're running a 64-bit machine, with 64-bit Lazarus, and a native 64-bit FPC with which to build 64-bit programs, and when you want to build for 32-bit you just switch the Lazarus project settings and the secondary 32-bit compiler binary is invoked instead.
I am familiar with this, and if you take a look at ct2laz from my signature you will see that I do it for a long time. The point is that I used to be able to generate all targeted executables no matter if Lazarus 32-bit or 64-bit was used, with fpcupdeluxe generated cross compilers. For a while, I can not build any more x64=>i386 cross compiler from fpcupdeluxe - as pointed in the link I provided.

The -dFPC_SOFT_FPUX80 thing is not necessary or relevant at all in the context of an "official" Lazarus install like ASBzone is talking about here. I am also pretty sure that -dFPC_SOFT_FPUX80 does in fact work anyways (although it may only exist in trunk.)
Does anyone know a way how to build x64=>i386 cross compiler with fpcupdeluxe for current fixes or trunks of FPC and Laz?

A cross-compiler from 64 to 32 bit compiler (under Windows and Linux) works when properly build. Yes, you have to build it yourself from source and the tool chain needs to be correct.
(e.g. linux needs multi-arch)
Good to hear. However I am not in a rush so I think I will wait with 64-bit IDE til that functionality gets restored into fpcupdeluxe for current fixes and trunks.
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

mercurhyo

  • Full Member
  • ***
  • Posts: 242
Re: To be OR not to be? Lazarus x64 or x32?
« Reply #21 on: February 06, 2019, 04:53:34 pm »
@avra +10 bro  ;) I think we had same reflexion! and your ct2laz is awesome by the way
DEO MERCHVRIO - Linux, Win10pro - Ryzen9XT 24threads + Geforce Rtx 3080SUPRIM
god of financial gain, commerce, eloquence (and thus poetry), messages, communication (including divination), travelers, boundaries, luck, trickery and thieves; he also serves as the guide of souls to the underworld

Akira1364

  • Hero Member
  • *****
  • Posts: 561
Re: To be OR not to be? Lazarus x64 or x32?
« Reply #22 on: February 08, 2019, 08:42:29 pm »
Does anyone know a way how to build x64=>i386 cross compiler with fpcupdeluxe for current fixes or trunks of FPC and Laz?

If you have a 64-bit build of trunk FPC, it should have no problem building a trunk 32-bit cross compiler by just clicking the button in FPCUpDeluxe.

lainz

  • Hero Member
  • *****
  • Posts: 4468
    • https://lainz.github.io/
Re: To be OR not to be? Lazarus x64 or x32?
« Reply #23 on: February 08, 2019, 09:01:09 pm »
I still use 32bits compiler to compile for 64bits because I noticed issues when i needed to crosscompile from 64bits compiler to 32bits.


What kind of issues?

I noticed the same, for example floating point in a SQLite database gets corrupted when using binary cross compiled with 64 bit IDE to 32 bit, Windows.

ASBzone

  • Hero Member
  • *****
  • Posts: 678
  • Automation leads to relaxation...
    • Free Console Utilities for Windows (and a few for Linux) from BrainWaveCC
Re: To be OR not to be? Lazarus x64 or x32?
« Reply #24 on: February 08, 2019, 10:34:58 pm »
I noticed the same, for example floating point in a SQLite database gets corrupted when using binary cross compiled with 64 bit IDE to 32 bit, Windows.


Interesting...    Any bug reports filed?
-ASB: https://www.BrainWaveCC.com/

Lazarus v2.2.7-ada7a90186 / FPC v3.2.3-706-gaadb53e72c
(Windows 64-bit install w/Win32 and Linux/Arm cross-compiles via FpcUpDeluxe on both instances)

My Systems: Windows 10/11 Pro x64 (Current)

lainz

  • Hero Member
  • *****
  • Posts: 4468
    • https://lainz.github.io/
Re: To be OR not to be? Lazarus x64 or x32?
« Reply #25 on: February 08, 2019, 11:23:43 pm »
No, since it was not working what I immediately did was switch back to 32 bit IDE.

mercurhyo

  • Full Member
  • ***
  • Posts: 242
Re: To be OR not to be? Lazarus x64 or x32?
« Reply #26 on: February 09, 2019, 11:34:40 am »
@Lainz  ;)
SO ... as long as you do not have unit's source code larger than 2GB (this will probably never happen), the best practice on windows, is to use 32 bits IDE and crosscomp to 64bits OSes if needed, there are many more reasons than the ones exposed along this post (including stability and trust)
Regards
« Last Edit: February 09, 2019, 11:38:35 am by mercurhyo »
DEO MERCHVRIO - Linux, Win10pro - Ryzen9XT 24threads + Geforce Rtx 3080SUPRIM
god of financial gain, commerce, eloquence (and thus poetry), messages, communication (including divination), travelers, boundaries, luck, trickery and thieves; he also serves as the guide of souls to the underworld

ASBzone

  • Hero Member
  • *****
  • Posts: 678
  • Automation leads to relaxation...
    • Free Console Utilities for Windows (and a few for Linux) from BrainWaveCC
Re: To be OR not to be? Lazarus x64 or x32?
« Reply #27 on: March 17, 2019, 02:47:00 am »
If you have a 64-bit build of trunk FPC, it should have no problem building a trunk 32-bit cross compiler by just clicking the button in FPCUpDeluxe.

Just to clarify, 3.2 Fixes or Trunk will work in FPCUpDeluxe to allow 32-bit cross compile in a 64-bit installation.
-ASB: https://www.BrainWaveCC.com/

Lazarus v2.2.7-ada7a90186 / FPC v3.2.3-706-gaadb53e72c
(Windows 64-bit install w/Win32 and Linux/Arm cross-compiles via FpcUpDeluxe on both instances)

My Systems: Windows 10/11 Pro x64 (Current)

 

TinyPortal © 2005-2018