Commit Graph

422 Commits

Author SHA1 Message Date
Saleem Abdulrasool
1dffb688d6 WinSDK: add DDE, OLE, LZ32 submodules
Further modularise the Windows SDK. This adds 3 new submodules to get
better coverage of the Windows SDK.
2025-03-03 13:44:51 -08:00
Saleem Abdulrasool
c4f5831507 Platform: add APINotes for bionic.spawn
Add some APINotes for `bionic.spawn` to correct the nullability
annotations. This allows building Foundation with NDK r26b.
2025-02-27 21:09:23 -08:00
Saleem Abdulrasool
79d2af759b ClangImporter: support modularizing __msvc_string_view.hpp
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.
2025-02-10 12:48:35 -08:00
Finagolfin
22833fbc54 [android] Update to LTS NDK 27c
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.
2024-11-14 00:11:53 +05:30
Artem Chikin
60538d5918 Revert "Attempt to reduce the number of embedded stdlib targets being built simultaneously."
This reverts commit dfa1bdb1ce.
2024-11-11 14:42:59 -08:00
Artem Chikin
dfa1bdb1ce Attempt to reduce the number of embedded stdlib targets being built simultaneously.
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
2024-11-08 13:55:14 -08:00
furby™
c68b0d8320 Fix typos in VCRuntime modulemap.
* https://github.com/swiftlang/swift/issues/77351

Signed-off-by: furby™ <devs@wabi.foundation>
2024-11-01 19:16:00 -06:00
Egor Zhdan
168413ef61 Merge pull request #76823 from swiftlang/egorzhdan/msvc-bit-module
[cxx-interop] Modularize __msvc_bit_utils on Windows
2024-10-07 12:10:55 +01:00
Egor Zhdan
16e7cbeafa [cxx-interop] Modularize __msvc_bit_utils on Windows
`__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
2024-10-04 13:15:20 +01:00
Egor Zhdan
5b9186e445 [Glibc] Remove WASI gyb logic from the modulemap
This is a minor cleanup of the generated Glibc modulemap.

WASI no longer uses the Glibc modulemap since 902d75e6.
2024-10-04 01:00:24 +01:00
Egor Zhdan
0c106006db [Glibc] Remove Android gyb logic from the modulemap
This is a minor cleanup of the generated Glibc modulemap.

Android no longer uses the Glibc modulemap since 57b89d53.
2024-10-03 19:37:11 +01:00
Dmitrii Galimzianov
a8b71ea97f Add -print-diagnostic-groups flag
This change adds the `-print-diagnostic-groups` flag as described by SE-0443.
2024-09-11 13:34:42 +02:00
Yuta Saito
ba63b9f628 Merge pull request #75821 from kateinoigakukun/pr-680047d2b871e809cf13f27c8a4a5abc2f5c31d2
[wasm] Annotate errno as SwiftPrivate by apinotes
2024-08-17 14:35:42 +09:00
Yuta Saito
be08ebb12a [wasm] Annotate errno as SwiftPrivate by apinotes
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.
2024-08-16 10:57:24 +00:00
Alex Lorenz
d35af38ce4 Merge pull request #75721 from hyp/eng/75691
[windows] split out complex module from ucrt module, to allow new swi…
2024-08-12 08:30:47 -07:00
Yuta Saito
90799cfdf7 Revert "[wasm] Fix ambiguous errno error when importing WASILibc module"
This reverts commit 164ec0adaa.
2024-08-10 13:29:48 +00:00
Yuta Saito
164ec0adaa [wasm] Fix ambiguous errno error when importing WASILibc module
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.
2024-08-07 04:28:29 +00:00
Alex Lorenz
b62eafd866 [windows] split out complex module from ucrt module, to allow new swift-foundation to import ucrt when C++ interoperability is enabled
Fixes https://github.com/swiftlang/swift/issues/75691
2024-08-06 11:33:03 -07:00
Yuta Saito
65f9badbcd [wasm] Add shims for aliased errno constants in WASILibc overlay
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.
2024-08-03 07:51:49 +00:00
Alex Lorenz
c03627014e [android] fix path and cmake local build target tracking for posix_filesystem.apinotes
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
2024-07-25 21:25:25 -07:00
Alexander Cyon
c21b1e68fd [stdlib] Fix typos 2024-07-06 13:09:57 +02:00
Guillaume Lessard
8733ecd012 Merge pull request #75000 from glessard/rdar99047401-err-nosendable
[concurrency/stdlib] declare `POSIXErrorCode` as `Sendable`
2024-07-05 16:58:51 -07:00
Guillaume Lessard
ab117c997d [concurrency] declare POSIXErrorCode as Sendable 2024-07-05 13:34:26 -07:00
Saleem Abdulrasool
f011de6ce8 Merge pull request #74829 from compnerd/android-notes
ClangImporter: add support for Android API Notes
2024-07-01 11:34:46 -07:00
Saleem Abdulrasool
47f9d78990 ClangImporter: add support for Android 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
2024-06-28 13:24:04 -07:00
Saleem Abdulrasool
22817ccf1a Platform: add sys_xattr module for Android
This module was left out from the modulariation pass. The declarations
here are required for building swift-foundation for Android.
2024-06-26 12:33:36 -07:00
Kuba Mracek
6eeef12849 [embedded] Add a embedded-libraries CMake target to simplify the test dependencies 2024-06-23 13:08:01 -07:00
Alex Lorenz
98b74d8010 [android] do not import stdatomic from android's libc++
android's libc++ uses an older module map that requires C++23 for stdatomic, and thus it fails to compile with anything else
2024-06-12 10:04:14 -07:00
Alex Lorenz
5aa63fc93e Merge pull request #72634 from hyp/eng/android/ndk-overlay
[android] add an Android NDK Swift overlay
2024-06-05 19:35:13 -07:00
Alex Lorenz
46502f9249 Merge pull request #72161 from hyp/eng/android-ndk-modulemap
[android] add a module map for Android NDK
2024-06-05 19:35:00 -07:00
Alex Lorenz
743a501d1b comment cleanup 2024-06-05 10:53:15 -07:00
Alex Lorenz
e9739d7787 remove additional glibc android check from cmake 2024-06-04 12:37:59 -07:00
Alex Lorenz
9c31f98f6f [cmake] fix android header name targets 2024-06-04 12:37:51 -07:00
Alex Lorenz
8b8c72acd8 [stdlib] add a _math module overlay for Android for deprecated constants 2024-06-04 12:37:43 -07:00
Saleem Abdulrasool
c3d825144c Merge pull request #74040 from STREGA/main
Revert remove cplusplus requirement on XAudio29
2024-05-31 14:33:20 -04:00
STREGA
d69790bde2 Revert remove cplusplus requirement on XAudio29 2024-05-30 22:48:07 -04:00
Alex Lorenz
664f332994 Android: do not re-export macros from linux/stat.h from other modules
This lets us declare constants in the Android platform module using the expected mode_t type
2024-05-28 13:08:39 -07:00
Alex Lorenz
607766299b drop android stuff 2024-05-28 13:02:16 -07:00
Alex Lorenz
57b89d5303 [android] add an android NDK Swift overlay module, and use it instead of Glibc 2024-05-28 12:57:38 -07:00
Alex Lorenz
95493f673d [android] add a module map for 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
2024-05-28 12:55:02 -07:00
Alex Lorenz
444e2f465b Android: do not re-export macros from linux/stat.h from other modules
This lets us declare constants in the Android platform module using the expected mode_t type
2024-05-28 08:58:23 -07:00
Alex Lorenz
dac073965b [android] add a module map for 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
2024-05-26 20:00:10 -07:00
Saleem Abdulrasool
b68188b00c Platform: add new module for VC 17.10.0
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.
2024-05-22 13:10:08 -07:00
Alastair Houghton
20714b5fb9 [Platform] Rename modules for C library headers to match Darwin.
The Darwin headers have a naming convention for these modules; we should
match it.

rdar://123503615
2024-05-07 21:34:43 +01:00
Alastair Houghton
b6a3d22a06 [Platform] Updated after review comments.
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
2024-05-07 17:00:18 +01:00
Alastair Houghton
4262b7e4a4 [Platform] Update musl modulemap and improve musl platform support.
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
2024-05-07 17:00:18 +01:00
Artem Chikin
01d891ad99 Merge pull request #72834 from artemcm/UpstreamVisionOS
Introduce visionOS Platform
2024-04-15 09:33:49 -07:00
Saleem Abdulrasool
5919346b32 Platform: add UserEnv module to WinSDK
This allows access to the `GetUserProfileDirectoryW` API which is
required for the swift-foundation implementation on Windows.
2024-04-12 10:25:32 -07:00
Artem Chikin
1f14158a1d Introduce VisionOS Platform
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.
2024-04-10 09:38:02 -07:00
Eric Miotto
0cac358fe5 Do not install binary swiftmodule for Darwin
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
2024-03-27 10:56:55 -07:00