How to build an i686-elf toolchain?

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.
Post Reply
sjheiss
Posts: 5
Joined: Tue Jul 23, 2013 2:53 pm

How to build an i686-elf toolchain?

Post by sjheiss »

I was able to successfully compile binutils and gcc targeting i386-elf and boot a simple OS compiled with it. However, I would like to make an i686-elf toolchain so I'm not so limited in regards to features in the future.

Using the same arguments as the i386-elf toolchain, substituting i686 where applicable, i686-elf-ld reports that its only emulation mode is elf-i386. I am 100% sure that I did not specify the target as i386-elf.

Here are my configures:

Binutils

Code: Select all

./configure --target=i686-elf
GCC

Code: Select all

../gcc/configure --target=i686-elf --without-headers --disable-libssp --enable-languages=c
I didn't rebuild gcc's floating point dependencies, but that shouldn't make a difference, AFAICT.

Any help would be greatly appreciated.

EDIT: I just noticed that in the --help of i686-elf-ld it says this:

Code: Select all

i686-elf-ld: supported targets: elf32-i386 coff-i386 elf32-little elf32-big srec symbolsrec verilog tekhex binary ihex
i686-elf-ld: supported emulations: elf_i386
i686-elf-ld: emulation specific options:
elf_i386
But I have no idea why.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: How to build an i686-elf toolchain?

Post by Combuster »

And your problem is what? That the architecture-specific parts of the ELF file format hasn't needed any changes since i386 until 64-bits came along?
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
sjheiss
Posts: 5
Joined: Tue Jul 23, 2013 2:53 pm

Re: How to build an i686-elf toolchain?

Post by sjheiss »

Combuster wrote:And your problem is what? That the architecture-specific parts of the ELF file format hasn't needed any changes since i386 until 64-bits came along?
OK, well, I figured that since i686 is much more improved over i386 that they would have at least some differences, but apparently not. So you're saying that I could make a 64-bit OS with i386 ELFs?
User avatar
dozniak
Member
Member
Posts: 723
Joined: Thu Jul 12, 2012 7:29 am
Location: Tallinn, Estonia

Re: How to build an i686-elf toolchain?

Post by dozniak »

sjheiss wrote:So you're saying that I could make a 64-bit OS with i386 ELFs?
That's not what Combuster said. He said that bfd indicates x86 target using "elf-i386" name.
Learn to read.
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: How to build an i686-elf toolchain?

Post by bluemoon »

sjheiss wrote:So you're saying that I could make a 64-bit OS with i386 ELFs?
note the difference between i686 (P6 architecture) and x86_64.
sjheiss
Posts: 5
Joined: Tue Jul 23, 2013 2:53 pm

Re: How to build an i686-elf toolchain?

Post by sjheiss »

dozniak wrote:
sjheiss wrote:So you're saying that I could make a 64-bit OS with i386 ELFs?
That's not what Combuster said. He said that bfd indicates x86 target using "elf-i386" name.
OK. For some reason I was equating x86 with i686. It appears I have trouble distinguishing architecture from processor. My apologies.
bluemoon wrote:
sjheiss wrote:So you're saying that I could make a 64-bit OS with i386 ELFs?
note the difference between i686 (P6 architecture) and x86_64.
Yeah, I just realized the difference. I blame it on the fact that I've been getting only a couple hours of sleep the past week. :lol:
Post Reply