I'm trying to build a simple hello world project for RISC-V/spike. I've been through the tutorials and through the sel4test for RISC-V/spike. That project is too large for what I need. I tried following this: https://github.com/manu88/SeL4_101 and modified the CMakeLists.txt to configure as required: ### SeL4_101 CMakeLists.txt ### cmake_minimum_required(VERSION 3.7.2) #message(STATUS "Femur print " ${KernelX86Sel4Arch_all_strings}) #if (${PLATFORM} IN_LIST KernelRiscVSel4Arch_all_strings) if (${PLATFORM} IN_LIST KernelRiscVPlatform_all_strings) #if (${PLATFORM} IN_LIST ${KernelX86Sel4Arch_all_strings} ${KernelARMPlatform_all_strings} ${KernelRiscVPlatform_all_strings}) set(KernelArch riscv CACHE STRING "" FORCE) set(KernelRiscVSel4Arch riscv64 CACHE STRING "" FORCE) endif() include(tools/cmake-tool/default-CMakeLists.txt) if(SIMULATION) ApplyCommonSimulationSettings("riscv64") else() if(KernelArchX86) set(KernelIOMMU ON CACHE BOOL "" FORCE) endif() endif() # We must build the debug kernel because the tutorials rely on seL4_DebugPutChar # and they don't initialize a platsupport driver. ApplyCommonReleaseVerificationSettings(FALSE FALSE) GenerateSimulateScript() ############################################################################## When I build, I get the following error: user@user-KVM:/mnt/data/femur/build$ ninja [55/90] Building C object projects/util_libs/libplatsupport/CMakeFiles/platsupport.dir/src/plat/spike/serial.c.obj ../projects/util_libs/libplatsupport/src/plat/spike/serial.c:18:28: warning: 'struct dev_defn' declared inside parameter list will not be visible outside of this definition or declaration int uart_init(const struct dev_defn* defn, ^~~~~~~~ [73/90] Linking C executable projects/hello/hello FAILED: projects/hello/hello : && ccache /mnt/data/rocket-tools/bin/riscv64-unknown-elf-gcc --sysroot=/mnt/data/femur/build -march=rv64imac -mabi=lp64 -D__KERNEL_64__ -g -D__KERNEL_64__ -static -nostdlib -z max-page-size=0x1000 -u _sel4_start -e _sel4_start -T /mnt/data/femur/tools/cmake-tool/tls_rootserver.lds /mnt/data/femur/build/lib/crt1.o /mnt/data/femur/build/lib/crti.o /mnt/data/rocket-tools/lib/gcc/riscv64-unknown-elf/7.2.0/rv64imac/lp64/crtbegin.o projects/hello/CMakeFiles/hello.dir/src/main.c.obj -lgcc projects/seL4_libs/libsel4muslcsys/libsel4muslcsys.a projects/seL4_libs/libsel4utils/libsel4utils.a projects/util_libs/libcpio/libcpio.a projects/seL4_libs/libsel4platsupport/libsel4platsupport.a projects/util_libs/libplatsupport/libplatsupport.a projects/seL4_libs/libsel4simple-default/libsel4simple-default.a projects/seL4_libs/libsel4vspace/libsel4vspace.a projects/seL4_libs/libsel4simple/libsel4simple.a projects/seL4_libs/libsel4vka/libsel4vka.a projects/seL4_libs/libsel4debug/libsel4debug.a libsel4/libsel4.a projects/util_libs/libutils/libutils.a projects/util_libs/libelf/libelf.a projects/musllibc/build-temp/lib/libc.a -lgcc projects/seL4_libs/libsel4muslcsys/libsel4muslcsys.a projects/seL4_libs/libsel4utils/libsel4utils.a projects/util_libs/libcpio/libcpio.a projects/seL4_libs/libsel4platsupport/libsel4platsupport.a projects/util_libs/libplatsupport/libplatsupport.a projects/seL4_libs/libsel4simple-default/libsel4simple-default.a projects/seL4_libs/libsel4vspace/libsel4vspace.a projects/seL4_libs/libsel4simple/libsel4simple.a projects/seL4_libs/libsel4vka/libsel4vka.a projects/seL4_libs/libsel4debug/libsel4debug.a libsel4/libsel4.a projects/util_libs/libutils/libutils.a projects/util_libs/libelf/libelf.a projects/musllibc/build-temp/lib/libc.a /mnt/data/rocket-tools/lib/gcc/riscv64-unknown-elf/7.2.0/rv64imac/lp64/crtend.o /mnt/data/femur/build/lib/crtn.o -o projects/hello/hello && : /mnt/data/rocket-tools/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/bin/ld: projects/seL4_libs/libsel4platsupport/libsel4platsupport.a(common.c.obj): in function `vspace_map_pages': /mnt/data/femur/build/../projects/seL4_libs/libsel4vspace/include/vspace/vspace.h:492: undefined reference to `__ctzdi2' /mnt/data/rocket-tools/lib/gcc/riscv64-unknown-elf/7.2.0/../../../../riscv64-unknown-elf/bin/ld: projects/seL4_libs/libsel4platsupport/libsel4platsupport.a(common.c.obj): in function `platsupport_alloc_device_vaddr': /mnt/data/femur/build/../projects/seL4_libs/libsel4platsupport/src/common.c:83: undefined reference to `__ctzdi2' collect2: error: ld returned 1 exit status ninja: build stopped: subcommand failed. The missing symbol is in fact in the build, it shows up in kernel_all_pp.c etc. user@user-KVM:/mnt/data/femur/build$ grep -r ctzdi2 kernel/kernel_all_pp.c:uint32_t __ctzdi2(uint64_t x); kernel/kernel_all_pp.c:uint32_t __ctzdi2(uint64_t x) kernel/kernel_all_copy.c:uint32_t __ctzdi2(uint64_t x) kernel/kernel_all.i:uint32_t __ctzdi2(uint64_t x); kernel/kernel_all.i:uint32_t __ctzdi2(uint64_t x) Binary file kernel/kernel.elf matches kernel/kernel_all_pp_prune_wrapper_temp.c:uint32_t __ctzdi2(uint64_t x) kernel/CMakeFiles/kernel_i_wrapper_temp_lib.dir/kernel_all_copy.c.obj:uint32_t __ctzdi2(uint64_t x); kernel/CMakeFiles/kernel_i_wrapper_temp_lib.dir/kernel_all_copy.c.obj:uint32_t __ctzdi2(uint64_t x) Binary file kernel/CMakeFiles/kernel.elf.dir/kernel_all.i.obj matches kernel/CMakeFiles/kernel_all_pp_prune_wrapper_temp_lib.dir/kernel_all_pp_prune_wrapper_temp.c.obj:uint32_t __ctzdi2(uint64_t x); kernel/CMakeFiles/kernel_all_pp_prune_wrapper_temp_lib.dir/kernel_all_pp_prune_wrapper_temp.c.obj:uint32_t __ctzdi2(uint64_t x) kernel/kernel_all.c:uint32_t __ctzdi2(uint64_t x) kernel/kernel_all_pp_prune.c:uint32_t __ctzdi2(uint64_t x); kernel/kernel_all_pp_prune.c:uint32_t __ctzdi2(uint64_t x) Binary file projects/seL4_libs/libsel4utils/CMakeFiles/sel4utils.dir/src/irq_server/irq_server.c.obj matches Binary file projects/seL4_libs/libsel4utils/libsel4utils.a matches Binary file projects/seL4_libs/libsel4platsupport/libsel4platsupport.a matches Binary file projects/seL4_libs/libsel4platsupport/CMakeFiles/sel4platsupport.dir/src/common.c.obj matches What am I missing here?