Quartz v5.25

Platform Support Matrix

Quartz targets multiple platforms via LLVM IR cross-compilation. The compiler runs natively on macOS and cross-compiles for all other targets.

Compiler Host

PlatformArchStatusNotes
macOSarm64PrimarySelf-hosted compiler, full stdlib, all tests
macOSx86_64SupportedVia Rosetta 2 or native Intel
Linuxx86_64CI verifiedCross-compiled from macOS, bootstraps + self-compiles
Linuxaarch64CI verifiedCross-compiled from macOS, bootstraps + self-compiles

Compilation Targets

Target TripleOSArchStatusNotes
arm64-apple-macosx14.0.0macOSarm64FullPrimary development target
x86_64-apple-macosx14.0.0macOSx86_64FullRosetta or native
x86_64-unknown-linux-gnuLinuxx86_64FullCI tested, Docker verified
aarch64-unknown-linux-gnuLinuxaarch64FullCI tested, Docker verified (OrbStack)
wasm32-wasiWASIwasm32Partialwasmtime verified, stdlib gated with @cfg

Runtime Dependencies

TargetLibcAllocatorOptionalContainer Base
macOSsystemsystem mallocOpenSSL 3 (TLS), PCRE2 (regex)N/A
Linux glibcglibcmimallocOpenSSL (TLS), PCRE2 (regex)ubuntu:24.04
Linux muslmuslmimallocalpine:3.21 (static link)
WASIwasi-libcwasi defaultN/A (wasmtime)

Allocator note. Linux builds link mimalloc for a 30-50% RSS reduction on allocation-heavy workloads. macOS does not link mimalloc: on Apple Silicon, mimalloc hits a dyld TLS-slot bootstrap race (microsoft/mimalloc#343) where ImageLoader calls malloc before tpidr_el0 points at a valid TCB, causing SIGSEGV during process init. This cost a week of debugging in April 2026. The performance loss on macOS self-compile is acceptable; catastrophic bootstrap failure is not. See docs/BOOTSTRAP_RECOVERY.md for recovery procedures.

Cross-Compilation Flow

macOS (arm64)                    Linux (target arch)
─────────────                    ───────────────────
quartz --target <triple>         llc -filetype=obj program.ll
  program.qz > program.ll  ──→  clang [-static] program.o -o program

The compiler emits platform-aware LLVM IR via @cfg(os: ...) annotations:

  • Socket constants (SOL_SOCKET, SO_REUSEADDR) differ between macOS/Linux
  • Struct layouts (SockaddrIn.sin_len is BSD-only)
  • Runtime symbols (__stderrp vs stderr, arc4random_buf vs getrandom)
  • kqueue (macOS) vs epoll (Linux) for event loops

CI Pipeline

JobRunnerWhat it does
macosmacOS-latestBuild, QSpec, fixpoint, cross-compile IR for Linux
linux-x86ubuntu-latestBootstrap from IR, self-compile, QSpec, fixpoint
linux-armubuntu-24.04-armBootstrap from IR, self-compile, QSpec, fixpoint
pagesubuntu-latestBuild Astro site, deploy to GitHub Pages
dockerubuntu-24.04-armValidate Docker image builds and starts

LLVM Versions

PlatformLLVM VersionNotes
macOS (dev)21.xHomebrew llvm
Linux CI18.xUbuntu apt llvm-18
Docker (Alpine)18.xAlpine apk llvm18