BartmanAbyss / vscode-amiga-debug

One-stop Visual Studio Code Extension to compile, debug and profile Amiga C/C++ programs compiled by the bundled gcc 12.2 with the bundled WinUAE/FS-UAE.
GNU General Public License v3.0
316 stars 39 forks source link

Linking against FFP ROM symbols #245

Closed ssav7912 closed 7 months ago

ssav7912 commented 9 months ago

How is LD configured to link against functions stored in ROM?

When trying to build using FFP functions I get undefined reference linker errors to those functions (e.g. SPDiv, SPMul), an error I don't get with other ROM functions like AllocMem. Is this something I can configure LD to find, or should I just be writing wrappers to call into those functions by their offset on ROM?

I can see that at least some of the symbols are in the elf files in the /bin/symbols directory, but I'm not sure if that's relevant or useful for me.

Thanks

BartmanAbyss commented 8 months ago

There's no automatic linking for amiga system libraries. You need to manually load mathffp.library to use SPDiv, etc.; see here: http://amigadev.elowar.com/read/ADCD_2.1/Libraries_Manual_guide/node047E.html