Page 1 of 1

How to build an i686-elf toolchain?

Posted: Tue Jul 23, 2013 3:20 pm
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.

Re: How to build an i686-elf toolchain?

Posted: Tue Jul 23, 2013 3:39 pm
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?

Re: How to build an i686-elf toolchain?

Posted: Tue Jul 23, 2013 3:43 pm
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?

Re: How to build an i686-elf toolchain?

Posted: Tue Jul 23, 2013 4:06 pm
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.

Re: How to build an i686-elf toolchain?

Posted: Tue Jul 23, 2013 4:14 pm
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.

Re: How to build an i686-elf toolchain?

Posted: Tue Jul 23, 2013 4:19 pm
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: