diff options
| author | Marco A L Barbosa <malbarbo@gmail.com> | 2017-04-18 13:40:00 -0300 |
|---|---|---|
| committer | Marco A L Barbosa <malbarbo@gmail.com> | 2017-04-18 13:50:29 -0300 |
| commit | a42c0257c7ed05558f685a77db0de08379feeef8 (patch) | |
| tree | fbd619da019dc6907b98d8c29324db00bf7660e8 /src/bootstrap/bootstrap.py | |
| parent | e621e1c73f1487b4450446eafe6ccad3a99e3cd8 (diff) | |
| download | rust-a42c0257c7ed05558f685a77db0de08379feeef8.tar.gz rust-a42c0257c7ed05558f685a77db0de08379feeef8.zip | |
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 2e33b451194..e27f4091b19 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -415,7 +415,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': @@ -472,15 +476,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': |
