-
Notifications
You must be signed in to change notification settings - Fork 491
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
Add arm64 cross compilation support to makepkg-mingw (experimental) #2283
Add arm64 cross compilation support to makepkg-mingw (experimental) #2283
Conversation
# Currently, arm64 is only supported through cross-compilation from mingw32 | ||
if [ "${_mingw}" = "arm64" -a -f "/mingw32/bin/gcc.exe" ]; then | ||
MSYSTEM=${_msystem} \ | ||
PATH=/mingw32/bin:$(echo $PATH | tr ':' '\n' | awk '$0 != "/opt/bin"' | paste -sd:) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like PATH=/arm64/bin:mingw32/bin:$(echo ....
might also work, but I'm currently not sure what the implications of this would be. I assume it would first look for a native binary in /arm64/bin
, and if that fails, look at /mingw32/bin
instead.
My understanding was that Windows arm64 (aarch64-w64-mingw32) was not supported by gcc, but is by clang. There is a project underway to add entirely clang-based prefixes (like /clang64) and I was kind of hoping this might make building armv7/aarch64 prefixes possible as well. #2278 (comment). I did a quick brain-dead test adding armv7/aarch64 to the start of building the clang infrastructure (jeremyd2019@b1362de), but it failed to build libc++. |
Interesting - thanks for your comment. We'll try to focus on using I'll keep an eye on your progress with Clang and will close this PR for now. Thanks again and let's keep each other posted on our progress 🚀 |
It is possible to compile for aarch64-w64-mingw32 target using this llvm-mingw toolchain https://github.com/mstorsjo/llvm-mingw. I have already used that to compile some mingw packages (e.g. mesa-demos in Windows 10 ARM). I have suggested to use a separate folder (e.g. mingwarm64) in Gitter but maintainers are not happy with it @lazka |
I think a new folder/prefix is going to be the only way to go, but naming is always an issue. |
@Biswa96 How would i build the package?? Thanks you! |
It is not possible right now as I have not added my experiments here. Also my thoughts are not compatible with the cross-compilation methodology in msys2 environment. |
So it is not possible currently? |
Maybe. @jeremyd2019 is doing the work so he has better info. If you want to compile Windows ARM64 binaries you still can with llvm-mingw but it'll be not is packaged format. e.g. VLC uses llvm-mingw for that. |
OK, thank you very much for the help! |
Currently, Windows arm64 isn't supported natively by msys2 (refs #1888 #1276 #1787).
In the meantime, we added support for native arm64 Git for Windows (spoiler: it's ~2x as fast as the emulated 32-bit version on arm64). Our main goal currently is to get a Git executable that is native for arm64, but that falls back to mingw32 packages in case a native arm64 version isn't available (yet) for any of those packages (Windows arm64 supports 32-bit/i686/x86 emulation).
An important step is to be able to detect arm64 in
mingw-w64-git
and cross-compile from an x86_64 host. However,makepkg-mingw
currently only supportsMINGW_INSTALLS=mingw32
andMINGW_INSTALLS=mingw64
, which sets theCARCH
to eitheri686
orx86_64
.In order to support the cross-compilation scenario, this PR adds support for
MINGW_INSTALLS=arm64
, which sets theCARCH
toarm64
on ax86_64
host. Please note that this PR does not add support for native compilation on arm64.It goes without saying that this PR only lays the fundamental groundwork for arm64 cross-compilation support, after which we can make a start with native arm64 packages. Example:
Please let me know if there's anything I overlooked or whether you think a different approach should be taken.
CC @dscho