Overview
ReXGlue supports Windows and Linux on AMD64 (x86-64) architecture. This guide covers platform-specific build options, runtime differences, and cross-platform considerations.Supported Platforms
Windows (win-amd64)
- OS: Windows 10/11 (64-bit)
- Compiler: Clang 18+ (MSVC ABI compatible)
- Graphics: Direct3D 12 (default), Vulkan (optional)
- Architecture: x86-64 only
Linux (linux-amd64)
- OS: Ubuntu 20.04+, Debian 11+, Arch Linux, or compatible
- Compiler: Clang 18+
- Graphics: Vulkan (default), Direct3D 12 not available
- Architecture: x86-64 only
Unsupported Platforms
- macOS: Not currently supported (would require significant porting effort)
- ARM64: Partially supported in code but not tested
- 32-bit: Explicitly rejected at build time
/home/daytona/workspace/source/CMakeLists.txt:49-51
Platform Detection
Build-Time Detection
ReXGlue automatically detects the platform during CMake configuration:/home/daytona/workspace/source/CMakeLists.txt:80-88
Runtime Platform Macros
In C++ code, use these preprocessor macros:REX_PLATFORM_WIN32- WindowsREX_PLATFORM_LINUX- Linux (generic)REX_PLATFORM_GNU_LINUX- GNU/Linux specificallyREX_PLATFORM_ANDROID- Android (Linux variant)REX_PLATFORM_MAC- macOS (not supported)
/home/daytona/workspace/source/include/rex/platform.h:31-61
Architecture Detection
/home/daytona/workspace/source/include/rex/platform.h:77-85
Graphics Backend Selection
Windows: D3D12 vs Vulkan
On Windows, you can choose between Direct3D 12 (default) and Vulkan:- Native Windows API, better driver support
- Lower CPU overhead on Windows
- Better integration with Windows debugging tools
- Cross-platform code path (same as Linux)
- More explicit control over GPU resources
- Better for testing cross-platform behavior
Linux: Vulkan Only
On Linux, only Vulkan is available:/home/daytona/workspace/source/CMakeLists.txt:20-30
Runtime Graphics Backend Check
/home/daytona/workspace/source/src/graphics/CMakeLists.txt:132-142
Platform-Specific Build Options
Large Code Model (Linux Only)
Linux builds use the large code model to support executables over 35MB:/home/daytona/workspace/source/CMakeLists.txt:60-66
Reason: Recompiled Xbox 360 executables can exceed 100MB, requiring 64-bit absolute addressing.
Windows: Uses default code model (large is implicit on Win64).
Position-Independent Code
Linux builds use PIE (Position-Independent Executable):- ASLR (Address Space Layout Randomization) support
- Required for shared libraries
- Better security
Compiler Differences
Clang on Windows
Windows builds use Clang with MSVC ABI compatibility:GCC Not Supported
ReXGlue requires Clang 18+ on all platforms:/home/daytona/workspace/source/CMakeLists.txt:40-42
Reason: ReXGlue relies on Clang-specific code generation and C++23 features.
Platform-Specific APIs
Path Separators
/home/daytona/workspace/source/include/rex/platform.h:125-132
File System
Threading
ReXGlue uses C++23<thread> and <mutex> for cross-platform threading:
Exception Handling
Windows: Structured Exception Handling (SEH)
Windows uses SEH for exception handlers:Linux: Signal Handlers
Linux uses POSIX signals:rex::arch::ExceptionHandler (see Exception Handlers).
Memory Mapping
Guest Memory Location
ReXGlue maps Xbox 360 guest memory at a fixed host address:- Address:
0x100000000(4GB boundary) - Size: Up to 512MB (Xbox 360 physical memory)
- Mapping: Direct pointer arithmetic for fast access
- Windows: Uses
VirtualAllocwithMEM_RESERVE | MEM_COMMIT - Linux: Uses
mmapwithMAP_FIXED | MAP_ANONYMOUS
Build Output Directories
Builds output to platform-specific directories:/home/daytona/workspace/source/CMakeLists.txt:91-93
Cross-Platform Build Script
Windows (PowerShell)
Linux (Bash)
Common Platform-Specific Issues
Windows: Missing DLLs
Symptom: Application fails to start with “VCRUNTIME140.dll not found” Solution: Install Visual C++ Redistributable or build with static linking:Linux: Missing Vulkan Drivers
Symptom: “Failed to create Vulkan instance” Solution: Install Vulkan drivers:Linux: Large Code Model Linking Issues
Symptom: Linker error “relocation truncated to fit” Solution: Already handled by-mcmodel=large. If it persists, reduce executable size by splitting functions.
Windows: Path Length Limits
Symptom: Build fails with “path too long” errors Solution: Enable long paths in Windows:Platform Testing Strategy
- Develop on primary platform (Windows or Linux)
- Test on both platforms before release
- Use CI/CD to build and test both platforms automatically
- Profile on target platform (don’t assume performance parity)
- Test graphics backends separately (D3D12 vs Vulkan)
CMake Configuration Summary
Related Topics
- Optimization - Platform-specific optimization flags
- Debugging - Platform-specific debugging tools
- Exception Handlers - SEH vs signal handlers