update and fix the linker (#140)

This commit is contained in:
Cyrill Leutwiler
2024-12-18 23:11:06 +01:00
committed by GitHub
parent 22070a824d
commit 3f9771f838
9 changed files with 410 additions and 494 deletions
Generated
+392 -477
View File
File diff suppressed because it is too large Load Diff
+5 -5
View File
@@ -51,10 +51,10 @@ path-slash = "0.2"
rayon = "1.8"
clap = { version = "4", default-features = false, features = ["derive"] }
rand = "0.8"
polkavm-common = "0.17"
polkavm-linker = "0.17.1"
polkavm-disassembler = "0.17"
polkavm = "0.17"
polkavm-common = "0.18"
polkavm-linker = "0.18"
polkavm-disassembler = "0.18"
polkavm = "0.18"
alloy-primitives = { version = "0.8", features = ["serde"] }
alloy-sol-types = "0.8"
alloy-genesis = "0.3"
@@ -68,7 +68,7 @@ git2 = "0.19.0"
# polkadot-sdk and friends
codec = { version = "3.6.12", default-features = false, package = "parity-scale-codec" }
scale-info = { version = "2.11.1", default-features = false }
polkadot-sdk = { git = "https://github.com/paritytech/polkadot-sdk", rev = "ddfc608962febad82f154dc1ec39768d6675b329" }
polkadot-sdk = { git = "https://github.com/paritytech/polkadot-sdk", rev = "ef8886570ea692133c6b49ecb2f1117c0a366ebd" }
# llvm
[workspace.dependencies.inkwell]
+8 -8
View File
@@ -1,10 +1,10 @@
{
"Baseline": 1099,
"Computation": 2378,
"DivisionArithmetics": 14454,
"ERC20": 22731,
"Events": 1593,
"FibonacciIterative": 1643,
"Flipper": 1978,
"SHA1": 16801
"Baseline": 1110,
"Computation": 2389,
"DivisionArithmetics": 14822,
"ERC20": 23973,
"Events": 1605,
"FibonacciIterative": 2023,
"Flipper": 1989,
"SHA1": 17026
}
+1
View File
@@ -57,6 +57,7 @@ pub fn link<T: AsRef<[u8]>>(input: T) -> anyhow::Result<Vec<u8>> {
"--relocatable",
"--emit-relocs",
"--no-relax",
"--unique",
"--gc-sections",
"--library-path",
dir.path().to_str().expect("should be utf8"),
@@ -27,7 +27,7 @@ where
runtime::FUNCTION_LOAD_IMMUTABLE_DATA,
context.void_type().fn_type(Default::default(), false),
0,
Some(inkwell::module::Linkage::Private),
Some(inkwell::module::Linkage::External),
)?;
Ok(())
@@ -37,7 +37,7 @@ impl<'ctx> Global<'ctx> {
.add_global(r#type, Some(address_space.into()), name);
let global = Self { r#type, value };
global.value.set_linkage(inkwell::module::Linkage::Private);
global.value.set_linkage(inkwell::module::Linkage::External);
global
.value
.set_visibility(inkwell::GlobalVisibility::Default);
Binary file not shown.
@@ -1163,7 +1163,7 @@ where
self.name.as_str(),
function_type,
output_size,
Some(inkwell::module::Linkage::Private),
Some(inkwell::module::Linkage::External),
)?;
function
.borrow_mut()
@@ -211,7 +211,7 @@ where
self.identifier.as_str(),
function_type,
self.result.len(),
Some(inkwell::module::Linkage::Private),
Some(inkwell::module::Linkage::External),
)?;
revive_llvm_context::PolkaVMFunction::set_attributes(
context.llvm(),