Commit Graph

394 Commits

Author SHA1 Message Date
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
Yuta Saito
bc8f42d88e Merge pull request #71979 from kateinoigakukun/pr-cd8ba74ab4469e3c7607e61424497cc86fee8812
wasm: Add `pthread.h` to the WASI libc modulemap
2024-03-01 17:55:57 +09:00
Yuta Saito
e0131dc7dd wasm: Add pthread.h to the WASI libc modulemap
Recent wasi-libc has added `pthread.h` to its headers. This patch adds
it to the modulemap.
2024-02-29 17:59:24 +00:00
Saleem Abdulrasool
1845538c50 Windows: add WER module to WinSDK
This adds the Windows Error Reporting module to the WinSDK to make it
available to Swift.
2024-02-28 11:23:22 -08:00
Saleem Abdulrasool
2d72906b97 Windows: include SDDL conversion headers
This is allows us to use `ConvertSidToStringSidW`.
2024-02-12 14:37:37 -08:00
Kuba Mracek
dba8d5d3a0 Revert "Merge pull request #71278 from kubamracek/embedded-no-mach-defines"
This reverts commit 21eddf0b1a, reversing
changes made to e2d516f3c9.
2024-02-05 09:05:22 -08:00
Kuba Mracek
e22aedbcc3 [embedded] Implicitly define __APPLE__ and __MACH__ when on -apple-none triples 2024-01-31 09:22:31 -08:00
Max Desiatov
633d5bc45a Enable x86_64 and i686 ELF triples for embedded Swift (#70642)
This is just as useful for x86 bare metal as the already enabled `arm*-none-none-eabi` triples.
2024-01-26 21:39:17 +00:00
Kuba Mracek
bb1ba7c95c [embedded] Run DeadFunctionAndGlobalElimination after MandatoryPerformanceOptimizations 2023-12-09 22:39:55 -08:00
Kuba Mracek
2796e150fe [embedded] Disable building Darwin as embedded, unbreak the build and CI 2023-12-06 17:11:23 -08:00
Saleem Abdulrasool
203cace27f Platform: remove cplusplus requirement on XAudio29
The header is usable without C++ interop.  This should make it easier to
use the module in many cases.
2023-12-03 18:58:41 -08:00
Kuba Mracek
7c84cdb83f [embedded] Start installing embedded Concurrency and Darwin modules into the toolchain 2023-11-28 16:18:10 -08:00
Kuba Mracek
fa7da75cdc [embedded] Port and start building Darwin.swiftmodule as embedded 2023-11-27 20:16:58 -08:00
Yuta Saito
35120a110f [wasm] Exclude builtin headers from WASILibc system module
stable/20230725 now rejects including builtin headers in modulemap by
default to avoid module cycles on non-Apple platforms. Builtin headers
are now part of their own `_Builtin_XXX` modules.

See:
- https://github.com/apple/llvm-project/pull/7618
- https://reviews.llvm.org/D159483
- https://reviews.llvm.org/D159064
2023-10-24 00:07:32 +00:00
Saleem Abdulrasool
fa9186863f Merge pull request #69023 from compnerd/models
Platform: add an explicit `AppModel` module for Windows
2023-10-07 09:30:01 -07:00
Saleem Abdulrasool
cdc1a7b5bb Platform: add an explicit AppModel module for Windows
Extract and isolate the AppModel APIs into its own module.  This
corresponds to the contract boundary on Windows.
2023-10-06 12:13:35 -07:00
Yuta Saito
cdc47aabfb [WASILibc] Exclude semaphore APIs from overlay
Since wasi-libc does not support those APIs
2023-10-06 01:49:30 +00:00
STREGA
2832492ca8 Fix incorrect library name 2023-09-29 21:00:04 -04:00
Saleem Abdulrasool
aface3a75f Platform: add missing header for OLE32
We should include `oleauto.h` in the OLE32 module.  This ensures that we
are able to access the BSTR APIs which are used extensively in OLE.
2023-09-28 12:05:05 -07:00
Yuta Saito
902d75e608 [wasm][build] Add WASILibc module and its build support
[wasi-libc](https://github.com/WebAssembly/wasi-libc) is a libc
implementation widely used in WASI toolchains. This patch adds a new
module named WASILibc. Some extra emulation libraries are also added as
wasi_emulated_xxx.
2023-09-23 11:51:00 +00:00
Saleem Abdulrasool
47eb843f02 Merge pull request #67821 from stevapple/stevapple-patch-1-1
Remove `vcruntime._Private.xstddef`
2023-08-09 13:45:34 -07:00
Saleem Abdulrasool
af57672c0f Platform: further modularise vcruntime._Private
Create an explicit module for `xhash` to correct the usage for
`unordered_set`.
2023-08-09 13:45:21 -07:00
YR Chen
7c43dfb986 Remove vcruntime._Private.xstddef
`<xstddef>` was removed since MSVC 14.37. It isn't meant to be used by most users, but the reference will break all clients of `vcruntime`, including Swift standard library itself.
2023-08-09 18:53:00 +08:00
Saleem Abdulrasool
3de765cad3 Platform: correct requirements for std.unordered_set
This module requires C++11, not `unordered_set` which prevents the use
of the module.
2023-08-08 13:28:08 -07:00
Saleem Abdulrasool
81cab33a75 Platform: further modularise ucrt
Add a couple of submodules for these modules to further modularise the
headers.  This might expose additional APIs now as some of these headers
would not have been indirectly included and wind up in the wrong module.
2023-08-06 21:16:40 -07:00
Saleem Abdulrasool
3aec82da29 Platform: make stdint module implicit on Windows
This makes the `stdint` module implicit which repairs the ability to
build some components.  In order to accomplish this, we need to
potentially break the fragile Swift build system.  Due to the incorrect
handling of compilers we need some workarounds to support
cross-compilation.  This removes the injected system header paths when
building on Windows to ensure that the clang resource headers are not
following the system headers which breaks the modules as the clang
resources are dependent on the system headers when running in hosted
mode.
2023-08-04 15:37:59 -07:00
Saleem Abdulrasool
fc72e7cb0e Platform: add missing std._Private modules
Add the missing `std._Private.xstddef`, `std._Private.yvals`, and
`std._Private.yvals_core` modules.  This repairs the use of `std.map` as
a private member variable of a type with an explicit ctor.
2023-07-26 15:50:15 -07:00
Saleem Abdulrasool
d4c5f2a845 Platform: add an additional corecrt submodule
This was detected as missing when trying to re-modularise MSVCPRT.
2023-07-26 15:50:15 -07:00
Saleem Abdulrasool
04742d64e5 Platform: remove some deprecated modules from MSVCPRT
These modules were deprecated and do not exist in the distribution,
remove the commented out form.
2023-07-26 15:50:15 -07:00