Skip to content

Commit

Permalink
Removed cfg conditionnal compilation in link, to allow cross-link bet…
Browse files Browse the repository at this point in the history
…ween different bitness (wasm32 vs 64bits)
  • Loading branch information
ptitSeb committed May 3, 2022
1 parent 0d6e13a commit fd2db37
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/compiler-singlepass/src/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use wasmer_compiler::{
Relocation, RelocationTarget, SectionIndex,
};
use wasmer_types::{
entity::{EntityRef, PrimaryMap, SecondaryMap},
entity::{EntityRef, PrimaryMap},
FunctionIndex, FunctionType, GlobalIndex, LocalFunctionIndex, LocalMemoryIndex, MemoryIndex,
MemoryStyle, ModuleInfo, SignatureIndex, TableIndex, TableStyle, TrapCode, Type,
VMBuiltinFunctionIndex, VMOffsets,
Expand Down
3 changes: 0 additions & 3 deletions lib/engine-universal/src/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,14 @@ fn apply_relocation(
};

match r.kind {
#[cfg(target_pointer_width = "64")]
RelocationKind::Abs8 => unsafe {
let (reloc_address, reloc_delta) = r.for_address(body, target_func_address as u64);
write_unaligned(reloc_address as *mut u64, reloc_delta);
},
#[cfg(target_pointer_width = "32")]
RelocationKind::X86PCRel4 => unsafe {
let (reloc_address, reloc_delta) = r.for_address(body, target_func_address as u64);
write_unaligned(reloc_address as *mut u32, reloc_delta as _);
},
#[cfg(target_pointer_width = "64")]
RelocationKind::X86PCRel8 => unsafe {
let (reloc_address, reloc_delta) = r.for_address(body, target_func_address as u64);
write_unaligned(reloc_address as *mut u64, reloc_delta);
Expand Down

0 comments on commit fd2db37

Please sign in to comment.