XaviDCR92 / sdcc-gas

GNU assembler syntax support for SDCC
GNU General Public License v2.0
11 stars 1 forks source link

Libraries #3

Open spth opened 4 years ago

spth commented 4 years ago

https://github.com/XaviDCR92/stm8-dce-example states:

SDCC's Makefile compiles libc and other libraries in its own object format (*.rel), so the sources must be moved to the project and compiled separately using the GNU toolchain. Otherwise, you will get an undefined reference link-time error when performing some operations such as integer division. This will be solved once these forks are integrated into the main branch.

How would this be resolved? Have another set of stm8 libraries (i.e. like we now have stm8 and stm8-large, there would also be stm8-gas and stm8-gas-large)?

XaviDCR92 commented 4 years ago

That would be a feasible solution. I did not dare to modify the Makefile in "device/lib" as it seems to be closely tied to SDCC's default file extensions (.rel for object files and .lib for static libraries) and didn't want to break even more things. Instead, two new targets should generate .asm (in GNU as format), .o object files and .a static libraries so stm8-ld can link them. Are you willing to modify this Makefile accordingly?