mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
fix relocation format macos aarch64 dev backend
This commit is contained in:
parent
04906c1b58
commit
0259c11565
2 changed files with 31 additions and 4 deletions
|
@ -41,6 +41,9 @@ jobs:
|
||||||
- name: check that the platform`s produced dylib is loadable
|
- name: check that the platform`s produced dylib is loadable
|
||||||
run: cd examples/platform-switching/rust-platform && nix develop -c cargo test --release --locked
|
run: cd examples/platform-switching/rust-platform && nix develop -c cargo test --release --locked
|
||||||
|
|
||||||
|
- name: test aarch64 dev backend
|
||||||
|
run: nix develop -c cargo test-gen-dev bitwise_and --locked --release
|
||||||
|
|
||||||
# we run the llvm wasm tests only on this machine because it is fast and wasm should be cross-target
|
# we run the llvm wasm tests only on this machine because it is fast and wasm should be cross-target
|
||||||
- name: execute llvm wasm tests with --release
|
- name: execute llvm wasm tests with --release
|
||||||
run: nix develop -c cargo test-gen-llvm-wasm --locked --release
|
run: nix develop -c cargo test-gen-llvm-wasm --locked --release
|
||||||
|
|
|
@ -287,18 +287,42 @@ fn generate_wrapper<'a, B: Backend<'a>>(
|
||||||
}
|
}
|
||||||
|
|
||||||
fn create_relocation(target_info: TargetInfo, symbol: SymbolId, offset: u64) -> write::Relocation {
|
fn create_relocation(target_info: TargetInfo, symbol: SymbolId, offset: u64) -> write::Relocation {
|
||||||
let (encoding, size, addend) = match target_info.architecture {
|
let (encoding, size, addend, kind) = match target_info.architecture {
|
||||||
roc_target::Architecture::Aarch32 => todo!(),
|
roc_target::Architecture::Aarch32 => todo!(),
|
||||||
roc_target::Architecture::Aarch64 => (RelocationEncoding::AArch64Call, 26, 0),
|
roc_target::Architecture::Aarch64 => {
|
||||||
|
if cfg!(target_os = "macos") {
|
||||||
|
(
|
||||||
|
RelocationEncoding::Generic,
|
||||||
|
26,
|
||||||
|
0,
|
||||||
|
RelocationKind::MachO {
|
||||||
|
value: 2,
|
||||||
|
relative: true,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
(
|
||||||
|
RelocationEncoding::AArch64Call,
|
||||||
|
26,
|
||||||
|
0,
|
||||||
|
RelocationKind::PltRelative,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
roc_target::Architecture::Wasm32 => todo!(),
|
roc_target::Architecture::Wasm32 => todo!(),
|
||||||
roc_target::Architecture::X86_32 => todo!(),
|
roc_target::Architecture::X86_32 => todo!(),
|
||||||
roc_target::Architecture::X86_64 => (RelocationEncoding::X86Branch, 32, -4),
|
roc_target::Architecture::X86_64 => (
|
||||||
|
RelocationEncoding::X86Branch,
|
||||||
|
32,
|
||||||
|
-4,
|
||||||
|
RelocationKind::PltRelative,
|
||||||
|
),
|
||||||
};
|
};
|
||||||
|
|
||||||
write::Relocation {
|
write::Relocation {
|
||||||
offset,
|
offset,
|
||||||
size,
|
size,
|
||||||
kind: RelocationKind::PltRelative,
|
kind,
|
||||||
encoding,
|
encoding,
|
||||||
symbol,
|
symbol,
|
||||||
addend,
|
addend,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue