Skip to content

Targets, extern imports, and x86_64-windows AOT output - #41

Merged
dev-dami merged 5 commits into
mainfrom
agent/xp-target-win
Nov 23, 2026
Merged

dev-dami merged 5 commits into
mainfrom
agent/xp-target-win

Conversation

@dev-dami

Copy link
Copy Markdown
Owner

Wave 1 of cross-platform Track.

  • Targets: --target <arch>-<os> (or TRACKC_TARGET) on build, run and check. The host target is the default; unknown pairs are rejected with the list of valid ones.
  • Imported functions: extern "kernel32.dll" fn WriteFile(...) -> i32; declares a function in a system DLL or dylib. ffi.trk keeps the import table and the per-call fixups, and emits the Win64 call sequence through the IAT.
  • OS layer: each compiler/rt/os/<os>.trk (linux, windows) implements the same runtime interface. The Windows one uses kernel32 and converts between UTF-8 and UTF-16.
  • pe.trk: writes a PE32+ console executable.

Results under wine:

  • hello runs. 14 of 15 examples pass; net_demo fails because Winsock is not done yet.
  • tests/native, bench/progs and rt_smoke: 52 of 53 pass. rt_smoke fails because wine cannot delete a file that is still open.
  • trackc.exe compiles itself under wine to identical bytes.

On Linux:

  • The bootstrap reaches its fixed point.
  • 103 of 103 tests pass from a clean clone, including 9 new xplat tests.
  • The new seed builds the old compiler source into exactly the old seed.

🤖 Generated with Claude Code

dev-dami and others added 5 commits November 23, 2026 00:55
…xtern imports, PE32+ writer

x86_64-windows builds: kernel32 through the IAT with the Win64 ABI
(ffi.trk), syscall6 lowered to the OS layer's os_syscall off Linux, a
PE32+ console image (pe.trk). x86_64-linux output is byte-identical:
the new trackc builds the base compiler source into the old seed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rm table

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dev-dami
dev-dami merged commit fba56bc into main Nov 23, 2026
@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant