aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md36
1 files changed, 21 insertions, 15 deletions
diff --git a/README.md b/README.md
index 40351aa..8dc1910 100644
--- a/README.md
+++ b/README.md
@@ -16,7 +16,7 @@ so `--recursive` or `git submodule update --init --recursive` is not needed.
### Prerequisites
-Several standard packages are needed to build the toolchain.
+Several standard packages are needed to build the toolchain.
On Ubuntu, executing the following command should suffice:
@@ -25,10 +25,10 @@ On Ubuntu, executing the following command should suffice:
On Fedora/CentOS/RHEL OS, executing the following command should suffice:
$ sudo yum install autoconf automake python3 libmpc-devel mpfr-devel gmp-devel gawk bison flex texinfo patchutils gcc gcc-c++ zlib-devel expat-devel libslirp-devel
-
+
On Arch Linux, executing the following command should suffice:
- $ sudo pacman -Syyu autoconf automake curl python3 libmpc mpfr gmp gawk base-devel bison flex texinfo gperf libtool patchutils bc zlib expat libslirp
+ $ sudo pacman -Syu curl python3 libmpc mpfr gmp base-devel texinfo gperf patchutils bc zlib expat libslirp
Also available for Arch users on the AUR: [https://aur.archlinux.org/packages/riscv-gnu-toolchain-bin](https://aur.archlinux.org/packages/riscv-gnu-toolchain-bin)
@@ -91,7 +91,7 @@ To build either cross-compiler with support for both 32-bit and
64-bit, run the following command:
./configure --prefix=/opt/riscv --enable-multilib
-
+
And then either `make`, `make linux` or `make musl` for the Newlib, Linux
glibc-based or Linux musl libc-based cross-compiler, respectively.
@@ -104,10 +104,13 @@ using the `--print-multi-lib` flag on either cross-compiler.
Linux toolchain has an additional option `--enable-default-pie` to control the
default PIE enablement for GCC, which is disable by default.
-To customize the enabled languages, use option `--with-languages=`. For example,
+To customize the enabled languages, use option `--with-languages=`. For example,
if you want to enable `c,c++,fortran`, use `./configure --with-languages=c,c++,fortran`.
This option only takes effect for the GNU toolchain.
+The toolchain has an option `--enable-strip` to control strip of host binaries,
+strip is disabled by default.
+
### Troubleshooting Build Problems
Builds work best if installing into an empty directory. If you build a
@@ -126,7 +129,7 @@ is case-sensitive. A build on a case-insensitive filesystem will fail when
building glibc because \*.os and \*.oS files will clobber each other during
the build eventually resulting in confusing link errors.
-Centos (and RHEL) provide old GNU tools versions that may be too old to build
+CentOS (and RHEL) provide old GNU tools versions that may be too old to build
a RISC-V toolchain. There is an alternate toolset provided that includes
current versions of the GNU tools. This is the devtoolset provided as part
of the Software Collection service. For more info, see the
@@ -140,7 +143,10 @@ devtoolset-7 works.
There are a number of additional options that may be passed to
configure. See './configure --help' for more details.
-Also you can define extra flags to pass to specific projects: ```BINUTILS_NATIVE_FLAGS_EXTRA, BINUTILS_TARGET_FLAGS_EXTRA, GCC_EXTRA_CONFIGURE_FLAGS, GDB_NATIVE_FLAGS_EXTRA, GDB_TARGET_FLAGS_EXTRA, GLIBC_TARGET_FLAGS_EXTRA, NEWLIB_TARGET_FLAGS_EXTRA```.
+Also you can define extra flags to pass to specific projects: ```BINUTILS_NATIVE_FLAGS_EXTRA,
+BINUTILS_TARGET_FLAGS_EXTRA, GCC_EXTRA_CONFIGURE_FLAGS, GDB_NATIVE_FLAGS_EXTRA,
+GDB_TARGET_FLAGS_EXTRA, GLIBC_TARGET_FLAGS_EXTRA, NEWLIB_TARGET_FLAGS_EXTRA,
+LLVM_EXTRA_CONFIGURE_FLAGS, QEMU_EXTRA_CONFIGURE_FLAGS```.
Example: ```GCC_EXTRA_CONFIGURE_FLAGS=--with-gmp=/opt/gmp make linux```
#### Set default ISA spec version
@@ -218,8 +224,8 @@ This flag is particularly useful for developers testing and emulating full RISC-
The Dejagnu test suite has been ported to RISC-V. This can be run with a
simulator for the elf and linux toolchains. The simulator can be selected
by the SIM variable in the Makefile, e.g. SIM=qemu, SIM=gdb, or SIM=spike
-(experimental).In addition, the simulator can also be selected with the
-configure time option `--with-sim=`.However, the testsuite allowlist is
+(experimental).In addition, the simulator can also be selected with the
+configure time option `--with-sim=`.However, the testsuite allowlist is
only maintained for qemu.Other simulators might get extra failures.
#### Additional Prerequisite
@@ -271,7 +277,7 @@ Note:
By default GCC will execute all tests of its regression test suite.
While running them in parallel (e.g. `make -j$(nproc) report`) will
-significanlty speed up the execution time on multi-processor systems,
+significantly speed up the execution time on multi-processor systems,
the required time for executing all tests is usually too high for
typical development cycles. Therefore GCC allows to select the tests
that are being executed using the environment variable `RUNTESTFLAGS`.
@@ -279,12 +285,12 @@ that are being executed using the environment variable `RUNTESTFLAGS`.
To restrict a test run to only RISC-V specific tests
the following command can be used:
- RUNTESTFLAGS="riscv.exp" make report
+ RUNTESTFLAGS="riscv.exp" make report
To restrict a test run to only RISC-V specific tests with match the
pattern "zb*.c" and "sm*.c" the following command can be used:
- RUNTESTFLAGS="riscv.exp=zb*.c\ sm*.c" make report
+ RUNTESTFLAGS="riscv.exp=zb*.c\ sm*.c" make report
#### Testing GCC, Binutils, and glibc of a Linux toolchain
@@ -422,7 +428,7 @@ 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
+in case you want to using latest development tree, you can use following command
to upgrade all submodule.
git submodule update --remote
@@ -490,8 +496,8 @@ sources is among them. The flag `--enable-host-gcc` does exaclty that:
### FAQ
#### Ensuring Code Model Consistency
-If parts of newlib are going to be replaced with an external library (such as with [libgloss-htif](https://github.com/ucb-bar/libgloss-htif) for Berkeley Host-Target Interface),
-you should take care to ensure that both newlib and the external library are built using the same code model. For more information about RISC-V code models,
+If parts of newlib are going to be replaced with an external library (such as with [libgloss-htif](https://github.com/ucb-bar/libgloss-htif) for Berkeley Host-Target Interface),
+you should take care to ensure that both newlib and the external library are built using the same code model. For more information about RISC-V code models,
[read this SiFive blog article](https://www.sifive.com/blog/all-aboard-part-4-risc-v-code-models).
Errors that indicate a code model mismatch include "relocation overflow" or "relocation truncated" errors from the linker being unable to successfully relocate symbols in the executable.