Commit Graph

430 Commits

Author SHA1 Message Date
Saleem Abdulrasool
90cacaa359 Platform: install Windows auxiliary files
These are now referenced directly by the compiler so install them as
part of the package.
2023-03-08 14:07:10 -08:00
Saleem Abdulrasool
19a0eaaa77 Windows: add conio and corecrt.conio
This adds `conio` and `corecrt.conio` modules to the ucrt modulemap to expose these interfaces to Swift.

Fixes: #63024
2023-01-30 11:43:06 -08:00
Evan Wilde
f8a54181a9 Zipper all the things!
This patch goes through and adds zippering and the swift module
dependencies to a bunch of pieces of the swift runtimes. Here's to
hoping I hit everything that needed to be hit. :D

With this patch, I'm seeing the appropriate modules under
lib/swift/maccatalyst, so things seem to be working right.
2022-12-22 13:41:59 -08:00
Matt Jacobson
8e6ce5c087 stdlib: install SwiftGlibc.h in static resources directory
When SwiftGlibc.h was added in #32404, no cmake code was added to copy it to the
static resources.  Copy it along with glibc.modulemap, which references it.
2022-11-18 07:27:04 -05:00
Egor Zhdan
ba31ca4ea6 [build] Remove unused GLIBC_INCLUDE_PATH macro
This macro was previously substituted when generating `glibc.modulemap` file during the compiler build. Now Swift detects the location of Glibc dynamically and injects `glibc.modulemap` into it using LLVM VFS. The last usage of `GLIBC_INCLUDE_PATH` was removed in `78c0540b`.

This also removes `SWIFT_SDK_${sdk}_ARCH_${arch}_LIBC_INCLUDE_DIRECTORY` which doesn't have any usages left.
2022-09-05 18:57:29 +01:00
Egor Zhdan
78c0540b6f [Glibc] Refer to UUID headers from the modulemap using relative paths
This improves portability of the Swift toolchains by removing a usage of absolute path to Glibc.

The Glibc modulemap is now injected into the Glibc include path using LLVM VFS, so it can reference Glibc headers using relative paths. This already works for other Glibc headers (e.g. `assert.h`)
2022-08-17 15:09:17 +01:00
Saleem Abdulrasool
b420071835 vcruntime: adjust module definition further
Add some of the x* headers to the c++ module.  These are included
multiply and so we create private modules for them rather than
associate them with a different module which could cause issues
in practice due to intra-module dependencies.
2022-08-14 08:02:12 -07:00
Egor Zhdan
c314ae0d17 [Glibc] Add missing C stdlib header
`assert.h` is missing from the modulemap, which causes clang to consider `assert.h` to be a part of the first module to include it. This causes issues in SwiftCompilerSources when we try to use classes coming from LLVM headers on Linux.
2022-07-05 16:45:18 +01:00
Saleem Abdulrasool
f57fe44fdb Update vcruntime.modulemap
Remove `spanstream` header from the module until we can identify a way to do per-release variants.
2022-06-28 19:01:41 -07:00
Saleem Abdulrasool
1779c569c8 Platform: add a definition for std on Windows
This adds the c++ module for Windows to help further the C++ interop.
2022-06-28 16:10:37 -07:00
Saleem Abdulrasool
01ae682b4a Platform: extend ucrt with some MSVC extensions
Add some additional modules which become necessary to support the C++
modularization.
2022-06-27 13:44:18 -07:00
Saleem Abdulrasool
52f8760255 Merge pull request #59723 from compnerd/corecrt
Platform: extract `corecrt` module
2022-06-27 13:24:27 -07:00
Saleem Abdulrasool
c7ee0a85a8 Platform: extract corecrt module
This extracts the `corecrt` module in order to setup the necessary
structure for enabling the `std` module for C++.
2022-06-27 08:58:05 -07:00
Saleem Abdulrasool
fc070c6167 platform: restructure visualc module
Restructure the `visualc` module into `vcruntime` in order to help
expose the various components (SAL, vcruntime, ucrt, corecrt, STL) for C++
modularization.  Include the `stdint.h` textually to deal with
redefinition of types in clang resources and MSVC.
2022-06-26 14:06:59 -07:00
Saleem Abdulrasool
a4b9d950a7 platform: correct header for ssse3
Correct the header spelling for the ssse3 module.  The suffix was
incorrect which was ignored as a result.  This was identified by the
`modularize` tool from clang-tools-extras.
2022-06-22 19:27:32 -07:00
Josh Soref
644c18ca9b Spelling stdlib (#42444)
* spelling: against

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: algorithmic

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: alignment

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: anything

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: architectural

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: architecture

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: are

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: artificial

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: aside

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: available

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: being

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: bidirectional

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: characters

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: circular

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: compatibility

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: compiled

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: correctly

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: covers

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: declaration

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: dependencies

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: descriptor

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: dictionaries

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: dynamic

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: greater

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: hierarchy

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: immortal

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: initialize

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: initializes

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: iterable

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: message

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: minimum

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: multiple

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: originally

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: simplified

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: sophisticated

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: trivia

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: wasn't

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
2022-04-19 14:02:43 -07:00
Saleem Abdulrasool
ca25261f73 Merge pull request #41710 from compnerd/intrinsics
visualc: add new `_visualc_intrinsics` module
2022-03-11 08:51:10 -08:00
Saleem Abdulrasool
0bc375d97c Revert "visualc: clean up the module definition"
This reverts commit c194d1cf24.
2022-03-07 18:25:25 -08:00
Saleem Abdulrasool
b7ceca333a visualc: add new _visualc_intrinsics module
This introduces the `_visualc_intrinsics` module, which is the MSVC
analogue to `_Builtin_intrinsics` from clang.  This is needed for the
ARM64 SDK build which will attempt to use the neon intrinsics during the
build.
2022-03-07 12:54:02 -08:00
Saleem Abdulrasool
c194d1cf24 visualc: clean up the module definition
Clean up the submodules in visualc to not export all imported modules.
The one special case is `vcruntime` which re-exports `SAL` due to a
dependency in the headers.  The import of `visualc` however will
re-export all submodules to keep the current behaviour.  This is
required to get the ARM64 SDK building on newer MSVC toolsets.
2022-03-07 10:59:00 -08:00
Robert Widmann
beda891274 Merge pull request #40557 from 3405691582/UnifiedModulemap 2022-02-21 22:45:55 -08:00
Saleem Abdulrasool
b3b8fa50c3 Merge pull request #41421 from compnerd/pepperidge-farm-remembers
Platform: add a new submodule to WinSDK
2022-02-18 08:22:33 -08:00
Philippe Hausler
e675b310f8 [SE-0329] Clock/Instant/Duration (#40609)
* [WIP] Initial draft at v2 Clock/Instant/Duration

* Ensure the literal types for _DoubleWide are able to be at least 64 bits on 32 bit platforms

* static cast timespec members to long

* Remove runtime exports from clock functions

* Export clock functions in implementations as they are in headers

* Clean up internal properties by adding leading underscores, refine availability to a TBD marker macro, and break at 80 lines to match style

* Shift operators to concrete Instant types to avoid complexity in solver resolution

* Adjust diagnostic note and error expectation of ambiguities to reflect new potential solver (perhaps incorrect) solutions

* Update stdlib/public/Concurrency/TaskSleep.swift

Co-authored-by: Karoy Lorentey <klorentey@apple.com>

* [stdlib][NFC] Remove trailing whitespace

* [stdlib] Remove _DoubleWidth from stdlib's ABI

* [stdlib] Strip downd _DoubleWidth to _[U]Int128

* Additional adjustments to diagnostic notes and errors expectation of ambiguities to reflect new potential solver (perhaps incorrect) solutions

* Disable type checker performance validation for operator overload inferences (rdar://33958047)

* Decorate Duration, DurationProtocol, Instant and clocks with @available(SwiftStdlib 9999, *)

* Restore diagnostic ambiguity test assertion (due to availability)

* Add a rough attempt at implementing time accessors on win32

* Remove unused clock id, rename SPI for swift clock ids and correct a few more missing availabilities

* remove obsolete case of realtime clock for dispatch after callout

* Use the default implementation of ~ for Int128 and UInt128

* Ensure diagnostic ambiguitiy applies evenly to all platforms and their resolved types

* Restore the simd vector build modifications (merge damage)

* Update to latest naming results for Instant.Duration

* Updates to latest proposal initializers and accessors and adjust encoding/decoding to string based serialization

* Update availability for Clock/Instant/Duration methods and types to be 5.7

* Correct *Clock.now to report via the correct runtime API

* Ensure the hashing of Duration is based upon the attoseconds hashing

* Avoid string based encoding and resort back to high and low bit encoding/decoding but as unkeyed

* Adjust naming of component initializer to use suffixes on parameters

* Duration decoding should use a mutable container for decoding

* fix up components initializer and decode access

* Add platform base initializers for timespec and tiemval to and from Duration

* Add some first draft documentation for standard library types Duration, DurationProtocol and InstantProtocol

* Another round of documentation prose and some drive-by availability fixes

* InstantProtocol availability should be 5.7

* Correct linux timeval creation to be Int and not Int32

Co-authored-by: Karoy Lorentey <klorentey@apple.com>
2022-02-17 09:32:46 -08:00
Saleem Abdulrasool
67ba46e591 Platform: add a new submodule to WinSDK
This adds the memoryapi submodule to WinSDK which isolates the memoryapi
contract.  This enables additional functions such as
`QueryVirtualMemoryRegion` to now be available.
2022-02-16 18:02:53 -08:00
Saleem Abdulrasool
e6c6c5207b Platform: add submodule to WinSDK for ProcessAPI
This adds the PSAPI submodule to WinSDK for use in swift-inspect.
2022-02-12 18:23:03 -08:00
3405691582
600d500ed6 [stdlib] Use the single-header Glibc modulemap.
This migrates OpenBSD to use the single-header Glibc modulemap proposed
and implemented in #32404, and necessitates introducing some missing
headers for building Foundation added in #38341.

Additionally, incorporate nullability annotations in SwiftShims per
2022-02-11 13:04:12 -05:00
Robert Widmann
f5bc40be10 Merge pull request #35707 from buttaface/droid
[android] Switch to new single-header modulemap for Bionic too
2022-02-10 15:50:19 -08:00
Saleem Abdulrasool
a2c6d0c80b Platform: add a WinSDK submodule
This adds ToolHelp32 to the WinSDK module which is needed for
snapshotting process state.  This is useful for tooling like
swift-inspect.
2022-02-06 12:37:05 -08:00
Butta
0cf765adf4 [build] Remove SWIFT_SDK_${OS}_ARCH_${ARCH}_LIBC_ARCHITECTURE_INCLUDE_DIRECTORY CMake variable 2022-01-09 13:27:27 +05:30
Erik Eckstein
3d33f11e6c cmake/build-script: rename the libswift option to "bootstrapping"
In cmake, rename LIBSWIFT_BUILD_MODE to BOOTSTRAPPING_MODE.
Also, rename the lit feature "libswift" to "swift_in_compiler".
2021-12-22 11:31:52 +01:00
Butta
5eb29d99dd [android] Switch to new single-header modulemap for Bionic too 2021-12-13 23:23:45 +05:30
swift-ci
a77f161ec9 Merge pull request #38341 from 3405691582/FoundationInterop 2021-12-12 18:41:01 -08:00
Eric Miotto
403ccd4072 Extend freestanding to support targeting Darwin platforms (#40202)
* add an option to add freestanding to the Darwin platform, so that
  to get expected compile behaviours (e.g. setting the install name)
* rework testing configuration to relax assumptions about freestanding
* add a preset to test such configuration (at least for PR testing)

Addresses rdar://85465396
2021-12-08 07:09:44 -08:00
Erik Eckstein
77d421cbcd cmake: fix a typo in the libswift Debug bootstrapping build 2021-11-30 16:54:28 +01:00
Erik Eckstein
61db072617 cmake: fix libswift build dependencies
Unfortunately using the convenient "bootstrapping0-all", etc. custom targets does not work.
For some reason it does not cause a dependent file (like libswift's SIL.o) being rebuilt when a depenency (like swift-frontend from the previous bootstrapping stage) changes.
Instead we have to list al library- and executable-targets explicitly.
2021-11-23 18:33:43 +01:00
Erik Eckstein
e30688da82 libswift: fix dependencies in the bootstrapping build mode
swiftDarwin and swiftOnoneSupport  didn't depend on building the Swift core library.
This was a subtle bug, because the compiler just picked up the module from the SDK instead of the (still building) Swift module.
It only resulted in compiler errors if the SDK swiftinterface was too new to be parsable by the compiler.
2021-11-05 18:33:21 +01:00
Erik Eckstein
78c4c3ff6d libswift: fixes for the linux bootstrapping build 2021-10-29 08:56:02 +02:00
Erik Eckstein
4383610ed3 cmake: some fixes for the libswift bootstrapping build
* fix a typo which prevented linking the right bootstrapping libs
* build swiftDarwin for bootstrapping
* disable COW checks if built with bootstrapping-with-hostlibs
2021-10-19 13:10:59 +02:00
Kuba (Brecka) Mracek
c2c1bfb053 Add SWIFT_STDLIB_HAS_ENVIRON to remove usage of getenv/environ from stdlib (#39599) 2021-10-12 07:16:36 -07:00
Max Desiatov
f34e321444 WebAssembly: add WASI cases to POSIXErrorCode enum (#39482)
These new cases match WASI-libc declarations at https://github.com/WebAssembly/wasi-libc/blob/ad513341/libc-bottom-half/headers/public/wasi/api.h#L106
2021-09-28 19:26:25 +01:00
Kuba (Brecka) Mracek
8b189d99e4 Turn off SWIFT_ENABLE_REFLECTION on the stdlib_minimal preset (#39030) 2021-09-12 18:54:53 -07:00
Kuba (Brecka) Mracek
750ba09ef4 Introduce SWIFT_FREESTANDING_FLAVOR to select whether the FREESTANDING stdlib should be built/tested using an Apple SDK, or another SDK (e.g. Linux, not implemented yet) (#34450) 2021-08-19 15:56:04 -07:00
3405691582
ac9640b00a [stdlib] Changes to support Foundation on OpenBSD.
* Not implementing POSIXError for a given platform is not a blocking
  problem to getting a successful build of Swift. However, it is
  part of the validation tests (albeit locked behind REQUIRES) and is
  referenced when building Foundation. Implement by forklifting from
  `sys/errno.h`.

* Some Foundation class implementations require some missing includes in
  the platform modulemap. Add these.
2021-07-09 18:55:51 -04:00
Alex Taffe
715f1ecbcd Move WinUSB out of OS core 2021-05-25 09:07:11 -04:00
Alex Taffe
7ea15d5664 Fix typo 2021-05-24 17:16:07 -04:00
Alex Taffe
9a4a6d4587 Add winusb.h support 2021-05-24 17:13:22 -04:00
Saleem Abdulrasool
73edf071b5 Platform: correct link dependency for WinSDK.User
Add the User32 link dependency for uses of the User module.
2021-03-18 11:06:27 -07:00
Saleem Abdulrasool
621a4207f8 Platform: link against ComCtl32 when using Common Controls
This adds a missing link directive to the ComCtl32 module.  This allows
use of the module without requiring the user to explicitly add the
linked library to the target when building code against this module.
2021-02-27 12:28:45 -08:00
Saleem Abdulrasool
66a9ae44b4 Platform: add dxgidebug.h to _DXGI module
The debug header is used for enumeration of certain DXGI interfaces
related to debugging of the pipeline.  Add this to gain access to the
interfaces and some of the global GUIDs associated with it.
2021-01-27 09:53:04 -08:00
Saleem Abdulrasool
997cb0f671 Platform: add HLSL compiler to the WinSDK modulemap
The DirectX subsystem may require access to the HLSL compiler for
building the shaders before uploading to the GPU.  This is adds to the
modulemap the D3DCompiler module to get access to the compiler.
2021-01-24 13:10:54 -08:00