Skip to content

Commit

Permalink
Merge pull request #34661 from buttaface/droid
Browse files Browse the repository at this point in the history
[android] Add support for x86_64 arch
  • Loading branch information
CodaFi authored Nov 12, 2020
2 parents fdd1821 + b7d2633 commit 7abf272
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
3 changes: 3 additions & 0 deletions utils/build-script
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,9 @@ def apply_default_arguments(toolchain, args):
elif args.android_arch == "aarch64":
args.stdlib_deployment_targets.append(
StdlibDeploymentTarget.Android.aarch64.name)
elif args.android_arch == "x86_64":
args.stdlib_deployment_targets.append(
StdlibDeploymentTarget.Android.x86_64.name)

# Infer platform flags from manually-specified configure targets.
# This doesn't apply to Darwin platforms, as they are
Expand Down
7 changes: 6 additions & 1 deletion utils/build-script-impl
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,8 @@ function verify_host_is_supported() {
| watchsimulator-arm64 \
| watchos-armv7k \
| android-armv7 \
| android-aarch64)
| android-aarch64 \
| android-x86_64)
;;
*)
echo "Unknown host tools target: ${host}"
Expand Down Expand Up @@ -458,6 +459,10 @@ function set_build_options_for_host() {
SWIFT_HOST_TRIPLE="armv7-unknown-linux-androideabi"
llvm_target_arch="ARM"
;;
android-x86_64)
SWIFT_HOST_TRIPLE="x86_64-unknown-linux-android${ANDROID_API_LEVEL}"
llvm_target_arch="X86"
;;
linux-armv6)
SWIFT_HOST_TRIPLE="armv6-unknown-linux-gnueabihf"
llvm_target_arch="ARM"
Expand Down
6 changes: 3 additions & 3 deletions utils/build_swift/build_swift/driver_arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -1087,10 +1087,10 @@ def create_argument_parser():
android.adb.commands.DEVICE_TEMP_DIR))

option('--android-arch', store,
choices=['armv7', 'aarch64'],
choices=['armv7', 'aarch64', 'x86_64'],
default='armv7',
help='The Android target architecture when building for Android. '
'Currently only armv7 and aarch64 are supported. '
help='The target architecture when building for Android. '
'Currently, only armv7, aarch64, and x86_64 are supported. '
'%(default)s is the default.')

# -------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion utils/swift_build_support/swift_build_support/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ class StdlibDeploymentTarget(object):

Cygwin = Platform("cygwin", archs=["x86_64"])

Android = AndroidPlatform("android", archs=["armv7", "aarch64"])
Android = AndroidPlatform("android", archs=["armv7", "aarch64", "x86_64"])

Windows = Platform("windows", archs=["x86_64"])

Expand Down

0 comments on commit 7abf272

Please sign in to comment.