Skip to content

How am I supposed to cross-compile to embedded ARM? #253

@hustlerone

Description

@hustlerone

Here is the drv:

{
  lib,
  rust-bin,
  makeRustPlatform,
  fetchFromGitHub,

  pkg-config,
  stdenv,
  udev,
}:
let
  rust = (
    rust-bin.stable.latest.default.override {
      targets = [
        "thumbv6m-none-eabi"
        "thumbv7m-none-eabi"
      ];
    }
  );
in
(makeRustPlatform {
  cargo = rust;
  rustc = rust;
}).buildRustPackage
  (finalAttrs: {
    name = "picoprog";

    src = fetchFromGitHub {
      owner = "9elements";
      repo = "picoprog";
      rev = "b2ca65f6b6120088335ba2033d22735d852f31db";
      hash = "sha256-V0HiGNWKpvf9KjAwbv3ss7cWJtiD3F4u0l7mZ+rOFhw=";
    };

    buildInputs = [ pkg-config ] ++ lib.optional stdenv.hostPlatform.isLinux udev;
    cargoHash = "sha256-RsOhd3pNBGT9co+UVWqT4aVs+Vn0BIG0x8kRO2xciWQ=";

    nativeBuildInputs = [
      pkg-config
    ];

    strictDeps = true;
    doCheck = false;
  })

For some reason rust insists on compiling for x86_64-linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions