Maximo Balestrini
02/07/2024, 3:36 PMundefined reference to '__mulsi3'
It seems the example firmware Makefile doesn't include libgcc, where soft implementations of multiplication, mod, float, etc are located.
Adding -lgcc
to the end of the compilation command solved the issue:
$(TOOLCHAIN_PATH)$(TOOLCHAIN_PREFIX)-gcc -I../ -I../generated/ -O0 -mabi=ilp32 -march=$(ARCH) -D__vexriscv__ -Wl,-Bstatic,-T,../sections.lds,--strip-debug -ffreestanding -nostdlib -o $@ ../crt0_vex.S ../isr.c ../stub.c $< -lgcc
I created an issue on the caravel_board repo so they can check if it's a useful change: https://github.com/efabless/caravel_board/issues/101