Bug 1339161 - Add more rustc targets for cross-compilation. r=rillian a=gchang
authorJan Beich <jbeich@FreeBSD.org>
Mon, 13 Feb 2017 19:08:53 +0000
changeset 376205 6898429f8828083e114ca5c5a07567627298366c
parent 376204 6db1cdc5eedd295f9c984b21c73859c4de992f72
child 376206 9cde62d9b944e0adf27e3133b58041d6387a0c91
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrillian, gchang
bugs1339161
milestone53.0a2
Bug 1339161 - Add more rustc targets for cross-compilation. r=rillian a=gchang MozReview-Commit-ID: 5C7Bgsx2B2z
build/moz.configure/rust.configure
--- a/build/moz.configure/rust.configure
+++ b/build/moz.configure/rust.configure
@@ -101,45 +101,53 @@ def rust_triple_alias(host_or_target):
         # Rust uses distinct target triples for targetting the GNU C++ ABI
         # and the MSVC C++ ABI on Win32, whereas autoconf has a single
         # triple and relies on the user to ensure that everything is
         # compiled for the appropriate ABI.  We need to perform appropriate
         # munging to get the correct option to rustc.
         #
         # The canonical list of targets supported can be derived from:
         #
-        # https://github.com/rust-lang/rust/tree/master/mk/cfg
+        # https://github.com/rust-lang/rust/blob/master/src/librustc_back/target/mod.rs
 
         # Avoid having to write out os+kernel for all the platforms where
         # they don't differ.
         os_or_kernel = host_or_target.kernel if host_or_target.kernel == 'Linux' and host_or_target.os != 'Android' else host_or_target.os
         rustc_target = {
             # DragonFly
             ('x86_64', 'DragonFly'): 'x86_64-unknown-dragonfly',
             # FreeBSD
+            ('aarch64', 'FreeBSD'): 'aarch64-unknown-freebsd',
             ('x86', 'FreeBSD'): 'i686-unknown-freebsd',
             ('x86_64', 'FreeBSD'): 'x86_64-unknown-freebsd',
             # NetBSD
+            ('sparc64', 'NetBSD'): 'sparc64-unknown-netbsd',
+            ('x86', 'NetBSD'): 'i686-unknown-netbsd',
             ('x86_64', 'NetBSD'): 'x86_64-unknown-netbsd',
             # OpenBSD
             ('x86', 'OpenBSD'): 'i686-unknown-openbsd',
             ('x86_64', 'OpenBSD'): 'x86_64-unknown-openbsd',
             # Linux
+            ('aarch64', 'Linux'): 'aarch64-unknown-linux-gnu',
+            ('arm', 'Linux'): 'armv7-unknown-linux-gnueabihf',
+            ('sparc64', 'Linux'): 'sparc64-unknown-linux-gnu',
             ('x86', 'Linux'): 'i686-unknown-linux-gnu',
-            # Linux
             ('x86_64', 'Linux'): 'x86_64-unknown-linux-gnu',
-            ('aarch64', 'Linux'): 'aarch64-unknown-linux-gnu',
-            # OS X and iOS
+            # OS X
             ('x86', 'OSX'): 'i686-apple-darwin',
+            ('x86_64', 'OSX'): 'x86_64-apple-darwin',
+            # iOS
+            ('aarch64', 'iOS'): 'aarch64-apple-ios',
+            ('arm', 'iOS'): 'armv7s-apple-ios',
             ('x86', 'iOS'): 'i386-apple-ios',
-            ('x86_64', 'OSX'): 'x86_64-apple-darwin',
+            ('x86_64', 'iOS'): 'x86_64-apple-ios',
             # Android
-            ('x86', 'Android'): 'i686-linux-android',
+            ('aarch64', 'Android'): 'aarch64-linux-android',
             ('arm', 'Android'): 'armv7-linux-androideabi',
-            ('aarch64', 'Android'): 'aarch64-linux-android',
+            ('x86', 'Android'): 'i686-linux-android',
             # Windows
             # XXX better detection of CXX needed here, to figure out whether
             # we need i686-pc-windows-gnu instead, since mingw32 builds work.
             ('x86', 'WINNT'): 'i686-pc-windows-msvc',
             ('x86_64', 'WINNT'): 'x86_64-pc-windows-msvc',
         }.get((host_or_target.cpu, os_or_kernel), None)
 
         if rustc_target is None: