Files
revive/crates/linker/src/pvm.rs
T
xermicus d97d094a8a Update the Rust dependencies (#420)
The `Cargo.lock` kept changing locally on all my hosts. Not sure why
exactly - maybe it got forgotten in a recent PR. I took it as an
opportunity to quickly update the Rust dependencies.

---------

Signed-off-by: xermicus <bigcyrill@hotmail.com>
2025-11-21 15:34:21 +01:00

15 lines
478 B
Rust

//! The revive PVM blob linker library.
pub fn polkavm_linker<T: AsRef<[u8]>>(code: T, strip_binary: bool) -> anyhow::Result<Vec<u8>> {
let mut config = polkavm_linker::Config::default();
config.set_strip(strip_binary);
config.set_optimize(true);
polkavm_linker::program_from_elf(
config,
polkavm_linker::TargetInstructionSet::ReviveV1,
code.as_ref(),
)
.map_err(|reason| anyhow::anyhow!("polkavm linker failed: {}", reason))
}