aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKito Cheng <kito.cheng@sifive.com>2021-01-05 16:28:27 +0800
committerKito Cheng <kito.cheng@sifive.com>2021-01-07 11:03:34 +0800
commit2d676e45359295f83d62c6a1e03e2609598e83a6 (patch)
treedc2b1a6bc48941bc5ce26e7a84a43800d844d309
parent87a6c36aa74718289c94dbf5d63d96a0a649cf55 (diff)
downloadriscv-gnu-toolchain-2d676e45359295f83d62c6a1e03e2609598e83a6.zip
riscv-gnu-toolchain-2d676e45359295f83d62c6a1e03e2609598e83a6.tar.gz
riscv-gnu-toolchain-2d676e45359295f83d62c6a1e03e2609598e83a6.tar.bz2
Add doc for development
-rw-r--r--README.md59
1 files changed, 59 insertions, 0 deletions
diff --git a/README.md b/README.md
index 6f3beac..f0aef4d 100644
--- a/README.md
+++ b/README.md
@@ -180,3 +180,62 @@ To test GCC, run the following commands:
Note:
- spike only support rv64* bare-metal/elf toolchain.
- gdb simulator only support bare-metal/elf toolchain.
+
+### Development
+
+This section is only for developer or advanced user, or you want to build
+toolchain with your own source tree.
+
+#### Update Source Tree
+
+`riscv-gnu-toolchain` contain stable but not latest source for each submodule,
+in case you want to using latest develoment tree, you can use following command
+to upgrade all submodule.
+
+ git submodule update --remote
+
+Or you can upgrade specific submodule only.
+
+ git submodule update --remote <component>
+
+For example, upgrade riscv-gcc only, you can using following command:
+
+ git submodule update --remote riscv-gcc
+
+#### How to Check Which Branch are Used for Specific submodule
+
+The branch info has recorded in `.gitmodules` file, which can set or update via
+`git submodule add -b` or `git submodule set-branch`.
+
+However the only way to check which branch are using is to check `.gitmodules`
+file, here is the example for `riscv-gcc`, it using riscv-gcc-10.2.0 branch, so
+it will has a section named `riscv-gcc` and has a field `branch` is
+`riscv-gcc-10.2.0`.
+
+```
+[submodule "riscv-gcc"]
+ path = riscv-gcc
+ url = ../riscv-gcc.git
+ branch = riscv-gcc-10.2.0
+```
+
+#### Use Source Tree Other Than `riscv-gnu-toolchain`
+
+`riscv-gnu-toolchain` also support using out-of-tree source to build toolchain,
+there is couple configure option to specify the source tree of each
+submodule/component.
+
+For example you have a gcc in `$HOME/gcc`, use `--with-gcc-src` can specify that:
+
+ ./configure --with-gcc-src=$HOME/gcc
+
+Here is the list of configure option for specify source tree:
+
+ --with-gcc-src
+ --with-binutils-src
+ --with-newlib-src
+ --with-glibc-src
+ --with-musl-src
+ --with-gdb-src
+ --with-linux-headers-src
+