--target <triple> (default: the host, from OS=Windows_NT) selects the Windows runtime. emit_win.ludic defines the POSIX names the backend already calls over the UCRT and Win32 in IR, so rename replaces an existing file, ftell is 64-bit, and fopen is binary. Known folders follow %APPDATA% / %LOCALAPPDATA% / %TEMP%, and the driver speaks cmd.exe, writes .exe outputs and finds LLVM's clang. Verified: macOS three-stage fixpoint, ludic-dev test 135/135, and on Windows the Mac-emitted Windows IR and the Windows-built compiler's IR are identical through two generations. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1.4 KiB
1.4 KiB
bump: minor
type: feat
Windows target — ludicc builds and runs headless programs on Windows, and builds itself there.
--target <triple>— a triple namingwindowsselects the Windows runtime; without the flag the target is the host, read at run time fromOS=Windows_NT. The IR still carries no triple, so clang assembles it for the machine it runs on.- The libc surface, in IR — on Windows the header emits
emit_win.ludic, which defines the POSIX names the backend calls (fopen,ftell,rename,opendir,mmap,fmemopen,uname, …) over the UCRT and Win32. Three of them fixed silent breakage rather than link errors:renameonto an existing file (everyFs.write_textafter the first), a 32-bitftell, and text-modefopenrewriting\nas\r\n. - Known folders —
Os.save_dir/config_dirare%APPDATA%\<app>,cache_diris%LOCALAPPDATA%\<app>,temp_diris%TEMP%, all with forward slashes; a bundle'shomeline points at%APPDATA%\<name>. - The driver — finds
C:\Program Files\LLVM\bin\clang.exewhen clang is not on%PATH%, writes.exeoutputs, speaks cmd.exe for its directory and cleanup commands, and readsargv[0],%PATH%and$LUDIC_HOMEwith either separator. - Not yet — a window,
Gl.*,Audio.*andHttp.*are still macOS platform layers; a Windows build that needs one stops with a message saying so.