Reputation: 4022
I have a Windows 11 for ARM device (ARM64 aka ARMv8 64-bit). I'm trying to see if it's possible to get a C++ compiler to work natively on this device. Meaning, I want the compiler to be running natively on ARM, compiling ARM software that can run on the same device I'm compiling on. I do not want to cross-compile from an x86 device to ARM.
I've been looking for information on this for awhile but I haven't found anything. I found this StackOverflow post which has a promising title but it's about compiling from an x86_64 host. All other resources I can find in a Google search are specifically about cross-compiling from an x86 host, which is not what I want, as the goal is to see if it's possible to natively develop from ARM for ARM without using an x86 device or any x86 emulation. This is possible on both macOS and Ubuntu so I am trying to see if it's possible to do on Windows.
The usual compilers I've looked into (MSVC, MinGW GCC, MinGW Clang/LLVM, and Cygwin) all seem to be x86-only. But perhaps there are some experimental builds of these that I am unaware of.
Upvotes: 3
Views: 4013
Reputation: 19
There is a GNU CC ARM project at https://developer.arm.com/Tools%20and%20Software/GNU%20Toolchain
Qt, a common tool chain for cross platform has Windows on ARM support. What makes this interesting, of course, is the porting of QT Creator which is primarily used for C++, QML (JavaScript), and Python. Qt has some notes on building Qt Creator for Windows on ARM.
https://developer.arm.com/Tools%20and%20Software/GNU%20Toolchain
There is NOT a release for Windows on ARM, yet, at https://github.com/cristianadam/qt-creator/releases nor https://download.qt.io/official_releases/qtcreator/ but it does seem that they have better support for building Windows ARM target. So it may be possible to build Qt creator, but I don't think it has its own compiler collection, rather uses whatever you have.
Some brave souls have gone about this using Cygwin: https://github.com/mkende/cygwin-arm-toolchain/blob/master/README.md https://sergeev.io/notes/setting_up_arm_gcc_windows/
Several IDEs and other languages (GO, Java, Python, node.js) have been ported and native Windows on ARM versions are ready. See the listing on
https://github.com/qwinsi/awesome-native-app-windows-arm
This includes Visual Studio, which I believe comes with a compilier.
I wonder if you could not install the Linux compilers for ARM using WSL and use those to build for Windows on Arm with close to native performance.
I assume there is some reason that GCC has not been ported.
I didn't see anything on GCC, mingw, mingw64, or cygwin about Windows ARM binaries or see anything in the their downloads that would suggest support.
So, I am sticking w/ Linux for now...but might give it a try as I need a new notebook and Lenovo has a decent X13 that uses the Snapdragon CPU and Windows 11--I was planning on just replacing Windows w/ openSUSE like I usually do...
Upvotes: 0
Reputation: 2018
Since yesterday - it is.
The new Visual Studio 2022 17.3 Preview 2 has all C++ tooling running natively on ARM64 Windows.
Here's the link to the 17.3 Preview 2 Release Notes:
https://learn.microsoft.com/en-us/visualstudio/releases/2022/release-notes-preview#17.3.0-pre.2.0
And here's an MS blog post about the ARM64 support: https://devblogs.microsoft.com/visualstudio/arm64-visual-studio/
Upvotes: 3