PPC64 host building PPC32 stuff
authorPieter van den Abeele <pvdabeel@gentoo.org>
Fri, 7 May 2004 04:24:48 +0000 (04:24 +0000)
committerPieter van den Abeele <pvdabeel@gentoo.org>
Fri, 7 May 2004 04:24:48 +0000 (04:24 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@364 d1e1f19c-881f-0410-ab34-b69fee027534

arch/ppc.py

index 649b70cc8f86f256b288325b2446089ac321720c..8f2b832a3cf0c579f2caf014790ea1c2b7dd2a91 100644 (file)
@@ -1,56 +1,67 @@
 # Distributed under the GNU General Public License version 2
-# Copyright 2003-2004 Gentoo Technologies, Inc.
+# Copyright 2003-2004 Gentoo Technologies, Inc. && Pieter Van den Abeele
 
-import builder
+import os,builder
+from catalyst_support import *
+
+# gcc-3.3.3 required to do G5 optimizations
+# install a 32bit kernel personality changer (that works) before building on a ppc64 host
+# new gcc optimization feature requires -fno-strict-aliasing needed, otherwise code complains 
+# use the experimental thing for nptl builds
 
 class generic_ppc(builder.generic):
        "abstract base class for all ppc builders"
        def __init__(self,myspec):
                builder.generic.__init__(self,myspec)
                self.settings["mainarch"]="ppc"
-               self.settings["CHROOT"]="chroot"
                self.settings["CHOST"]="powerpc-unknown-linux-gnu"
+               if self.settings["hostarch"]=="ppc64":
+                       if not os.path.exists("/usr/bin/powerpc32"):
+                               raise CatalystError,"required /usr/bin/setarch executable not found."
+                       self.settings["CHROOT"]="/usr/bin/powerpc32 chroot"
+               else:   
+                       self.settings["CHROOT"]="chroot"
 
 class arch_power_ppc(generic_ppc):
        "builder class for generic powerpc/power"
        def __init__(self,myspec):
                generic_ppc.__init__(self,myspec)
-               self.settings["CFLAGS"]="-O3 -mcpu=common -fno-strict-aliasing"
+               self.settings["CFLAGS"]="-O3 -mcpu=common"
 
 class arch_ppc(generic_ppc):
        "builder class for generic powerpc"
        def __init__(self,myspec):
                generic_ppc.__init__(self,myspec)
-               self.settings["CFLAGS"]="-O3 -mcpu=powerpc -fno-strict-aliasing"
+               self.settings["CFLAGS"]="-O3 -mcpu=powerpc"
 
 class arch_power(generic_ppc):
        "builder class for generic power"
        def __init__(self,myspec):
                generic_ppc.__init__(self,myspec)
-               self.settings["CFLAGS"]="-O3 -mcpu=power -fno-strict-aliasing"
+               self.settings["CFLAGS"]="-O3 -mcpu=power"
 
 class arch_g3(generic_ppc):
        def __init__(self,myspec):
                generic_ppc.__init__(self,myspec)
-               self.settings["CFLAGS"]="-O2 -mcpu=G3 -fno-strict-aliasing"
+               self.settings["CFLAGS"]="-O3 -mcpu=G3 -fno-strict-aliasing -pipe"
 
 class arch_g4(generic_ppc):
        def __init__(self,myspec):
                generic_ppc.__init__(self,myspec)
-               self.settings["CFLAGS"]="-O2 -mcpu=G4 -maltivec -mabi=altivec -fno-strict-aliasing"
+               self.settings["CFLAGS"]="-O3 -mcpu=G4 -maltivec -mabi=altivec -fno-strict-aliasing -pipe"
                self.settings["HOSTUSE"]=["altivec"]
 
 class arch_g5(generic_ppc):
        def __init__(self,myspec):
                generic_ppc.__init__(self,myspec)
-               self.settings["CFLAGS"]="-O2 -mcpu=G5 -maltivec -mabi=altivec -fno-strict-aliasing"
+               self.settings["CFLAGS"]="-O2 -mcpu=G5 -maltivec -mabi=altivec -fno-strict-aliasing -pipe"
                self.settings["HOSTUSE"]=["altivec"]
 
 class arch_experimental(generic_ppc):
        def __init__(self,myspec):
                generic_ppc.__init__(self,myspec)
                self.settings["CFLAGS"]="-O3 -mcpu=7450 -maltivec -mabi=altivec -fno-strict-aliasing"
-               self.settings["HOSTUSE"]=["altivec nptl"]
+               self.settings["HOSTUSE"]=["altivec"]
        
 def register(foo):
        "Inform main catalyst program of the contents of this plugin."