2.1 KiB
2.1 KiB
Building the Windows native set on Linux
The GW native DLLs (Bridge, Wire, Backend, codec) can be built on Linux with the
same compiler version the Windows MSYS2 host uses. Verified 2026-11-21 by
rebuilding signed final7 from its exact source manifest: verify_matched_set.py
passes, and builds via cmake/toolchains/linux-msys2-ucrt64.cmake differ from
the original Linux wrapper build only in the link timestamp/checksum bytes.
Requirements
- Arch/CachyOS:
pacman -S mingw-w64-gcc(GCC 16.2.0), plusclang/lldfor the codec link. - MSYS2 ucrt64 packages extracted (not installed) under
/mnt/Games/@project/tools/msys2-ucrt64/root/ucrt64(override withMSYS2_UCRT64):crt/headers/winpthreads14.0.0.r598,gcc+gcc-libs16.2.0-6 (Rev6, as on Windows),openssl3.6.5-1,zlib1.3.2-2 (both byte-equal to the DLLs shipped in the client once Authenticode is stripped),boost1.92.0-4 (headers only).
Build
CFLAGS=-ffile-prefix-map=/mnt/Games/@project=D:/@project \
CXXFLAGS=-ffile-prefix-map=/mnt/Games/@project=D:/@project \
cmake -G Ninja -S . -B build-win \
-DCMAKE_TOOLCHAIN_FILE=$PWD/cmake/toolchains/linux-msys2-ucrt64.cmake \
-DGW_WINDOWS_NOHELPER_PROFILE5=ON -DGW_WINDOWS_SOURCE_ENDPOINT=OCTO ... # rest of the build's cmake-defs
/usr/bin/ninja -C build-win
Pitfalls
cmake-defs.txtwritten on Windows has CRLF endings: strip\r, or every option silently becomes OFF.- Pass extra flags through
CFLAGS/CXXFLAGS, not-DCMAKE_C_FLAGS(that overrides the toolchain's flags). - Arch's mingw crt has no
atexitinlibmingw32.a; the Wire links-nostartfiles, so the MSYS2 runtime must come first (the toolchain does this). - The distro cross GCC defaults to
-march=x86-64; MSYS2's defaults tonocona(set by the toolchain). - The game's stock
WowB_loader.dllonly loads an Authenticode-signed native set (a self-signed certificate is accepted). Sign Linux-built DLLs before installing them. - Under Proton (GE-Proton11-12) the signed set loads from
_classic_beta_viaWowB_loaderand Wine's built-in wintrust.