Bug 1515566 - Allow to only give a CPU type to configure's --target. r=chmanchester
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 21 Dec 2018 22:57:42 +0000
changeset 508880 00a81323e3a88f9dc1bd015483656af85224d869
parent 508879 5d8df624d01631ab668ef462f17132ad91f60ba7
child 508881 f3c445024b97de5b757c9c58835bad9ff1a346d5
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerschmanchester
bugs1515566
milestone66.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 1515566 - Allow to only give a CPU type to configure's --target. r=chmanchester So far, the main subject of cross-compiles was to cross compile from one OS to another (e.g. {linux,osx} -> android), but there are a few useful cases where the OS doesn't change, and, with --host being guessed, we can just have developers pass --target=$cpu instead of a complete target triplet. This can be useful to do x86 Linux builds on x86-64 Linux hosts, or aarch64 Windows builds on x86-64 Windows hosts. Differential Revision: https://phabricator.services.mozilla.com/D15063
build/moz.configure/init.configure
--- a/build/moz.configure/init.configure
+++ b/build/moz.configure/init.configure
@@ -764,17 +764,23 @@ def host(value, shell):
 host = help_host_target | host
 
 
 @depends('--target', host, shell)
 @checking('for target system type', lambda t: t.alias)
 def target(value, host, shell):
     if not value:
         return host
-    return split_triplet(config_sub(shell, value[0]))
+    # If --target was only given a cpu arch, expand it with the
+    # non-cpu part of the host.
+    target = value[0]
+    if '-' not in target:
+        cpu, rest = host.alias.split('-', 1)
+        target = '-'.join((target, rest))
+    return split_triplet(config_sub(shell, target))
 
 
 target = help_host_target | target
 
 
 @depends(host, target)
 @checking('whether cross compiling')
 def cross_compiling(host, target):