Skip to content

Commit

Permalink
ioctl/generate.sh: Use local toolchain for riscv32 (#107)
Browse files Browse the repository at this point in the history
RV32 toolchains are not yet packages by distributions, therefore
download and install one into /opt before running the ioctl generation
script.

Update the generated files

Signed-off-by: Khem Raj <raj.khem@gmail.com>
  • Loading branch information
kraj authored and sunfishcode committed May 17, 2024
1 parent 4d45072 commit 99d5b17
Show file tree
Hide file tree
Showing 4 changed files with 1,918 additions and 380 deletions.
10 changes: 10 additions & 0 deletions gen/ioctl/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@ qemu-mips64el -L /usr/mips64el-linux-gnuabi64 ./main.exe >> "$out"
mipsel-linux-gnu-gcc -Iinclude -c list.c $cflags
mipsel-linux-gnu-gcc main.c list.o -o main.exe $cflags
qemu-mipsel -L /usr/mipsel-linux-gnu ./main.exe >> "$out"

# RISCV32 tolchains are not yet packaged by major distributions e.g. debian etc.
# Therefore download it from https://github.com/riscv-collab/riscv-gnu-toolchain/releases
# e.g. riscv32-glibc-ubuntu-22.04-gcc-nightly-2024.02.02-nightly.tar.gz
# install it into /opt and then running below commands will succeed
# /opt/riscv/bin/riscv32-unknown-linux-gnu-gcc --sysroot=/opt/riscv/sysroot/ -Iinclude -c list.c $cflags
# /opt/riscv/bin/riscv32-unknown-linux-gnu-gcc --sysroot=/opt/riscv/sysroot/ main.c list.o -o main.exe $cflags
# /opt/riscv/bin/qemu-riscv32 -L /opt/riscv/sysroot/ ./main.exe >> "$out"
cat riscv32-ioctls.txt >> "$out"

riscv64-linux-gnu-gcc -Iinclude -c list.c $cflags
riscv64-linux-gnu-gcc main.c list.o -o main.exe $cflags
qemu-riscv64 -L /usr/riscv64-linux-gnu ./main.exe >> "$out"
Expand Down
Loading

0 comments on commit 99d5b17

Please sign in to comment.