Patch #303: Crossing the Architecture Barrier: Advanced Cross-Compilation and Backend Control
We are excited to announce a major infrastructure update that transforms Wave into a truly portable toolchain. Whether you are building for a modern Apple Silicon Mac, a heavy-duty x86_64 Linux server
Patch #303: Crossing the Architecture Barrier: Advanced Cross-Compilation and Backend Control
We are excited to announce a major infrastructure update that transforms Wave into a truly portable toolchain. Whether you are building for a modern Apple Silicon Mac, a heavy-duty x86_64 Linux server, or an ARM64 embedded device, Wave now provides the fine-grained control needed to target multiple architectures and operating systems from a single host.
1. Universal Cross-Compilation Framework
We have overhauled the backend to support a wide range of targets. By introducing a structured BackendOptions system, the compiler can now parameterize everything from the target triple to specific CPU features.
Expanded Architecture Support: Wave now natively supports both x86_64 and ARM64 architectures across Linux and Darwin (macOS).
ABI Precision: Our
abi_c.rsnow implements the System V ABI for both Intel and ARM chips, ensuring that your Wave code interfaces perfectly with C libraries regardless of the underlying hardware.
2. Fine-Grained Backend Customization
For power users who need to squeeze every bit of performance or satisfy specific linking requirements, we’ve added an extensive suite of CLI flags.
The
--llvmSubcommand: You can now directly control the LLVM backend with flags like--target,--cpu,--features,--abi, and--sysroot.Linker Control with
-C: Similar to professional compilers likerustc, you can now specify a custom linker, pass specific linker arguments, or choose to exclude default libraries:-C linker=/path/to/linker-C link-arg=-static-C no-default-libs
3. Hardware-Aware Inline Assembly
As we expand to ARM64, our inline assembly engine has become much smarter.
Register Mapping: We’ve implemented full register group mapping for ARM64 (
x0–x30,sp, etc.), allowing you to write high-performance ARM-specific logic.Smart Dialects: Wave now automatically switches between assembly dialects—using Intel syntax for x86 and standard AT&T/ARM syntax for ARM targets.
Refined Clobbering: We’ve optimized the automatic clobber logic to ensure that memory barriers and empty assembly blocks don't unnecessarily trash general-purpose registers.
4. Robust Conditional Compilation
The #[target] attribute system has received a significant logic upgrade. Our new preprocessor is now fully aware of:
Nested braces
Multi-line block comments
String and character literals
This prevents the compiler from prematurely truncating a target-specific code block if it contains complex syntax, making platform-specific code much safer to write.
5. Transparency: Tiered Platform Policy
To set clear expectations for our users, we have officially formalized a Tiered Platform Policy in our README.md.
Tier 1: Fully supported and tested (e.g., x86_64 Linux).
Tier 2-4: Guaranteed to build, experimental, or community-maintained architectures.
This roadmap ensures that developers know exactly which platforms are ready for production and which are still in the forge.
Conclusion
Wave is no longer just "Wave for your machine." It is now a professional-grade toolchain capable of targeting the modern computing landscape. From Apple Silicon to Linux cloud instances, you can now build, link, and optimize your systems code with total precision.
Check out the updated documentation and try building your first cross-platform binary today!