Recent

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

msintle

  • Full Member
  • ***
  • Posts: 106
Lazarus for Windows on aarch64 (ARM64) - Native Compiler
« on: April 12, 2024, 03:24:27 pm »
Has any progress been made in getting Lazarus to work natively on ARM64 (aarch64) on Windows?

This support exists for macOS and Linux, but is ironically absent on Windows; where Lazarus had originally started.

Without native code, we can't do certain things like compile shell extensions; and ARM64 is gaining traction on the Windows side.

Are there any development costs which need sponsoring to get over this hurdle?

VisualLab

  • Sr. Member
  • ****
  • Posts: 355
Re: Lazarus for Windows on aarch64 (ARM64) - Native Compiler
« Reply #1 on: April 12, 2024, 09:45:49 pm »
Has any progress been made in getting Lazarus to work natively on ARM64 (aarch64) on Windows?

This support exists for macOS and Linux, but is ironically absent on Windows; where Lazarus had originally started.

Without native code, we can't do certain things like compile shell extensions; and ARM64 is gaining traction on the Windows side.

Are there any development costs which need sponsoring to get over this hurdle?

How common is Windows on ARM64? Is it at least half as popular on ARM64 as Linux? Does Windows for ARM64 support peripherals as well as Windows for ARM64/EM64T?

dsiders

  • Hero Member
  • *****
  • Posts: 1108
Re: Lazarus for Windows on aarch64 (ARM64) - Native Compiler
« Reply #2 on: April 12, 2024, 10:35:00 pm »
Has any progress been made in getting Lazarus to work natively on ARM64 (aarch64) on Windows?

This support exists for macOS and Linux, but is ironically absent on Windows; where Lazarus had originally started.

Without native code, we can't do certain things like compile shell extensions; and ARM64 is gaining traction on the Windows side.

Are there any development costs which need sponsoring to get over this hurdle?

How common is Windows on ARM64? Is it at least half as popular on ARM64 as Linux? Does Windows for ARM64 support peripherals as well as Windows for ARM64/EM64T?

ZDNet claims ARM64 will be 30% of the Windows market by 2026. But crystal balls sometimes lie.

Can't speak to the other questions. But we know Windows is way more popular than Linux on X64 desktops, where Linux just reached 4% in 2023. I would expect a similar ratio when it comes to ARM64. And my crystal ball is shattered.
Preview Lazarus 3.99 documentation at: https://dsiders.gitlab.io/lazdocsnext

VisualLab

  • Sr. Member
  • ****
  • Posts: 355
Re: Lazarus for Windows on aarch64 (ARM64) - Native Compiler
« Reply #3 on: April 12, 2024, 11:27:32 pm »
I would be in favor if Windows was available for ARM64 and supported various devices such as Raspberry Pi, Organe Pi, etc. I mean the real one, not a substitute in the form of Windows IoT (earlier RT and even earlier CE). But these are more of a dream. Porting WinAPI from AMD64/EM64T to ARM64 is years of work (if it is technically possible). All industrial computers (and the like), if they use Windows, probably only run on AMD64/EM64T. The second thing is the processing power that Windows requires to run. However, for now, ARM is inferior to the AMD64/EM64T family in terms of computing power.

msintle

  • Full Member
  • ***
  • Posts: 106
Re: Lazarus for Windows on aarch64 (ARM64) - Native Compiler
« Reply #4 on: April 16, 2024, 06:32:02 pm »
I would be in favor if Windows was available for ARM64 and supported various devices such as Raspberry Pi, Organe Pi, etc. I mean the real one, not a substitute in the form of Windows IoT (earlier RT and even earlier CE). But these are more of a dream. Porting WinAPI from AMD64/EM64T to ARM64 is years of work (if it is technically possible). All industrial computers (and the like), if they use Windows, probably only run on AMD64/EM64T. The second thing is the processing power that Windows requires to run. However, for now, ARM is inferior to the AMD64/EM64T family in terms of computing power.

It sounds like you're unaware Windows aarch64 has been shipping on laptops (and tablets) since 2018.

The full Windows API is available and has been for more than half a decade.

Furthermore, not only can Windows aarch64 emulate x86 apps, it can also emulate amd64 apps starting with Windows 11 (although, this doesn't extend to things like major shell extensions, where native code aarch64 is required).

Microsoft released (and upgraded) Surface 9 X as an aarch64 device years ago, and in May this year they are going to launch another major upgrade for it as the consumer Surface 10 device, again implemented as an aarch64 platform - their first major consumer play for the first time on aarch64.

So yes, it is high time Free Pascal and Lazaru supports aarch64 targets on Windows - the only (and ironically, biggest) platform where they lack this support.

PascalDragon

  • Hero Member
  • *****
  • Posts: 5526
  • Compiler Developer
Re: Lazarus for Windows on aarch64 (ARM64) - Native Compiler
« Reply #5 on: April 16, 2024, 08:17:32 pm »
So yes, it is high time Free Pascal and Lazaru supports aarch64 targets on Windows - the only (and ironically, biggest) platform where they lack this support.

FPC 3.3.1 already supports aarch64-win64, however due to some bugs in the code generator that have yet to be investigated it can't cycle itself and thus is not really usable for developing larger applications (which includes Lazarus).

I would be in favor if Windows was available for ARM64 and supported various devices such as Raspberry Pi, Organe Pi, etc. I mean the real one, not a substitute in the form of Windows IoT (earlier RT and even earlier CE). But these are more of a dream. Porting WinAPI from AMD64/EM64T to ARM64 is years of work (if it is technically possible).

Ehm, you are aware that this is already the case for many years? I'm even running a full blown Windows 10 natively on a Pi 4 (see also the WoR project).
« Last Edit: April 16, 2024, 08:20:16 pm by PascalDragon »

VisualLab

  • Sr. Member
  • ****
  • Posts: 355
Re: Lazarus for Windows on aarch64 (ARM64) - Native Compiler
« Reply #6 on: April 16, 2024, 09:41:40 pm »
So yes, it is high time Free Pascal and Lazaru supports aarch64 targets on Windows - the only (and ironically, biggest) platform where they lack this support.

FPC 3.3.1 already supports aarch64-win64, however due to some bugs in the code generator that have yet to be investigated it can't cycle itself and thus is not really usable for developing larger applications (which includes Lazarus).

I would be in favor if Windows was available for ARM64 and supported various devices such as Raspberry Pi, Organe Pi, etc. I mean the real one, not a substitute in the form of Windows IoT (earlier RT and even earlier CE). But these are more of a dream. Porting WinAPI from AMD64/EM64T to ARM64 is years of work (if it is technically possible).

Ehm, you are aware that this is already the case for many years? I'm even running a full blown Windows 10 natively on a Pi 4 (see also the WoR project).

Yes, I read about it some time ago. I also watched videos on YouTube showing Windows 10 running on the RPi. But it was proof that it was (technically) possible. However, the work was far from comfortable (it was basically a "slide show"). Can ARM64 processors cope with such work?

The RPi Foundation specially "trimmed" and adapted Linux (Raspberry Pi OS) so that it could run on their board. I have an RPi 3B. From my own experience, I know that RaspberryPi OS works well, but it is not comfortable to work with (although Lazarus works quite well there). Another thing is that I don't use it as a desktop replacement, but for hobby purposes related to electronics (which is what the RPi foundation designed this board for).

domasz

  • Sr. Member
  • ****
  • Posts: 455
Re: Lazarus for Windows on aarch64 (ARM64) - Native Compiler
« Reply #7 on: April 16, 2024, 10:21:52 pm »
ZDNet claims ARM64 will be 30% of the Windows market by 2026. But crystal balls sometimes lie.

Impossible. And I believe it was President and CEO of Canalys Steve Brazier, not ZDNet.

1) Windows 11 is shit. There is lots of people who still use Windows 10, 7 and even XP. Microsoft totally doesn't know how to progress with Windows.
2) The biggest value Windows has over MacOS or Linux is all the software and games. Most of these won't be ported to ARM
3) ARM is still slow. Macs are slow and their benchmarks aren't true
4) Windows is slow. It got too big, it needs power
5) MacOs and Linux are getting more and more popular on laptops. Windows is now most popular na home desktops, gaming laptops and other powerful machines.
« Last Edit: April 16, 2024, 10:23:41 pm by domasz »

dsiders

  • Hero Member
  • *****
  • Posts: 1108
Re: Lazarus for Windows on aarch64 (ARM64) - Native Compiler
« Reply #8 on: April 17, 2024, 01:22:37 am »
ZDNet claims ARM64 will be 30% of the Windows market by 2026. But crystal balls sometimes lie.

Impossible. And I believe it was President and CEO of Canalys Steve Brazier, not ZDNet.

My attribution was incorrect.
https://www.windowscentral.com/software-apps/windows-11/arm-cpus-predicted-to-hit-30-pc-market-share-by-2026
« Last Edit: April 17, 2024, 01:24:33 am by dsiders »
Preview Lazarus 3.99 documentation at: https://dsiders.gitlab.io/lazdocsnext

hansotten

  • Jr. Member
  • **
  • Posts: 89
Re: Lazarus for Windows on aarch64 (ARM64) - Native Compiler
« Reply #9 on: April 17, 2024, 09:59:24 am »
ZDNet claims ARM64 will be 30% of the Windows market by 2026. But crystal balls sometimes lie.

Impossible. And I believe it was President and CEO of Canalys Steve Brazier, not ZDNet.

1) Windows 11 is shit. There is lots of people who still use Windows 10, 7 and even XP. Microsoft totally doesn't know how to progress with Windows.
2) The biggest value Windows has over MacOS or Linux is all the software and games. Most of these won't be ported to ARM
3) ARM is still slow. Macs are slow and their benchmarks aren't true
4) Windows is slow. It got too big, it needs power
5) MacOs and Linux are getting more and more popular on laptops. Windows is now most popular na home desktops, gaming laptops and other powerful machines.

Sources of your 'statements'? 

VisualLab

  • Sr. Member
  • ****
  • Posts: 355
Re: Lazarus for Windows on aarch64 (ARM64) - Native Compiler
« Reply #10 on: April 17, 2024, 01:27:12 pm »
1) Windows 11 is shit. There is lots of people who still use Windows 10, 7 and even XP. Microsoft totally doesn't know how to progress with Windows.
2) The biggest value Windows has over MacOS or Linux is all the software and games. Most of these won't be ported to ARM
3) ARM is still slow. Macs are slow and their benchmarks aren't true
4) Windows is slow. It got too big, it needs power
5) MacOs and Linux are getting more and more popular on laptops. Windows is now most popular na home desktops, gaming laptops and other powerful machines.

1. Is it shit? It's hard to say. However, some statistics (probably from a week ago) show that most people currently use Windows 10. However, the fact is that both Windows 11 (and 10) contain various (to put it mildly) annoyances:
  • tracking users (so-called "telemetry"),
  • sending an advertising "cesspool" to the user,
  • forced updates (which occasionally damage the system and/or user files),
  • forced installation of various useless "IT garbage" along with updates.
The real problem with these versions of the system is not only violating users' privacy, but also exposing them to costs, for which MS does not pay users (and it should, because it is supposed to increase MS's revenues). In other words, MS transfers part of the costs of its activities to users. And this is plain theft (forcing people to provide services for free). MS forces (technically) the user's computer to download and send data, which the user usually does not want (some of them are not aware of what is happening). You can't turn it off, although you can try to block it. The user pays for data transfer that he did not order or does not want to be shared. His computer's storage is cluttered. And yet, data transfer via the network is not free, because users pay for it with their Internet access operator. These activities increase the load on your computer, which forces your computer to consume more power. On the scale of one day, it's not much. But over the course of a year it adds up to a considerable number. Secondly, this practice burdens Internet connections. Data is unnecessarily "pushed" through the network from the MS server to the user's computer (updates, advertising "cesspool") and vice versa ("telemetry"). On a global scale, this is a significant amount of energy unnecessarily wasted on the nonsense of some companies. Interestingly, MS does not boast about its ecological approach, as Google does (which also makes up and manipulates public opinion). So I suspect that's what you meant when you said Windows was shit.

2. Completely agree.

3. Yes.

4. Agreement. Too many different processes are installed and run, some of which are not needed by an ordinary user (they are useful in corporations). In addition, some of the processes are garbage processes that support: the service of continuous updating and installation of updates and crappy programs, pumping the advertising cesspool from MS servers, "telemetry" and monitoring the operation of the previously mentioned garbage processes. Some of this can be blocked, but this is "messing around in the system". For example: what is the use of geolocation on a desktop used at home for engineering work (not on a laptop, not on a tablet)?

5. Yes.

« Last Edit: April 17, 2024, 01:37:19 pm by VisualLab »

msintle

  • Full Member
  • ***
  • Posts: 106
Re: Lazarus for Windows on aarch64 (ARM64) - Native Compiler
« Reply #11 on: April 17, 2024, 04:12:52 pm »
Nice to see everyone has plenty of love for their favorite operating systems ;)

Can we get back on track - what needs to be done to fix FPC so larger apps like Lazarus can be compiled successfully for aarch64 on Windows?

Let's face it - Windows is still going to be the biggest market for the foreseeable future - and with new aarch64 consumer Surface 10s coming out in May, the timing is perfect for aarch64 Lazarus running natively on Windows.

Wallaby

  • Jr. Member
  • **
  • Posts: 84
Re: Lazarus for Windows on aarch64 (ARM64) - Native Compiler
« Reply #12 on: April 17, 2024, 10:25:46 pm »
Nice to see everyone has plenty of love for their favorite operating systems ;)
Can we get back on track - what needs to be done to fix FPC so larger apps like Lazarus can be compiled successfully for aarch64 on Windows?

Indeed  :D From my experience with the trunk compiler, it works in principle for simple programs, but there are two showstopper bugs I have reported:

Win64 AArch64 optimizer bug and Win64 AArch64 exception handling

I already offered to pay anyone in the FPC team who is able to fix those issues (aka offer a bounty), but so far looks like no one is interested.

PascalDragon

  • Hero Member
  • *****
  • Posts: 5526
  • Compiler Developer
Re: Lazarus for Windows on aarch64 (ARM64) - Native Compiler
« Reply #13 on: April 18, 2024, 10:09:10 pm »
Yes, I read about it some time ago. I also watched videos on YouTube showing Windows 10 running on the RPi. But it was proof that it was (technically) possible. However, the work was far from comfortable (it was basically a "slide show"). Can ARM64 processors cope with such work?

Of course they can. The Pi 3 might be a bit on the weaker side, but with a Pi 4 it runs rather comfortably and in fact I also use Windows inside a virtual machine utilizing the KVM capability of the underlying Linux system (less potential driver issues this way, but near native performance).
And on the ARM laptops we have at work Windows definitely runs comfortably enough, even the i386 and x86_64 emulation is working rather well. Not to mention that there is also Windows on ARM developers kit with an 8 core CPU, 32 GB RAM and a PCIe port for NVMe support.

I did not have the chance to try one yet, but the M*-processor based Macs should be rather nice to use as well regarding performance, especially since Linux is supported on them as well.

The RPi Foundation specially "trimmed" and adapted Linux (Raspberry Pi OS) so that it could run on their board. I have an RPi 3B. From my own experience, I know that RaspberryPi OS works well, but it is not comfortable to work with (although Lazarus works quite well there). Another thing is that I don't use it as a desktop replacement, but for hobby purposes related to electronics (which is what the RPi foundation designed this board for).

I use an ordinary ArchLinux on my Pis. No “trimming” involved there...

dbannon

  • Hero Member
  • *****
  • Posts: 2854
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Lazarus for Windows on aarch64 (ARM64) - Native Compiler
« Reply #14 on: April 19, 2024, 07:02:55 am »
The RPi Foundation specially "trimmed" and adapted Linux (Raspberry Pi OS) so that it could run on their board.

I use a plain debian, works at least as well as the "trimmed" one. Most of the trimming the Foundation does is undesirable IMHO.

But I would not see it as a desktop workstation replacement. However, thats not particularly relevant to the discussion, the ARM chips in Mac or those silly Surface things are far more powerful than the RasPi chips, they don't boot off a SDCard, they have decent  NVMe 'disks' attached, serious graphics hardware.

So, I think the OP's original question is valid. We support an Alpha chip running Tru64 but not the hardware/software combo anyone can buy in their local (computer) shops today ?

Makes me want to ask that question that will earn me a rebuke, is FPC development in trouble ? While Lazarus is booming ahead, FPC promised us a 3.2.4 release "soon" back in October 2021.

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

 

TinyPortal © 2005-2018