Skip to content

Commit 6766bc8

Browse files
authored
ioctl/generate.sh: Use local toolchain for riscv32 (#107)
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>
1 parent e612c73 commit 6766bc8

File tree

4 files changed

+1918
-380
lines changed

4 files changed

+1918
-380
lines changed

gen/ioctl/generate.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,16 @@ qemu-mips64el -L /usr/mips64el-linux-gnuabi64 ./main.exe >> "$out"
3838
mipsel-linux-gnu-gcc -Iinclude -c list.c $cflags
3939
mipsel-linux-gnu-gcc main.c list.o -o main.exe $cflags
4040
qemu-mipsel -L /usr/mipsel-linux-gnu ./main.exe >> "$out"
41+
42+
# RISCV32 tolchains are not yet packaged by major distributions e.g. debian etc.
43+
# Therefore download it from https://github.com/riscv-collab/riscv-gnu-toolchain/releases
44+
# e.g. riscv32-glibc-ubuntu-22.04-gcc-nightly-2024.02.02-nightly.tar.gz
45+
# install it into /opt and then running below commands will succeed
46+
# /opt/riscv/bin/riscv32-unknown-linux-gnu-gcc --sysroot=/opt/riscv/sysroot/ -Iinclude -c list.c $cflags
47+
# /opt/riscv/bin/riscv32-unknown-linux-gnu-gcc --sysroot=/opt/riscv/sysroot/ main.c list.o -o main.exe $cflags
48+
# /opt/riscv/bin/qemu-riscv32 -L /opt/riscv/sysroot/ ./main.exe >> "$out"
49+
cat riscv32-ioctls.txt >> "$out"
50+
4151
riscv64-linux-gnu-gcc -Iinclude -c list.c $cflags
4252
riscv64-linux-gnu-gcc main.c list.o -o main.exe $cflags
4353
qemu-riscv64 -L /usr/riscv64-linux-gnu ./main.exe >> "$out"

0 commit comments

Comments
 (0)