Build on riscv64#160
Conversation
Edit config.h to disable x86 defs and add a conditional to use edited config.h on riscv64 builds, use regular config.h otherwise.
copy riscv64 headers to include outdir when building for riscv64, and use archdir files for libffi.a
add riscv64 to arches and generated riscv.lua, just like with aarch64 and x86_64. unistd is empty because riscv doesn't have a syscall.tbl, apparantly it doesn't need it.
riscv64 doesn't use assembly files for crti and crtn, so use the c files in the build. generate riscv64.lua as with other arches.
JIT is unsupported in riscv64, disable it in config.h, by using a different config.h on riscv64
michaelforney
left a comment
There was a problem hiding this comment.
Thanks for working on this! I pushed the libffi commit, and have just a few comments on the others.
Fun fact, oasis was probably the first musl distribution to run on riscv. Someone reached out to me years ago about running oasis on riscv32sf, so I tried it and ran into a bunch of bugs in the riscv port (hadn't been upstreamed yet). I fixed all those I found, and got it working in temu/jslinux. Looks like it still works:
https://bellard.org/jslinux/vm.html?cpu=riscv64&url=https://mforney.org/virt/oasis-riscv64/temu.cfg
(the root password is oasis)
apply suggestions from mforney: oasislinux#160 (review)
Use include guards instead of a separate file
Use guards instead of a separate file
|
Thanks so much for the help! I applied the suggestions, and its all building fine :D |
add cflags and syscalls to riscv64 build
|
Also I figured out why strace wasn't building, it needed some syscalls and had to enable the build with the cflags and ioctls. No idea why it didn't fail before and instead just continued without building. |
|
Applied, thanks! |
Built the system using riscv64-linux-musl_rocket-15.2.0 toolchain from skarnet.org, on alpine linux x86_64. all sets build without errors, except ffmpeg which I believe will require more work than I know to do, and mpv which depends on ffmpeg. Originally strace and wpa_supplicant also gave errors, but the recent fixes in master removed them. wpa_supplicant seems to be ok, but strace has an emtpy tree.fspec and root.index for some reason. I have not tested much else yet, I just know it builds.