rustc: fix crates compilation

This commit is contained in:
Sebastien Bourdeauducq 2019-04-07 23:16:00 +08:00
parent da982a60cc
commit c3992220e5
1 changed files with 6 additions and 7 deletions

View File

@ -11,25 +11,24 @@ let
url = "https://static.rust-lang.org/dist/rustc-${version}-src.tar.gz";
sha256 = "0ji2l9xv53y27xy72qagggvq47gayr5lcv2jwvmfirx029vlqnac";
};
# nixcloud team code
riscv32imac-crates = stdenv.mkDerivation {
name = "riscv32imac-crates";
inherit src;
phases = [ "unpackPhase" "buildPhase" ];
buildPhase = ''
destdir=$out
rustc="${rustc_internal}/bin/rustc --out-dir ''${destdir} -L ''${destdir} --target riscv32imac-unknown-none-elf -g -C target-feature=+mul,+div,+ffl1,+cmov,+addc -C opt-level=s --crate-type rlib"
rustc="${rustc_internal}/bin/rustc --out-dir ''${destdir} -L ''${destdir} --target riscv32imac-unknown-none-elf -g -C opt-level=s --crate-type rlib"
mkdir -p ''${destdir}
''${rustc} --crate-name core src/libcore/lib.rs
''${rustc} --crate-name compiler_builtins src/libcompiler_builtins/src/lib.rs --cfg 'feature="compiler-builtins"' --cfg 'feature="mem"'
''${rustc} --crate-name std_unicode src/libstd_unicode/lib.rs
''${rustc} --crate-name alloc src/liballoc/lib.rs
''${rustc} --crate-name libc src/liblibc_mini/lib.rs
''${rustc} --crate-name unwind src/libunwind/lib.rs
''${rustc} -Cpanic=abort --crate-name panic_abort src/libpanic_abort/lib.rs
''${rustc} -Cpanic=unwind --crate-name panic_unwind src/libpanic_unwind/lib.rs --cfg llvm_libunwind
'';
# ''${rustc} --crate-name libc ${./libc_mini.rs}
# ''${rustc} --crate-name unwind src/libunwind/lib.rs
# ''${rustc} --crate-name std src/libstd/lib.rs
# ''${rustc} -Cpanic=abort --crate-name panic_abort src/libpanic_abort/lib.rs
# ''${rustc} -Cpanic=unwind --crate-name panic_unwind src/libpanic_unwind/lib.rs --cfg llvm_libunwind
};
# nixcloud team code
# originally rustc but now renamed to rustc_internal