Commit Graph

285 Commits

Author SHA1 Message Date
Saleem Abdulrasool
b06eed151c Merge pull request #84124 from compnerd/mirroring
SwiftRemoteMirror: export symbols from the library on Windows
2025-09-05 17:28:57 -07:00
Saleem Abdulrasool
e7992a6b6b SwiftRemoteMirror: export symbols from the library on Windows
When building a shared library on Windows, ensure that we export the
symbols. We would previously export none of the interfaces making the
dynamic library unusable. Simplify the macros as
`swiftRemoteMirror_EXPORTS` would only be defined when building a shared
library.
2025-09-05 08:19:20 -07:00
Evan Wilde
0bebd9d190 CMake: Runtime: Extract runtime version number
This extracts the version number computation out into a separate module
to be shared between the runtimes.
Setting `SWIFT_RUNTIME_VERSION` allows external build orchestration
tools to override the version number specified in source if necessary,
while centralizing the location of the default version number across the
runtime libraries.
2025-09-04 12:27:11 -07:00
Mishal Shah
c75932b89f Merge pull request #83748 from swiftlang/bump-version-6.3
Bump the Swift version to 6.3
2025-09-03 21:18:05 -07:00
Saleem Abdulrasool
185ff12154 Merge pull request #83956 from compnerd/strength
Runtimes: ensure that we strongly resolve all symbols on Linux
2025-08-29 10:52:39 -07:00
Justice Adams
ff3fdd32ee [cmake] Use correct identifier for CFBundleIdentifier (#83960)
Use the associated library name for the `CFBundleIdentifier` within the
plist. This will prevent cases where we have projects with multiple
targets referencing the project name itself (i.e swiftSwiftOnoneSupport
had it's bundle name set to SwiftCore)
2025-08-29 10:28:21 -07:00
Saleem Abdulrasool
bec67c70a7 Runtimes: ensure that we strongly resolve all symbols on Linux
Ensure that there are no undefined symbols at link time to validate that
we fully specified dependencies. This is the default behaviour on
Windows, but ELF targets will simply make any undefined symbols weakly
defined and rely on load time symbolic resolution.
2025-08-27 11:17:04 -07:00
Mishal Shah
e5020ed077 Update the runtime version to 6.3 2025-08-26 22:07:42 -07:00
Justice Adams
dd7890e644 [Cmake] Use correct magic symbols file for Concurrency (#83619)
We want to use [this magic symbols
file](https://github.com/swiftlang/swift/blob/main/stdlib/public/Concurrency/linker-support/magic-symbols-for-install-name.c),
not [this
one](https://github.com/swiftlang/swift/blob/main/stdlib/linker-support/magic-symbols-for-install-name.c).

Outstanding question: Do we need both?
2025-08-14 16:21:07 -07:00
Saleem Abdulrasool
7e700889b0 RemoteMirror: add the SwiftRemoteMirror build to the new runtimes build
This adds the final missing runtime library to the runtiems build. With
this addition, the Windows SDK is complete.
2025-08-13 08:48:37 -07:00
Eric Miotto
7acecdcd88 Merge pull request #83604 from edymtt/edymtt/build-distributed-synchronization-in-new-runtimes-build
macOS smoketest: enable Distributed and Synchronization in runtimes
2025-08-11 11:51:38 -07:00
Eric Miotto
48fd452cd6 macOS smoketest: enable Distributed and Synchronization in runtimes
To make this work:
* expose SwiftCMakeConfig.h from the Core build
system, to support scenarios in which the downstream Distributed build
is leveraging the config files generated by CMake itself.
* adjust how SwiftShims is defined in `FindSwiftCore.cmake`, so that the
shims are found from C++ and that we don't get redefinition errors
when multiple module maps are in the search paths.

Fixes #83449
Addresses rdar://149241603, rdar://157165530
2025-08-08 13:17:19 -07:00
Saleem Abdulrasool
36246a2c8e Merge pull request #83576 from compnerd/namespace
Demangling: correct build for the runtime
2025-08-07 12:54:12 -07:00
Saleem Abdulrasool
5fe4a7840a Demangling: define SWIFT_RUNTIME when building
This is required to ensure that we do not get ODR violations due to
LLVMSupport being linked in with multiple definitions. We would
previously miscompile the library resulting in a mixed signature
containing both `__swift::runtime::llvm::` and `::llvm::` versions of
`StringRef`.
2025-08-06 15:52:04 -07:00
Saleem Abdulrasool
51e4561ce0 SwiftOnoneSupport, Concurrency: embed plist/manifest
Ensure that we install the runtime manifest into the Concurrency
runtime. This is required for the Win32 SxS mechanism to function.
2025-08-06 08:58:22 -07:00
Eric Miotto
72f56dd052 Merge pull request #83262 from edymtt/edymtt/catalyst-and-backdeployment-for-overlay
Overlay: support Catalyst, hooks and backdeployment on Apple platforms
2025-07-25 07:19:49 -07:00
Justice Adams
d454771ee2 [CMAKE] Fix layering issue between Concurrency and Darwin overlay (#82973)
Concurrency from the Core project is importing the Darwin platform
overlay, which in turn depends on SwiftCore from the Core project,
breaking the project layering.

Concurrency only needs the Clang module, but Swift does not have a
mechanism to only import a clang module. For now import the
functionality needed from Darwin by importing and wrapping the
associated functions from `<dlfcn.h>` within `CFExecutor.cpp`

Also remove Darwin import from `AsyncStreamBuffer.swift` because it is
not used
2025-07-23 16:04:14 -07:00
Eric Miotto
94d554dd61 Overlay: support Catalyst, hooks and backdeployment on Apple platforms
This involves copying the correct source file to generate the magic
symbols (the one for SwiftCore would not work here), and listening to
the backdeployment configuration of Core.

Take the chance to add hooks for vendor overrides.

Addresses rdar://156436695
2025-07-23 09:24:29 -07:00
Guillaume Lessard
b72c4422b8 Merge pull request #81637 from glessard/rdar147780495-OutputSpan-updates
[SE-0485] OutputSpan and OutputRawSpan
2025-07-17 14:14:52 -07:00
Eric Miotto
4923ce817e Merge pull request #81529 from edymtt/edymtt/add-distributed-to-new-build-system-inert
[Runtimes][CMake] Add Distributed to Supplemental build
2025-07-17 08:51:20 -07:00
Yuta Saito
30e0fa5133 [Concurrency] Fix runtime isolated-conformance checks with static stdlib
Most of linkers pull object files from static archives only if any
symbol from that object file is referenced, even if the object contains
a ctor code. `Setup.cpp` didn't have any symbols referenced from
other code, so it was not linked in when the concurrency runtime was
linked in statically. This commit moves the ctor code to `Task.cpp`
to ensure that it is always linked in.
2025-07-16 06:28:04 +00:00
Eric Miotto
7348469093 Cleanup CMakeConfig.h.in generation across the codebase
Addresses rdar://154230645
2025-07-15 14:44:40 -07:00
Guillaume Lessard
db93172db8 [stdlib] list files for cmake 2025-07-14 23:04:47 -07:00
Saleem Abdulrasool
326f18d113 Runtimes: detect the existence of dispatch_async_swift_job
This function is used by the executor to help schedule the async job.
While not currently available on Windows on main, this allows correctly
handling the presence of the symbol for static linking.
2025-07-11 11:28:07 -07:00
Eric Miotto
c1d901df2d [Runtimes] handle incremental builds that have non nested swiftmodules
Before #82571, we would generate a binary swiftmodule file at `<build
folder>/<module>.swiftmodule`, while now in the same location we
generate a directory.
Trying an incremental run on top of a build folder generated with the
old logic will fail during configuration with an error similar to

```
CMake Error at .../Supplemental/cmake/modules/EmitSwiftInterface.cmake:21 (file):
  file failed to create directory:

    .../StringProcessing-build/_RegexParser/_RegexParser.swiftmodule

  because: File exists
```

To reduce churn in CI and at desk, delete such remnant from the previous
logic.

Addresses rdar://155466197
2025-07-09 15:08:13 -07:00
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
a654df7caa Merge pull request #82578 from compnerd/isolation
Runtimes: avoid ODR violations in _Concurrency
2025-06-30 14:07:21 -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
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
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
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
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
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
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
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
Guillaume Lessard
db7881ef2c [cmake] InoutLifetimeDependence should be enabled
Addresses rdar://152467655
2025-06-02 18:55:13 -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
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
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
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
Evan Wilde
9993d295fa Merge pull request #81491 from etcwilde/ewilde/enable-commandline-by-default
Runtimes: Enable CommandLine support wholesale
2025-05-14 12:02:18 -07:00