Stream: cranelift

Topic: building rustc_codegen_cranelift on ARM


view this post on Zulip Adrian Sampson (Apr 19 2023 at 19:58):

Hi! This may mainly be a question for @bjorn3 if they're willing. I'm trying to build rustc_codegen_cranelift on ARM (my M1 Mac, so aarch64-apple-darwin) and running into this error during ./y.rs build:

error: error writing object file: unimplemented relocation Relocation { offset: 32, size: 32, kind: Relative, encoding: Generic, symbol: SymbolId(32), addend: -4 }

I recall getting similar errors in the past (in a different Cranelift-related effort) that I ended up blaming on missing support in the object crate for some PIC feature or other on aarch64. Do you know if I'm doing something obviously wrong?

view this post on Zulip bjorn3 (Apr 19 2023 at 19:59):

ARM macOS is currently not supported unfortunately. There are a couple of missing features.

view this post on Zulip bjorn3 (Apr 19 2023 at 20:00):

See https://github.com/bjorn3/rustc_codegen_cranelift/issues/1248

CirrusCI now has support for running on M1 macs: https://cirrus-ci.org/guide/macOS/ Implement Mach-O TLS model for AArch64 in Cranelift (bytecodealliance/wasmtime#5434) Implement calling variadic f...

view this post on Zulip bjorn3 (Apr 19 2023 at 20:00):

I thought relocations were already implemented though, but I guess something is still missing.

view this post on Zulip bjorn3 (Apr 19 2023 at 20:02):

cg_clif does work on ARM Linux though. In fact I do most of the development on it nowadays. CI is still exclusively x86_64.

view this post on Zulip Adrian Sampson (Apr 19 2023 at 20:07):

That would do it! Thank you for clarifying!!


Last updated: Nov 22 2024 at 16:03 UTC