[PATCH] ppc64 & powerpc: Check whether the native CC can use -m64

Daniel Ostrow dostrow at gentoo.org
Thu Nov 10 06:47:21 EST 2005


On 13:27 Wed 09 Nov     , linas wrote:
> On Wed, Nov 09, 2005 at 06:32:36PM +0100, Arnd Bergmann was heard to remark:
> > On Middeweken 09 November 2005 18:08, Daniel Ostrow wrote:
> >  
> > > +NATIVE64	:= $(call cc-option-yn, -m64)
> > > +ifeq ($(NATIVE64),n)
> > > +CROSS_COMPILE	:= powerpc64-unknown-linux-gnu-
> > > +endif
> > > +
> > 
> > But now you're using powerpc64-unknown-linux-gnu- instead
> > of powerpc64-linux-. I don't know which one is more widely
> > used, but at least the debian packages I'm using have
> > 'powerpc64-linux' only.
> 
> SUSE uses (used) powerpc64-linux- although its native now.
> Is debian not native?
> 
> --linas
> 

A little insight into the way Gentoo does things...something that is
seemingly somewhat non-standard.

On the Gentoo side regardless of whether the toolchain is native or not
symlinks are created for $CHOST-<binary> for binutils and gcc. To that
effect Gentoo has three environments for a user to choose on ppc64, a
pure 32-bit userland compiled using the powerpc-unknown-linux-gnu CHOST,
a pure 64-bit userland compiled using the powerpc64-unknown-linux-gnu
CHOST and Gentoo's flavor of multilib which uses the
powerpc64-unknown-linux-gnu CHOST and a series of emulation libraries.
All three use ARCH=ppc64 at the moment.

For the 32-bit userland we compile a 64bit, C only, cross compiler to build
the kernel and headers. This leaves the user with
powerpc-unknown-linux-gnu-gcc (their native compiler the same binary as
/usr/bin/gcc) and powerpc64-unknown-linux-gnu-gcc (their C only cross 
compiler), as well as a full set of symlinks for all of the various 
binutils binaries. As well Gentoo also creates a powerpc64-linux-gcc
symlink for this cross compiler. The only time a symlink of this type
gets created is for the C only cross compilers used by mips, sparc and
ppc64 for building kernels under a 32-bit userland.

At the moment we have a note in our installation guide to tell people 
to add an `alias ppc64make="make CROSS_COMPILE='powerpc64-unknown-linux-gnu-'"
to the bottom of their /etc/profile and use ppc64make to build their kernels. 
>From where I stand this is an ugly as sin hack and should be able to be taken
care of automatically. I knew for example that it was already handled for
sparc/sparc64 (who have the same setup Gentoo userland wise) in the
kernel Makefile (see my original patch, it was just a pull of that
check). I agree that setting $(CROSS_COMPILE) is probably a better option
we just need to come up with the most standard syntax (which is looking
more and more like it isn't the way Gentoo happens to be doing things at
the moment) and go from there.

Thanks again for everyones help :)

-- 
Daniel Ostrow
Gentoo Foundation Board of Trustees
Gentoo/{PPC,PPC64,DevRel}
dostrow at gentoo.org




More information about the Linuxppc64-dev mailing list