termux-packages/packages/swift/swift-x86_64.patch

66 lines
2.9 KiB
Diff

diff --git a/swift/utils/build-script b/swift/utils/build-script
index e2ab40128b..f6f5ca50cd 100755
--- a/swift/utils/build-script
+++ b/swift/utils/build-script
@@ -316,6 +316,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 209bc334da..64ad978a65 100755
--- a/swift/utils/build-script-impl
+++ b/swift/utils/build-script-impl
@@ -433,7 +433,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}"
@@ -477,6 +478,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 1a18e83cb3..e594620dbd 100644
--- a/swift/utils/build_swift/build_swift/driver_arguments.py
+++ b/swift/utils/build_swift/build_swift/driver_arguments.py
@@ -1065,7 +1065,7 @@ 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. '
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 6bc7abe319..6365bf99e6 100644
--- a/swift/utils/swift_build_support/swift_build_support/targets.py
+++ b/swift/utils/swift_build_support/swift_build_support/targets.py
@@ -195,7 +195,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"])