termux-packages/packages/swift/swift-build-script.patch

57 lines
2.6 KiB
Diff
Raw Normal View History

diff --git a/swift/utils/build-script b/swift/utils/build-script
index b1d060328bc..218c9215260 100755
--- a/swift/utils/build-script
+++ b/swift/utils/build-script
@@ -799,8 +807,7 @@
self._execute_install_action(host_target, product_class)
# Non-build-script-impl products...
- # Note: currently only supports building for the host.
- for host_target in [self.args.host_target]:
+ for host_target in [tgt.name for tgt in all_hosts if StdlibDeploymentTarget.Android.contains(tgt.name)]:
for product_class in product_classes:
if product_class.is_build_script_impl_product():
continue
2020-09-07 18:23:03 +02:00
diff --git a/swift/utils/gen-static-stdlib-link-args b/swift/utils/gen-static-stdlib-link-args
index 0fa009d67d3..abd98c2493f 100755
--- a/swift/utils/gen-static-stdlib-link-args
+++ b/swift/utils/gen-static-stdlib-link-args
@@ -60,9 +60,8 @@ function write_linkfile {
fi
cat >$OUTPUTFILE <<EOF
-ldl
--lpthread
-lswiftCore
--lswiftImageInspectionShared
+-llog
$ICU_LIBS
-lstdc++
-lm
diff --git a/swift/utils/swift_build_support/swift_build_support/products/swiftpm.py b/swift/utils/swift_build_support/swift_build_support/products/swiftpm.py
index 475483618f1..2bea230012b 100644
--- a/swift/utils/swift_build_support/swift_build_support/products/swiftpm.py
+++ b/swift/utils/swift_build_support/swift_build_support/products/swiftpm.py
@@ -31,8 +31,11 @@ class SwiftPM(product.Product):
def run_bootstrap_script(self, action, host_target, additional_params=[]):
script_path = os.path.join(
2020-09-07 18:23:03 +02:00
self.source_dir, 'Utilities', 'bootstrap')
- toolchain_path = self.install_toolchain_path(host_target)
- swiftc = os.path.join(toolchain_path, "bin", "swiftc")
+ if os.getenv("HOST_SWIFTC"):
+ swiftc = os.getenv("HOST_SWIFTC")
+ else:
2020-09-07 18:23:03 +02:00
+ toolchain_path = self.install_toolchain_path(host_target)
+ swiftc = os.path.join(toolchain_path, "bin", "swiftc")
# FIXME: We require llbuild build directory in order to build. Is
# there a better way to get this?
2020-09-07 18:23:03 +02:00
@@ -83,7 +86,7 @@ class SwiftPM(product.Product):
@classmethod
def get_install_destdir(self, args, host_target, build_dir):
install_destdir = args.install_destdir
- if self.has_cross_compile_hosts(args):
+ if self.has_cross_compile_hosts(args) and not os.getenv("HOST_SWIFTC"):
build_root = os.path.dirname(build_dir)
install_destdir = '%s/intermediate-install/%s' % (build_root, host_target)
return install_destdir