bebbo / libnix

libnix (v4): a C link library for AmigaOS/m68k
14 stars 9 forks source link

undefined reference to `__ulldivus' #83

Closed arczi84 closed 1 month ago

arczi84 commented 1 month ago

When compiling a game with gcc6 from gcc version 6.5.0b 240511220608 (GCC) I get this undefined reference : /opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: __vfprintf_total_size.o:(.text+0x9a6): undefined reference to__ulldivus'` I linked with -lm.

Not getting this error with older gcc I was using from 28.12.2022.

bebbo commented 1 month ago

Please explain a little more.

arczi84 commented 1 month ago

Compiling with -noixemul -lm -m68040 -fbbb=- -O0 -msoft-float

/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: /opt/amiga/m68k-amigaos/libnix/lib/libm020/libm881/libm.a(__vfprintf_total_size.o): in function `__vfprintf_total_size':
__vfprintf_total_size.o:(.text+0x64c): undefined reference to `__ulldivus'
/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: __vfprintf_total_size.o:(.text+0x9a6): undefined reference to `__ulldivus'
/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: __vfprintf_total_size.o:(.text+0xade): undefined reference to `__ulldivus'
/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: __vfprintf_total_size.o:(.text+0x1576): undefined reference to `__ulldivus'

It's prebuilt toolchain from your website. Maybe missing prototype/header?

bebbo commented 1 month ago

Sorry, I can't reproduce that issue:

[tickets]$ m68k-amigaos-gcc -noixemul -lm -m68040 -fbbb=- -O0 -msoft-float test.c -o test
[tickets]$ ll test*
-rwxr-xr-x 1 stefan stefan 3180 May 17 08:53 test
-rw-rw-r-- 1 stefan stefan  315 Aug 21  2022 test.c
[tickets]$ m68k-amigaos-objdump -t test | grep ull
00000cb0 g       .text      0000 00 ___ulldivus
bebbo commented 1 month ago

update to the recent version and rebuild your libraries!?

arczi84 commented 1 month ago

I use recent version? I won't be rebuilding my libs every update. I use libSDL build with gcc4 from 2010 and libgl from 1999 which links fine. I took ulldivus function from libnix source and put it in game code and it linked. Thanks.

arczi84 commented 1 month ago

There are also this flags: -fno-strict-aliasing -fwrapv -D_POSIX_TIMERS=1 -fsyntax-only -fsigned-char

bebbo commented 1 month ago

works here.