compile Rust core crate for riscv32i

This commit is contained in:
Sebastien Bourdeauducq 2019-06-08 21:52:33 +08:00
parent 03dc4f6e32
commit c7bda2b144
2 changed files with 4 additions and 4 deletions

View File

@ -8,12 +8,12 @@ let
}; };
in in
stdenv.mkDerivation { stdenv.mkDerivation {
name = "rust-riscv32imc-crates"; name = "rust-riscv32i-crates";
src = rustc.src; src = rustc.src;
phases = [ "unpackPhase" "buildPhase" ]; phases = [ "unpackPhase" "buildPhase" ];
buildPhase = '' buildPhase = ''
destdir=$out/lib/rustlib/riscv32imc-unknown-none-elf/lib/ destdir=$out/lib/rustlib/riscv32i-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" 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} mkdir -p ''${destdir}
export RUSTC_BOOTSTRAP=1 export RUSTC_BOOTSTRAP=1

View File

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