You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cranelift: error "unimplemented relocation addend Relocation" on MacOS on aarch64 #4564
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error("unimplemented relocation addend Relocation { offset: 104, size: 26, kind: Relative, encoding: AArch64Call, symbol: SymbolId(3), addend: -4 }")', <some path>/.cargo/registry/src/github.life-white.uk-1ecc6299db9ec823/cranelift-object-0.86.1/src/backend.rs:500:22
Versions and Environment
Cranelift version or commit: 0.86.1
Operating system: MacOS
Architecture: M1
Extra Info
This works for me on aarch64-unknown-gnu (see https://cirrus-ci.com/task/6079482023903232 - it runs a lot of additional things, but near the bottom of the "test" task it compiles the Fibonacci function fine), but not aarch64-apple-darwin. It also works on x86_64-apple-darwin.
Thanks for the report. Did this CLIF come from Wasmtime or some other frontend? (I ask because we try to support Wasmtime's use of Cranelift on aarch64-apple-darwin but the use of Cranelift with other frontends is much less well-tested. That doesn't mean we don't want to support it, I'm just trying to judge the severity.) It sounds like we need to implement another relocation case here. If you're willing to dig into it further, I'd be happy to review a PR.
Did this CLIF come from Wasmtime or some other frontend?
It came from a different frontend (a small compiler I'm writing). The problem seems to be withcranelift-object, because I can run the same program without error by using cranelift-jit (which I have adopted as a stopgap solution).
If you're willing to dig into it further, I'd be happy to review a PR.
I'd be happy to, but I'm not sure what a relocation is :)
changed the title [-]Cranelift: error "unimplemented relocation addend Relocation" on M1 Mac only[/-][+]Cranelift: error "unimplemented relocation addend Relocation" on MacOS on aarch64[/+]on Aug 5, 2022
I think this might already be fixed upstream in gimli-rs/object#465, so it might be a case of just updating the object crate whenever they do their next release.
Activity
cfallin commentedon Aug 1, 2022
Thanks for the report. Did this CLIF come from Wasmtime or some other frontend? (I ask because we try to support Wasmtime's use of Cranelift on aarch64-apple-darwin but the use of Cranelift with other frontends is much less well-tested. That doesn't mean we don't want to support it, I'm just trying to judge the severity.) It sounds like we need to implement another relocation case here. If you're willing to dig into it further, I'd be happy to review a PR.
teymour-aldridge commentedon Aug 2, 2022
It came from a different frontend (a small compiler I'm writing). The problem seems to be with
cranelift-object, because I can run the same program without error by usingcranelift-jit(which I have adopted as a stopgap solution).I'd be happy to, but I'm not sure what a relocation is :)
[-]Cranelift: error "unimplemented relocation addend Relocation" on M1 Mac only[/-][+]Cranelift: error "unimplemented relocation addend Relocation" on MacOS on aarch64[/+]afonso360 commentedon Oct 11, 2022
I think this might already be fixed upstream in gimli-rs/object#465, so it might be a case of just updating the object crate whenever they do their next release.
afonso360 commentedon Jan 8, 2023
👋 Hey,
Would you be able to test this code using PR #5434? It includes the updated version of object, and I suspect it might fix your issue.