adtools / amigaos-cross-toolchain

AmigaOS cross compiler for Linux / MacOSX / Windows
184 stars 48 forks source link

ld: cannot open crt0.o: No such file or directory #12

Closed sebastianbergmann closed 9 years ago

sebastianbergmann commented 9 years ago

Let me start with a big "Thank you!" for providing this toolchain. I recently dusted off my Amiga 1200 and now want to get my feet wet with cross-compiling for AmigaOS.

I made a fresh installation of Fedora 21 32bit in a virtual machine and followed the instructions in README.md (see https://github.com/cahirwpz/m68k-amigaos-toolchain/pull/11 for what was missing from it for me).

I then used the following "Hello world!" example code to test the cross-compiling toolchain ...

#include <stdio.h>
int main()
{
    printf("Hello World!\n");
    return(0);
}

... with this command to invoke the cross-compiler

$ m68k-amigaos-gcc hello.c -o hello
/usr/local/m68k-amigaos/m68k-amigaos/bin/ld: cannot open crt0.o: No such file or directory
collect2: ld returned 1 exit status

What am I missing? Compiling with -noixemul works:

$ m68k-amigaos-gcc hello.c -o hello -noixemul

The binary generated by the command above executes properly on my Amiga 1200 with AmigaOS 3.9.

cahirwpz commented 9 years ago

You need to use -noixemul switch during linking stage, otherwise the toolchain will try to use ixemul startup routine which is not available.

$ m68k-amigaos-gcc -noixemul hello.c -o hello