lronaldo / cpctelera

Astonishingly fast Amstrad CPC game engine for C developers
http://lronaldo.github.io/cpctelera/
GNU Lesser General Public License v3.0
229 stars 54 forks source link

Error: ?ASlink-Warning-Undefined Global 'cpct_fw2hw_asm' #127

Closed enrib4 closed 3 years ago

enrib4 commented 3 years ago

SDCC does not allow compilation in assembly of the "cpct_fw2hw" function, trying to declare it as:

.globl cpct_fw2hw_asm

Error in the linker:

?ASlink-Warning-Undefined Global 'cpct_fw2hw_asm' referenced by module 'cpct_keyboard'

?ASlink-Warning-Undefined Global 'cpct_fw2hw_asm' referenced by module ''
/home/.../cpctelera//cfg/global_main_makefile.mk:66: fallo en las instrucciones para el objetivo 'obj/game.ihx'
SpDizzy commented 3 years ago

An easy fix would be declare it as global, as you are doing:

.globl cpct_fw2hw_asm

And to add a double colon on it's assembly entry point, on cpct_fw2hw_asmbindings.s

Like this:

cpct_fw2hw_asm::

After doing this, you must 'make clean' -> 'make' on cpctelera folder for build library again.

(It looks like original definition has just one colon, instead of two, not beign global thus. A minuscule detail)

lronaldo commented 3 years ago

Thanks @enrib4 for this issue report. In fact, as @SpDizzy says, is just a mistake with the assembly label. It should have been marked as global, but it was marked as local.

Now it's fixed (commit 507e20f4df5ae0b854a47a7feae973b3f5db488a).

Thanks both of you :)