QBE-Compiler-Backend-for-windows

1 min read Original article ↗
QBE Compiler Backend
----------------------------------------------------------------------------------------------------------

Recently, the new version QBE IR/IL brings new feature for Windows developer. as posted on the https://c9x.me/compile/release/qbe-1.3.html, Windows ABI support is the reason QBE has been able to compile for Windows. but, this support kind of half hearted, QBE source code has not provided an easy way to build its binary for Windows natively yet. We have to build its binary from linux and builds the application from there using cross-compilation flags that depend on the platform. This method is conterproductive if you heavily depends on the Windows API although you are using WSL. You should use cross-compilation WinAPI library or pass the object file to Windows for linking. for this reason, I create this cmd script file.

This is the easy and more cheap way--personal claim--to build QBE for Windows without using neither MSYS2 nor WSL. Powered by zig, Git bash (only use bash.exe), and GNU Make for Windows.

This is the early stable version of the script but with limited/poor features (haven't supported dynamic flags command). If you need help, please refer to the script.

Just run the script if you don't know where to start. You will get the source location.