@@ -407,7 +407,11 @@ def build_triple(self):
407
407
# The goal here is to come up with the same triple as LLVM would,
408
408
# at least for the subset of platforms we're willing to target.
409
409
if ostype == 'Linux' :
410
- ostype = 'unknown-linux-gnu'
410
+ os = subprocess .check_output (['uname' , '-o' ]).strip ().decode (default_encoding )
411
+ if os == 'Android' :
412
+ ostype = 'linux-android'
413
+ else :
414
+ ostype = 'unknown-linux-gnu'
411
415
elif ostype == 'FreeBSD' :
412
416
ostype = 'unknown-freebsd'
413
417
elif ostype == 'DragonFly' :
@@ -464,15 +468,21 @@ def build_triple(self):
464
468
cputype = 'i686'
465
469
elif cputype in {'xscale' , 'arm' }:
466
470
cputype = 'arm'
471
+ if ostype == 'linux-android' :
472
+ ostype = 'linux-androideabi'
467
473
elif cputype == 'armv6l' :
468
474
cputype = 'arm'
469
- ostype += 'eabihf'
475
+ if ostype == 'linux-android' :
476
+ ostype = 'linux-androideabi'
477
+ else :
478
+ ostype += 'eabihf'
470
479
elif cputype in {'armv7l' , 'armv8l' }:
471
480
cputype = 'armv7'
472
- ostype += 'eabihf'
473
- elif cputype == 'aarch64' :
474
- cputype = 'aarch64'
475
- elif cputype == 'arm64' :
481
+ if ostype == 'linux-android' :
482
+ ostype = 'linux-androideabi'
483
+ else :
484
+ ostype += 'eabihf'
485
+ elif cputype in {'aarch64' , 'arm64' }:
476
486
cputype = 'aarch64'
477
487
elif cputype == 'mips' :
478
488
if sys .byteorder == 'big' :
0 commit comments