Page 1 of 1
The difference between i686-elf and i686-pc-elf
Posted: Wed May 28, 2014 6:09 am
by dlarudgus20
When I cross-compile gcc with "--target=i686-elf", following
http://wiki.osdev.org/GCC_Cross-Compiler, the "./configure" seems to recognize target as "i686-pc-elf".
Code: Select all
checking target system type... i686-pc-elf
Why? Are they the same? If not, What is difference, and why ./configure recognizes i686-elf as i686-pc-elf?
(I'm using Cygwin.)
Re: The difference between i686-elf and i686-pc-elf
Posted: Wed May 28, 2014 8:16 am
by sortie
You forgot to search the wiki:
http://wiki.osdev.org/Target_Triplet
The -pc- part of the target triplet is the vendor field. It is usually irrelevant and can safely be left out. This creates a difference between informal target triplets such as `i686-elf' and formal target triplets like `i686-elf-pc'. The latter is only used internally in the configure build machinery. You can put anything you want in the vendor field, and if you leave it out, it will be automatically be replaced with a default value such as `pc' or `unknown'. You can specify `--target=i686-pc-elf' if you wish, it doesn't matter, but then you get a `i686-pc-elf-gcc' by default rather than a `i686-elf-gcc'. It is normally (at least by some) considered good style to leave out the vendor part of the triplet, as it becomes shorter without and serves just as well.
Mind that if you pick a particular style such as i686-elf, you should be consistent. Don't sometimes use i686-pc-elf. This will cause trouble when locating tools prefixed with the target triplet and a dash.