Commit Graph

322 Commits

Author SHA1 Message Date
Doug Gregor
46572f80a2 Merge pull request #82661 from DougGregor/back-deploy-main-actor-isolated-deinit
[SE-0371] Back-deploy support for main-actor-isolated deinit
2025-07-01 20:50:19 -07:00
Eric Miotto
5246be53c7 Merge pull request #82571 from edymtt/edymtt/nested-swiftmodule-structure-before-cmake-4.1
[Runtimes] lay down nested swift modules ahead of CMake 4.1
2025-07-01 09:27:20 -07:00
Doug Gregor
f736677022 Switch to the appropriate C calling convention for pthread_main_np 2025-07-01 08:15:54 -07:00
Saleem Abdulrasool
87b0ca4cc7 Merge pull request #82577 from compnerd/linkage
Runtimes: adjust the linking to `_Concurrency`
2025-07-01 08:08:43 -07:00
Saleem Abdulrasool
a654df7caa Merge pull request #82578 from compnerd/isolation
Runtimes: avoid ODR violations in _Concurrency
2025-06-30 14:07:21 -07:00
Eric Miotto
111cfe24e2 [Runtimes][Supplemental] lay down nested swift modules ahead of CMake 4.1
This is needed in order to build target variants properly with a
SwiftDriver that has swiftlang/swift-driver#1856

Addresses rdar://154410676
2025-06-30 06:53:51 -07:00
Eric Miotto
5a39093e95 [Runtimes][Overlay] lay down nested swift modules ahead of CMake 4.1
This is needed in order to build target variants properly with a
SwiftDriver that has swiftlang/swift-driver#1856

Addresses rdar://154410676
2025-06-30 06:52:00 -07:00
Saleem Abdulrasool
9a8115223f Merge pull request #82576 from compnerd/interfaces
Runtimes: add interface include directories for _Concurrency
2025-06-29 18:56:55 -07:00
Eric Miotto
bf32bf54f3 [Runtimes][SwiftCore] lay down nested swift modules ahead of CMake 4.1
This is needed in order to build target variants properly with a
SwiftDriver that has https://github.com/swiftlang/swift-driver/pull/1856

Addresses rdar://154410676
2025-06-27 16:10:03 -07:00
Justice Adams
9bfb68035d [cmake] [Synchronization] disable autolinking concurrency and older runtimes (#82385)
Disable autolinking concurrency and older runtimes as part of the
Synchronization since they aren't needed
2025-06-27 14:35:22 -07:00
Saleem Abdulrasool
3f80226786 Runtimes: adjust the linking to _Concurrency
`_Concurrency` is being implicitly imported and then linked into the
runtime. Disable the implicit import of the concurrency runtime to allow
proper control over the linkage for the library.
2025-06-27 14:05:51 -07:00
Saleem Abdulrasool
3ae4ffe400 Runtimes: avoid ODR violations in _Concurrency
When building the standard libraries with the LLVM ADT types, we use the
local definition which have been modified to avoid ODR violations.
However, due to the intermingling of the compiler and runtime
implementations, we cannot isolate the headers properly to ensure that
the right definition is used. We need to ensure that we pass along
`SWIFT_RUNTIME` when processing headers to avoid references to the
unsafe references to the LLVM Support library.
2025-06-27 13:03:19 -07:00
Saleem Abdulrasool
e2f318a76b Runtimes: add interface include directories for _Concurrency
Ensure that the _Concurrency module is properly made available to the
users who link against it.
2025-06-27 13:02:08 -07:00
Eric Miotto
4686897dd3 Merge pull request #82035 from edymtt/edymtt/refactor-findswiftcore
[Runtimes][CMake] Refactor FindSwiftCore to put focus on targets...
2025-06-26 06:55:59 -07:00
Alastair Houghton
f7f4a19baf Merge pull request #82417 from al45tair/eng/PR-153531418
[Concurrency] Rename Dummy(Main|Task)Executor.
2025-06-26 10:53:57 +01:00
Alastair Houghton
a1daea92ed [Build][Concurrency] Update new runtime build as well.
We need to update the new runtime build with the filename change also.

rdar://153531418
2025-06-23 18:31:05 +01:00
Saleem Abdulrasool
104eb77272 Runtimes: adjust for incorrect Android behaviour
The runtime mixes `swift` and `swift_static` SDK layouts when building
Swift code on Android. The overlay is always referenced in `swift` and
never from `swift_static`. Adjust the layout to match the driver.
2025-06-23 08:40:43 -07:00
Eric Miotto
4efbe16a6b [Runtimes][CMake] Refactor FindSwiftCore to put focus on targets...
...instead of platforms.

Notable changes/flags:
* Append to variables controlling paths and names, to allow for user
  configuration
* add `SwiftCore_USE_STATIC_LIBS` to generate static archives
* use PlatformInfo variables to get the platform and arch subfolders
  (where appropriate)
* add include guards to ensure PlatformInfo and FindSwiftCore are
    included once in a project
* search for the appropriate static or import library under Windows

Addresses rdar://152838903
2025-06-17 15:39:16 -07:00
Evan Wilde
d34347876d SwiftCore: Cache computed platform info
Implements a similar caching mechanism to what CMake uses for detecting
the compiler. The file is created based on the computed values and
allows us to avoid calling the compiler if we aren't going to extract
out any platform info.
2025-06-09 18:01:56 -07:00
Saleem Abdulrasool
6c9a8b4033 Merge pull request #82072 from compnerd/pre-special
Runtimes: allow enabling prespecialization and library evolution
2025-06-07 14:55:15 -07:00
Evan Wilde
93603987dd Move availability args to response file
The availability flags keep increasing the number of characters on the
command line overflowing the maximum character length on Windows and
making the commands harder to read. This patch moves the generated
arguments into a separate response file so that they can continue to
grow without running into argument length limitations.
2025-06-06 16:58:12 -07:00
Saleem Abdulrasool
be13a2ed87 Runtimes: allow enabling prespecialization and library evolution
Adjust the StringProcessing module to follow the defaults of SwiftCore
with regards to generic metadata prespecialization and the library
evolution modes.
2025-06-06 14:41:32 -07:00
Justice Adams
ecad1d9da1 [cmake] add SINGLE_THREADED_MODE option to Synchronization (#81980)
Add `SwiftSynchronization_ SINGLE_THREADED_MODE` flag to use
empty mutex definition for certain apple platforms. This brings
Synchronization in line with the current build systems functionality

We will revisit this in the future to determine if we can add a mutex
definition for all Darwin platforms
2025-06-04 16:33:55 -07:00
Alastair Houghton
726aaf710f Merge pull request #81940 from al45tair/eng/PR-152498657
Rename SwiftStdlibCurrentOS to StdlibDeploymentTarget.
2025-06-04 17:27:49 +01:00
Alastair Houghton
42ca1b1cc8 Rename SwiftStdlibCurrentOS to StdlibDeploymentTarget.
`StdlibDeploymentTarget` seems to be a better name.

rdar://152498657
2025-06-04 10:40:19 +01:00
Saleem Abdulrasool
75b3fdd121 Merge pull request #81926 from compnerd/android-supplements
Runtimes: repair the Supplemental runtime on Android
2025-06-03 14:31:37 -07:00
Saleem Abdulrasool
3d0d95bfe3 Merge pull request #81927 from compnerd/this-reflects-poorly
runtimes: enable reflection by default on ELFish targets
2025-06-03 13:31:47 -07:00
Saleem Abdulrasool
b7151477e3 Merge pull request #81920 from compnerd/search-party
runtimes: add Android search handling for SwiftCore
2025-06-03 13:31:31 -07:00
Alastair Houghton
d5ed335339 Merge pull request #81440 from al45tair/currentos-availability
[Concurrency][Stdlib] Add SwiftStdlibCurrentOS availability, use it.
2025-06-03 15:01:22 +01:00
Saleem Abdulrasool
447b50d573 runtimes: enable reflection by default on ELFish targets
We need reflection enabled as swift-collections uses this which is
required for Foundation. Adjust the defaults to allow building
Foundation for Android again.
2025-06-02 20:12:08 -07:00
Saleem Abdulrasool
08d522a643 Runtimes: repair the Supplemental runtime on Android
Adjust the build rules to account for Android which is a separate
platform from Linux.
2025-06-02 20:03:20 -07:00
Guillaume Lessard
db7881ef2c [cmake] InoutLifetimeDependence should be enabled
Addresses rdar://152467655
2025-06-02 18:55:13 -07:00
Saleem Abdulrasool
ce681898b3 runtimes: add Android search handling for SwiftCore
This updates the search handling to account for Android SDK searches on
Windows. This is required to repair the nightly builds.
2025-06-02 17:36:18 -07:00
Alastair Houghton
467f401ef1 [Build] Fix availability platform macros.
These need to be defined always; we'll set them to "unknown" and "none"
respectively if they end up being something we don't understand.

rdar://150966361
2025-06-02 11:30:31 +01:00
Justice Adams
e493bb5033 [cmake] tweak Synchronization compile flags (#81847)
Adding compiler flags which were missing when comparing the old build to
the new build
2025-05-30 09:41:33 -05:00
Alastair Houghton
d110464649 [Build] Fix macos vs macosx issue.
The module triple bizarrely omits the "x" from "macosx".

Also disable some of this code on non-Apple platforms.

rdar://150944675
2025-05-29 18:18:44 +01:00
Alastair Houghton
7e318e2c91 [Build] Use FATAL_ERROR, not ERROR.
We should be using `FATAL_ERROR` for error messages from CMake, not
just `ERROR`.
2025-05-28 14:55:49 +01:00
Alastair Houghton
c749e64f93 [Build] Fix variable name in new build system.
It should have been `SwiftCore_MODULE_TRIPLE`, not
`SwiftCore_SWIFT_MODULE_TRIPLE`.
2025-05-28 14:49:42 +01:00
Konrad `ktoso` Malawski
31b6ae2fcf Merge pull request #80984 from ktoso/task-names-update
[Concurrency][SE-review update] Task names update
2025-05-28 06:23:49 +09:00
Stephen Canon
592d72bba9 Concrete SIMD.init(repeating:) and SIMD.init(lowHalf:highHalf:) optimizations (#81766)
WIP to add more overloads to optimize SIMD codegen on concrete types.
Here we do:

- init(repeating:)
- init(lowHalf:highHalf:)

These are always inlined, even in debug, since LLVM knows how to lower
them to one or two instructions on the targets that we care about.
2025-05-27 15:15:13 -04:00
Justice Adams
6fee86d156 [cmake] add Synchronization specific cache files (#81618)
Add the cache files relevant for building the Synchronization
supplemental library
2025-05-23 13:42:08 -05:00
Alastair Houghton
cd7701cd82 [Build] Add catalyst support to SwiftStdlibCurrentOS.
Add catalyst support for SwiftStdlibCurrentOS.

Also, set a minimum deployment target when building Concurrency;
this stops the build failing when we're trying to build on older
systems where Concurrency didn't really exist yet.

rdar://150966361
2025-05-23 10:31:56 +01:00
Eric Miotto
794fe00351 Merge pull request #81680 from edymtt/edymtt/fix-target-case-find-swift-core
[Runtimes][CMake] Rename `SwiftCore` target to `swiftCore`
2025-05-22 11:19:15 -07:00
Eric Miotto
58a782b98b [Runtimes][CMake] use config mode first in Supplemental build in CI
In this configuration we want to pull dependencies from the current
build, not from the underlying SDK.

Addresses rdar://151784135
2025-05-21 12:20:13 -07:00
Eric Miotto
64da069187 [Runtimes][CMake] Rename SwiftCore target to swiftCore
This matches the case that we use in the Runtimes build system, so we
rely the exported target instead of adding `-lswiftCore`.

Addresses rdar://151700669
2025-05-21 08:52:15 -07:00
Saleem Abdulrasool
8d15d57253 Merge pull request #81597 from compnerd/objectification
Runtimes: mark CommandLineSupporta as an OBJECT library
2025-05-20 14:12:00 -07:00
Justice Adams
dfa4bf7348 [cmake] include CheckCompilerFlag in CatalystSupport (#81623)
add missing import
2025-05-20 11:33:14 -05:00
Saleem Abdulrasool
028624c30d Runtimes: mark CommandLineSupporta as an OBJECT library
This allows compaction into swiftCore when building mirroring the
beahviour of the old build system. This matters solely when building
with a static library distribution of swiftCore where you would
previously need to explicitly link against the swiftCommandLineSupport
library when building with the new build system.
2025-05-19 17:36:49 -07:00
Saleem Abdulrasool
e79760bbed Merge pull request #81558 from compnerd/synchronise-synchronization
Runtimes: adjust the synchronization module build
2025-05-18 20:00:26 -07:00
Saleem Abdulrasool
0b080ac5b8 Runtimes: adjust the synchronization module build
Disable CMP0157 with the old driver as this breaks on Windows. Adjust
the Windows platform ID spelling to repair the Windows build. Take the
opportunity to re-order some of the structure so that it is similar to
the other modules.
2025-05-16 14:43:21 -07:00