mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-14 11:11:00 +00:00
d97d094a8a
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>
15 lines
478 B
Rust
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))
|
|
}
|