Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add libgcc to firmware examples Makefiles? #101

Open
mbalestrini opened this issue Feb 7, 2024 · 0 comments
Open

Add libgcc to firmware examples Makefiles? #101

mbalestrini opened this issue Feb 7, 2024 · 0 comments

Comments

@mbalestrini
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant