Hello, I try to generate a mpy file from a c lib file.
When the makefile link the lib, I have an undefined symbol error
LINK build/iaq_1st_gen.o
qstr vals: py_init_iaq_1st_gen
qstr objs:
LinkError: lib_iaq_1st_gen.o: undefined symbol: __divsf3
make: *** [../../../../../../../_codes/micropython/micropython/py/dynruntime.mk:138: build/iaq_1st_gen.native.mpy] Error 1
Is someone know how to fix this problem?
Thanks
undefined symbol __divsf3
Re: undefined symbol __divsf3
That symbol is provided by libgcc.a. I think it's because you've got a floating point divide in your C code.
https://gcc.gnu.org/onlinedocs/gccint/S ... tines.html
So you've basically got 3 options:
1 - Remove the floating point divide
2 - Link libgcc.a into your code
3 - Write a version of __divsf3 that provides the reqauired functionality
https://gcc.gnu.org/onlinedocs/gccint/S ... tines.html
So you've basically got 3 options:
1 - Remove the floating point divide
2 - Link libgcc.a into your code
3 - Write a version of __divsf3 that provides the reqauired functionality
Re: undefined symbol __divsf3
Thank you,
I hase choose the option 2
I hase choose the option 2
Re: undefined symbol __divsf3
And you can use the compiler to determine the correct version of libgcc to use.
Pass in all of the options you would normally use and add the option -print-libgcc-filename and that will give you the name to the libgcc.a This becomes important when there are several different flavours (i.e. hard-float versus soft-float, the arm architecture used, etc).
Pass in all of the options you would normally use and add the option -print-libgcc-filename and that will give you the name to the libgcc.a This becomes important when there are several different flavours (i.e. hard-float versus soft-float, the arm architecture used, etc).