Browse Source

compile Rust core crate for riscv32i

pull/1/head
parent
commit
c7bda2b144
  1. 6
      compilers/rust-riscv32i-crates.nix
  2. 2
      default.nix

6
compilers/rust-riscv32imc-crates.nix → compilers/rust-riscv32i-crates.nix

@ -8,12 +8,12 @@ let
};
in
stdenv.mkDerivation {
name = "rust-riscv32imc-crates";
name = "rust-riscv32i-crates";
src = rustc.src;
phases = [ "unpackPhase" "buildPhase" ];
buildPhase = ''
destdir=$out/lib/rustlib/riscv32imc-unknown-none-elf/lib/
rustc="${rustc}/bin/rustc --out-dir ''${destdir} -L ''${destdir} --target riscv32imc-unknown-none-elf -g -C opt-level=s --crate-type rlib"
destdir=$out/lib/rustlib/riscv32i-unknown-none-elf/lib/
rustc="${rustc}/bin/rustc --out-dir ''${destdir} -L ''${destdir} --target riscv32i-unknown-none-elf -g -C opt-level=s --crate-type rlib"
mkdir -p ''${destdir}
export RUSTC_BOOTSTRAP=1

2
default.nix

@ -20,7 +20,7 @@ rec {
gcc-riscv32 = pkgs.callPackage ./compilers/gcc.nix { platform = "riscv32"; platform-binutils = binutils-riscv32; };
binutils-riscv64 = pkgs.callPackage ./compilers/binutils.nix { platform = "riscv64"; };
gcc-riscv64 = pkgs.callPackage ./compilers/gcc.nix { platform = "riscv64"; platform-binutils = binutils-riscv64; };
rust-riscv32imc-crates = pkgs.callPackage ./compilers/rust-riscv32imc-crates.nix { };
rust-riscv32i-crates = pkgs.callPackage ./compilers/rust-riscv32i-crates.nix { };
fw-helloworld = pkgs.callPackage ./firmware { inherit rust-riscv32i-crates binutils-riscv32; };
};

Loading…
Cancel
Save