Skip to content

Commit

Permalink
swift: update from 5.9.1 to 5.10 Nov 4 snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
finagolfin committed Nov 8, 2023
1 parent 1d3be9c commit c65be29
Show file tree
Hide file tree
Showing 16 changed files with 6,762 additions and 7,121 deletions.
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-11-04-a.tar.gz
TERMUX_PKG_SHA256=cfa2e737c6f03327fa1eb299eeea06414fac8f015bc463ef65613fadfe58456a
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-11-04-a.tar.gz
TERMUX_PKG_SHA256=32647a012b13c1240cbc2c5d44f4dbbb9354ba873918fd23105a70b9276982de
TERMUX_PKG_DEPENDS="libc++, libandroid-spawn, libsqlite"
TERMUX_PKG_NO_STATICSPLIT=true
54 changes: 27 additions & 27 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-04-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=275512ab4951508bfb145f0f44530184dfdf427a2b66404d197c00040eb1ab2f
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[swift-collections]=575cf0f88d9068411f9acc6e3ca5d542bef1cc9e87dc5d69f7b5a1d5aec8c6b6
library_checksums[swift-crypto]=a7b2f5c4887ccd728cdff5d1162b4d4d36bd6c2df9c0c31d5b9b73d341c5c1bb
library_checksums[swift-corelibs-foundation]=8d02be046c341068f5350f383022a73cebcf5d612707c5af54bfb397fec52a32
library_checksums[swift-crypto]=5c860c0306d0393ff06268f361aaf958656e1288353a0e23c3ad20de04319154
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]=e0da995ae53e6fcf8251887f44d4030f6600e2f8f8451d9c92fcaf52b41b6c35
library_checksums[llvm-project]=a38de0e14f1db518c3894bda38f379e115f63c5238035248d6a58f087f91d457
library_checksums[swift-corelibs-libdispatch]=cfa2e737c6f03327fa1eb299eeea06414fac8f015bc463ef65613fadfe58456a
library_checksums[swift-tools-support-core]=d9c20c79c6b88432709980ae3c233e1c802cd9442e7985fdfa0d4198195f94ab
library_checksums[swift-collections]=575cf0f88d9068411f9acc6e3ca5d542bef1cc9e87dc5d69f7b5a1d5aec8c6b6
library_checksums[swift-driver]=4ade6dabfe34a35d2d0c105624770fe673958c05f4d7cf8f027431057d436fd5
library_checksums[swift-experimental-string-processing]=722b8c986e2fa747770aebd58e7fc75960e6c3a9dd2290ec340c20e4e5980e35
library_checksums[swift-package-manager]=245463052db1baadd743dd8f0a702ce1fcde454a2468dc536038245a4cc3b784
library_checksums[swift-cmark]=e51593a706e8e1e2beb2845bd73d94da21d469356d403a0f85a5ca162ff8af77
library_checksums[swift-argument-parser]=4a10bbef290a2167c5cc340b39f1f7ff6a8cf4e1b5433b68548bf5f1e542e908
library_checksums[sourcekit-lsp]=9d9522116551cb39e3c7c5b8b14d746f440b141ed2d931b0b6cafceb2dc4fbb9
library_checksums[indexstore-db]=5a0b99708c67ccab74f8a0e3cb43de613b8ac0af13f949518394f57e5be537e2
library_checksums[swift-syntax]=92e3f373cf323dc3342da26cf49af2c0e8c6b0f17bbed8109296d1372b240077
library_checksums[swift-corelibs-xctest]=af6c374cbbe88de5775bf3803874dbf6165d48e1a5ac0b95a04805e929b2d63c
library_checksums[swift-llbuild]=32647a012b13c1240cbc2c5d44f4dbbb9354ba873918fd23105a70b9276982de
library_checksums[swift-certificates]=fcaca458aab45ee69b0f678b72c2194b15664cc5f6f5e48d0e3f62bc5d1202ca
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 c65be29

Please sign in to comment.