Recent

Author Topic: Free Pascal for Windows AARCH64 (ARM64)  (Read 6481 times)

simonking

  • Newbie
  • Posts: 4
Free Pascal for Windows AARCH64 (ARM64)
« on: March 15, 2020, 03:07:30 am »
Does Free Pascal have support for Windows 10 running on ARM64 devices, such as the Surface Pro X?

Since Delphi doesn't support this yet, I am eager to find an alternative which I can use to target this emerging platform...

THank you,

Thaddy

  • Hero Member
  • *****
  • Posts: 14203
  • Probably until I exterminate Putin.
Re: Free Pascal for Windows AARCH64 (ARM64)
« Reply #1 on: March 15, 2020, 07:51:12 am »
Afaik no. Only Linux Aarch, Android Aarch and iOS Aarch are supported (from 3.2.0) See https://wiki.freepascal.org/FPC_New_Features_3.2#Support_for_the_AArch64_target

Of course you know that the Surface Pro X has a 32bit x86 emulation mode, so FPC programs for that platform can run (but much slower that native)
« Last Edit: March 15, 2020, 08:01:16 am by Thaddy »
Specialize a type, not a var.

simonking

  • Newbie
  • Posts: 4
Re: Free Pascal for Windows AARCH64 (ARM64)
« Reply #2 on: March 16, 2020, 02:03:31 am »
Afaik no. Only Linux Aarch, Android Aarch and iOS Aarch are supported (from 3.2.0) See https://wiki.freepascal.org/FPC_New_Features_3.2#Support_for_the_AArch64_target

Of course you know that the Surface Pro X has a 32bit x86 emulation mode, so FPC programs for that platform can run (but much slower that native)

Yes feared that. Obviously not interested in emulated code but targeting native as currently there's no Pascal that can target AARCH64 on Windows.

Is this part of the roadmap at all? Is there anything that can be done to bring this support to FreePascal, and then ultimately Lazarus to compile native for ARM64 on Windows? Who are the right people to talk to for this?

Thanks,

Thaddy

  • Hero Member
  • *****
  • Posts: 14203
  • Probably until I exterminate Putin.
Re: Free Pascal for Windows AARCH64 (ARM64)
« Reply #3 on: March 16, 2020, 08:02:20 am »
Well that depends on volunteers.
Btw: Does the surface pro x have WSL2?, the Windows subsystem for Linux?
In that case FPC 3.2.0 Linux-AARCH64 should work out of the box and at native speed in the WSL.
On Intel I run a Debian64 in WSL2. Maybe that is possible on Windows AARCH64 too, with a Debian AARCH64 installed in the WSL.
They advertise it as full Windows 10, so maybe you should investigate. That would be a nice start... Plz report back.

[edit]
https://www.reddit.com/r/bashonubuntuonwindows/comments/dcicpl/ben_surface_pro_x_wsl_on_arm_well/

So looks like it does! Nice!
« Last Edit: March 16, 2020, 08:14:15 am by Thaddy »
Specialize a type, not a var.

simonking

  • Newbie
  • Posts: 4
Re: Free Pascal for Windows AARCH64 (ARM64)
« Reply #4 on: March 16, 2020, 11:18:13 am »
That's nice to hear, but that's kind of like offering a vegetarian diner a steak because there's no veggies left to serve in the restaurant...

What are options moving forward for bona fide ARM64 support on Windows 10?

Thaddy

  • Hero Member
  • *****
  • Posts: 14203
  • Probably until I exterminate Putin.
Re: Free Pascal for Windows AARCH64 (ARM64)
« Reply #5 on: March 16, 2020, 11:56:00 am »
1. Give an incentive to one or more of the compiler core team... (hardware, A machine, or a financial compensation might work)
2. Wait till one of them bites....(there is a foundation)
3. It is not a popular platform (maybe yet), so that may put people off.
4. It is less of an effort than adding a complete new platform/cpu, but still not easy.

In principle FPC has a rather good code generator for Aarch64, but adding a full platform is not that easy.( toolchain, cross compilation, libraries, etc)

And since WSL2 is supported, you can already run full-speed FPC applications. I would start there...
« Last Edit: March 16, 2020, 12:04:18 pm by Thaddy »
Specialize a type, not a var.

simonking

  • Newbie
  • Posts: 4
Re: Free Pascal for Windows AARCH64 (ARM64)
« Reply #6 on: March 17, 2020, 01:12:48 am »
Well to clarify steak vs veganism...I need to build a shell extension, so really, the Linux subsystem couldn't be less related!

I am happy to offer remote access to the ARM64 machine 24/7 (at least for the next 3 weeks) in case anyone would care to give it a try...

Is there anything I can try to do at my end - any instructions or similar - to try and build this myself directly, starting with FPC and then moving on to Laz; in the absence of any further interest?

PascalDragon

  • Hero Member
  • *****
  • Posts: 5446
  • Compiler Developer
Re: Free Pascal for Windows AARCH64 (ARM64)
« Reply #7 on: April 21, 2020, 09:00:51 am »
Free Pascal now has initial support for Windows on ARM64. See here. It's not yet perfect (don't try to use optimizations yet), requires clang as assembler and I don't know yet whether the LCL will work, but at least simple applications already run. You can give it a try and report problems on the bugtracker.

Spyd

  • New member
  • *
  • Posts: 7
Re: Free Pascal for Windows AARCH64 (ARM64)
« Reply #8 on: July 16, 2020, 04:01:40 pm »
I have a question: is that Windows on ARM64 compiler valid for the Raspberry Pi, as right now it's the easiest (and cheapest) way to run ARM Windows 10?
If someone's interested in trying Win10 on the Raspberry Pi, there is the official discord for installing Windows on the Raspberry Pi:  https://discord.com/invite/jQCpfVK
« Last Edit: July 16, 2020, 04:05:42 pm by Spyd »

Thaddy

  • Hero Member
  • *****
  • Posts: 14203
  • Probably until I exterminate Putin.
Re: Free Pascal for Windows AARCH64 (ARM64)
« Reply #9 on: July 16, 2020, 05:01:41 pm »
In principle yes, but don't confuse the (free) IOT windows 10 available for the Raspberry Pi and a full windows 10 aarch install.
Note I have some RPi's running the IOT version, but none of them with FPC/Lazarus.
Note I have successfully installed Ubuntu-aarch64 on a Rpi4 and that has FPC trunk and Lazarus on it.

You can try what I usually do: mr Trial and miss Error
« Last Edit: July 16, 2020, 05:05:38 pm by Thaddy »
Specialize a type, not a var.

PascalDragon

  • Hero Member
  • *****
  • Posts: 5446
  • Compiler Developer
Re: Free Pascal for Windows AARCH64 (ARM64)
« Reply #10 on: July 17, 2020, 09:46:21 am »
I have a question: is that Windows on ARM64 compiler valid for the Raspberry Pi, as right now it's the easiest (and cheapest) way to run ARM Windows 10?
If someone's interested in trying Win10 on the Raspberry Pi, there is the official discord for installing Windows on the Raspberry Pi:  https://discord.com/invite/jQCpfVK

Whether it's Pi or not is only important for the Embedded target due to the need of selecting the correct controller unit. For those targets that run atop an operating system like Windows or Linux only the selected CPU type does matter and for Aarch64 there currently only is ARMv8.

Though please note that the aarch64-win64 target is still experimental. The native compiler does not yet work (you need to use a i386-win32 based cross compiler) and from what I've heard Lazarus does not compile either. I really have to find the time to fix things there... :-\

Also I myself run Windows on ARM64 inside a KVM on an ArchLinux Aarch64. Less hazzle regarding drivers and near native performance. ;)

dieselnutjob

  • Full Member
  • ***
  • Posts: 217
Re: Free Pascal for Windows AARCH64 (ARM64)
« Reply #11 on: October 10, 2020, 12:09:50 am »
Concerning Windows Subsystem for Linux on AARCH64, is there an X11 Server (like XMing) for these PCs?
I already have my code working with X windows on Linux for AARCH64 (I have a Pinebook Pro) using fpgui.  If there is an X11 Server then would this work?

PascalDragon

  • Hero Member
  • *****
  • Posts: 5446
  • Compiler Developer
Re: Free Pascal for Windows AARCH64 (ARM64)
« Reply #12 on: October 10, 2020, 12:28:13 pm »
Considering that Windows on ARM64 allows running native i386 applications I'd say that Xming should work just as well considering that it only uses normal Windows API (and people use it on x86 Windows together with WSL).

Alternatively you can wait up bit longer for Microsoft to release their Wayland support for WSL2 which will probably include ARM64 as well ;)

 

TinyPortal © 2005-2018