Skip to content

Commit

Permalink
swift: update from 5.9.1 to 5.10 Nov 2 snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
finagolfin committed Nov 2, 2023
1 parent 632362d commit 9d5073f
Show file tree
Hide file tree
Showing 16 changed files with 214 additions and 7,120 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
target_arch: [aarch64, arm, x86_64]
target_arch: [aarch64] #, arm, x86_64]
fail-fast: false
steps:
- name: Clone repository
Expand Down
6 changes: 3 additions & 3 deletions packages/libdispatch/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ TERMUX_PKG_HOMEPAGE=https://github.com/apple/swift-corelibs-libdispatch
TERMUX_PKG_DESCRIPTION="The libdispatch project, for concurrency on multicore hardware"
TERMUX_PKG_LICENSE="Apache-2.0"
TERMUX_PKG_MAINTAINER="@finagolfin"
TERMUX_PKG_VERSION="1:5.9"
TERMUX_PKG_SRCURL=https://github.com/apple/swift-corelibs-libdispatch/archive/swift-${TERMUX_PKG_VERSION:2}-RELEASE.tar.gz
TERMUX_PKG_SHA256=db30ccf6b20963112ab3aad256c2e49a18041a9806cf2f05854fe63a90d688c2
TERMUX_PKG_VERSION="1:5.10"
TERMUX_PKG_SRCURL=https://github.com/apple/swift-corelibs-libdispatch/archive/swift-${TERMUX_PKG_VERSION:2}-DEVELOPMENT-SNAPSHOT-2023-09-04-a.tar.gz
TERMUX_PKG_SHA256=04162d1291cafb588c31106558fa8ea2d0be6ba08b570c19691a8140d7017fee
TERMUX_PKG_AUTO_UPDATE=false
TERMUX_PKG_DEPENDS="libc++, libblocksruntime"
6 changes: 3 additions & 3 deletions packages/llbuild/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ TERMUX_PKG_HOMEPAGE=https://github.com/apple/swift-llbuild
TERMUX_PKG_DESCRIPTION="A low-level build system, used by the Swift Package Manager"
TERMUX_PKG_LICENSE="Apache-2.0, NCSA"
TERMUX_PKG_MAINTAINER="@finagolfin"
TERMUX_PKG_VERSION=5.9
TERMUX_PKG_SRCURL=https://github.com/apple/swift-llbuild/archive/swift-${TERMUX_PKG_VERSION}-RELEASE.tar.gz
TERMUX_PKG_SHA256=cc8dfb098db4b0210ca5466f59d3e5fc55c4eedcd835263e6eae7dd719ba8203
TERMUX_PKG_VERSION=5.10
TERMUX_PKG_SRCURL=https://github.com/apple/swift-llbuild/archive/swift-${TERMUX_PKG_VERSION}-DEVELOPMENT-SNAPSHOT-2023-09-04-a.tar.gz
TERMUX_PKG_SHA256=243ecafee41686ffaf9e0622bcb865dcd4c0f29710196d1cc8bdfe800b309c93
TERMUX_PKG_DEPENDS="libc++, libandroid-spawn, libsqlite"
TERMUX_PKG_NO_STATICSPLIT=true
52 changes: 26 additions & 26 deletions packages/swift/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ TERMUX_PKG_HOMEPAGE=https://swift.org/
TERMUX_PKG_DESCRIPTION="Swift is a high-performance system programming language"
TERMUX_PKG_LICENSE="Apache-2.0, NCSA"
TERMUX_PKG_MAINTAINER="@finagolfin"
TERMUX_PKG_VERSION=5.9.1
SWIFT_RELEASE="RELEASE"
TERMUX_PKG_VERSION=5.10
SWIFT_RELEASE="DEVELOPMENT-SNAPSHOT-2023-11-02-a"
TERMUX_PKG_SRCURL=https://github.com/apple/swift/archive/swift-$TERMUX_PKG_VERSION-$SWIFT_RELEASE.tar.gz
TERMUX_PKG_SHA256=d63c9743fa1d35c8c6203745955375fd69c710897de96d1c6245d2c9e42fbb49
TERMUX_PKG_SHA256=e2c6f738d71bef1a835e7155bdb90ed40f520117e2d40e13f37082815f579942
TERMUX_PKG_AUTO_UPDATE=false
TERMUX_PKG_HOSTBUILD=true
TERMUX_PKG_DEPENDS="clang, libandroid-glob, libandroid-posix-semaphore, libandroid-spawn, libcurl, libicu, libicu-static, libsqlite, libuuid, libxml2, libdispatch, llbuild, pkg-config, swift-sdk-${TERMUX_ARCH/_/-}"
Expand Down Expand Up @@ -35,43 +35,43 @@ termux_step_post_get_source() {
mv .temp swift

declare -A library_checksums
library_checksums[swift-cmark]=33dde8fc9e02a882d2adc79f1b7b77ae6397a66c73262bbdc3b49c53ab823b01
library_checksums[llvm-project]=3cd34ef37dd74a6d4d93be20fb251658e9a1e3c19aeeefd81c027023c485e286
library_checksums[swift-experimental-string-processing]=a01b2f895d49c23a4d322bfd486d4a7dcfeb96760d9c17f2e48b93428220b9ee
library_checksums[swift-syntax]=b2ab10adcfbaebdd56954f724856d6ddd327422b4109d49ec5fb96b92b078003
library_checksums[swift-corelibs-libdispatch]=bcccde91987982dca285a5c73efa0922135b6caca07bc9e5a33333b0aa869db2
library_checksums[swift-corelibs-foundation]=9835efe51b78c329042e32b2b1bd82a0816535ca08687a30c0787091cdd40884
library_checksums[swift-corelibs-xctest]=8d4cbffba2f828033a0074682d1bedd7a55d6410b6a30ca1e7c69917ab9352fe
library_checksums[swift-llbuild]=eeff879bc19de21aed72a747602212dff8ffe25833880c466a44087ffe2ed1ac
library_checksums[swift-argument-parser]=44782ba7180f924f72661b8f457c268929ccd20441eac17301f18eff3b91ce0c
library_checksums[Yams]=ec1ad699c30f0db45520006c63a88cc1c946a7d7b36dff32a96460388c0a4af2
library_checksums[sourcekit-lsp]=0ad88c95df072ff430e72aa7dd2c7de7e60ab0888b8ebd8cff7e773c12257e53
library_checksums[swift-corelibs-xctest]=62c739e130c9682e9461694774990e9a7a8060e71738087cff4fe79fe6226680
library_checksums[swift-corelibs-foundation]=f0a410bb2929a2d8cf5f0ed70dec699e5af358166b370643b3a35b535853ad65
library_checksums[swift-collections]=575cf0f88d9068411f9acc6e3ca5d542bef1cc9e87dc5d69f7b5a1d5aec8c6b6
library_checksums[swift-crypto]=a7b2f5c4887ccd728cdff5d1162b4d4d36bd6c2df9c0c31d5b9b73d341c5c1bb
library_checksums[swift-driver]=5f405e82cdb22709dc15f6a128adf95d1edf88165a5ef1696aea2d6014d13888
library_checksums[swift-argument-parser]=4a10bbef290a2167c5cc340b39f1f7ff6a8cf4e1b5433b68548bf5f1e542e908
library_checksums[swift-syntax]=7d4ffb4368b9df826756da4e7edfa527488e7845aca70a73874ca3b7652b185b
library_checksums[swift-llbuild]=243ecafee41686ffaf9e0622bcb865dcd4c0f29710196d1cc8bdfe800b309c93
library_checksums[swift-corelibs-libdispatch]=04162d1291cafb588c31106558fa8ea2d0be6ba08b570c19691a8140d7017fee
library_checksums[swift-system]=865b8c380455eef27e73109835142920c60ae4c4f4178a3d12ad04acc83f1371
library_checksums[swift-asn1]=d4470d61788194abbd60ed73965ee0722cc25037e83d41226a8a780088ba524e
library_checksums[swift-certificates]=d7699ce91d65a622c1b9aaa0235cbbbd1be4ddc42a90fce007ff74bef50e8985
library_checksums[swift-driver]=4fc7965cd477daf61ff2d5b555007a195dc601e9864ee6d494826a7aa7ff31c7
library_checksums[swift-tools-support-core]=e261dfdfc964a770c545c66267108c77692d06977c0d0bb437498f79ec23365c
library_checksums[swift-package-manager]=8e08b39fd7eb5329539514358d470bd84218a8b4ce53962d7fe3797f51adf59b
library_checksums[indexstore-db]=0789b254455e6f216b8d907ebc8fe5927106ae3a7a099d6478bbb9e6fac9b9fb
library_checksums[sourcekit-lsp]=0fd130c814a35b3ba2b6b6d01979923fd57b3f453d154860ec2f53f9ade38023
library_checksums[swift-asn1]=f02d911cece4daa4b0e71ff1c1884e02dbb210ac2c9758c3fd2449ab79b45f3a
library_checksums[swift-tools-support-core]=189f3204846877c34bc9304ed06ceb2e817fe82b8efab67b3f835acb484bf3df
library_checksums[swift-package-manager]=17b6dd4cbe37ceaf2de583158ba3c34420f4a0d35a2d33723b659911ed4a39da
library_checksums[swift-cmark]=eaefc07e060ef98a022e86fec5152c12b6745bd4f518969c756069a220c5144b
library_checksums[indexstore-db]=7c0e9a11a80c4750459ad902c9379fdd85c4fe9d1a67f9fbff2d5e498e32f930
library_checksums[swift-certificates]=b762df25d82b5f0b95b1e2dfa7b44986455b6daad968cd631d8996d97ad7d604
library_checksums[swift-crypto]=a7b2f5c4887ccd728cdff5d1162b4d4d36bd6c2df9c0c31d5b9b73d341c5c1bb
library_checksums[llvm-project]=a0841f2cf726afd10ebd44eb09cde650b2cb328ee3806fd19535937dbba6c3b5
library_checksums[swift-experimental-string-processing]=420f7706ec3dfa2dbf8f71d46653c701be69f0b6c4af0712d2443100217e412b
library_checksums[Yams]=ec1ad699c30f0db45520006c63a88cc1c946a7d7b36dff32a96460388c0a4af2

for library in "${!library_checksums[@]}"; do \
GH_ORG="apple"
if [ "$library" = "swift-argument-parser" ]; then
SRC_VERSION="1.2.2"
SRC_VERSION="1.2.3"
TAR_NAME=$SRC_VERSION
elif [ "$library" = "swift-asn1" ]; then
SRC_VERSION="0.7.0"
SRC_VERSION="1.0.0"
TAR_NAME=$SRC_VERSION
elif [ "$library" = "swift-certificates" ]; then
SRC_VERSION="0.4.1"
SRC_VERSION="1.0.1"
TAR_NAME=$SRC_VERSION
elif [ "$library" = "swift-collections" ]; then
SRC_VERSION="1.0.1"
TAR_NAME=$SRC_VERSION
elif [ "$library" = "swift-crypto" ]; then
SRC_VERSION="2.5.0"
SRC_VERSION="3.0.0"
TAR_NAME=$SRC_VERSION
elif [ "$library" = "swift-system" ]; then
SRC_VERSION="1.1.1"
Expand Down Expand Up @@ -133,7 +133,7 @@ termux_step_make() {
SWIFT_BUILD_FLAGS="$SWIFT_BUILD_FLAGS --android
--android-ndk $TERMUX_STANDALONE_TOOLCHAIN --android-arch $SWIFT_ARCH
--build-toolchain-only --skip-local-build --skip-local-host-install
--cross-compile-hosts=android-$SWIFT_ARCH --bootstrapping=off
--cross-compile-hosts=android-$SWIFT_ARCH
--cross-compile-deps-path=$(dirname $TERMUX_PREFIX)
--native-swift-tools-path=$SWIFT_BINDIR
--native-clang-tools-path=$SWIFT_BINDIR
Expand Down
140 changes: 111 additions & 29 deletions packages/swift/swift-cmake.patch
Original file line number Diff line number Diff line change
Expand Up @@ -44,27 +44,6 @@ index ac9e0871489d..b495cbfb5c2e 100644
RESULT_VARIABLE had_error
OUTPUT_VARIABLE library_file
)
diff --git a/llvm-project/llvm/cmake/modules/FindTerminfo.cmake b/llvm-project/llvm/cmake/modules/FindTerminfo.cmake
index 65edb80fa6..d02a445021 100644
--- a/llvm-project/llvm/cmake/modules/FindTerminfo.cmake
+++ b/llvm-project/llvm/cmake/modules/FindTerminfo.cmake
@@ -14,15 +14,7 @@
find_library(Terminfo_LIBRARIES NAMES terminfo tinfo curses ncurses ncursesw)

if(Terminfo_LIBRARIES)
- include(CMakePushCheckState)
- include(CheckCSourceCompiles)
- cmake_push_check_state()
- list(APPEND CMAKE_REQUIRED_LIBRARIES ${Terminfo_LIBRARIES})
- check_c_source_compiles("
- int setupterm(char *term, int filedes, int *errret);
- int main() { return setupterm(0, 0, 0); }"
- Terminfo_LINKABLE)
- cmake_pop_check_state()
+ set(Terminfo_LINKABLE 1)
endif()

include(FindPackageHandleStandardArgs)
diff --git a/swift/CMakeLists.txt b/swift/CMakeLists.txt
index b7503ecdd6..c643c2c9a5 100644
--- a/swift/CMakeLists.txt
Expand All @@ -78,7 +57,24 @@ index b7503ecdd6..c643c2c9a5 100644
set(SWIFT_BUILD_HOST_DISPATCH TRUE)
endif()

@@ -976,7 +976,8 @@ if (LLVM_ENABLE_DOXYGEN)
@@ -857,7 +857,7 @@ endif()

if(SWIFT_BUILD_SWIFT_SYNTAX)
# Only "HOSTTOOLS" is supported in Linux when Swift parser integration is enabled.
- if(SWIFT_HOST_VARIANT_SDK MATCHES "LINUX|ANDROID|OPENBSD|FREEBSD" AND NOT BOOTSTRAPPING_MODE STREQUAL "HOSTTOOLS")
+ if(SWIFT_HOST_VARIANT_SDK MATCHES "LINUX|OPENBSD|FREEBSD" AND NOT BOOTSTRAPPING_MODE STREQUAL "HOSTTOOLS")
message(WARNING "Force setting BOOTSTRAPPING=HOSTTOOLS because Swift parser integration is enabled")
set(BOOTSTRAPPING_MODE "HOSTTOOLS")
endif()
@@ -1187,6 +1187,7 @@ if(SWIFT_INCLUDE_TOOLS)
message(STATUS " Assertions: ${LLVM_ENABLE_ASSERTIONS}")
message(STATUS " LTO: ${SWIFT_TOOLS_ENABLE_LTO}")
message(STATUS " Bootstrapping: ${BOOTSTRAPPING_MODE}")
+ message(STATUS " C++ Bridging: ${BRIDGING_MODE}")
message(STATUS " Swift parser: ${SWIFT_BUILD_SWIFT_SYNTAX}")
message(STATUS "")
else()
@@ -1279,7 +1280,8 @@ if (LLVM_ENABLE_DOXYGEN)
message(STATUS "Doxygen: enabled")
endif()

Expand All @@ -88,6 +84,16 @@ index b7503ecdd6..c643c2c9a5 100644
include(Libdispatch)
endif()

@@ -1345,6 +1345,9 @@ if(SWIFT_INCLUDE_TOOLS)
FetchContent_MakeAvailable(SwiftSyntax)
endfunction()
include_swift_syntax()
+ if (NOT "${SWIFT_ANDROID_NDK_PATH}" STREQUAL "")
+ add_dependencies(SwiftSyntax swift-stdlib-android-${SWIFT_HOST_VARIANT_ARCH})
+ endif()

add_subdirectory(lib)

diff --git a/swift/SwiftCompilerSources/CMakeLists.txt b/swift/SwiftCompilerSources/CMakeLists.txt
index f4a2eb2dddc..61a2548cf77 100644
--- a/swift/SwiftCompilerSources/CMakeLists.txt
Expand All @@ -111,6 +117,23 @@ index f4a2eb2dddc..61a2548cf77 100644
endforeach()

# Create a static library containing all module object files.
diff --git a/swift/cmake/modules/AddPureSwift.cmake b/swift/cmake/modules/AddPureSwift.cmake
index dc58b8fa0f6..37e9f817471 100644
--- a/swift/cmake/modules/AddPureSwift.cmake
+++ b/swift/cmake/modules/AddPureSwift.cmake
@@ -44,6 +44,12 @@ function(_add_host_swift_compile_options name)
$<$<COMPILE_LANGUAGE:Swift>:none>)

target_compile_options(${name} PRIVATE $<$<COMPILE_LANGUAGE:Swift>:-target;${SWIFT_HOST_TRIPLE}>)
+ if (NOT "${SWIFT_ANDROID_NDK_PATH}" STREQUAL "")
+ swift_android_tools_path(${SWIFT_HOST_VARIANT_ARCH} tools_path)
+ target_compile_options(${name} PRIVATE $<$<COMPILE_LANGUAGE:Swift>:-resource-dir;${SWIFTLIB_DIR};>
+ $<$<COMPILE_LANGUAGE:Swift>:-sdk;${SWIFT_SDK_ANDROID_ARCH_${SWIFT_HOST_VARIANT_ARCH}_PATH};>
+ $<$<COMPILE_LANGUAGE:Swift>:-tools-directory;${tools_path};>)
+ endif()
_add_host_variant_swift_sanitizer_flags(${name})
endfunction()

diff --git a/swift/cmake/modules/AddSwift.cmake b/swift/cmake/modules/AddSwift.cmake
index a448bcb23c4..0ddbac17a52 100644
--- a/swift/cmake/modules/AddSwift.cmake
Expand All @@ -124,6 +147,16 @@ index a448bcb23c4..0ddbac17a52 100644
set(swiftrt "${host_lib_dir}/${SWIFT_HOST_VARIANT_ARCH}/swiftrt.o")

target_link_libraries(${target} PRIVATE ${swiftrt})
@@ -606,6 +606,9 @@ function(_add_swift_runtime_link_flags target relpath_to_lib_dir bootstrapping)
endif()
endif()
endif()
+ if(SWIFT_HOST_VARIANT_SDK STREQUAL "ANDROID")
+ target_link_options(${target} PRIVATE "SHELL:-Xlinker -z -Xlinker nostart-stop-gc")
+ endif()
endif()

set_property(TARGET ${target} PROPERTY BUILD_WITH_INSTALL_RPATH YES)
diff --git a/swift/localization/CMakeLists.txt b/swift/localization/CMakeLists.txt
index 07a3585a66c..461a98b6856 100644
--- a/swift/localization/CMakeLists.txt
Expand Down Expand Up @@ -236,6 +269,46 @@ index 11cda641cc2..bd2cb152725 100644
compiler
)
+endif()
diff --git a/swift/tools/swift-plugin-server/CMakeLists.txt b/swift/tools/swift-plugin-server/CMakeLists.txt
index a21b79ed260..5b591a30514 100644
--- a/swift/tools/swift-plugin-server/CMakeLists.txt
+++ b/swift/tools/swift-plugin-server/CMakeLists.txt
@@ -1,28 +1,19 @@
if (SWIFT_BUILD_SWIFT_SYNTAX)
- # _swiftCSwiftPluginServer is just a C support library for swift-plugin-server
- # Don't bother to create '.a' for that.
- add_swift_host_library(_swiftCSwiftPluginServer OBJECT
- Sources/CSwiftPluginServer/PluginServer.cpp
- )
- target_link_libraries(_swiftCSwiftPluginServer PRIVATE
- swiftDemangling
+ add_swift_host_tool(swift-plugin-server SWIFT_COMPONENT compiler Sources/CSwiftPluginServer/PluginServer.cpp)
+ add_pure_swift_host_library(SwiftPluginServer STATIC
+ Sources/swift-plugin-server/swift-plugin-server.swift
)
- target_include_directories(_swiftCSwiftPluginServer PUBLIC
+ target_include_directories(SwiftPluginServer PUBLIC
Sources/CSwiftPluginServer/include
)
-
- add_pure_swift_host_tool(swift-plugin-server
- Sources/swift-plugin-server/swift-plugin-server.swift
- DEPENDENCIES
+ target_link_libraries(SwiftPluginServer PRIVATE SwiftCompilerPluginMessageHandling)
+ target_link_libraries(swift-plugin-server PRIVATE
swiftDemangling
- $<TARGET_OBJECTS:_swiftCSwiftPluginServer>
- SWIFT_COMPONENT
- compiler
- SWIFT_DEPENDENCIES
SwiftSyntaxMacros
SwiftSyntaxMacroExpansion
SwiftCompilerPluginMessageHandling
swiftLLVMJSON
+ SwiftPluginServer
)
target_include_directories(swift-plugin-server PRIVATE
Sources/CSwiftPluginServer/include
diff --git a/swift-corelibs-xctest/CMakeLists.txt b/swift-corelibs-xctest/CMakeLists.txt
index 531e7c0..589930f 100644
--- a/swift-corelibs-xctest/CMakeLists.txt
Expand All @@ -248,11 +321,20 @@ index 531e7c0..589930f 100644
endif()
endif()
set_target_properties(XCTest PROPERTIES
@@ -69,7 +69,6 @@ set_target_properties(XCTest PROPERTIES
if(ENABLE_TESTING)
enable_testing()
diff --git a/swift-syntax/cmake/modules/AddSwiftHostLibrary.cmake b/swift-syntax/cmake/modules/AddSwiftHostLibrary.cmake
index 951c2d2e..1157ec66 100644
--- a/swift-syntax/cmake/modules/AddSwiftHostLibrary.cmake
+++ b/swift-syntax/cmake/modules/AddSwiftHostLibrary.cmake
@@ -87,6 +87,12 @@ function(add_swift_syntax_library name)
target_compile_options(${name} PRIVATE
$<$<COMPILE_LANGUAGE:Swift>:-wmo>)
endif()
+ if (NOT "${SWIFT_ANDROID_NDK_PATH}" STREQUAL "")
+ swift_android_tools_path(${SWIFT_HOST_VARIANT_ARCH} tools_path)
+ target_compile_options(${name} PRIVATE $<$<COMPILE_LANGUAGE:Swift>:-resource-dir;${SWIFTLIB_DIR};>
+ $<$<COMPILE_LANGUAGE:Swift>:-sdk;${SWIFT_SDK_ANDROID_ARCH_${SWIFT_HOST_VARIANT_ARCH}_PATH};>
+ $<$<COMPILE_LANGUAGE:Swift>:-tools-directory;${tools_path};>)
+ endif()

- enable_language(C)
find_package(LLVM CONFIG)
if(LLVM_FOUND)
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
if(LLVM_USE_LINKER)
target_link_options(${name} PRIVATE
Loading

0 comments on commit 9d5073f

Please sign in to comment.