diff options
| author | Ariel Ben-Yehuda <arielb1@mail.tau.ac.il> | 2017-04-26 22:11:02 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-04-26 22:11:02 +0000 |
| commit | a3dde0b457b5c5fd736ce1ff1419d90646a93a15 (patch) | |
| tree | c85af16ccf3c87ba819e2cbe1d451935082a0b92 /src/bootstrap/bootstrap.py | |
| parent | 036983201d4e9aeb5c5e56e47c305971972b2569 (diff) | |
| parent | a42c0257c7ed05558f685a77db0de08379feeef8 (diff) | |
| download | rust-a3dde0b457b5c5fd736ce1ff1419d90646a93a15.tar.gz rust-a3dde0b457b5c5fd736ce1ff1419d90646a93a15.zip | |
Rollup merge of #41370 - malbarbo:android-bootstrap, r=alexcrichton
Add bootstrap support for android
Diffstat (limited to 'src/bootstrap/bootstrap.py')
| -rw-r--r-- | src/bootstrap/bootstrap.py | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 3233a73b007..1dfc5593e5f 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -407,7 +407,11 @@ class RustBuild(object): # The goal here is to come up with the same triple as LLVM would, # at least for the subset of platforms we're willing to target. if ostype == 'Linux': - ostype = 'unknown-linux-gnu' + os = subprocess.check_output(['uname', '-o']).strip().decode(default_encoding) + if os == 'Android': + ostype = 'linux-android' + else: + ostype = 'unknown-linux-gnu' elif ostype == 'FreeBSD': ostype = 'unknown-freebsd' elif ostype == 'DragonFly': @@ -464,15 +468,21 @@ class RustBuild(object): cputype = 'i686' elif cputype in {'xscale', 'arm'}: cputype = 'arm' + if ostype == 'linux-android': + ostype = 'linux-androideabi' elif cputype == 'armv6l': cputype = 'arm' - ostype += 'eabihf' + if ostype == 'linux-android': + ostype = 'linux-androideabi' + else: + ostype += 'eabihf' elif cputype in {'armv7l', 'armv8l'}: cputype = 'armv7' - ostype += 'eabihf' - elif cputype == 'aarch64': - cputype = 'aarch64' - elif cputype == 'arm64': + if ostype == 'linux-android': + ostype = 'linux-androideabi' + else: + ostype += 'eabihf' + elif cputype in {'aarch64', 'arm64'}: cputype = 'aarch64' elif cputype == 'mips': if sys.byteorder == 'big': |
