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/22 18:54]
mick
developers:env_prepare [2019/04/10 20:30] (current)
mick [riscv-gnu-toolchain how to]
Line 48: Line 48:
 ==== Your preferences ==== ==== Your preferences ====
  
-Git allows you to use your favourite tools, in this example we'll use more for pager, nano for editor and meld for diff/merge. In order to use meld instead of the pager for displaying ​d+Git allows you to use your favourite tools, in this example we'll use more for pager, nano for editor and meld for diff/merge. In order to use meld instead of the pager for displaying ​diffs. Note that for using the external tool for diff/merge you should use the git difftool/​mergetool command instead of git diff.
  
 <​code>​ <​code>​
Line 64: Line 64:
 ===== Prepare the toolchain ===== ===== Prepare the toolchain =====
  
-For building the Linux kernel on RISC-V, you'll need a recent toolchain. You may use [[https://​crosstool-ng.github.io/​docs/​ | Crosstool-NG ]] with the [[https://​github.com/​crosstool-ng/​crosstool-ng/​tree/​master/​samples/​riscv64-unknown-linux-gnu | riscv64-unknown-linux-gnu ]] sample, using source code from upstream gcc/​binutils/​glibc or using the [[https://​github.com/​riscv/​riscv-gnu-toolchain | riscv-gnu-toolchain]] repository.+For building the Linux kernel on RISC-V, you'll need a recent toolchain. You may use [[https://​crosstool-ng.github.io/​docs/​ | Crosstool-NG ]] with the [[https://​github.com/​crosstool-ng/​crosstool-ng/​tree/​master/​samples/​riscv64-unknown-linux-gnu | riscv64-unknown-linux-gnu ]] sample, using source code from upstream gcc/​binutils/​glibc or using the [[https://​github.com/​riscv/​riscv-gnu-toolchain | riscv-gnu-toolchain]] repository. Your distribution may also provide cross-toolchains,​ e.g. [[https://​packages.debian.org/​sid/​gcc-riscv64-linux-gnu | debian]].
  
 ==== Crosstool-NG how to ==== ==== Crosstool-NG 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
developers/env_prepare.1540223650.txt.gz · Last modified: 2018/10/22 18:54 by mick