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.
This commit fixes an ambiguous `errno` error when importing WASILibc
module and SwiftWASILibc Clang module.
The error is caused by the fact that we define a shim for `errno` in
`Platform.swift` file, but wasi-libc defines `errno` in a way
ClangImporter can understand. We don't need to define shims for it,
otherwise we get two candidates for `errno` identifier.
We provide shims for errno constants in WASILibc overlay since
wasi-libc's errno.h defines those constants in a way that cannot be
imported by ClangImporter.
However, some errno constants are aliased in wasi-libc, and we didn't
provided shims for them. This patch adds those missing shims.
This apinote file needs to be accessible in the locally built Android SDK as it's being built with build.ps1, so that swift-foundation can be built with that file present. This change ensures that the file is copied over into the local build directory for that Android SDK, in addition to being included in the installed component
This change also places the component into lib/swift/apinotes, as that's where the clang importer already looks for API notes
Introduce the first APINotes injection for the Android platform. This
follows the VCRuntime pattern of permitting the SDK to provide API Notes
that augment the system SDK. This adds a workaround for incorrect
nullability on the `fts_open` function in bionic. The system library
itself is fixed at:
https://android-review.googlesource.com/c/platform/bionic/+/3151616
This commit doesn't install them yet, they will be installed and a whole Android NDK module will be built in a follow-up commit
This module map covers the Bionic C standard library and other Posix headers used in the Android NDK
This commit doesn't install them yet, they will be installed and a whole Android NDK module will be built in a follow-up commit
This module map covers the Bionic C standard library and other Posix headers used in the Android NDK
The new headers for LWG-3268 in the new VC release broke the
modularisation of `std.atomic`. Add the dependent private module to
ensure that we correctly modularise the dependency and allow
`std.atomic` to be built again.
Added the _modules workaround to make the compiler pull in the correct
module when someone does `import stdc_assert` (for instance).
Fix various niggles.
rdar://123503615
We need to declare separate top-level modules for every header in
the musl C library. Note that our set-up here does require some
tweaks to musl itself (specifically, the `alltypes.h` header needs
some fairly serious massaging to make it module compatible; in
particular, we need to pull out every type declaration into its
own separate modularized header in `bits/types`).
Also update `Platform.swift` a little for more musl support.
rdar://123503615
This change introduces a new compilation target platform to the Swift compiler - visionOS.
- Changes to the compiler build infrastrucuture to support building compiler-adjacent artifacts and test suites for the new target.
- Addition of the new platform kind definition.
- Support for the new platform in language constructs such as compile-time availability annotations or runtime OS version queries.
- Utilities to read out Darwin platform SDK info containing platform mapping data.
- Utilities to support re-mapping availability annotations from iOS to visionOS (e.g. 'updateIntroducedPlatformForFallback', 'updateDeprecatedPlatformForFallback', 'updateObsoletedPlatformForFallback').
- Additional tests exercising platform-specific availability handling and availability re-mapping fallback code-path.
- Changes to existing test suite to accomodate the new platform.
This is needed to support Apple internal configurations that would fail
consuming such binary swiftmodule (but work as expected when rebuilding
from the swiftinterface).
Addresses rdar://124390643