/mingw-woarm64-build

Workflows and build scripts for Windows on Arm64 GNU cross-compiler for `aarch64-w64-mingw32` target.

Primary LanguageCGNU General Public License v2.0GPL-2.0

Windows-on-arm64 GNU toolchain cross compiler.

Build toolchain

This repository contains a script to build a GNU toolchain cross compiler for Windows-on-arm64. It is a work in progress. This allows binaries that can execute on Windows-on-arm64 to be built on Linux. I have only tested this script on Ubuntu/WSL.

Known issues:

This toolchain is not yet ready for real-world use. Problems and missing parts are listed in the issues.

Install build dependencies:

sudo apt-get install build-essential binutils-for-build texinfo bison flex zlib1g-dev libgmp-dev dejagnu libmpc-dev

Build the cross-compiler

Running build.sh will build the cross compiler. It installs it into ~/cross. The build script does multiple things.

Using the cross compiler

To build a simple C file, something like this works:

~/cross/bin/aarch64-w64-mingw32-gcc hello.c

I was able to cross compile zlib and install as follows:

make -f win32/Makefile.gcc DESTDIR=~/cross CC=~/cross/bin/aarch64-w64-mingw32-gcc AR=~/cross/bin/aarch64-w64-mingw32-ar RANLIB=~/cross/bin/aarch64-w64-mingw32-ranlib RC=~/cross/bin/aarch64-w64-mingw32-windres STRIP=~/cross/bin/aarch64-w64-mingw32-strip BINARY_PATH=$PREFIXDIR/bin INCLUDE_PATH=$PREFIXDIR/include LIBRARY_PATH=$PREFIXDIR/lib SHARED_MODE=1 PREFIX=aarch64-w64-mingw32- clean install