firmware: prevent Nix from corrupting output ELF

This commit is contained in:
Sebastien Bourdeauducq 2019-07-29 13:58:21 +08:00
parent 3deb18c261
commit 87acbacf87

View File

@ -7,6 +7,8 @@ rustPlatform.buildRustPackage rec {
src = ./.;
cargoSha256 = "0kf2pnfylfmzm0qvi4jfci43qvrnj1v5f037sb9zpvfqyddhdffl";
phases = ["unpackPhase" "buildPhase" "installPhase"];
buildPhase = ''
export CARGO_HOME=$(mktemp -d cargo-home.XXX)
export RUSTFLAGS="-L ${rust-riscv32i-crates}/lib/rustlib/riscv32i-unknown-none-elf/lib -C linker=${binutils-riscv32}/bin/riscv32-unknown-elf-ld -C link-arg=-Tlink.x"