[SOLVED]Problems with i686-elf-gcc

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
gardinirafael
Posts: 21
Joined: Mon Feb 03, 2014 12:52 pm

Re: Problems with i686-elf-gcc

Post 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.
User avatar
bashcommando
Member
Member
Posts: 62
Joined: Mon Jan 06, 2014 4:23 pm

Re: Problems with i686-elf-gcc

Post 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.
Building an operating system is like building an airplane, you don't want it to crash.
User avatar
bashcommando
Member
Member
Posts: 62
Joined: Mon Jan 06, 2014 4:23 pm

Re: Problems with i686-elf-gcc

Post 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!
Building an operating system is like building an airplane, you don't want it to crash.
Post Reply