Recent

Author Topic: I cannot build 64-bit IDE  (Read 721 times)

Zoran

  • Hero Member
  • *****
  • Posts: 1746
    • http://wiki.lazarus.freepascal.org/User:Zoran
I cannot build 64-bit IDE
« on: July 10, 2022, 01:55:31 pm »
OS - Windows 10, 64 bit
I have FPC 3.2.2 stable installed with fpc installer, first 32-bit compiler, then 64-bit cross-compiler; they are installed in default path, as suggested by the installer (C:\FPC\3.2.2\bin\i386-win32).

I have Lazarus sources, current fixes branch, downloaded from git repository.

Now, I build Lazarus IDE 64-bit from command line:
Code: [Select]
make clean all OS_TARGET=win64 CPU_TARGET=x86_64That passes without problems and I have 64-bit IDE.

But then I want to rebuild the IDE from the IDE build options dialog. It does not work.
If I just rebuild with "Normal IDE", I get 32-bit IDE instead of 64-bit.
If I set the combo boxes "Target OS" and "Target CPU" to Win64 and x86_64 (see the attached image), I get compiler error:
Code: [Select]
Build IDE: Exit code 2, Errors: 1
Error: Illegal parameter: -Twin64

Okay, I can work normally with 32-bit IDE, projects compile quite well to both 32-bit and 64-bit, when I create BuildModes and set appropriate options (see attached image), however, I would like the IDE itself also built as 64-bit application.

So, please, what am I doing wrong?

tetrastes

  • Full Member
  • ***
  • Posts: 235
Re: I cannot build 64-bit IDE
« Reply #1 on: July 15, 2022, 03:24:06 pm »
It seems that this is bug in IDE. I have tried to build the reverse: 32-bit IDE from official Lazarus for Win64 (which has 64-bit fpc) and Lazarus add-on for cross compiling for Win32, and have got the same error, only with -Twin32. Obviously, the -P<cpu_type> parameter is not passed to fpc when building IDE.

Thaddy

  • Hero Member
  • *****
  • Posts: 11929
Re: I cannot build 64-bit IDE
« Reply #2 on: July 15, 2022, 04:40:10 pm »
Try to build it with fpcupdeluxe. I have no problems with that. Also on windows 10 64.
For 64 bit it also installs a 64 bit bootstrap compiler
« Last Edit: July 15, 2022, 04:42:47 pm by Thaddy »
Black themes should be banned.

oliverhbailey

  • New member
  • *
  • Posts: 9
Re: I cannot build 64-bit IDE
« Reply #3 on: July 15, 2022, 05:59:19 pm »
This is interesting!
Windows 11 is 64 bit only. I received a pushed update on Wednesday that rebooted my Windows development system before yesterday morning.  It would seem that MS is testing stopping 32 bit code generation to force developers to move to 64 bit exclusively.  They set the stage for that by announcing Windows 11 would be 64 bit only when it was announced.  They did this accidentally a number of years ago that forced 64 bit only code generation.  There was a registry entry that needed to be changed.  My guess is they are testing these flags before rolling out the release update.  Wednesday and Thursday push releases are pre-release versions for new features within 21 days of release. I expect more of this from MS over the upcoming months based on differences between Windows 10 and Windows 11.  The accompanying screen shows todays fpcupdeluxe error.  And I installed the current trunk in that directory when I had a 64 bit code generation problem from a prior test installation from last week. 

tetrastes

  • Full Member
  • ***
  • Posts: 235
Re: I cannot build 64-bit IDE
« Reply #4 on: July 15, 2022, 06:27:20 pm »
This is advice not to use cross-compiler from Win64 to Win32 because Windows 64 does not support Extended type (80-bit floating point), and to use native 32-bit compiler. See e.g. https://forum.lazarus.freepascal.org/index.php/topic,59386.msg442731.html#msg442731.

Thaddy

  • Hero Member
  • *****
  • Posts: 11929
Re: I cannot build 64-bit IDE
« Reply #5 on: July 15, 2022, 06:31:00 pm »
That is nonsense: a 64 bit cross compiler win 64 to win 32 results in a compiler that supports extended 80 bit. So really bad advice. Ignore it.

On another note: Although on windows a 64 bit extended is really a double as standard, there is a well hidden option to build the compiler to support 80 bit extended although this is not very well known and Florian - who implemented this - discourages its use, because it is not win64 ABI compliant. On linux it is not an issue.
« Last Edit: July 15, 2022, 06:37:34 pm by Thaddy »
Black themes should be banned.

tetrastes

  • Full Member
  • ***
  • Posts: 235
Re: I cannot build 64-bit IDE
« Reply #6 on: July 15, 2022, 10:19:02 pm »
That is nonsense: a 64 bit cross compiler win 64 to win 32 results in a compiler that supports extended 80 bit. So really bad advice. Ignore it.
I have not understood, do you think that it is my advice? This is advice from oliverhbailey's picture of fpcupdeluxe, which you have recommended in your previous post. You are somewhat inconsistent in your recommendations.  :D

PascalDragon

  • Hero Member
  • *****
  • Posts: 4562
  • Compiler Developer
Re: I cannot build 64-bit IDE
« Reply #7 on: July 16, 2022, 04:07:32 pm »
That is nonsense: a 64 bit cross compiler win 64 to win 32 results in a compiler that supports extended 80 bit. So really bad advice. Ignore it.

Wrong. The cross compiler from Win64 to i386, i8086 or any other x86_64 target is not supported by us currently, because it results in different code than what a native compiler would generate (because the Win64 compiler can not correctly evaluate 80-bit floating point at compile time)

Zoran

  • Hero Member
  • *****
  • Posts: 1746
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: I cannot build 64-bit IDE
« Reply #8 on: July 16, 2022, 05:15:03 pm »
Thank you all.

What I understand actually is that on Windows there is 32-bit compiler and 64-bit cross-compiler. And, as far as I get it, it is so, regardless of whether Lazarus IDE is built as 32-bit or 64-bit application.
Is that correct?

So, my original question is only why I cannot build the IDE as 64-bit application from the IDE itself (as I said, I can from command line).

So, with details from my first post in this topic, is there anything I do wrong?

tetrastes

  • Full Member
  • ***
  • Posts: 235
Re: I cannot build 64-bit IDE
« Reply #9 on: July 16, 2022, 09:46:44 pm »
What I understand actually is that on Windows there is 32-bit compiler and 64-bit cross-compiler. And, as far as I get it, it is so, regardless of whether Lazarus IDE is built as 32-bit or 64-bit application.
Is that correct?
No. Official Lazarus distribution for Win64 has native 64-bit compiler (ppcx64.exe), and fpc.exe is 64-bit also. Lazarus add-on for cross-compiling from Win64 to Win32 in fact installs native Win32 32-bit compiler ppc386.exe, not real cross-compiler.

So, my original question is only why I cannot build the IDE as 64-bit application from the IDE itself (as I said, I can from command line).
I think that this is bug in the IDE (see my first reply). The -P<cpu_type> is not passed to fpc, without it your 32-bit fpc.exe runs 32-bit ppc386.exe, and you get error that -Twin64 is illegal parameter. I have 64-bit fpc.exe, so without -Pi386 it runs 64-bit ppcx64.exe, and I get error that -Twin32 is illegal parameter.

So, with details from my first post in this topic, is there anything I do wrong?
No.
« Last Edit: July 16, 2022, 09:48:46 pm by tetrastes »

Zoran

  • Hero Member
  • *****
  • Posts: 1746
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: I cannot build 64-bit IDE
« Reply #10 on: July 18, 2022, 02:55:08 pm »
What I understand actually is that on Windows there is 32-bit compiler and 64-bit cross-compiler. And, as far as I get it, it is so, regardless of whether Lazarus IDE is built as 32-bit or 64-bit application.
Is that correct?
No. Official Lazarus distribution for Win64 has native 64-bit compiler (ppcx64.exe), and fpc.exe is 64-bit also. Lazarus add-on for cross-compiling from Win64 to Win32 in fact installs native Win32 32-bit compiler ppc386.exe, not real cross-compiler.

So, my original question is only why I cannot build the IDE as 64-bit application from the IDE itself (as I said, I can from command line).
I think that this is bug in the IDE (see my first reply). The -P<cpu_type> is not passed to fpc, without it your 32-bit fpc.exe runs 32-bit ppc386.exe, and you get error that -Twin64 is illegal parameter. I have 64-bit fpc.exe, so without -Pi386 it runs 64-bit ppcx64.exe, and I get error that -Twin32 is illegal parameter.

So, with details from my first post in this topic, is there anything I do wrong?
No.

Thank you, for thorough answer, very much.

 

TinyPortal © 2005-2018