Files
reims-vgpu/docs
Anees Iqbal 4ba8eb34f2 🆕 Write the library's dist tree on Windows, its archive renamed
`cargo xtask dist` refused on Windows. Run in MSYS2's CLANG64 environment, it
now builds reims-vgpu-c for x86_64-pc-windows-gnullvm, the MinGW target whose
archive QEMU's Windows build links, and writes the tree as on Linux: the
archive, lib/libreims_vgpu.dll, the header, and reims-vgpu.pc, whose
Libs.private is rustc's native-static-libs note for the target.

The archive bundles SDL3, whose 3203 SDL_* globals a host's own SDL (QEMU's
-display sdl, SDL 2) would bind to. Linux links the objects into one and makes
every global but the C API's local; COFF has no such link: lld makes no
relocatable object, and GNU ld -r resolves the objects' COMDAT sections into
static symbols in section 0 that lld refuses ("GCC_except_table36 should not
refer to special section 0"), after writing a plain COFF object of 156110
sections that no tool read until given --oformat pe-bigobj-x86-64. So the
objects stay as built, and llvm-objcopy --redefine-syms gives every global they
define but the rvg_* functions the suffix .rvg, with its __imp_ name, in every
object: no C name of a host's is one of them, and each reference in the archive
binds where it did. rustc's 1832 raw-dylib import members stay as built. dist
fails where the objects keep another global.

The DLL is linked from the archive with a module-definition file that exports
the rvg_* functions alone, and not --whole-archive, which would define each
crate's import descriptor of a DLL again. No import library is installed, so
-lreims_vgpu and meson's static lookup take the archive. What Linux and Windows
share (rustc's note, nm's listing, the C API's names and the globals check)
moves from linux.rs to dist/archive.rs.
2026-11-15 08:39:56 -08:00
..