commit b7d26337e3252f013d271cd001635e260a50eb77
Date:   Wed Nov 11 01:24:23 2020 +0530

    [android] Add support for x86_64 arch

diff --git a/swift/utils/build-script b/swift/utils/build-script
index 639f790fe35..8b1c1cd4fde 100755
--- a/swift/utils/build-script
+++ b/swift/utils/build-script
@@ -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
diff --git a/swift/utils/build-script-impl b/swift/utils/build-script-impl
index f7fd838905c..b99da016f5c 100755
--- a/swift/utils/build-script-impl
+++ b/swift/utils/build-script-impl
@@ -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}"
@@ -458,6 +459,10 @@ function set_build_options_for_host() {
             SWIFT_HOST_TRIPLE="armv7-unknown-linux-androideabi${ANDROID_API_LEVEL}"
             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"
diff --git a/swift/utils/build_swift/build_swift/driver_arguments.py b/swift/utils/build_swift/build_swift/driver_arguments.py
index cb1c5c0b0e3..45d76b51951 100644
--- a/swift/utils/build_swift/build_swift/driver_arguments.py
+++ b/swift/utils/build_swift/build_swift/driver_arguments.py
@@ -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.')
 
     # -------------------------------------------------------------------------
diff --git a/swift/utils/swift_build_support/swift_build_support/targets.py b/swift/utils/swift_build_support/swift_build_support/targets.py
index 9370a1a82e0..02613404af9 100644
--- a/swift/utils/swift_build_support/swift_build_support/targets.py
+++ b/swift/utils/swift_build_support/swift_build_support/targets.py
@@ -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"])
 
