I managed to run UserlandVM in chroot environment and compile programs with riscv64 GCC. I added syscall overrides for fork, load_image and exec (prepend UserlandVM as first argument).
In theory it should be possible to run haikuporter and compile HaikuPorts packages for any architecture without haikuports.cross.
~/Tests/UserlandVM/build.x86_64> uname -a
Haiku pc-1 1 hrev55969+49 Mar 31 2022 04:50: x86_64 x86_64 Haiku
~/Tests/UserlandVM/build.x86_64> chroot ../root /boot/system/runtime/UserlandVM /boot/system/bin/bash
/> cd /boot/home/Tests/MinApp
~/Tests/MinApp> make clean
rm -rf "objects.x86_64-cc11-release"
~/Tests/MinApp> make
mkdir -p objects.x86_64-cc11-release; \
mkdepend -I./ -p .cpp:objects.x86_64-cc11-release/%n.o -m -f "objects.x86_64-cc11-release/MinApp.d" MinApp.cpp
g++ -c MinApp.cpp -iquote./ -iquote./ -O3 -o "objects.x86_64-cc11-release/MinApp.o"
cc -o "objects.x86_64-cc11-release/MinApp" objects.x86_64-cc11-release/MinApp.o -Xlinker -soname=_APP_ -L./ -lstdc++ -lsupc++ -lbe
mimeset -f "objects.x86_64-cc11-release/MinApp"
~/Tests/MinApp> readelf -h objects.x86_64-cc11-release/MinApp
ELF Header:
Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
Class: ELF64
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: DYN (Shared object file)
Machine: RISC-V
Version: 0x1
Entry point address: 0x45d2
Start of program headers: 64 (bytes into file)
Start of section headers: 36016 (bytes into file)
Flags: 0x5, RVC, double-float ABI
Size of this header: 64 (bytes)
Size of program headers: 56 (bytes)
Number of program headers: 3
Size of section headers: 64 (bytes)
Number of section headers: 24
Section header string table index: 23
~/Tests/MinApp> objects.x86_64-cc11-release/MinApp
~/Tests/MinApp> ls /boot/system/runtime
UserlandVM lib
~/Tests/MinApp> ls /boot/system/runtime/lib
libgcc_s.so.1 libroot.so libstdc++.so libstdc++.so.6 libstdc++.so.6.0.29
~/Tests/MinApp> exit
exit
~/Tests/UserlandVM/build.x86_64>