mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 07:31:08 +00:00
contracts: Update to Polkavm 0.5 (#2945)
This will allow us to change to the target supporting atomics and makes the linker file no longer necessary.
This commit is contained in:
committed by
GitHub
parent
8b28031d16
commit
c1c0e62d33
Generated
+25
-5
@@ -3294,7 +3294,7 @@ dependencies = [
|
|||||||
"gimli 0.27.3",
|
"gimli 0.27.3",
|
||||||
"hashbrown 0.13.2",
|
"hashbrown 0.13.2",
|
||||||
"log",
|
"log",
|
||||||
"regalloc2",
|
"regalloc2 0.6.1",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
"target-lexicon",
|
"target-lexicon",
|
||||||
]
|
]
|
||||||
@@ -13793,6 +13793,12 @@ version = "0.4.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "fecd2caacfc4a7ee34243758dd7348859e6dec73f5e5df059890f5742ee46f0e"
|
checksum = "fecd2caacfc4a7ee34243758dd7348859e6dec73f5e5df059890f5742ee46f0e"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "polkavm-common"
|
||||||
|
version = "0.5.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "88b4e215c80fe876147f3d58158d5dfeae7dabdd6047e175af77095b78d0035c"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "polkavm-derive"
|
name = "polkavm-derive"
|
||||||
version = "0.4.0"
|
version = "0.4.0"
|
||||||
@@ -13809,7 +13815,7 @@ version = "0.4.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c99f4e7a9ff434ef9c885b874c99d824c3a5693bf5e3e8569bb1d2245a8c1b7f"
|
checksum = "c99f4e7a9ff434ef9c885b874c99d824c3a5693bf5e3e8569bb1d2245a8c1b7f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"polkavm-common",
|
"polkavm-common 0.4.0",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.48",
|
"syn 2.0.48",
|
||||||
@@ -13817,15 +13823,16 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "polkavm-linker"
|
name = "polkavm-linker"
|
||||||
version = "0.4.0"
|
version = "0.5.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "550738c1b49b9279fa19d8ebed81f551b911b869227a20a190f85f6db45d5d0e"
|
checksum = "a5a668bb33c7f0b5f4ca91adb1e1e71cf4930fef5e6909f46c2180d65cce37d0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"gimli 0.28.0",
|
"gimli 0.28.0",
|
||||||
"hashbrown 0.14.3",
|
"hashbrown 0.14.3",
|
||||||
"log",
|
"log",
|
||||||
"object 0.32.2",
|
"object 0.32.2",
|
||||||
"polkavm-common",
|
"polkavm-common 0.5.0",
|
||||||
|
"regalloc2 0.9.3",
|
||||||
"rustc-demangle",
|
"rustc-demangle",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -14597,6 +14604,19 @@ dependencies = [
|
|||||||
"smallvec",
|
"smallvec",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "regalloc2"
|
||||||
|
version = "0.9.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ad156d539c879b7a24a363a2016d77961786e71f48f2e2fc8302a92abd2429a6"
|
||||||
|
dependencies = [
|
||||||
|
"hashbrown 0.13.2",
|
||||||
|
"log",
|
||||||
|
"rustc-hash",
|
||||||
|
"slice-group-by",
|
||||||
|
"smallvec",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "regex"
|
name = "regex"
|
||||||
version = "1.10.2"
|
version = "1.10.2"
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ parity-wasm = "0.45.0"
|
|||||||
tempfile = "3.8.1"
|
tempfile = "3.8.1"
|
||||||
toml = "0.8.2"
|
toml = "0.8.2"
|
||||||
twox-hash = "1.6.3"
|
twox-hash = "1.6.3"
|
||||||
polkavm-linker = { version = "0.4.0", optional = true }
|
polkavm-linker = { version = "0.5.0", optional = true }
|
||||||
anyhow = "1.0.0"
|
anyhow = "1.0.0"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
|
|||||||
@@ -234,11 +234,12 @@ fn post_process_wasm(input_path: &Path, output_path: &Path) -> Result<()> {
|
|||||||
/// Build contracts for RISC-V.
|
/// Build contracts for RISC-V.
|
||||||
#[cfg(feature = "riscv")]
|
#[cfg(feature = "riscv")]
|
||||||
fn invoke_riscv_build(current_dir: &Path) -> Result<()> {
|
fn invoke_riscv_build(current_dir: &Path) -> Result<()> {
|
||||||
let encoded_rustflags =
|
let encoded_rustflags = [
|
||||||
["-Crelocation-model=pie", "-Clink-arg=--emit-relocs", "-Clink-arg=-Tmemory.ld"]
|
"-Crelocation-model=pie",
|
||||||
.join("\x1f");
|
"-Clink-arg=--emit-relocs",
|
||||||
|
"-Clink-arg=--export-dynamic-symbol=__polkavm_symbol_export_hack__*",
|
||||||
fs::write(current_dir.join("memory.ld"), include_bytes!("./build/riscv_memory_layout.ld"))?;
|
]
|
||||||
|
.join("\x1f");
|
||||||
|
|
||||||
let build_res = Command::new(env::var("CARGO")?)
|
let build_res = Command::new(env::var("CARGO")?)
|
||||||
.current_dir(current_dir)
|
.current_dir(current_dir)
|
||||||
@@ -247,7 +248,7 @@ fn invoke_riscv_build(current_dir: &Path) -> Result<()> {
|
|||||||
.env("CARGO_ENCODED_RUSTFLAGS", encoded_rustflags)
|
.env("CARGO_ENCODED_RUSTFLAGS", encoded_rustflags)
|
||||||
.env("RUSTUP_TOOLCHAIN", "rve-nightly")
|
.env("RUSTUP_TOOLCHAIN", "rve-nightly")
|
||||||
.env("RUSTUP_HOME", env::var("RUSTUP_HOME").unwrap_or_default())
|
.env("RUSTUP_HOME", env::var("RUSTUP_HOME").unwrap_or_default())
|
||||||
.args(["build", "--release", "--target=riscv32em-unknown-none-elf"])
|
.args(["build", "--release", "--target=riscv32ema-unknown-none-elf"])
|
||||||
.output()
|
.output()
|
||||||
.expect("failed to execute process");
|
.expect("failed to execute process");
|
||||||
|
|
||||||
@@ -288,7 +289,7 @@ fn write_output(build_dir: &Path, out_dir: &Path, entries: Vec<Entry>) -> Result
|
|||||||
|
|
||||||
#[cfg(feature = "riscv")]
|
#[cfg(feature = "riscv")]
|
||||||
post_process_riscv(
|
post_process_riscv(
|
||||||
&build_dir.join("target/riscv32em-unknown-none-elf/release").join(entry.name()),
|
&build_dir.join("target/riscv32ema-unknown-none-elf/release").join(entry.name()),
|
||||||
&out_dir.join(entry.out_riscv_filename()),
|
&out_dir.join(entry.out_riscv_filename()),
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ edition = "2021"
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
uapi = { package = 'pallet-contracts-uapi', path = "", default-features = false }
|
uapi = { package = 'pallet-contracts-uapi', path = "", default-features = false }
|
||||||
common = { package = 'pallet-contracts-fixtures-common', path = "" }
|
common = { package = 'pallet-contracts-fixtures-common', path = "" }
|
||||||
polkavm-derive = '0.4.0'
|
polkavm-derive = '0.5.0'
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
opt-level = 3
|
opt-level = 3
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
SECTIONS {
|
|
||||||
.text : { KEEP(*(.text.polkavm_export)) }
|
|
||||||
}
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user