Closed th-otto closed 5 years ago
please use -Xlinker --verbose |& grep succeeded
to determine which libraries are really used since -print-libgcc-file-name
does not know about the linkers multilib capabilities.
The linker is pretty stupid and searches every library only once. That's why each one has to be listed several times... and often is - as you can see - not often enough^^
Add -lnix -lgcc
as a workaround:
m68k-amigaos-gcc -Os utimes.c -o utimes -v -m68020-60 -mcrt=nix20 -Xlinker --verbose -lnix -lgcc |& grep succeeded
attempt to open /opt/amiga/m68k-amigaos/libnix/lib/ncrt0.o succeeded
attempt to open /tmp/cc8nS89B.o succeeded
attempt to open /opt/amiga/m68k-amigaos/libnix/lib/libm020/libnix.a succeeded
attempt to open /opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/libm020/libgcc.a succeeded
attempt to open /opt/amiga/m68k-amigaos/libnix/lib/libm020/libnix20.a succeeded
attempt to open /opt/amiga/m68k-amigaos/libnix/lib/libm020/libnixmain.a succeeded
attempt to open /opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/lib/libm020/libstubs.a succeeded
attempt to open /opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/libm020/libgcc.a succeeded
attempt to open /opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/lib/libm020/libstubs.a succeeded
attempt to open /opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/lib/libamiga.a succeeded
attempt to open /opt/amiga/m68k-amigaos/libnix/lib/libm020/libnix20.a succeeded
attempt to open /opt/amiga/m68k-amigaos/libnix/lib/libm020/libnix.a succeeded
attempt to open /opt/amiga/m68k-amigaos/libnix/lib/libm020/libnix20.a succeeded
attempt to open /opt/amiga/m68k-amigaos/libnix/lib/libm020/libnix20.a succeeded
attempt to open /opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/lib/libm020/libstubs.a succeeded
attempt to open /opt/amiga/m68k-amigaos/libnix/lib/libm020/libm.a succeeded
Hm yes, adding -lnix worked. Would it be possible to change the spec file of gcc accordingly? I encountered the problem when trying build flac, which does not only build a library, but also some tools. Having to add that switch to all recipes for such packages would be cumbersome.
Or alternatively, add those functions to libgcc instead, where they actually belong. Either by hacking the Makefiles of gcc, or (maybe easier) by just extracting the members of libnix.a and adding them to libgcc.a before installing.
Hm yes, adding -lnix worked. Would it be possible to change the spec file of gcc accordingly? I encountered the problem when trying build flac, which does not only build a library, but also some tools. Having to add that switch to all recipes for such packages would be cumbersome.
The ticket is still open - and I only suggested a workaround... /shrug
it's not fixed yet.
Oh sry, I thought you wanted to convince me to close it, with your comment above.
Oh sry, I thought you wanted to convince me to close it, with your comment above.
Misunderstandings exist to misunderstand each other.
please test
Yes, seems to work, thank you!
When using the nix20 runtime library, i get unresolved externals for programs that use for examples utimes():
It seems to be a mismatch in the underscores of the symbols:
So the function is there, but exported with 3 underscores.
There is another strange thing:
So when using -m68020-60, it links the library in the main directory, not the one in /libm020