Hi all,
While setting up a PPC cross-compiler environment for OpenBIOS, I noticed that the default cross-compiler prefix is set to 'powerpc-linux-gnu-' as opposed to 'powerpc-elf-'.
Is there any particular reason that we need the linux platform version, instead of the elf version which is used by SPARC? The reason I ask is that the Linux platform version is much much harder to compile as you need an extra set of glibc headers and have to bootstrap the gcc build by hand in order to produce the working final compiler.
On my tests here everything seems to work fine with just the 'powerpc-elf-' prefix as far as I can tell.
ATB,
Mark.
On Wednesday 25 November 2009, Mark Cave-Ayland wrote:
Hi all,
While setting up a PPC cross-compiler environment for OpenBIOS, I noticed that the default cross-compiler prefix is set to 'powerpc-linux-gnu-' as opposed to 'powerpc-elf-'.
Most likely because that's what most linux users happen to have lying around.
Paul
While setting up a PPC cross-compiler environment for OpenBIOS, I noticed that the default cross-compiler prefix is set to 'powerpc-linux-gnu-' as opposed to 'powerpc-elf-'.
Is there any reason you want -elf instead of -eabi? :-)
Is there any particular reason that we need the linux platform version, instead of the elf version which is used by SPARC? The reason I ask is that the Linux platform version is much much harder to compile as you need an extra set of glibc headers and have to bootstrap the gcc build by hand in order to produce the working final compiler.
Use --without-headers, and maybe some of the --disable-* flags, and you don't need glibc (or any other C library). Oh, and --enable-languages=c of course.
Segher
On 11/25/09 5:43 PM, Segher Boessenkool wrote:
While setting up a PPC cross-compiler environment for OpenBIOS, I noticed that the default cross-compiler prefix is set to 'powerpc-linux-gnu-' as opposed to 'powerpc-elf-'.
Is there any reason you want -elf instead of -eabi? :-)
Just the crazy assumption there's a generic pattern behind all the target names.
-eabi is probably the right one.
Is there any particular reason that we need the linux platform version, instead of the elf version which is used by SPARC? The reason I ask is that the Linux platform version is much much harder to compile as you need an extra set of glibc headers and have to bootstrap the gcc build by hand in order to produce the working final compiler.
Use --without-headers, and maybe some of the --disable-* flags, and you don't need glibc (or any other C library). Oh, and --enable-languages=c of course.
interesting... That builds glibc-free linux compilers?
Stefan
While setting up a PPC cross-compiler environment for OpenBIOS, I noticed that the default cross-compiler prefix is set to 'powerpc-linux-gnu-' as opposed to 'powerpc-elf-'.
Is there any reason you want -elf instead of -eabi? :-)
Just the crazy assumption there's a generic pattern behind all the target names.
-eabi is probably the right one.
EABI is the modern ABI on pretty much all architectures. It's the same as -elf on some archs; -elf is an older ABI on some other archs.
If your build system allows pretty much any compiler, it would be wise for it to select the ABI itself; in that case, it doesn't matter what the compiler used defaults to.
Use --without-headers, and maybe some of the --disable-* flags, and you don't need glibc (or any other C library). Oh, and --enable-languages=c of course.
interesting... That builds glibc-free linux compilers?
Yes, with the resulting compiler you cannot build anything that uses the C library; it is just fine for anything that doesn't need those user-space interfaces, like building a firmware or an OS kernel.
You can use my build scripts if you want, they work for most architectures, only a few need some simple patches: http://git.infradead.org/users/segher/buildall.git
Segher
Am 26.11.2009 um 22:19 schrieb Segher Boessenkool:
While setting up a PPC cross-compiler environment for OpenBIOS, I noticed that the default cross-compiler prefix is set to 'powerpc-linux-gnu-' as opposed to 'powerpc-elf-'.
Is there any reason you want -elf instead of -eabi? :-)
Just the crazy assumption there's a generic pattern behind all the target names.
-eabi is probably the right one.
EABI is the modern ABI on pretty much all architectures. It's the same as -elf on some archs; -elf is an older ABI on some other archs.
http://gcc.gnu.org/install/specific.html#powerpc-x-elf describes them as:
powerpc-*-elf: PowerPC system in big endian mode, running System V.4.
powerpc-*-eabi: Embedded PowerPC system in big endian mode.
Andreas