User Tools

Site Tools


developers:env_prepare

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
developers:env_prepare [2018/10/27 16:14]
mick
developers:env_prepare [2019/04/10 20:30]
mick [riscv-gnu-toolchain how to]
Line 108: Line 108:
 </​code>​ </​code>​
  
-==== Use the toolchain ====+<WRAP Tip> 
 +You may build a multi-lib toolchain (that can create both 32bit and 64bit binaries) by using the ''​--enable-multilib''​ argument on the configure command above. 
 +</​WRAP>​ 
 + 
 +<WRAP Info> 
 +=== newlib-based toolchain ​=== 
 + 
 +Similar to the GNU-based toolchain, you may build a newlib-based toolchain by just typing ''​make''​ instead of ''​make linux''​ above. Make sure you use a different prefix path. 
 +</​WRAP>​ 
 + 
 +<WRAP Info> 
 +=== musl-based toolchain === 
 + 
 +It is possible to build a toolchain based on musl libc, to do this clone https://​github.com/​riscv/​riscv-musl.git on the risc-gnu-toolchain top directory and use musl32 and musl64 targets. Note that musl doesn'​t support multi-lib. 
 + 
 +<​code>​ 
 +$ cd riscv-gnu-toolchain 
 +$ git clone --recursive https://​github.com/​riscv/​riscv-musl.git 
 +$ ./configure --prefix=<​install directory>​ 
 +$ make musl<​xlen>​ 
 +</​code>​ 
 +</​WRAP>​ 
 +==== Using the toolchain ====
  
 Now that you are done, you should add <install directory>/​bin to your PATH Now that you are done, you should add <install directory>/​bin to your PATH
Line 125: Line 147:
 riscv64-unknown-linux-gnu-cpp ​       riscv64-unknown-linux-gnu-gcc-nm ​    ​riscv64-unknown-linux-gnu-gfortran ​   riscv64-unknown-linux-gnu-objdump ​ riscv64-unknown-linux-gnu-strip riscv64-unknown-linux-gnu-cpp ​       riscv64-unknown-linux-gnu-gcc-nm ​    ​riscv64-unknown-linux-gnu-gfortran ​   riscv64-unknown-linux-gnu-objdump ​ riscv64-unknown-linux-gnu-strip
 </​code>​ </​code>​
- 
- 
developers/env_prepare.txt · Last modified: 2019/04/10 20:30 by mick