msys2 / MSYS2-packages

Package scripts for MSYS2.
https://packages.msys2.org
BSD 3-Clause "New" or "Revised" License
1.29k stars 485 forks source link

Port bash recipe to Windows Arm64 #3834

Open Blackhex opened 1 year ago

Blackhex commented 1 year ago

Assess whether the work on binutils and GCC WoArm64 codegen support done in https://github.com/ZacWalk/binutils-woarm64.git and https://github.com/ZacWalk/gcc-woarm64.git is already enabling a cross-build of the MSYS2 bash recipe for the WoArm64 target.

The binutils and gcc packages built from those forks will be done first, then the actuall bash recipe and it's dependencies like msys2-runtime will be built using them. This sholud be considered just as a PoC until the WoArm64 codegen changes will be contributed to the upstream.

jeremyd2019 commented 1 year ago

You're not going to have any luck getting bash or anything else from this repo running natively on ARM64 until you get msys2-runtime (AKA cygwin) building and working.

revelator commented 1 year ago

could probably use the arm runtime from w32api (should be a straight copy of the mingw-w64 api just with some cygwin specific stuff added in) and then build the msys2 runtime against that. will probably have to rebuild all the tools/libraries if you get that far so expect some work.

Blackhex commented 1 year ago

@revelator Thank you for your suggestion. Can you be a little bit more specific what you mean by "w32api" and "mingw-w64 api" ? I've figured out that the https://github.com/msys2/MSYS2-packages/tree/master/mingw-w64-cross-crt recipe is being built by https://github.com/msys2/MSYS2-packages/tree/master/gcc binaries on x64 so I am currently focusing on porting the gcc recipe to aarch64 target (running on x64 host).

revelator commented 1 year ago

cygwin uses a special version of the mingw-w64 api located in /usr/include/w32api /usr/lib/w32api since cygwin and hence newlib uses the windows api to emulate a posix environment i figured it should be possible to do the same using the arm runtime api (might take some work tho).

revelator commented 1 year ago

also depends on the arm api having the same mechanisms newlib uses from the w32api to emulate a posix environment (not sure if it does in which case things will get a lot more complicated), if you pull it off it would be quite an achivement in itself. wishing you good luck is all i can do atm. i had my own share of porting trouble with the cygwin runtime back when the old msys.org was the only one avaliable but i managed to make a working version of the new 64 bit capable version (not related to this project though).

Blackhex commented 1 year ago

Thank you @revelator for this information. The Win32 API should be available while WinRT API is not much relevant for WoARM64. Any further details on this topic would be appreciated though. The progress of ours can be tracked at https://github.com/Blackhex/MSYS2-packages/commits/woarm64. Any feedback would be appreciated as well.