This nudges the Glibc modulemap just enough to get SwiftPM and later
targets building. Without it, Swift tries to import the signal hander
APIs through CDispatch instead of Glibc. CDispatch shouldn't be directly
imported, so recommending that is nonsensical.
This is not a full solution for all headers, but meant to perturb the
module machinery sufficiently that it pulls signal.h into glibc
correctly.
Works around:
```
Swift-Project/swiftpm/Sources/Basics/Cancellator.swift:79:24:
error: property '__sigaction_u' is not available due to missing import of defining module 'CDispatch' [#MemberImportVisibility]
```
This prevents other Clang modules from hijacking this header, causing modularization errors. For example, several WinRT headers `#include <winapifamily.h>`.
OpenBSD 7.8 snapshots hide the type information for FILE. Therefore, the
types for the standard stdio streams should (regrettably) be
OpaquePointer, due to the well-discussed issue of losing type
information for forward-declared C types.
We explicitly drop to void * in the LibcOverlayShims for backwards
compatibility, since OpenBSD 7.8 is not yet released.
This PR changes the name of the clang module introduced in #83914 from
`_GUID` to `_GUIDDef`. This change is necessary because the Windows SDK
declares a type named `_GUID` and Swift gets confused when a module and
a type have the same name.
This confusion is the motivation for
[SE-0491](https://github.com/swiftlang/swift-evolution/blob/main/proposals/0491-module-selectors.md),
but we can't just wait for a fix because the new module is a
source-breaking change and clients won't be able to adopt the proposed
syntax for some time.
This fixes modularization errors that arise when importing a C++ header that contains `#include <guiddef.h>`, which might hijack this header from the WinSDK module where it belongs.
WASILibc wasn't built for the embedded stdlib in `stdlib/public/Platform/CMakeLists.txt`. New `copy_wasilibc_modulemap_embedded_resource` and `embedded-stdlib-platform-${triple}` targets are added, the latter for `wasm32-unknown-wasip1` only for now. Also added a `wasilibc_functions.swift` test to verify the result.
Resolves https://github.com/swiftlang/swift/issues/83513
rdar://157467412
This adds `xsmf_control.h` into the STL modulemap on Windows.
Fixes the following compiler error emitted by Clang when trying to use `std::variant` from Swift with C++ interop:
```
...\MSVC\14.42.34433\include\variant:923:25: error: missing '#include <xsmf_control.h>'; '_Non_trivial_move_assign' must be defined before it is used
```
A minor update to the Windows SDK broke our module maps. This fixes the
issue by re-separating a few modules. For backward-compatibility and
proper export of symbols, the split headers are also included in the
main `ucrt` module.
Building with the Windows static SDK uncovered issues in the Windows
module maps. Some of the headers were missing and others had incorrect
layering. This updates the module maps to build with the static Windows
SDK.
The SDK overlays have been provided in the Apple SDKs for many years, and the interface and implementation has diverged in more recent years such that trying to build the Swift version no longer works. Remove all of the dead code.
rdar://151889154
These were split out in #79751. However, this split is not needed for
these. Furthermore, modulemaps have bugs when it comes to re-exporting
some modules, resulting in missing exports.
This commit adds required conditional compilation blocks to enable bulding on
FreeBSD (tested on x86_64 FreeBSD 14.1-RELEASE-p6). Also implements FreeBSD
synchronization shims using `_umtx_op(2)`
This header was introduced in a recent STL release. Modularise the
header properly, adding a shim for compatibility with older releases.
Partially based on a change from @egorzhdan.
Add a new bits/ header to the Android overlay, include runtime libraries that are
auto-extracted and listed many times to the list of libraries to be de-duplicated,
enable a C++ interop test that's working again, and update the doc with new
libraries that need to be available to run a simple executable.
We are seeing strange crashes during embedded stdlib build stage on Ubuntu 24.04. These crashes only seem to occur when we dispatch many stdlib emit-module tasks at the same time. While we root-cause it, this change attempts to slow down the process to only two Embedded StdLib tasks at-a-time.
Workaround for rdar://137674862
`__msvc_bit_utils.hpp` was added in a recent version of MSVC, and it is causing build errors for SwiftCompilerSources:
```
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\numeric:598:12: error: function '_Select_countr_zero_impl<unsigned long long, (lambda at C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\numeric:598:55)>' with deduced return type cannot be used before it is defined
return _Select_countr_zero_impl<_Common_unsigned>([=](auto _Countr_zero_impl) {
```
This change references the `__msvc_bit_utils.hpp` header from the modulemap. Since we still need to support older versions of Visual Studio that do not provide `__msvc_bit_utils.hpp`, this also teaches ClangImporter to inject an empty header file named `__msvc_bit_utils.hpp` into the system include directory, unless it already exists.
rdar://137066642
This patch adds an apinotes file for SwiftWASILibc clang module to mark
`errno` macro hidden from Swift code. This resolves ambiguity between
the C macro definition and the Swift wrapper in WASILibc overlay module.
This change installs the apinotes file to the resource directories for
both lib/swift/apinotes and lib/swift_static/apinotes.