Page 2 of 2

Re: Problems with i686-elf-gcc

Posted: Wed Jan 21, 2015 12:50 pm
by gardinirafael
I followed the tutorial as accurate as possible and downgraded to gcc 4.8.3 and binutils 2.24. I got this:

Code: Select all

/home/bashcommando/opt/cross/lib/gcc/i686-elf/4.8.3/../../../../i686-elf/bin/ld: cannot find crt0.o: No such file or directory
/home/bashcommando/opt/cross/lib/gcc/i686-elf/4.8.3/../../../../i686-elf/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status
What else am I doing wrong?
for crt0.o error, compiling with -ffreestanding -nostdlib -nostartfiles

Do you need -lc parameter?

Try to remove.

Re: Problems with i686-elf-gcc

Posted: Wed Jan 21, 2015 4:22 pm
by bashcommando
Combuster wrote:
What else am I doing wrong?
Reading, as usual:
GCC Cross-Compiler wrote:Note how this compiler is not able to compile normal C programs.
I was compiling my kernel.

Re: Problems with i686-elf-gcc

Posted: Wed Jan 21, 2015 4:24 pm
by bashcommando
gardinirafael wrote:
I followed the tutorial as accurate as possible and downgraded to gcc 4.8.3 and binutils 2.24. I got this:

Code: Select all

/home/bashcommando/opt/cross/lib/gcc/i686-elf/4.8.3/../../../../i686-elf/bin/ld: cannot find crt0.o: No such file or directory
/home/bashcommando/opt/cross/lib/gcc/i686-elf/4.8.3/../../../../i686-elf/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status
What else am I doing wrong?
for crt0.o error, compiling with -ffreestanding -nostdlib -nostartfiles

Do you need -lc parameter?

Try to remove.
I added the switches -nostdlib and -nostartfiles and it worked like a charm! Thanks!