Cross-compilation

Pass --target= to select a non-default CPU target:

./pxx --target=i386 hello.pas hello.i386
./pxx --target=aarch64 hello.pas hello.a64
./pxx --target=arm32 hello.pas hello.arm

Linux cross-target executables can be run with QEMU user-mode when the matching runtime support is installed. Install the QEMU runners if needed:

tools/install_qemu.sh

Then run through the repository helper:

tools/run_target.sh aarch64 ./hello.a64
tools/run_target.sh arm32 ./hello.arm

wasm32 produces a WebAssembly module, run with wasmtime:

./pxx --target=wasm32 hello.pas hello.wasm
wasmtime hello.wasm

Static syscall-only PXX binaries do not need a target sysroot for normal cross-target smoke runs. Binaries that deliberately use external C libraries may need a guest dynamic loader and libc; tools/run_target.sh honors QEMU_LD_PREFIX and PXX_CROSS_SYSROOT for those cases.

ESP32 flows use target-specific helpers and need Espressif's toolchain (. ~/esp/esp-idf/export.sh). The hello examples are ESP-IDF programs, so they boot under QEMU through the ESP-IDF runner:

tools/esp_run.sh --chip esp32c3 examples/esp32/hello-c3/main/main.pas
tools/esp_run.sh --chip esp32s3 examples/esp32/hello-s3/main/main.pas

tools/esp_run_bare.sh is for bare-metal programs only; a program that calls ESP-IDF functions, like these two, cannot build bare.

See ESP32 / Microcontrollers for the bare-metal and ESP-IDF integration modes, footprint numbers, and the soft-float contract.

Plain --target=riscv32 (without an ESP chip name or --esp-profile=bare) emits a 32-bit RISC-V Linux ELF that runs under qemu-riscv32, with console I/O, exceptions and classes. It has three limits the other Linux targets do not: --threadsafe and threadvar are refused, Nil Python is refused, and Real is Single. The target table has the full comparison.

Next