2020-11-13 07:58:40 +01:00
|
|
|
commit b7d26337e3252f013d271cd001635e260a50eb77
|
|
|
|
Date: Wed Nov 11 01:24:23 2020 +0530
|
|
|
|
|
|
|
|
[android] Add support for x86_64 arch
|
|
|
|
|
2020-11-06 17:02:29 +01:00
|
|
|
diff --git a/swift/utils/build-script b/swift/utils/build-script
|
2020-11-13 07:58:40 +01:00
|
|
|
index 639f790fe35..8b1c1cd4fde 100755
|
2020-11-06 17:02:29 +01:00
|
|
|
--- a/swift/utils/build-script
|
|
|
|
+++ b/swift/utils/build-script
|
2020-11-13 07:58:40 +01:00
|
|
|
@@ -349,6 +349,9 @@ def apply_default_arguments(toolchain, args):
|
2020-11-06 17:02:29 +01:00
|
|
|
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
|
2020-11-13 07:58:40 +01:00
|
|
|
index f7fd838905c..b99da016f5c 100755
|
2020-11-06 17:02:29 +01:00
|
|
|
--- a/swift/utils/build-script-impl
|
|
|
|
+++ b/swift/utils/build-script-impl
|
2020-11-13 07:58:40 +01:00
|
|
|
@@ -414,7 +414,8 @@ function verify_host_is_supported() {
|
2020-11-06 17:02:29 +01:00
|
|
|
| watchsimulator-arm64 \
|
|
|
|
| watchos-armv7k \
|
|
|
|
| android-armv7 \
|
|
|
|
- | android-aarch64)
|
|
|
|
+ | android-aarch64 \
|
|
|
|
+ | android-x86_64)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Unknown host tools target: ${host}"
|
2020-11-13 07:58:40 +01:00
|
|
|
@@ -458,6 +459,10 @@ function set_build_options_for_host() {
|
2020-11-06 17:02:29 +01:00
|
|
|
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
|
2020-11-13 07:58:40 +01:00
|
|
|
index cb1c5c0b0e3..45d76b51951 100644
|
2020-11-06 17:02:29 +01:00
|
|
|
--- a/swift/utils/build_swift/build_swift/driver_arguments.py
|
|
|
|
+++ b/swift/utils/build_swift/build_swift/driver_arguments.py
|
2020-11-13 07:58:40 +01:00
|
|
|
@@ -1087,10 +1087,10 @@ def create_argument_parser():
|
2020-11-06 17:02:29 +01:00
|
|
|
android.adb.commands.DEVICE_TEMP_DIR))
|
|
|
|
|
|
|
|
option('--android-arch', store,
|
|
|
|
- choices=['armv7', 'aarch64'],
|
|
|
|
+ choices=['armv7', 'aarch64', 'x86_64'],
|
|
|
|
default='armv7',
|
2020-11-13 07:58:40 +01:00
|
|
|
- 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.')
|
|
|
|
|
|
|
|
# -------------------------------------------------------------------------
|
2020-11-06 17:02:29 +01:00
|
|
|
diff --git a/swift/utils/swift_build_support/swift_build_support/targets.py b/swift/utils/swift_build_support/swift_build_support/targets.py
|
2020-11-13 07:58:40 +01:00
|
|
|
index 9370a1a82e0..02613404af9 100644
|
2020-11-06 17:02:29 +01:00
|
|
|
--- a/swift/utils/swift_build_support/swift_build_support/targets.py
|
|
|
|
+++ b/swift/utils/swift_build_support/swift_build_support/targets.py
|
2020-11-13 07:58:40 +01:00
|
|
|
@@ -201,7 +201,7 @@ class StdlibDeploymentTarget(object):
|
2020-11-06 17:02:29 +01:00
|
|
|
|
|
|
|
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"])
|
|
|
|
|