ARM CPU + FreeBASIC?

General discussion for topics related to the FreeBASIC project or its community.
Post Reply
Provoni
Posts: 521
Joined: Jan 05, 2014 12:33
Location: Belgium

ARM CPU + FreeBASIC?

Post by Provoni »

Hello all,

Soon we will have Windows laptops with ARM CPU, for example the "Snapdragon X Elite". Any idea how such a CPU would play with FreeBASIC? Will it run our x86 programs? And will GCC recognize the arch and optimize / generate proper code for it with the march=native flag?

Thank you
Provoni
Posts: 521
Joined: Jan 05, 2014 12:33
Location: Belgium

Re: ARM CPU + FreeBASIC?

Post by Provoni »

Anyone happen to have such a laptop by now and can tell me if FreeBASIC will run on it?

These laptops have great discounts right now.
St_W
Posts: 1632
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: ARM CPU + FreeBASIC?

Post by St_W »

I don't have such hardware unfortunately, so I can't tell for sure, but I read in the news that they do come with x86 emulation (comparable to Rosetta on a Mac). Older versions support 32-bit only, current ones 64-bit as well. So I'm pretty sure FreeBasic itself and FreeBasic applications will run using the built-in emulation (except low-level stuff probably, like serial port IO).
More interesting, however, would be whether FB can be built for ARM+Windows. ARM+Linux already works since quite a while ago, but I haven't heard about ARM builds for Windows (and neither did I try it myself).
Provoni
Posts: 521
Joined: Jan 05, 2014 12:33
Location: Belgium

Re: ARM CPU + FreeBASIC?

Post by Provoni »

Thank you, I guess someone may have to try :D
marcov
Posts: 3497
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: ARM CPU + FreeBASIC?

Post by marcov »

Afaik a RPI5 can run some form of arm windows. Do get the higher memory models though.
mikefb
Posts: 1
Joined: Jan 03, 2025 3:41

Re: ARM CPU + FreeBASIC?

Post by mikefb »

If you have a Mac with a M1 or higher CPU then you can get VMWare Fusion (it's currently free for personal use from Broadcom) and run Windows 11 for ARM64 (or a aarch64 version of Linux). I have Windows 11 for ARM64 installed in a VM on my M1 Mac Studio and it has x64 emulation (maybe 32-bit too, not 100% about that) for Windows binaries built in to the O/S, I like to tinker with Pascal, so I have the x64 version of the Lazarus IDE installed (just to see it would run really) and it runs OK, albeit a little slow, but it does run and can compile and run the output. From their forums they do not yet have the compiler working on aarch64 yet, something about exception unwinding (I think that may be fixed now) and some sort of other issue holding it back, I believe their ultimate test is whether it can compile itself and it needs to do that to pass.

So I would assume depending on how FB does the compiling/linking on whether or not it could generate a native ARM64 binary but someone more knowledgeable would have to check and I lack that skill, unfortunately. I can test something if it's of interest if someone can give me the steps to try.

Happy New Year to you all btw!
nehakakar
Posts: 14
Joined: Jul 04, 2023 6:42
Location: India
Contact:

Re: ARM CPU + FreeBASIC?

Post by nehakakar »

Happy New Year, everyone.
Has anyone tried running FreeBASIC on a Windows laptop with an ARM CPU, like the Snapdragon X Elite? And can FreeBASIC make native ARM64 programs for Windows now?
chamaeleon
Posts: 1
Joined: Jan 20, 2025 18:14

Re: ARM CPU + FreeBASIC?

Post by chamaeleon »

Successfully ran compiled examples\manual\samples.bas and used it to compile all the programs in there (one or three might have failed due to compile errors, but I don't think it's related to ARM). The windows,exe and windows2.exe samples run and display the window with its content without any issue. Generated executable is x64, as expected really, and the Windows 11 emulation layer is used to run the programs. My laptop is a Lenovo Yoga Slim 7x. I have never really used FreeBASIC in-depth, so I can't speak to some more complex corner cases that may or may not exist.
Post Reply