Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update and fix the linker #140

Merged
merged 4 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
869 changes: 392 additions & 477 deletions Cargo.lock

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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]
Expand Down
16 changes: 8 additions & 8 deletions crates/integration/codesize.json
Original file line number Diff line number Diff line change
@@ -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 change: 1 addition & 0 deletions crates/linker/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
Expand Down
2 changes: 1 addition & 1 deletion crates/llvm-context/src/polkavm/context/global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Binary file modified crates/runner/fixtures/Baseline.pvm
Binary file not shown.
2 changes: 1 addition & 1 deletion crates/solidity/src/evmla/ethereal_ir/function/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down