swift: update from 5.4.1 to 5.4.2
This commit is contained in:
parent
924a018169
commit
9a137331fe
@ -2,11 +2,10 @@ TERMUX_PKG_HOMEPAGE=https://swift.org/
|
|||||||
TERMUX_PKG_DESCRIPTION="Swift is a high-performance system programming language"
|
TERMUX_PKG_DESCRIPTION="Swift is a high-performance system programming language"
|
||||||
TERMUX_PKG_LICENSE="Apache-2.0, NCSA"
|
TERMUX_PKG_LICENSE="Apache-2.0, NCSA"
|
||||||
TERMUX_PKG_MAINTAINER="@buttaface"
|
TERMUX_PKG_MAINTAINER="@buttaface"
|
||||||
TERMUX_PKG_VERSION=5.4.1
|
TERMUX_PKG_VERSION=5.4.2
|
||||||
TERMUX_PKG_REVISION=2
|
|
||||||
SWIFT_RELEASE="RELEASE"
|
SWIFT_RELEASE="RELEASE"
|
||||||
TERMUX_PKG_SRCURL=https://github.com/apple/swift/archive/swift-$TERMUX_PKG_VERSION-$SWIFT_RELEASE.tar.gz
|
TERMUX_PKG_SRCURL=https://github.com/apple/swift/archive/swift-$TERMUX_PKG_VERSION-$SWIFT_RELEASE.tar.gz
|
||||||
TERMUX_PKG_SHA256=9634b9424cf8b4162e7bb7da44c475081019b1bce6b9f9d958b4780acfc0de85
|
TERMUX_PKG_SHA256=df36ef943e0759b602d36d538e0f19db60a1b56b01f6b8bff2564313f665a183
|
||||||
TERMUX_PKG_HOSTBUILD=true
|
TERMUX_PKG_HOSTBUILD=true
|
||||||
TERMUX_PKG_DEPENDS="binutils-gold, clang, libc++, ndk-sysroot, libandroid-glob, libandroid-spawn, libcurl, libicu, libicu-static, libsqlite, libuuid, libxml2, libdispatch, llbuild"
|
TERMUX_PKG_DEPENDS="binutils-gold, clang, libc++, ndk-sysroot, libandroid-glob, libandroid-spawn, libcurl, libicu, libicu-static, libsqlite, libuuid, libxml2, libdispatch, llbuild"
|
||||||
TERMUX_PKG_BUILD_DEPENDS="cmake, ninja, perl, pkg-config, rsync"
|
TERMUX_PKG_BUILD_DEPENDS="cmake, ninja, perl, pkg-config, rsync"
|
||||||
@ -20,7 +19,7 @@ SWIFT_BUILD_FLAGS="$SWIFT_TOOLCHAIN_FLAGS $SWIFT_PATH_FLAGS"
|
|||||||
|
|
||||||
if [ "$TERMUX_ON_DEVICE_BUILD" = "false" ]; then
|
if [ "$TERMUX_ON_DEVICE_BUILD" = "false" ]; then
|
||||||
SWIFT_BIN="swift-$TERMUX_PKG_VERSION-$SWIFT_RELEASE-ubuntu20.04"
|
SWIFT_BIN="swift-$TERMUX_PKG_VERSION-$SWIFT_RELEASE-ubuntu20.04"
|
||||||
export SWIFT_BINDIR="$TERMUX_PKG_HOSTBUILD_DIR/$SWIFT_BIN/usr/bin"
|
SWIFT_BINDIR="$TERMUX_PKG_HOSTBUILD_DIR/$SWIFT_BIN/usr/bin"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
termux_step_post_get_source() {
|
termux_step_post_get_source() {
|
||||||
@ -32,17 +31,17 @@ termux_step_post_get_source() {
|
|||||||
mv .temp swift
|
mv .temp swift
|
||||||
|
|
||||||
declare -A library_checksums
|
declare -A library_checksums
|
||||||
library_checksums[swift-cmark]=2fc256d5c36915634f59accc55dd478cd10d18c7ba680e9df7cbb905188b3de3
|
library_checksums[swift-cmark]=d1c2d9728667a563e9420c608ef4fcde749a86e38ee373e8b109bce5eb94510d
|
||||||
library_checksums[llvm-project]=1afc3ca829031b3b5df58dc593cbe5cfac5b1044c1d9bc35ed1d3ed0cc093d03
|
library_checksums[llvm-project]=50401b5b696292ccf6dc11f59f34f8958fdc0097c7d4db9cd862a4622ee1676a
|
||||||
library_checksums[swift-corelibs-libdispatch]=2435395ac2f572fccd996b0ea6a6a467301c05387cdd8db2edfd6a0055807dcc
|
library_checksums[swift-corelibs-libdispatch]=84602423596712a1fd0d866d640af0c2de56c52ea03c95864af900a55945ef37
|
||||||
library_checksums[swift-corelibs-foundation]=92b351d5b10b9c663137cdb608719f34ff919c9abfb8515d868f25b392d42cf6
|
library_checksums[swift-corelibs-foundation]=38e15b60188a4240fe71b9ca6e9409d423d342896102ac957db42d7fa8b4ad23
|
||||||
library_checksums[swift-corelibs-xctest]=4215e1a00302dcec907033754735db9a7e9849767ebacf759ca6ff3e36f8b11d
|
library_checksums[swift-corelibs-xctest]=5e0bede769b0869e65d2626a3bfdab09faf99dfe48366a37e5c72dc3b7dc9287
|
||||||
library_checksums[swift-llbuild]=77dcf01c0b9351aba50f6ad9448dd8e1ad03d53e14c90b62c602616fd3adb0a1
|
library_checksums[swift-llbuild]=d5562e63fd68f6fcd64c60820a1be0142592a2742c71c1c6fe673f34854ac599
|
||||||
library_checksums[swift-argument-parser]=6743338612be50a5a32127df0a3dd1c34e695f5071b1213f128e6e2b27c4364a
|
library_checksums[swift-argument-parser]=6743338612be50a5a32127df0a3dd1c34e695f5071b1213f128e6e2b27c4364a
|
||||||
library_checksums[Yams]=8bbb28ef994f60afe54668093d652e4d40831c79885fa92b1c2cd0e17e26735a
|
library_checksums[Yams]=8bbb28ef994f60afe54668093d652e4d40831c79885fa92b1c2cd0e17e26735a
|
||||||
library_checksums[swift-driver]=904b4f03ee68f8c022919e77c83cc263df0366a42fe6da6801531756b196bc56
|
library_checksums[swift-driver]=9907e6d41236cf543a43a89b5ff67b6cb12474692f96069908d4b6f92b617518
|
||||||
library_checksums[swift-tools-support-core]=fa41540de20c9f8508b357040666a5a0a5bd6b280204321f5367b3af35aa9586
|
library_checksums[swift-tools-support-core]=a4bc991cf601fe0f45edc7d0a6248f1a19def4d149b3e86b37361f34b0ecbd2c
|
||||||
library_checksums[swift-package-manager]=36ed5dd26b71e7aec0cac2ae7c6624cc4b4c1fb313c68e03b4c8f6051ab5edc2
|
library_checksums[swift-package-manager]=3648d7cbf74a2ad69b444d78b53e278541b1bd0e4e54fb1b8bc9002596bbaf4b
|
||||||
|
|
||||||
for library in "${!library_checksums[@]}"; do \
|
for library in "${!library_checksums[@]}"; do \
|
||||||
if [ "$library" = "swift-argument-parser" ]; then
|
if [ "$library" = "swift-argument-parser" ]; then
|
||||||
@ -76,7 +75,7 @@ termux_step_post_get_source() {
|
|||||||
termux_download \
|
termux_download \
|
||||||
https://swift.org/builds/swift-$TERMUX_PKG_VERSION-release/ubuntu2004/swift-$TERMUX_PKG_VERSION-$SWIFT_RELEASE/$SWIFT_BIN.tar.gz \
|
https://swift.org/builds/swift-$TERMUX_PKG_VERSION-release/ubuntu2004/swift-$TERMUX_PKG_VERSION-$SWIFT_RELEASE/$SWIFT_BIN.tar.gz \
|
||||||
$TERMUX_PKG_CACHEDIR/$SWIFT_BIN.tar.gz \
|
$TERMUX_PKG_CACHEDIR/$SWIFT_BIN.tar.gz \
|
||||||
2bc30169bd8a761a88b6ae2fb5bb7854f800e5dea7ff116d903347290d6b61f7
|
86b849d9f6ba2eda4e12ea5eafaa0748bffcd6272466b514c2b0fd4a829c63a4
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
# The Swift compiler searches for the clang headers so symlink against them.
|
# The Swift compiler searches for the clang headers so symlink against them.
|
||||||
@ -89,24 +88,14 @@ termux_step_host_build() {
|
|||||||
termux_setup_ninja
|
termux_setup_ninja
|
||||||
termux_setup_standalone_toolchain
|
termux_setup_standalone_toolchain
|
||||||
|
|
||||||
local SKIP_BUILD=
|
|
||||||
test $TERMUX_ARCH != 'arm' && SKIP_BUILD="--skip-build-cmark --skip-build-llvm --skip-build-swift"
|
|
||||||
|
|
||||||
# Natively compile llvm-tblgen and some other files needed later.
|
# Natively compile llvm-tblgen and some other files needed later.
|
||||||
SWIFT_BUILD_ROOT=$TERMUX_PKG_BUILDDIR $TERMUX_PKG_SRCDIR/swift/utils/build-script \
|
SWIFT_BUILD_ROOT=$TERMUX_PKG_BUILDDIR $TERMUX_PKG_SRCDIR/swift/utils/build-script \
|
||||||
-R --no-assertions -j $TERMUX_MAKE_PROCESSES --build-subdir=. \
|
-R --no-assertions -j $TERMUX_MAKE_PROCESSES $SWIFT_PATH_FLAGS \
|
||||||
$SKIP_BUILD --build-toolchain-only \
|
--skip-build-cmark --skip-build-llvm --skip-build-swift --build-toolchain-only \
|
||||||
--host-cc=$TERMUX_STANDALONE_TOOLCHAIN/bin/clang \
|
--host-cc=$TERMUX_STANDALONE_TOOLCHAIN/bin/clang \
|
||||||
--host-cxx=$TERMUX_STANDALONE_TOOLCHAIN/bin/clang++
|
--host-cxx=$TERMUX_STANDALONE_TOOLCHAIN/bin/clang++
|
||||||
|
|
||||||
tar xf $TERMUX_PKG_CACHEDIR/$SWIFT_BIN.tar.gz -C $TERMUX_PKG_HOSTBUILD_DIR
|
tar xf $TERMUX_PKG_CACHEDIR/$SWIFT_BIN.tar.gz -C $TERMUX_PKG_HOSTBUILD_DIR
|
||||||
if [ "$TERMUX_ARCH" == "arm" ]; then
|
|
||||||
rm $TERMUX_PKG_BUILDDIR/swift-linux-x86_64/lib/swift/FrameworkABIBaseline
|
|
||||||
rm -rf $TERMUX_PKG_BUILDDIR/swift-linux-x86_64/lib/swift/migrator
|
|
||||||
cp -r $SWIFT_BIN/usr/lib/swift $TERMUX_PKG_BUILDDIR/swift-linux-x86_64/lib
|
|
||||||
ln -sf $SWIFT_BINDIR/../lib/clang/10.0.0 $TERMUX_PKG_BUILDDIR/swift-linux-x86_64/lib/swift/clang
|
|
||||||
patchelf --set-rpath \$ORIGIN $TERMUX_PKG_BUILDDIR/swift-linux-x86_64/lib/swift/linux/libicu{uc,i18n}swift.so.65.1
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,9 +129,6 @@ termux_step_pre_configure() {
|
|||||||
|
|
||||||
termux_step_make() {
|
termux_step_make() {
|
||||||
if [ "$TERMUX_ON_DEVICE_BUILD" = "false" ]; then
|
if [ "$TERMUX_ON_DEVICE_BUILD" = "false" ]; then
|
||||||
local SWIFT_TOOLCHAIN=
|
|
||||||
test $SWIFT_ARCH != 'armv7' && SWIFT_TOOLCHAIN="--native-swift-tools-path=$SWIFT_BINDIR"
|
|
||||||
|
|
||||||
SWIFT_BUILD_FLAGS="$SWIFT_BUILD_FLAGS --android
|
SWIFT_BUILD_FLAGS="$SWIFT_BUILD_FLAGS --android
|
||||||
--android-ndk $TERMUX_STANDALONE_TOOLCHAIN --android-arch $SWIFT_ARCH
|
--android-ndk $TERMUX_STANDALONE_TOOLCHAIN --android-arch $SWIFT_ARCH
|
||||||
--android-icu-uc $TERMUX_PREFIX/lib/libicuuc.so
|
--android-icu-uc $TERMUX_PREFIX/lib/libicuuc.so
|
||||||
@ -152,7 +138,7 @@ termux_step_make() {
|
|||||||
--android-icu-data $TERMUX_PREFIX/lib/libicudata.so --build-toolchain-only
|
--android-icu-data $TERMUX_PREFIX/lib/libicudata.so --build-toolchain-only
|
||||||
--skip-local-build --skip-local-host-install
|
--skip-local-build --skip-local-host-install
|
||||||
--cross-compile-hosts=android-$SWIFT_ARCH --cross-compile-deps-path=$TERMUX_PREFIX
|
--cross-compile-hosts=android-$SWIFT_ARCH --cross-compile-deps-path=$TERMUX_PREFIX
|
||||||
$SWIFT_TOOLCHAIN
|
--native-swift-tools-path=$SWIFT_BINDIR
|
||||||
--native-clang-tools-path=$TERMUX_STANDALONE_TOOLCHAIN/bin"
|
--native-clang-tools-path=$TERMUX_STANDALONE_TOOLCHAIN/bin"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
From 74fce8307c37ed2990b5ee1a8fe63e24195a4ae2
|
|
||||||
From: Dario Rexin <drexin@apple.com>
|
|
||||||
Date: Tue, 30 Mar 2021 13:36:08 -0700
|
|
||||||
Subject: [PATCH] [IRGen] Disable pre-specialization for 32-bit ARM on Linux
|
|
||||||
|
|
||||||
This is a temporary workaround for segfaults we observed in TargetMetadata,
|
|
||||||
caused by invalid pointers.
|
|
||||||
|
|
||||||
diff --git a/swift/lib/IRGen/IRGenModule.cpp b/swift/lib/IRGen/IRGenModule.cpp
|
|
||||||
index b36302a16c0be..b1ede0772218d 100644
|
|
||||||
--- a/swift/lib/IRGen/IRGenModule.cpp
|
|
||||||
+++ b/swift/lib/IRGen/IRGenModule.cpp
|
|
||||||
@@ -1641,7 +1641,8 @@ bool IRGenModule::useDllStorage() { return ::useDllStorage(Triple); }
|
|
||||||
|
|
||||||
bool IRGenModule::shouldPrespecializeGenericMetadata() {
|
|
||||||
auto canPrespecializeTarget =
|
|
||||||
- (Triple.isOSDarwin() || Triple.isTvOS() || Triple.isOSLinux());
|
|
||||||
+ (Triple.isOSDarwin() || Triple.isTvOS() ||
|
|
||||||
+ (Triple.isOSLinux() && !(Triple.isARM() && Triple.isArch32Bit())));
|
|
||||||
if (canPrespecializeTarget && isStandardLibrary()) {
|
|
||||||
return true;
|
|
||||||
}
|
|
@ -48,16 +48,6 @@ index 25e982e23f..3127069e19 100644
|
|||||||
|
|
||||||
|
|
||||||
class SwiftPM(product.Product):
|
class SwiftPM(product.Product):
|
||||||
@@ -43,6 +44,9 @@ class SwiftPM(product.Product):
|
|
||||||
toolchain_path = self.install_toolchain_path(host_target)
|
|
||||||
swiftc = os.path.join(toolchain_path, "bin", "swiftc")
|
|
||||||
|
|
||||||
+ if host_target == 'android-armv7':
|
|
||||||
+ swiftc = os.path.join(os.path.dirname(self.build_dir), '%s-%s' % ("swift", self.args.host_target), "bin", "swiftc")
|
|
||||||
+
|
|
||||||
# FIXME: We require llbuild build directory in order to build. Is
|
|
||||||
# there a better way to get this?
|
|
||||||
build_root = os.path.dirname(self.build_dir)
|
|
||||||
@@ -88,9 +89,18 @@ class SwiftPM(product.Product):
|
@@ -88,9 +89,18 @@ class SwiftPM(product.Product):
|
||||||
|
|
||||||
# Pass Cross compile host info
|
# Pass Cross compile host info
|
||||||
|
@ -12,7 +12,7 @@ index ead6af68..95a8427f 100755
|
|||||||
|
|
||||||
def add_test_args(parser):
|
def add_test_args(parser):
|
||||||
"""Configures the parser with the arguments necessary for the test action."""
|
"""Configures the parser with the arguments necessary for the test action."""
|
||||||
@@ -195,15 +198,19 @@ def parse_build_args(args):
|
@@ -195,8 +198,12 @@ def parse_build_args(args):
|
||||||
args.clang_path = get_clang_path(args)
|
args.clang_path = get_clang_path(args)
|
||||||
args.cmake_path = get_cmake_path(args)
|
args.cmake_path = get_cmake_path(args)
|
||||||
args.ninja_path = get_ninja_path(args)
|
args.ninja_path = get_ninja_path(args)
|
||||||
@ -27,15 +27,6 @@ index ead6af68..95a8427f 100755
|
|||||||
else:
|
else:
|
||||||
args.target_dir = os.path.join(args.build_dir, get_build_target(args))
|
args.target_dir = os.path.join(args.build_dir, get_build_target(args))
|
||||||
args.bootstrap_dir = os.path.join(args.target_dir, "bootstrap")
|
args.bootstrap_dir = os.path.join(args.target_dir, "bootstrap")
|
||||||
args.conf = 'release' if args.release else 'debug'
|
|
||||||
args.bin_dir = os.path.join(args.target_dir, args.conf)
|
|
||||||
- args.bootstrap = not args.skip_cmake_bootstrap or \
|
|
||||||
- not os.path.exists(os.path.join(os.path.split(args.swiftc_path)[0], "swift-build"))
|
|
||||||
+ args.bootstrap = not args.skip_cmake_bootstrap # or \
|
|
||||||
+# not os.path.exists(os.path.join(os.path.split(args.swiftc_path)[0], "swift-build"))
|
|
||||||
|
|
||||||
def parse_test_args(args):
|
|
||||||
"""Parses and cleans arguments necessary for the test action."""
|
|
||||||
@@ -270,10 +277,13 @@ def get_ninja_path(args):
|
@@ -270,10 +277,13 @@ def get_ninja_path(args):
|
||||||
else:
|
else:
|
||||||
return call_output(["which", "ninja"], verbose=args.verbose)
|
return call_output(["which", "ninja"], verbose=args.verbose)
|
||||||
@ -135,18 +126,6 @@ index ead6af68..95a8427f 100755
|
|||||||
|
|
||||||
if args.llbuild_link_framework:
|
if args.llbuild_link_framework:
|
||||||
add_rpath_for_cmake_build(args, args.llbuild_build_dir)
|
add_rpath_for_cmake_build(args, args.llbuild_build_dir)
|
||||||
@@ -610,7 +610,10 @@ def build_swiftpm_with_swiftpm(args, integrated_swift_driver):
|
|
||||||
swiftpm_args.append(os.path.join(args.bootstrap_dir, "bin/swift-build"))
|
|
||||||
else:
|
|
||||||
note("Building SwiftPM (with a prebuilt swift-build)")
|
|
||||||
- swiftpm_args.append(os.path.join(os.path.split(args.swiftc_path)[0], "swift-build"))
|
|
||||||
+ if re.match('android-armv7', args.cross_compile_hosts):
|
|
||||||
+ swiftpm_args.append(os.path.join(os.path.realpath(os.getenv("SWIFT_BINDIR")), "swift-build"))
|
|
||||||
+ else:
|
|
||||||
+ swiftpm_args.append(os.path.join(os.path.split(args.swiftc_path)[0], "swift-build"))
|
|
||||||
|
|
||||||
swiftpm_args.append("--disable-sandbox")
|
|
||||||
|
|
||||||
@@ -763,8 +788,10 @@ def get_swiftpm_flags(args):
|
@@ -763,8 +788,10 @@ def get_swiftpm_flags(args):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -126,7 +126,6 @@ PACKAGES+=" zlib1g-dev:i386"
|
|||||||
|
|
||||||
# For swift.
|
# For swift.
|
||||||
PACKAGES+=" lld"
|
PACKAGES+=" lld"
|
||||||
PACKAGES+=" patchelf"
|
|
||||||
|
|
||||||
# Needed by wrk.
|
# Needed by wrk.
|
||||||
PACKAGES+=" luajit"
|
PACKAGES+=" luajit"
|
||||||
|
Loading…
Reference in New Issue
Block a user