Skip to content
This repository has been archived by the owner on Jan 9, 2020. It is now read-only.
/ rust-riscv Public archive

Build Rust standard library for RISC-V GNU/Linux

License

Notifications You must be signed in to change notification settings

msizanoen1/rust-riscv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DEPRECATED - SUPPORT IS NOW UPSTREAM

rust-riscv

A set of script and patches to build the Rust standard library for RISC-V on GNU/Linux. This should no longer be necessary when RISC-V support for GNU/Linux is upstreamed.

Dependencies

  • RISC-V GCC cross toolchain
  • Rust nightly compiler
  • Rust rust-src component: rustup component add rust-src

Building

./setup.sh   # Copy and patch sources
./build.sh   # Build standard library
./install.sh # Install the built libraries into rustc sysroot
./clean.sh   # Optional, clean everything

Usage

To compile a program, pass --target riscv64gc-unknown-linux-gnu to Cargo. Also make sure rustc use the RISC-V cross toolchain by setting the RUSTFLAGS environment variable to -C linker=riscv64-unknown-linux-gnu. If the program depends on C code, set the CC_riscv64gc_unknown_linux_gnu to the cross compiler and set CFLAGS_riscv64gc_unknown_linux_gnu to -mabi=lp64d -fPIC. If the build process report failure to build libc crate, make sure you use the latest version by running cargo update -p libc.

About

Build Rust standard library for RISC-V GNU/Linux

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages