caravel_board icon indicating copy to clipboard operation
caravel_board copied to clipboard

Add libgcc to firmware examples Makefiles?

Open mbalestrini opened this issue 1 year ago • 0 comments

Testing some caravel firmware project that had integer multiplication I got this error: undefined reference to '__mulsi3'

It seems that the default Makefile didn't include libgcc, where soft implementations of mult, mod, float, etc are located

Adding -lgcc at the end of the compilation command seems to solve 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'm not an expert on the subject so maybe there are some other implications to adding libgcc, but it seems to me that making this change could help others that may run into this issue

mbalestrini avatar Feb 07 '24 15:02 mbalestrini