Bug 1329194 - mozbuild: Add SH4 as target architecture. r=glandium
authorJohn Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Thu, 29 Dec 2016 10:50:17 +0100
changeset 330246 1380d9d6ee091148e34537052bf23e79639ed734
parent 330245 a8d2fc52fdeec706da43fd2ae824a03a462fce82
child 330247 572856b5083a33bf7ca1fc1399f975b56fb75271
push id31233
push userphilringnalda@gmail.com
push dateFri, 20 Jan 2017 06:05:15 +0000
treeherdermozilla-central@aa3e49299a3a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1329194
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1329194 - mozbuild: Add SH4 as target architecture. r=glandium
build/moz.configure/init.configure
python/mozbuild/mozbuild/configure/constants.py
python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py
--- a/build/moz.configure/init.configure
+++ b/build/moz.configure/init.configure
@@ -391,16 +391,19 @@ def split_triplet(triplet):
         canonical_cpu = 'mips32'
         endianness = 'little' if 'el' in cpu else 'big'
     elif cpu in ('mips64', 'mips64el'):
         canonical_cpu = 'mips64'
         endianness = 'little' if 'el' in cpu else 'big'
     elif cpu.startswith('aarch64'):
         canonical_cpu = 'aarch64'
         endianness = 'little'
+    elif cpu == 'sh4':
+        canonical_cpu = 'sh4'
+        endianness = 'little'
     else:
         die('Unknown CPU type: %s' % cpu)
 
     return namespace(
         alias=triplet,
         cpu=CPU(canonical_cpu),
         bitness=CPU_bitness[canonical_cpu],
         kernel=Kernel(canonical_kernel),
--- a/python/mozbuild/mozbuild/configure/constants.py
+++ b/python/mozbuild/mozbuild/configure/constants.py
@@ -45,16 +45,17 @@ CPU_bitness = {
     'hppa': 32,
     'ia64': 64,
     'mips32': 32,
     'mips64': 64,
     'ppc': 32,
     'ppc64': 64,
     's390': 32,
     's390x': 64,
+    'sh4': 32,
     'sparc': 32,
     'sparc64': 64,
     'x86': 32,
     'x86_64': 64,
 }
 
 CPU = EnumString.subclass(*CPU_bitness.keys())
 
@@ -80,16 +81,17 @@ CPU_preprocessor_checks = OrderedDict((
     ('ppc64', '__powerpc64__'),
     ('ppc', '__powerpc__'),
     ('Alpha', '__alpha__'),
     ('hppa', '__hppa__'),
     ('sparc64', '__sparc__ && __arch64__'),
     ('sparc', '__sparc__'),
     ('mips64', '__mips64'),
     ('mips32', '__mips__'),
+    ('sh4', '__sh__'),
 ))
 
 assert sorted(CPU_preprocessor_checks.keys()) == sorted(CPU.POSSIBLE_VALUES)
 
 kernel_preprocessor_checks = {
     'Darwin': '__APPLE__',
     'DragonFly': '__DragonFly__',
     'FreeBSD': '__FreeBSD__',
--- a/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py
+++ b/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py
@@ -1032,16 +1032,19 @@ class LinuxCrossCompileToolchainTest(Bas
         },
         'mips64-unknown-linux-gnuabi64': big_endian + {
             '__mips64': 1,
             '__mips__': 1,
         },
         'mips-unknown-linux-gnu': big_endian + {
             '__mips__': 1,
         },
+        'sh4-unknown-linux-gnu': little_endian + {
+            '__sh__': 1,
+        },
     }
 
     PLATFORMS['powerpc64le-unknown-linux-gnu'] = \
         PLATFORMS['powerpc64-unknown-linux-gnu'] + GCC_PLATFORM_LITTLE_ENDIAN
     PLATFORMS['mips64el-unknown-linux-gnuabi64'] = \
         PLATFORMS['mips64-unknown-linux-gnuabi64'] + GCC_PLATFORM_LITTLE_ENDIAN
     PLATFORMS['mipsel-unknown-linux-gnu'] = \
         PLATFORMS['mips-unknown-linux-gnu'] + GCC_PLATFORM_LITTLE_ENDIAN