The project I am working on at the minute must be compiled using a cross compiler. My binutils
and gcc
have been installed into ~/opt/cross
, however when I try to compile, I am faced with this error:
/home/george/opt/cross/lib/gcc/i686-elf/6.1.0/../../../../i686-elf/bin/ld: cannot find crt0.o: No such file or directory
/home/george/opt/cross/lib/gcc/i686-elf/6.1.0/../../../../i686-elf/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status
My code uses only GCC's freestanding headers (my full compile command: ~/opt/cross/bin/i686-elf-gcc kernel.c tty.c -std=gnu99 -ffreestanding -O2 -Wall -Wextra
).
So what is crt0.o
and how can I fix this error?