Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Will There be an ARM/ARM64 Windows Support Soon? #1787

Open
falhumai96 opened this issue Nov 17, 2019 · 25 comments
Open

Will There be an ARM/ARM64 Windows Support Soon? #1787

falhumai96 opened this issue Nov 17, 2019 · 25 comments

Comments

@falhumai96
Copy link

Hello devs,

I would like to know if there will be an ARM/ARM64 Windows support for MinGW's toolchain (such as GCC/G++), since Windows 10 ARM/ARM64 will be widely adopted soon with the release of Microsoft Surface Pro X that comes pre-installed with Windows 10 ARM64?

@Alexpux
Copy link
Member

Alexpux commented Nov 17, 2019

I don’t plan to support it myself, only if someone want to volunteer it

@Biswa96
Copy link
Member

Biswa96 commented Nov 25, 2019

What will be the necessary steps to make a ARM64 msys2 installation? Any Wiki or docs?

@falhumai96
Copy link
Author

I don't have docs/wikis per se, but I found a repo that instructs on building Mingw+LLVM on Windows/Ubuntu that targets Windows MinGW. This is the link to the repo: https://github.com/mstorsjo/llvm-mingw. It also contains prebuilt binaries for all four architectures: armv7 (ARM), aarch64 (ARM64), i686 (X86), and x86_64 (X86-64). However, the clang++ being used is defaulting to libc++.dll, which, for example, doesn't yet support std::filesystem, while libstdc++.dll (GNU toolchain in MSYS2 for MinGW) does. Aside from that, it would be nice to have a fully integrated system for MSYS2+MinGW with Pacman, much like the already available one for X86 and X86_64, which also supports GNU toolchain, for ARM/ARM64 targets.

@Biswa96
Copy link
Member

Biswa96 commented Nov 25, 2019

Is it possible to cross compile msys2 for ARM64 in Arch Linux ARM64?

@falhumai96
Copy link
Author

I believe the problem is that there are no assemblers built yet for ARM64 for Windows for the GNU toolchain, and that might be what's holding back the build for MSYS2. I might be mistaken here. The MSYS2 devs knows better.

@aaronfranke
Copy link

Is there an update on this issue? I would appreciate if there were ARM compilers available for Windows for ARM.

@Biswa96
Copy link
Member

Biswa96 commented Nov 28, 2021

Some native AArch64 mingw toolchain is available in clangarm64 repository (https://repo.msys2.org/mingw/clangarm64/). But it is in experimental stage now. But the msys2 itself is only x86_64.

@aaronfranke
Copy link

@Biswa96 How would I install these? I don't see any instructions or any installation files. I'm also a bit confused because the *.tar.* formats are typically used on Linux, but MinGW stands for Minimalist GNU for Windows.

@Biswa96
Copy link
Member

Biswa96 commented Nov 28, 2021

As I said, the aarch64 is only in experimental first stage. Hence there is no instructions. Here is a gist:

  1. Install msys2 installer in your machine. The OS should support x86_64 emulation in aarch64.
  2. Add this in /etc/pacman.conf file
[clangarm64]
Include = /etc/pacman.d/mirrorlist.mingw
  1. Run C:\msys64\msys2_shell.cmd -defterm -no-start -clangarm64 (assume mssy2 is installed in C:\msys64).
  2. Run pacman -Syy and pacman -S <package> to download aarch64 packages.

I may be wrong. @jeremyd2019 can provide further details.

@Biswa96
Copy link
Member

Biswa96 commented Nov 28, 2021

BTW, if you are looking for cross compile toolchain for aarch64 then llvm-mingw is the right one.

@jeremyd2019
Copy link
Member

  1. Install msys2 installer in your machine. The OS should support x86_64 emulation in aarch64.

Only on Windows 11. If you're still on 10, you'd have to use i686 msys2, which is no longer supported. It's possible, but more tricky.

  1. Run C:\msys64\msys2_shell.cmd -defterm -no-start -clangarm64 (assume mssy2 is installed in C:\msys64).

You'd need to have updated msys2 before that would work (filesystem-2021.11-1 added -clangarm64 option)

  1. Run pacman -Syy and pacman -S <package> to download aarch64 packages.

the first <package> you would probably want is actually the toolchain group... pacman -S --needed mingw-w64-clang-aarch64-toolchain

The packages available are pretty limited. I could work on getting more if there are particular few you need, but the main limiting factor is that there is no hosted Github Actions runner for ARM64, so all the packages currently get built on my Raspberry Pi 4 8GB.

@aaronfranke
Copy link

I'm on Windows 11 for ARM. I downloaded the latest MSYS2 for x86_64 from the website (msys2-x86_64-20210725), ran it, updated, then after updating with pacman -Syyu I was able to launch MSYS2 with C:\msys64\msys2_shell.cmd -defterm -no-start -clangarm64, however uname -a reports the system is x86_64. Then when I tried this command, it failed:

$ pacman -S --needed mingw-w64-clang-aarch64-toolchain
error: target not found: mingw-w64-clang-aarch64-toolchain

The packages available are pretty limited. I could work on getting more if there are particular few you need, but the main limiting factor is that there is no hosted Github Actions runner for ARM64, so all the packages currently get built on my Raspberry Pi 4 8GB.

GCC and/or Clang/LLVM, Python 3 (including pip). I'm compiling Godot. The Linux dependencies also include pkg-config and development libraries for X11, Xcursor, Xinerama, Xi, XRandR, MesaGL, ALSA, PulseAudio, but I'm not sure if these are needed for compiling the Windows version of Godot.

If desired I can donate my computing power. I have an M1 Pro Mac, I can just set up a VM and give you remote access to it. This definitely wouldn't be a 24/7 solution, but if packages are needed to be built at some frequency then I can plan for it, and also it has surprisingly fast CPU performance so it probably wouldn't take much time each time.

@jeremyd2019
Copy link
Member

I'm on Windows 11 for ARM. I downloaded the latest MSYS2 for x86_64 from the website (msys2-x86_64-20210725), ran it, updated, then after updating with pacman -Syyu I was able to launch MSYS2 with C:\msys64\msys2_shell.cmd -defterm -no-start -clangarm64, however uname -a reports the system is x86_64. Then when I tried this command, it failed:

$ pacman -S --needed mingw-w64-clang-aarch64-toolchain
error: target not found: mingw-w64-clang-aarch64-toolchain

You need to add the clangarm64 repo to pacman.conf as Biswa96 said. and then run pacman -Sy (you can combine that as pacman -Sy --needed ...)

The packages available are pretty limited. I could work on getting more if there are particular few you need, but the main limiting factor is that there is no hosted Github Actions runner for ARM64, so all the packages currently get built on my Raspberry Pi 4 8GB.

GCC and/or Clang/LLVM, Python 3 (including pip).

GCC does not support Windows on ARM. We have clang/llvm, and python3. I don't think I did pip. Even if we had pip, it probably wouldn't be horribly useful as I don't expect any Windows ARM64 wheels exist (and if they did they probably wouldn't be compatible). It looks like you might just need scons. That should be more doable.

I'm compiling Godot. The Linux dependencies also include pkg-config and development libraries for X11, Xcursor, Xinerama, Xi, XRandR, MesaGL, ALSA, PulseAudio, but I'm not sure if these are needed for compiling the Windows version of Godot.

The godot package has quite a few dependencies, it would be quite some effort to get all of them going on ARM64. Maybe you'll be lucky and they'll be optional?

@MehdiChinoune
Copy link
Collaborator

Isn't possible to build MSYS2-packages for aarch64 using msys2/clang?

@Biswa96
Copy link
Member

Biswa96 commented Nov 28, 2021

That will be some sort of cross compiling. But native compiler toolchain is used/preferred to build mingw packages. I can try to help expand aarch64 packages but it has to be built somewhere. Everyone has to trust a machine.

@jeremyd2019
Copy link
Member

#8762 I have played around with setting up cross compiling for people who want it, but the PKGBUILDs assume they're building native.

@MehdiChinoune
Copy link
Collaborator

MehdiChinoune commented Nov 28, 2021

I was talking about native compilation. I mean bootstrap clang/msys2 on aarch64 and then use it to build natively the other packages.
Maybe the biggest blocker here is msys2-runtime (cygwin).

@aaronfranke
Copy link

aaronfranke commented Nov 28, 2021

You need to add the clangarm64 repo to pacman.conf as Biswa96 said. and then run pacman -Sy

Thanks, that worked for installing the package. I didn't look closely enough that I had to follow the instructions in both posts.

As you noted there are a lot of dependencies. Most are optional and can be disabled by disabling modules, I'll see if I can make it work. I've started compiling and so far it seems to function, Task Manager says that clang++ is "ARM64" (although MSYS2's Bash is still "x64" aka x86_64, it would be nice to have ARM64 everything).

EDIT: It's missing OpenGL, so the linker can't link it together. I think that Mesa needs to be ported.

@ZachBacon
Copy link
Contributor

I was talking about native compilation. I mean bootstrap clang/msys2 on aarch64 and then use it to build natively the other packages.
Maybe the biggest blocker here is msys2-runtime (cygwin).

Technically, and I'm sure it's been mentioned already, but on windows arm there's a layer for running regular 32bit/64bit on arm, so you could run msys2 already. But I will say, I wouldn't mind seeing the runtime itself natively on arm.

@Biswa96
Copy link
Member

Biswa96 commented Nov 28, 2021

It's missing OpenGL, so the linker can't link it together.

There is some confusion about opengl in win arm. See this issue for detailed info mstorsjo/llvm-mingw#209.

@lb90
Copy link

lb90 commented Dec 20, 2021

Looks like it's now fixed upstream: https://sourceforge.net/p/mingw-w64/mailman/message/37403944/

EDIT: or not?

@lhmouse
Copy link
Contributor

lhmouse commented Aug 11, 2022

I am looking for some test environments for https://github.com/lhmouse/mcfgthread. Would you please give it a try?

[There is an issue in Clang which prevents the pre-compiled header from working, so it has to be disabled.]

autoreconf -i
./configure --disable-pch
make
make check

@mati865
Copy link
Collaborator

mati865 commented Aug 11, 2022

Regarding this topic:
I have made crude Cygwin targets for LLVM but quickly given up since building Cygwin seems to require huge amount of linker scripts magic (tested with x86_64 target) which very likely will be never supported by LLD's COFF backend.

@ZachBacon
Copy link
Contributor

I would reckon that cygwin would need to be changed to support lld in this case I guess and that's not an easy task I would imagine.

@minnyres
Copy link

FYI there is an experimental build of Mingw GCC toolchain for Arm64: https://github.com/Windows-on-ARM-Experiments/msys2-woarm64-build.
It is able to compile zlib but seems have problem compiling C++ code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests