Closed TCH68k closed 4 years ago
you have to add '-mhard-float' to avoid this.
Now i tried that way:
m68k-amigaos-gcc -mcrt=nix20 -mcpu=68030 -march=68030 -m68881 -mhard-float -lm main.c -o main
It is still fails to start with the same error message.
then add the missing lib to libs:
That's not the point. This executable should work without the math*.library files.
Then use a lib which does not use math*.libararies. libnix does.
I figured it out right this moment, that it was the -mcrt=nix20
option what caused the problem, but i did not know why; now it makes sense. Thanks.
However without that option, my program does not do anything. Just gives back the prompt. Even the first printf("KECSKE\n");
does not work. What can i use instead of nix20?
If i use clib2
m68k-amigaos-gcc -mcrt=clib2 -mcpu=68030 -march=68030 -m68881 -mhard-float -lm main.c -o main
Then i get back a bunch of error messages:
/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: /tmp/ccKm1gc0.o: in function `AmigaBlitterDrawPolygon2D':
/tmp/ccKm1gc0.o:(.text+0x126c): undefined reference to `SetDrMd'
/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: /tmp/ccKm1gc0.o:(.text+0x128c): undefined reference to `InitArea'
/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: /tmp/ccKm1gc0.o:(.text+0x12b2): undefined reference to `AreaMove'
/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: /tmp/ccKm1gc0.o:(.text+0x12e6): undefined reference to `AreaDraw'
/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: /tmp/ccKm1gc0.o:(.text+0x1308): undefined reference to `AreaEnd'
/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: /tmp/ccKm1gc0.o: in function `new_screen':
/tmp/ccKm1gc0.o:(.text+0x13aa): undefined reference to `OpenScreen'
/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: /tmp/ccKm1gc0.o: in function `speccy_palette':
/tmp/ccKm1gc0.o:(.text+0x1442): undefined reference to `SetRGB4'
/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: /tmp/ccKm1gc0.o: in function `RasterBufInit':
/tmp/ccKm1gc0.o:(.text+0x1554): undefined reference to `InitTmpRas'
/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: /tmp/ccKm1gc0.o: in function `AmigaBlitterDrawPolygon2D':
/tmp/ccKm1gc0.o:(.text+0x123e): undefined reference to `SetAPen'
/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: /tmp/ccKm1gc0.o: in function `main':
/tmp/ccKm1gc0.o:(.text+0x175a): undefined reference to `CloseScreen'
/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: /tmp/ccKm1gc0.o: in function `AmigaBlitterDrawPolygon2D':
/tmp/ccKm1gc0.o:(.text+0x125c): undefined reference to `SetBPen'
collect2: error: ld returned 1 exit status
Try it with -lamiga to bind to the libraries.
On Mon, Mar 2, 2020 at 2:09 PM, TCH68knotifications@github.com wrote:
If i use clib2
m68k-amigaos-gcc -mcrt=clib2 -mcpu=68030 -march=68030 -m68881 -mhard-float -lm main.c -o main
Then i get back a bunch of error messages:
/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: /tmp/ccKm1gc0.o: in function AmigaBlitterDrawPolygon2D': /tmp/ccKm1gc0.o:(.text+0x126c): undefined reference to
SetDrMd'
/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: /tmp/ccKm1gc0.o:(.text+0x128c): undefined reference to InitArea' /opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: /tmp/ccKm1gc0.o:(.text+0x12b2): undefined reference to
AreaMove'
/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: /tmp/ccKm1gc0.o:(.text+0x12e6): undefined reference to AreaDraw' /opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: /tmp/ccKm1gc0.o:(.text+0x1308): undefined reference to
AreaEnd'
/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: /tmp/ccKm1gc0.o: in function new_screen': /tmp/ccKm1gc0.o:(.text+0x13aa): undefined reference to
OpenScreen'
/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: /tmp/ccKm1gc0.o: in function speccy_palette': /tmp/ccKm1gc0.o:(.text+0x1442): undefined reference to
SetRGB4'
/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: /tmp/ccKm1gc0.o: in function RasterBufInit': /tmp/ccKm1gc0.o:(.text+0x1554): undefined reference to
InitTmpRas'
/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: /tmp/ccKm1gc0.o: in function AmigaBlitterDrawPolygon2D': /tmp/ccKm1gc0.o:(.text+0x123e): undefined reference to
SetAPen'
/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: /tmp/ccKm1gc0.o: in function main': /tmp/ccKm1gc0.o:(.text+0x175a): undefined reference to
CloseScreen'
/opt/amiga/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: /tmp/ccKm1gc0.o: in function AmigaBlitterDrawPolygon2D': /tmp/ccKm1gc0.o:(.text+0x125c): undefined reference to
SetBPen'
collect2: error: ld returned 1 exit status
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.
m68k-amigaos-gcc -mcrt=clib2 -mcpu=68030 -march=68030 -m68881 -mhard-float -lm -lamiga main.c -o main
Same error messages.
Order is significant. Try putting main.c before the linking commands.
On Mon, Mar 2, 2020 at 2:15 PM, TCH68knotifications@github.com wrote: m68k-amigaos-gcc -mcrt=clib2 -mcpu=68030 -march=68030 -m68881 -mhard-float -lm -lamiga main.c -o main
Same error messages.
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
Nope, did not change anything.
I modified the libnix Makefile.gcc6
to apply -mhard-float
to the libs for 68881. Rebuild your libnix libs once this is live and try again with libnix.
see af4270f
I've rebuilt the entire SDK (it was long overdue anyway):
git clone https://github.com/bebbo/amiga-gcc
cd amiga-gcc
make update
make all -j7
And then i compiled:
m68k-amigaos-gcc -mcrt=nix20 -mcpu=68030 -march=68030 -m68881 -mhard-float -lm -lamiga main.c -o main
Nothing has changed. Still requires mathieeedoubtrans.library. It does not change things if i omit the option -lamiga
or -m68881
or both.
Rebuild your libnix libs once this is live and try again with libnix.
you could modify Makefile.gcc6 manually and replace -m68881
with -m68881 -mhard-float
in projects/libnix. Note that this will break future git pull
s ...
Then do make clean-libnix
and make libnix
Sorry, i thought the commit you linked in meant that it is live. When will it be then?
I'd rather stick to the upstream version of everything, i do not want to break anything.
it's live:
cat >nix32.c <<EOF
#include <stdio.h>
int main(int argc, char ** argv) {
printf("%e\n", 3.14159d * (double)argc);
return 0;
}
EOF
m68k-amigaos-gcc nix32.c -o nix32 -Os -noixemul -m68020 -m68881 -mhard-float -lm
vamos -C40 nix32
3.141590e+00
It works, thank you.
I've compiled the program like this:
But the program fails to start; it says, it needs mathieeedoubtrans.library. Did i something wrong, or is this a bug?
The host system is Linux AMD64.