You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am aware that I am pushing the mpy_ld.py / dynamic module support quite hard here, compared to usual. But some tips as to what might be the issue here would be very welcomed. So that maybe we can improve the support.
I am providing here the .o files for the __ieee754_rem_pio2f (for xtensawin and armv7emsp). I have poked a bit with readelf/objdump, but don't really know how to interpret the relocations - and why this symbol is different from any others... micropython-reloc-rem_pio2.zip
jonnor
changed the title
mpy_ld.py: Unsupported relocation for libm __ieee754_rem_pio2f
mpy_ld.py: Unsupported relocation when using cos/sin functions
May 5, 2024
Renamed issue to highlight relevance. I am pretty sure this would happen whenever sin/cos or sinf/cosf are used. It would happen also if there just exists some code calling these functions - even these code paths are not actually used. Because there seems to be no dead-code stripping done by mpy_ld.py.
jonnor
added a commit
to emlearn/emlearn-micropython
that referenced
this issue
May 5, 2024
Checks
I agree to follow the MicroPython Code of Conduct to ensure a safe and respectful space for everyone.
I've searched for existing issues matching this bug, and didn't find any.
Port, board and/or hardware
esp32/xtensawin and armv7emsp
MicroPython version
MicroPython 1.22.2 from git
Reproduction
Note, you have to include the object files from libm and libgcc manually in the Makefile. This means extracting the .o files from the archives, and then adding them to SRC_O make variable. See this for an example:
https://github.com/emlearn/emlearn-micropython/blob/bd85ae1fade99b34a626c9fcaae0aa4f2ec87803/src/emlfft/Makefile
Expected behaviour
Linking succeeds without errors, module is functional.
Alternatively: Error and/or documentation provides hints as to the possible reasons why this could happen, and ways of resolving.
Observed behaviour
Exception when linking. With ARCH=xtensawin
On ARCH=armv7emsp
Additional Information
arm-none-eabi-gcc --version
arm-none-eabi-gcc (Arch Repository) 13.2.0
xtensa-esp32-elf-gcc --version
xtensa-esp32-elf-gcc (crosstool-NG esp-2022r1) 11.2.0
Error log for xtensawin. ARM is the same, just the relocation value differs
The text was updated successfully, but these errors were encountered: