I’ve used Rustler on Nerves before, and fortunately it exposes ways to support cross compile, namely through the RUSTLER_TARGET environment variable. Cocoa has a really good guide on it here:
https://cocoa-research.works/2022/01/use-rustler-with-nerves-cross-compile/
There’s also a :target configuration option for the Rustler package:
You might just be able to set that to the target triple on your Nerves device in your config/target.exs. But there might also be some more steps that would be required to get it to work on Nerves - it looks like Cocoa’s method explicitly sets the linker with System.get_env("CC") |> tap(&System.put_env("RUSTFLAGS", "-C linker=#{&1}")), so that might also be required


















