Compare commits
2 commits
bab2803568
...
a376d27260
| Author | SHA1 | Date | |
|---|---|---|---|
| a376d27260 | |||
| 988b888f62 |
2 changed files with 38 additions and 5 deletions
31
README.md
31
README.md
|
|
@ -37,6 +37,7 @@ mkdir ./build && cd ./build
|
|||
mkdir /usr/local/riscv && chmod -R 0775 /usr/local/riscv
|
||||
|
||||
# Setup to build newlib for 32bit embedded and compressed cpus.
|
||||
# Not needed for ch32fun as it uses musl
|
||||
./configure --prefix=/usr/local/riscv --with-arch=rv32ec \
|
||||
--with-arch=rv32ec \
|
||||
--with-abi=ilp32e \
|
||||
|
|
@ -58,6 +59,36 @@ make -j4 build-binutils
|
|||
Pretty much the same as FreeBSD, just follow the toolchain's `README.md` files
|
||||
instructions.
|
||||
|
||||
First download the tar.gz file from the link in the requirements(Xpack).
|
||||
|
||||
Once you've downloaded the latest release extract the archive into it's own
|
||||
file.
|
||||
|
||||
You should then move the contents into a new directory like so.
|
||||
|
||||
```sh
|
||||
sudo mkdir -p /opt/riscv
|
||||
tar -xvzf ./xpack<name_here>
|
||||
sudo mv ./xpack<name_here>/* /opt/riscv/
|
||||
```
|
||||
|
||||
You will also need to add the location to your path so it's picked up in your
|
||||
terminal.
|
||||
|
||||
```sh
|
||||
# Appends the new location on to the existing path variable.
|
||||
echo "export PATH=/opt/riscv/bin:$PATH" >> ~/.bashrc
|
||||
|
||||
# Sources the bashrc(config file) to update current terminal session.
|
||||
source ~/.bashrc
|
||||
|
||||
```
|
||||
|
||||
After following the above steps you should now have a working RISC-V toolchain
|
||||
that can be used for development.
|
||||
|
||||
|
||||
|
||||
|
||||
## TODO
|
||||
|
||||
|
|
|
|||
|
|
@ -33,14 +33,16 @@ set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
|
|||
if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "FreeBSD")
|
||||
message("OS:: FreeBSD")
|
||||
#set(NEWLIB /usr/local/riscv/riscv32-unknown-elf/include)
|
||||
set(NEWLIB /usr/local/lib/gcc/riscv32-unknown-elf/11.3.00/include)
|
||||
set(CMAKE_C_COMPILER riscv32-unknown-elf-gcc)
|
||||
set(CMAKE_CXX_COMPILER riscv32-unknown-elf-g++)
|
||||
set(CMAKE_ASM_COMPILER riscv32-unknown-elf-gcc)
|
||||
#set(NEWLIB /usr/local/lib/gcc/riscv32-unknown-elf/11.3.00/include)
|
||||
set(NEWLIB /compat/linux/opt/riscv/riscv-none-elf/include)
|
||||
set(CMAKE_C_COMPILER riscv-none-elf-gcc)
|
||||
set(CMAKE_CXX_COMPILER riscv-none-elf-g++)
|
||||
set(CMAKE_ASM_COMPILER riscv-none-elf-gcc)
|
||||
|
||||
# Don't know why this is here?
|
||||
#set(CMAKE_FIND_ROOT_PATH /usr/local/riscv/)
|
||||
set(CMAKE_FIND_ROOT_PATH /usr/local/lib/gcc/riscv32-unknown-elf/)
|
||||
#set(CMAKE_FIND_ROOT_PATH /usr/local/lib/gcc/riscv32-unknown-elf/)
|
||||
set(CMAKE_FIND_ROOT_PATH /compat/linux/opt/riscv/)
|
||||
|
||||
#set(CMAKE_SYSROOT "/usr/local/riscv/" /usr/local/riscv/riscv32-unknown-elf)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue