Skip to main content

Module pvm2

Module pvm2 

Source
Expand description

build.rs helper: cross-compile a guest crate for the PVM2 target and link it into a runnable program.

Two entry points, deliberately split:

  • build_elf stops at the RV64EMC ELF. A personality that wants its own container (JAVM wraps the blob in a cap Image) calls this and links the ELF itself.
  • build goes all the way to a .nubp ProgramBlob file.

The target is riscv64emc-pvm2: RV64 embedded (16 registers) with compressed, M, and the Zbb/Zba/Zbs/Zicond/Zicclsm extensions, no atomics, panic=abort, PIE. It is a custom target JSON, so the guest build needs -Zbuild-std and therefore RUSTC_BOOTSTRAP=1 — which build_crate::GuestBuild sets.

Functions§

build
Cross-compile and link bin_name into $OUT_DIR/<bin_name>.nubp, returning the blob path.
build_elf
Cross-compile bin_name in manifest_dir for riscv64emc-pvm2 and return the path to the resulting ELF.