========================================= OpenSmalltalk VM on RISCV64 problem notes ========================================= Update to platform/unix/vm/include_ucontext.h for Fedora Linux .. #elif __linux__ && __riscv64__ # define _PC_IN_UCONTEXT uc_mcontext.__gregs[REG_PC] # define _FP_IN_UCONTEXT uc_mcontext.__gregs[REG_S0] # define _SP_IN_UCONTEXT uc_mcontext.__gregs[REG_SP] .. building/linux64riscv/squeak.stack.spur/build/mvm =====VVV===== #!/usr/bin/env bash set -e # Stack Spur VM with VM profiler and threaded heartbeat INSTALLDIR=sqstkspur64linuxht OPT="-g -O2 -DNDEBUG -DDEBUGVM=0 -DMUSL -D_GNU_SOURCE -DUSEEVDEV" if [ $# -ge 1 ]; then INSTALLDIR="$1"; shift fi if ../../../../scripts/checkSCCSversion ; then exit 1; fi echo -n "clean? " read a case $a in n|no|N|NO) echo "ok but this isn't safe!!";; *) rm -f config.h; test -f Makefile && make reallyclean esac test -f plugins.int || (test -f ../plugins.int && cp -p ../plugins.int . || cp -p ../../plugins.int .) test -f plugins.ext || (test -f ../plugins.ext && cp -p ../plugins.ext . || cp -p ../../plugins.ext .) test -f config.h || ../../../../platforms/unix/config/configure \ --with-vmversion=5.0 \ --with-src=src/spur64.stack --disable-cogit \ --without-npsqueak \ TARGET_ARCH="-m64 -march=rv64g" \ CC=clang \ VM_WORD_SIZE="64" \ VM_CFLAGS="$OPT -D__linux__ -D__riscv64__" CFLAGS="$OPT -D__linux__ -D__riscv64__" ## --without-vm-display-fbdev rm -f vm/sqUnixMain.o # nuke version info rm -rf ../../../../products/$INSTALLDIR # prefer make install prefix=`readlink -f \`pwd\`/../../../../products/$INSTALLDIR` # but older linux readlinks lack the -f flag make install-squeak install-plugins prefix=`(cd ../../../../;pwd)`/products/$INSTALLDIR 2>&1 | tee LOG ; test ${PIPESTATUS[0]} -eq 0 =====^^^===== Command from ./mvm run to invoke compiler (NB: NO -D__riscv__ ..): =====VVV===== clang -Wall -g -O2 -pthread -DLSB_FIRST=1 -m64 -Wno-missing-braces -Wno-unknown-pragmas -Wno-unused-value -Wno-unused-label - Wno-unused-function -Wno-unused-variable -DHAVE_CONFIG_H -DSQUEAK_BUILTIN_PLUGIN -I/home/kend/opensmalltalk-vm-rv64/building /linux64riscv/squeak.stack.spur/build -I/home/kend/opensmalltalk-vm-rv64/building/linux64riscv/squeak.stack.spur/build -I/home /kend/opensmalltalk-vm-rv64/platforms/unix/vm -I/home/kend/opensmalltalk-vm-rv64/platforms/Cross/vm -I/home/kend/opensmalltalk -vm-rv64/src/spur64.stack -I/usr/local/include -I/home/kend/opensmalltalk-vm-rv64/platforms/Cross/vm -I/home/kend/opensmalltal k-vm-rv64/platforms/unix/vm -I/home/kend/opensmalltalk-vm-rv64/src/spur64.stack -I/home/kend/opensmalltalk-vm-rv64/platforms/C ross/plugins/FilePlugin -I/home/kend/opensmalltalk-vm-rv64/platforms/unix/plugins/B3DAcceleratorPlugin -m64 -Wno-missing-brace s -Wno-unknown-pragmas -Wno-unused-value -Wno-unused-label -Wno-unused-function -Wno-unused-variable -c -o sqUnixMain.o /hom e/kend/opensmalltalk-vm-rv64/platforms/unix/vm/sqUnixMain.c In file included from /home/kend/opensmalltalk-vm-rv64/platforms/unix/vm/sqUnixMain.c:56: /home/kend/opensmalltalk-vm-rv64/platforms/unix/vm/include_ucontext.h:110:3: error: need to implement extracting pc from a uco ntext_t on this system =====^^^===== Note: https://fedoraproject.org/wiki/Architectures/RISC-V/Installing https://dl.fedoraproject.org/pub/alt/risc-v/repo/virt-builder-images/images/index Command to invoke qemu to run Fedora prebuild developer image. =====VVV===== ## Fedora Linux qemu-system-riscv64 -nographic -machine virt -cpu rv64 \ -m 2G \ -kernel Fedora-Developer-Rawhide-20200108.n.0-fw_payload-uboot-qemu-virt-smode.elf \ -append "root=/dev/vda console=ttyS0" \ -device virtio-blk-device,drive=hd0 \ -drive file=Fedora-Developer-Rawhide-20200108.n.0-sda.raw,format=raw,id=hd0 \ -device virtio-net-device,netdev=usernet \ -netdev user,id=usernet,hostfwd=tcp::2222-:22 \ -bios none =====^^^=====