Bug 544519: Add ARM_ARCH switch to the cross-compile script (p=jsudduth, r=cpeyer)
authorChris Peyer <cpeyer@adobe.com>
Mon, 09 Aug 2010 12:44:35 -0700
changeset 4992 884c16c65e9e816ab26658ec568cf2d35d1b25ac
parent 4990 e11f1a751fcc96fd69de29d5cb3f8e6bd746f1b2
child 4993 cd1b504260863f1f4586039b1c5737e5555967ec
push id2667
push usercpeyer@adobe.com
push dateMon, 09 Aug 2010 19:45:15 +0000
reviewerscpeyer
bugs544519
Bug 544519: Add ARM_ARCH switch to the cross-compile script (p=jsudduth, r=cpeyer)
build/buildbot/master/sandbox.py
build/buildbot/master/tamarinredux.py
build/getopt.py
configure.py
--- a/build/buildbot/master/sandbox.py
+++ b/build/buildbot/master/sandbox.py
@@ -404,32 +404,32 @@ class sandbox:
     sb_linux_compile_factory.addStep(bb_slaveupdate(slave="linux"))
     sb_linux_compile_factory.addStep(compile_builtin)
     sb_linux_compile_factory.addStep(compile_generic(name="Release", shellname="avmshell", args="--enable-shell", upload="false"))
     sb_linux_compile_factory.addStep(compile_generic(name="Release-wordcode", shellname="avmshell_wordcode", args="--enable-shell --enable-wordcode-interp", upload="false"))
     sb_linux_compile_factory.addStep(compile_generic(name="Debug", shellname="avmshell_d", args="--enable-shell --enable-debug", upload="false"))
     sb_linux_compile_factory.addStep(compile_generic(name="ReleaseDebugger", shellname="avmshell_s", args="--enable-shell --enable-debugger", upload="false"))
     sb_linux_compile_factory.addStep(compile_generic(name="DebugDebugger", shellname="avmshell_sd", args="--enable-shell --enable-debug --enable-debugger", upload="false"))
     sb_linux_compile_factory.addStep(BuildShellCommand(
-                command=['../all/compile-generic.sh', WithProperties('%s','revision'), '--enable-shell --enable-arm-neon --target=arm-linux --enable-sys-root-dir=/usr/local/arm-linux/debian5', 'avmshell_neon_arm', 'false'],
+                command=['../all/compile-generic.sh', WithProperties('%s','revision'), '--enable-shell --enable-arm-neon --arm-arch=armv7-a --target=arm-linux --enable-sys-root-dir=/usr/local/arm-linux/debian5', 'avmshell_neon_arm', 'false'],
                 env={
                     'branch': WithProperties('%s','branch'),
                     'silent':WithProperties('%s','silent'),
                     'CXX': 'arm-none-linux-gnueabi-g++',
                     'CC' : 'arm-none-linux-gnueabi-gcc',
                     'LD' : 'arm-none-linux-gnueabi-ld',
                     'AR' : 'arm-none-linux-gnueabi-ar',
                 },
                 description='starting Release_arm-linux build...',
                 descriptionDone='finished Release_arm-linux build.',
                 name="Release_arm-linux",
                 workdir="../repo/build/buildbot/slaves/scripts")
     )
     sb_linux_compile_factory.addStep(BuildShellCommand(
-                command=['../all/compile-generic.sh', WithProperties('%s','revision'), '--enable-shell --enable-debug --enable-arm-neon --target=arm-linux --enable-sys-root-dir=/usr/local/arm-linux/debian5', 'avmshell_neon_arm_d', 'false'],
+                command=['../all/compile-generic.sh', WithProperties('%s','revision'), '--enable-shell --enable-debug --enable-arm-neon --arm-arch=armv7-a --target=arm-linux --enable-sys-root-dir=/usr/local/arm-linux/debian5', 'avmshell_neon_arm_d', 'false'],
                 env={
                     'branch': WithProperties('%s','branch'),
                     'silent':WithProperties('%s','silent'),
                     'CXX': 'arm-none-linux-gnueabi-g++',
                     'CC' : 'arm-none-linux-gnueabi-gcc',
                     'LD' : 'arm-none-linux-gnueabi-ld',
                     'AR' : 'arm-none-linux-gnueabi-ar',
                 },
@@ -479,21 +479,21 @@ class sandbox:
     #### builder for winmobile-emulator-compile-sandbox ####
     ########################################################
     sb_winmobile_emulator_compile_factory = factory.BuildFactory()
     sb_winmobile_emulator_compile_factory.addStep(sync_clean)
     sb_winmobile_emulator_compile_factory.addStep(sync_clone_sandbox)
     sb_winmobile_emulator_compile_factory.addStep(sync_update)
     sb_winmobile_emulator_compile_factory.addStep(bb_slaveupdate(slave="winmobile-emulator"))
     sb_winmobile_emulator_compile_factory.addStep(compile_builtin)
-    sb_winmobile_emulator_compile_factory.addStep(compile_generic(name="ReleaseARM", shellname="avmshell_arm", args="--enable-shell --target=arm-windows", upload="false"))
-    sb_winmobile_emulator_compile_factory.addStep(compile_generic(name="Release-wordcode-ARM", shellname="avmshell_wordcode_arm", args="--enable-shell --enable-wordcode-interp --target=arm-windows", upload="false"))
-    sb_winmobile_emulator_compile_factory.addStep(compile_generic(name="Release-fpu-ARM", shellname="avmshell_fpu_arm", args="--enable-shell --enable-arm-fpu --target=arm-windows", upload="false"))
-    sb_winmobile_emulator_compile_factory.addStep(compile_generic(name="DebugARM", shellname="avmshell_arm_d", args="--enable-shell --enable-debug --target=arm-windows", upload="false"))
-    sb_winmobile_emulator_compile_factory.addStep(compile_generic(name="Debug-fpu-ARM", shellname="avmshell_fpu_arm_d", args="--enable-shell --enable-debug --enable-arm-fpu --target=arm-windows", upload="false"))
+    sb_winmobile_emulator_compile_factory.addStep(compile_generic(name="ReleaseARM", shellname="avmshell_arm", args="--enable-shell --arm-arch=arch5 --target=arm-windows", upload="false"))
+    sb_winmobile_emulator_compile_factory.addStep(compile_generic(name="Release-wordcode-ARM", shellname="avmshell_wordcode_arm", args="--enable-shell --enable-wordcode-interp --arm-arch=arch5 --target=arm-windows", upload="false"))
+    sb_winmobile_emulator_compile_factory.addStep(compile_generic(name="Release-fpu-ARM", shellname="avmshell_fpu_arm", args="--enable-shell --enable-arm-fpu --arm-arch=arch6 --target=arm-windows", upload="false"))
+    sb_winmobile_emulator_compile_factory.addStep(compile_generic(name="DebugARM", shellname="avmshell_arm_d", args="--enable-shell --enable-debug --arm-arch=arch5 --target=arm-windows", upload="false"))
+    sb_winmobile_emulator_compile_factory.addStep(compile_generic(name="Debug-fpu-ARM", shellname="avmshell_fpu_arm_d", args="--enable-shell --enable-debug --enable-arm-fpu --arm-arch=arch6 --target=arm-windows", upload="false"))
     sb_winmobile_emulator_compile_factory.addStep(BuildShellCommand(
                 command=['../all/compile-generic.sh', WithProperties('%s','revision'), '--enable-shell --target=x86_64-win', 'avmshell_64', 'false'],
                 env={
                     'branch': WithProperties('%s','branch'),
                     'silent':WithProperties('%s','silent'),
                     'compile64':'true',
                 },
                 description='starting Release64 build...',
--- a/build/buildbot/master/tamarinredux.py
+++ b/build/buildbot/master/tamarinredux.py
@@ -464,31 +464,31 @@ class tamarinredux:
     linux_compile_factory.addStep(bb_slaveupdate(slave="linux"))
     linux_compile_factory.addStep(compile_builtin)
     linux_compile_factory.addStep(compile_generic(name="Release", shellname="avmshell", args="--enable-shell", upload="false"))
     linux_compile_factory.addStep(compile_generic(name="Release-wordcode", shellname="avmshell_wordcode", args="--enable-shell --enable-wordcode-interp", upload="false"))
     linux_compile_factory.addStep(compile_generic(name="Debug", shellname="avmshell_d", args="--enable-shell --enable-debug", upload="false"))
     linux_compile_factory.addStep(compile_generic(name="ReleaseDebugger", shellname="avmshell_s", args="--enable-shell --enable-debugger", upload="false"))
     linux_compile_factory.addStep(compile_generic(name="DebugDebugger", shellname="avmshell_sd", args="--enable-shell --enable-debug --enable-debugger", upload="false"))
     linux_compile_factory.addStep(BuildShellCommand(
-                command=['../all/compile-generic.sh', WithProperties('%s','revision'), '--enable-shell --enable-arm-neon --target=arm-linux --enable-sys-root-dir=/usr/local/arm-linux/debian5', 'avmshell_neon_arm', 'false'],
+                command=['../all/compile-generic.sh', WithProperties('%s','revision'), '--enable-shell --enable-arm-neon --arm-arch=armv7-a --target=arm-linux --enable-sys-root-dir=/usr/local/arm-linux/debian5', 'avmshell_neon_arm', 'false'],
                 env={
                     'branch': WithProperties('%s','branch'),
                     'CXX': 'arm-none-linux-gnueabi-g++',
                     'CC' : 'arm-none-linux-gnueabi-gcc',
                     'LD' : 'arm-none-linux-gnueabi-ld',
                     'AR' : 'arm-none-linux-gnueabi-ar',
                 },
                 description='starting Release_arm-linux build...',
                 descriptionDone='finished Release_arm-linux build.',
                 name="Release_arm-linux",
                 workdir="../repo/build/buildbot/slaves/scripts")
     )
     linux_compile_factory.addStep(BuildShellCommand(
-                command=['../all/compile-generic.sh', WithProperties('%s','revision'), '--enable-shell --enable-debug --enable-arm-neon --target=arm-linux --enable-sys-root-dir=/usr/local/arm-linux/debian5', 'avmshell_neon_arm_d', 'false'],
+                command=['../all/compile-generic.sh', WithProperties('%s','revision'), '--enable-shell --enable-debug --enable-arm-neon --arm-arch=armv7-a --target=arm-linux --enable-sys-root-dir=/usr/local/arm-linux/debian5', 'avmshell_neon_arm_d', 'false'],
                 env={
                     'branch': WithProperties('%s','branch'),
                     'CXX': 'arm-none-linux-gnueabi-g++',
                     'CC' : 'arm-none-linux-gnueabi-gcc',
                     'LD' : 'arm-none-linux-gnueabi-ld',
                     'AR' : 'arm-none-linux-gnueabi-ar',
                 },
                 description='starting Debug_arm-linux build...',
@@ -538,21 +538,21 @@ class tamarinredux:
     #### builder for winmobile-emulator-compile ####
     ################################################
     winmobile_emulator_compile_factory = factory.BuildFactory()
     winmobile_emulator_compile_factory.addStep(sync_clean)
     winmobile_emulator_compile_factory.addStep(sync_clone(url=HG_URL))
     winmobile_emulator_compile_factory.addStep(sync_update)
     winmobile_emulator_compile_factory.addStep(bb_slaveupdate(slave="winmobile-emulator"))
     winmobile_emulator_compile_factory.addStep(compile_builtin)
-    winmobile_emulator_compile_factory.addStep(compile_generic(name="ReleaseARM", shellname="avmshell_arm", args="--enable-shell --target=arm-windows", upload="false"))
-    winmobile_emulator_compile_factory.addStep(compile_generic(name="Release-wordcode-ARM", shellname="avmshell_wordcode_arm", args="--enable-shell --enable-wordcode-interp --target=arm-windows", upload="false"))
-    winmobile_emulator_compile_factory.addStep(compile_generic(name="Release-fpu-ARM", shellname="avmshell_fpu_arm", args="--enable-shell --enable-arm-fpu --target=arm-windows", upload="false"))
-    winmobile_emulator_compile_factory.addStep(compile_generic(name="DebugARM", shellname="avmshell_arm_d", args="--enable-shell --enable-debug --target=arm-windows", upload="false"))
-    winmobile_emulator_compile_factory.addStep(compile_generic(name="Debug-fpu-ARM", shellname="avmshell_fpu_arm_d", args="--enable-shell --enable-debug --enable-arm-fpu --target=arm-windows", upload="false"))
+    winmobile_emulator_compile_factory.addStep(compile_generic(name="ReleaseARM", shellname="avmshell_arm", args="--enable-shell --arm-arch=arch5 --target=arm-windows", upload="false"))
+    winmobile_emulator_compile_factory.addStep(compile_generic(name="Release-wordcode-ARM", shellname="avmshell_wordcode_arm", args="--enable-shell --enable-wordcode-interp --arm-arch=arch5 --target=arm-windows", upload="false"))
+    winmobile_emulator_compile_factory.addStep(compile_generic(name="Release-fpu-ARM", shellname="avmshell_fpu_arm", args="--enable-shell --enable-arm-fpu --arm-arch=arch6 --target=arm-windows", upload="false"))
+    winmobile_emulator_compile_factory.addStep(compile_generic(name="DebugARM", shellname="avmshell_arm_d", args="--enable-shell --enable-debug --arm-arch=arch5 --target=arm-windows", upload="false"))
+    winmobile_emulator_compile_factory.addStep(compile_generic(name="Debug-fpu-ARM", shellname="avmshell_fpu_arm_d", args="--enable-shell --enable-debug --enable-arm-fpu --arm-arch=arch6 --target=arm-windows", upload="false"))
     winmobile_emulator_compile_factory.addStep(BuildShellCommand(
                 command=['../all/compile-generic.sh', WithProperties('%s','revision'), '--enable-shell --target=x86_64-win', 'avmshell_64', 'false'],
                 env={
                     'branch': WithProperties('%s','branch'),
                     'compile64':'true'
                 },
                 description='starting Release64 build...',
                 descriptionDone='finished Release64 build.',
--- a/build/getopt.py
+++ b/build/getopt.py
@@ -41,43 +41,49 @@ import re
 _target = re.compile("^--target=(.*)$")
 _host = re.compile("^--host=(.*)$")
 _ignore = re.compile(r"^--(srcdir|cache-file)=")
 _arg = re.compile(r"^--(enable|disable|with|without)-([\w-]+)(?:=(.*)|$)$")
 _yes = re.compile("^(t|true|yes|y|1)$", re.I)
 _no = re.compile("^(f|false|no|n|0)$", re.I)
 _help = re.compile("^(-h|--help)$")
 _sdk = re.compile("^--mac-sdk=(.*)$")
+_arm_arch = re.compile("^--arm_arch=(.*)$")
 
 class Options:
     def __init__(self, argv = sys.argv):
         self._args = {}
         self.target = None
         self.host = None
         self.ignore_unknown_flags = False
         self.help = False
         self._allargs = {}
-        self.sdk_version = None
-
+        self.mac_sdk_version = None
+        self.arm_arch = None
 
         unknown_args = []
         for arg in argv[1:]:
             m = _target.search(arg)
             if m:
                 self.target = m.group(1)
                 continue
 
             m = _host.search(arg)
             if m:
                 self.host = m.group(1)
                 continue
 
             m = _sdk.search(arg)
             if m:
-                self.sdk_version = m.group(1)
+                self.mac_sdk_version = m.group(1)
+                continue
+
+            m = _arm_arch.search(arg)
+            if m:
+                self.arm_arch = m.group(1)
                 continue
 
             if _ignore.search(arg) is not None:
                 continue
 
             if arg == '--ignore-unknown-flags':
                 self.ignore_unknown_flags = True
                 continue
--- a/configure.py
+++ b/configure.py
@@ -130,16 +130,17 @@ if MMGC_INTERIOR_PTRS:
 
 MMGC_DYNAMIC = o.getBoolArg('mmgc-shared', False)
 if MMGC_DYNAMIC:
     MMGC_DEFINES['MMGC_DLL'] = None
     MMGC_CPPFLAGS += "-DMMGC_IMPL "
 
 arm_fpu = o.getBoolArg("arm-fpu",False)
 arm_neon = o.getBoolArg("arm-neon",False)
+arm_arch = o.arm_arch
 
 the_os, cpu = config.getTarget()
 
 # For -Wreorder, see https://bugzilla.mozilla.org/show_bug.cgi?id=475750
 if config.getCompiler() == 'GCC':
     if 'CXX' in os.environ:
         rawver = build.process.run_for_output(['$CXX', '--version'])
     else:
@@ -153,42 +154,48 @@ if config.getCompiler() == 'GCC':
     # warnings have been updated to try to include all those enabled by current Flash/AIR builds -- disable with caution, or risk integration pain
     APP_CXXFLAGS = "-Wall -Wcast-align -Wdisabled-optimization -Wextra -Wformat=2 -Winit-self -Winvalid-pch -Wno-invalid-offsetof -Wno-switch -Wparentheses -Wpointer-arith -Wreorder -Wsign-compare -Wunused-parameter -Wwrite-strings -Wno-ctor-dtor-privacy -Woverloaded-virtual -Wsign-promo -Wno-char-subscripts -fmessage-length=0 -fno-exceptions -fno-rtti -fno-check-new -fstrict-aliasing -fsigned-char  "
     if GCC_MAJOR_VERSION >= 4:
         APP_CXXFLAGS += "-Wstrict-null-sentinel "
         if (GCC_MAJOR_VERSION == 4 and GCC_MINOR_VERSION <= 2) or cpu == 'mips': # 4.0 - 4.2
             APP_CXXFLAGS += "-Wstrict-aliasing=0 "
         else: # gcc 4.3 or later
             APP_CXXFLAGS += "-Werror -Wempty-body -Wno-logical-op -Wmissing-field-initializers -Wstrict-aliasing=3 -Wno-array-bounds -Wno-clobbered -Wstrict-overflow=0 -funit-at-a-time  "
+
     if arm_fpu:
-        ARM_FPU_FLAGS = "-mfloat-abi=softfp -mfpu=vfp -march=armv6 -Wno-cast-align " # compile to use hardware fpu and armv6
+        ARM_FPU_FLAGS = "-mfloat-abi=softfp -mfpu=vfp -march=%s -Wno-cast-align " % arm_arch # compile to use hardware fpu
         OPT_CXXFLAGS += ARM_FPU_FLAGS
         DEBUG_CXXFLAGS += ARM_FPU_FLAGS
     if arm_neon:
-        ARM_NEON_FLAGS = "-mfloat-abi=softfp -mfpu=neon -march=armv7-a -Wno-cast-align "  # compile to use neon vfp and armv7
-        OPT_CXXFLAGS += ARM_NEON_FLAGS  # compile to use neon vfp and armv7
+        ARM_NEON_FLAGS = "-mfloat-abi=softfp -mfpu=neon -march=%s -Wno-cast-align " % arm_arch # compile to use neon vfp
+        OPT_CXXFLAGS += ARM_NEON_FLAGS
         DEBUG_CXXFLAGS += ARM_NEON_FLAGS
+    #if arm_arch:
+        #OPT_CXXFLAGS += "-march=%s " % arm_arch
+        #DEBUG_CXXFLAGS += "-march=%s " % arm_arch
+
     if config.getDebug():
         APP_CXXFLAGS += ""
     else:
         APP_CXXFLAGS += "-Wuninitialized "
     DEBUG_CXXFLAGS += "-g "
 elif config.getCompiler() == 'VS':
     if cpu == "arm":
         APP_CXXFLAGS = "-W4 -WX -wd4291 -wd4201 -wd4189 -wd4740 -wd4127 -fp:fast -GF -GS- -Zc:wchar_t- "
         OS_LDFLAGS += "-MAP "
         if config.getDebug():
             DEBUG_CXXFLAGS = "-Od "
             DEBUG_CFLAGS = "-Od "
             APP_CXXFLAGS += "-GR- -fp:fast -GS- -Zc:wchar_t- -Zc:forScope "
         else:
             OPT_CXXFLAGS = "-O2 -GR- "
-
+        if arm_arch:
+            OPT_CXXFLAGS += "-QR%s " % arm_arch
         if arm_fpu:
-            OPT_CXXFLAGS += "-QRfpe- -QRarch6"  # compile to use hardware fpu and armv6
+            OPT_CXXFLAGS += "-QRfpe- " # compile to use hardware fpu
     else:
         APP_CXXFLAGS = "-W4 -WX -wd4291 -GF -GS- -Zc:wchar_t- "
         APP_CFLAGS = "-W4 -WX -wd4291 -GF -GS- -Zc:wchar_t- "
     if cpu == 'x86_64':
         pass # 64 bit VC does NaN comparisons incorrectly with fp:fast
     else:
         APP_CXXFLAGS += "-fp:fast "
         APP_CFLAGS += "-fp:fast "
@@ -237,18 +244,18 @@ if the_os == "darwin":
     MMGC_DEFINES.update({'TARGET_API_MAC_CARBON': 1,
                          'DARWIN': 1,
                          '_MAC': None,
                          'AVMPLUS_MAC': None,
                          'TARGET_RT_MAC_MACHO': 1})
     APP_CXXFLAGS += "-fpascal-strings -faltivec -fasm-blocks "
 
     # If an sdk is selected align OS and gcc/g++ versions to it
-    if o.sdk_version is not None:
-        os_ver,sdk_number = _setSDKParams(o.sdk_version, os_ver)
+    if o.mac_sdk_version is not None:
+        os_ver,sdk_number = _setSDKParams(o.mac_sdk_version, os_ver)
         APP_CXXFLAGS += "-mmacosx-version-min=%s -isysroot /Developer/SDKs/MACOSX%s.sdk " % (os_ver,sdk_number)
     else:
         APP_CXXFLAGS += "-mmacosx-version-min=%s " % os_ver
 
     config.subst("MACOSX_DEPLOYMENT_TARGET",os_ver)
 
     if cpu == 'ppc64':
         APP_CXXFLAGS += "-arch ppc64 "