Recent

Author Topic: Lazarus for Windows on aarch64 (ARM64) - Native Compiler  (Read 35980 times)

Thaddy

  • Hero Member
  • *****
  • Posts: 18321
  • Here stood a man who saw the Elbe and jumped it.
Re: Lazarus for Windows on aarch64 (ARM64) - Native Compiler
« Reply #105 on: October 03, 2025, 07:56:57 pm »
Has anyone ever been able to install Windows 10/11 on an RPi (3 if possible)? If so, any comments on how to install it are welcome?
3 is probably a bit too low, although technically it might work since Linux's are all running fine.
But no, I did not try that yet, although the Raspberry Pi  foundation has warm connections with Microsoft, so who knows?
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

Fred vS

  • Hero Member
  • *****
  • Posts: 3716
    • StrumPract is the musicians best friend
Re: Lazarus for Windows on aarch64 (ARM64) - Native Compiler
« Reply #106 on: October 03, 2025, 11:56:35 pm »
Has anyone ever been able to install Windows 10/11 on an RPi (3 if possible)? If so, any comments on how to install it are welcome?
3 is probably a bit too low, although technically it might work since Linux's are all running fine.
But no, I did not try that yet, although the Raspberry Pi  foundation has warm connections with Microsoft, so who knows?

I suppose that Windows 11 on RPi 4/5 is playable. But it is precisely on an RPi 3 that I would like to see if Windows 11 aarch64 (helped by its immense and powerful staff) does as well on Linux/FreeBSD/OpenBSD for aarch64 (which work correctly on RPi 3).

« Last Edit: October 04, 2025, 12:00:45 am by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1841
Re: Lazarus for Windows on aarch64 (ARM64) - Native Compiler
« Reply #107 on: October 04, 2025, 05:22:08 pm »
Some Lazarus progress on Windows for ARM64 ...  :D

msintle

  • Sr. Member
  • ****
  • Posts: 358
Re: Lazarus for Windows on aarch64 (ARM64) - Native Compiler
« Reply #108 on: October 04, 2025, 05:57:26 pm »
Some Lazarus progress on Windows for ARM64 ...  :D

It would appear to me you have single-handedly claimed the $1,000 bonus we offered!

Congratulations, Don Alfredo! Everyone at InstallAware Software is extremely excited by this development. ;D

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1841
Re: Lazarus for Windows on aarch64 (ARM64) - Native Compiler
« Reply #109 on: October 04, 2025, 06:02:45 pm »
 :D
It's just a proof of concept.
I wanted to prove that Lazarus can be compiled and run successfully on ARM64/Win64.
There is no debugger-backend. The LLDB backend has to be adapted to support Windows.
As I said, lots of work. Better been done by the people who know all about Lazarus.

msintle

  • Sr. Member
  • ****
  • Posts: 358
Re: Lazarus for Windows on aarch64 (ARM64) - Native Compiler
« Reply #110 on: October 04, 2025, 06:27:52 pm »
:D
It's just a proof of concept.
I wanted to prove that Lazarus can be compiled and run successfully on ARM64/Win64.
There is no debugger-backend. The LLDB backend has to be adapted to support Windows.
As I said, lots of work. Better been done by the people who know all about Lazarus.

Where can I install this version?

Does it support COM for compiling shell extensions with?

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1841
Re: Lazarus for Windows on aarch64 (ARM64) - Native Compiler
« Reply #111 on: October 04, 2025, 07:18:19 pm »
I am still testing with Lazarus. No downloads or installs yet.
However. You might do this.
Install FPC trunk and Lazarus trunk somewhere, lets say in a directory named "arm64".
Next, make the FPC source-changes as described in the issue-report.
Next, install a cross-compiler targeting windows-aarch64.
Now you can cross-compile towards Win64/ARM64. Just for testing things.
Start with hello world. Followed by a simple form. And slowly proceed.

Khrys

  • Sr. Member
  • ****
  • Posts: 342
Re: Lazarus for Windows on aarch64 (ARM64) - Native Compiler
« Reply #112 on: October 06, 2025, 07:54:32 pm »
Exception handling still seems broken (on trunk with changes from #41428 applied):

Code: Pascal  [Select][+][-]
  1. program Test;
  2.  
  3. {$mode objfpc}{$H+}
  4. {$inline off}
  5.  
  6. function Condition(): Boolean;
  7. begin
  8.   Result := True;
  9. end;
  10.  
  11. procedure Main();
  12. begin
  13.  
  14.   WriteLn('Procedure [IN]');
  15.  
  16.   try
  17.     WriteLn('Try [IN]');
  18.     if Condition() then Exit();
  19.     WriteLn('Try [OUT]');
  20.  
  21.   finally
  22.     WriteLn('Finally [IN/OUT]');
  23.   end;
  24.  
  25.   WriteLn('Procedure [OUT]');
  26. end;
  27.  
  28. begin
  29.   Main();
  30. end.

Expected output:

Quote from: test-x86_64.exe
Procedure [IN]
Try [IN]
Finally [IN/OUT]

Actual output  (finally  block doesn't run):

Quote from: test-aarch64.exe
Procedure [IN]
Try [IN]



Edit: Applying @Wallaby's changes to enable  _fpc_local_unwind  also still behaves the same:  finally  is unwound and then the process crashes.
« Last Edit: October 06, 2025, 09:48:38 pm by Khrys »

PascalDragon

  • Hero Member
  • *****
  • Posts: 6189
  • Compiler Developer
Re: Lazarus for Windows on aarch64 (ARM64) - Native Compiler
« Reply #113 on: October 09, 2025, 09:57:26 pm »
Exception handling still seems broken (on trunk with changes from #41428 applied):

Of course it's still broken, because nothing was fixed there. And that's the main reason why aarch64-win64 is currently considered not usable.

Fred vS

  • Hero Member
  • *****
  • Posts: 3716
    • StrumPract is the musicians best friend
Re: Lazarus for Windows on aarch64 (ARM64) - Native Compiler
« Reply #114 on: October 10, 2025, 08:31:01 pm »
I have solved the stack unwinding on Windows ARM64.
See screenshot

 You are simply The Best. ;D
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1841
Re: Lazarus for Windows on aarch64 (ARM64) - Native Compiler
« Reply #115 on: October 10, 2025, 08:36:40 pm »
Was too soon. Needs more testing. Sorry about this. Exception unwinding works as far as I can see right now.

Fred vS

  • Hero Member
  • *****
  • Posts: 3716
    • StrumPract is the musicians best friend
Re: Lazarus for Windows on aarch64 (ARM64) - Native Compiler
« Reply #116 on: October 10, 2025, 08:41:41 pm »
Was too soon. Needs more testing. Sorry about this. Exception unwinding works as far as I can see right now.

OK, don't worry, you'll tame it and I stand by what I said in my previous post.
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1841
Re: Lazarus for Windows on aarch64 (ARM64) - Native Compiler
« Reply #117 on: October 10, 2025, 08:43:58 pm »
Exceptions a bit working already.

Code: Pascal  [Select][+][-]
  1. program project1;
  2.  
  3. {$mode objfpc}{$H+}
  4. {$inline off}
  5.  
  6. uses
  7.   Classes, SysUtils;
  8.  
  9. begin
  10.   WriteLn({$I %FPCTARGETOS%});
  11.   WriteLn({$I %FPCTARGETCPU%});
  12.  
  13.   try
  14.     writeln('try 1');
  15.     raise EInOutError.Create('test');
  16.     writeln('try 2 (should not print)');
  17.   except
  18.     on e: exception do
  19.     begin
  20.       writeln('except');
  21.       WriteLn(E.Message);
  22.     end;
  23.   end;
  24.   writeLn('end');
  25. end.

Result on ARM64/Win64.
Code: Pascal  [Select][+][-]
  1. Win64
  2. aarch64
  3. try 1
  4. except
  5. test
  6. end
  7.  

PascalDragon

  • Hero Member
  • *****
  • Posts: 6189
  • Compiler Developer
Re: Lazarus for Windows on aarch64 (ARM64) - Native Compiler
« Reply #118 on: October 11, 2025, 06:37:08 pm »
Exceptions a bit working already.

That's the point. They work a bit. That's what I had originally tested when implementing them, but there are situations that I hadn't thought about and how I implemented exceptions back then simply is not compatible with that. So in quite some situations it will work but in others it will break in mysterious, puzzling ways. And as such it's simply not ready for prime time.

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1841
Re: Lazarus for Windows on aarch64 (ARM64) - Native Compiler
« Reply #119 on: October 12, 2025, 06:03:44 am »
You are right.
But when I look at the compiler, I see that a tremendous amount of work has already been invested in arm64 for Windows. Not being able to make use of it is a pity.
That is why I thought about giving it a try.
But I am not able to solve the unwinding mystery unfortunately. I will give it another couple of days but I do not think I will be able to get it working.

 

TinyPortal © 2005-2018